> ## Documentation Index
> Fetch the complete documentation index at: https://docs.codex.io/llms.txt
> Use this file to discover all available pages before exploring further.

# PredictionMarket

> A prediction market with outcomes, pricing, and metadata.

<div data-generated>
  ## GraphQL

  ```
  type PredictionMarket {
    id: String!
    protocol: PredictionProtocol!
    venueMarketId: String!
    venueMarketSlug: String
    eventId: String
    venueEventId: String
    question: String
    label: String
    suggestedLabel: String
    eventLabel: String
    rules: String
    rules2: String
    venueOutcomeIds: [String!]!
    outcomeIds: [String!]!
    outcomeLabels: [String!]
    resolution: PredictionResolution
    imageLargeUrl: String
    imageThumbUrl: String
    imageSmallUrl: String
    createdAt: Int
    updatedAt: Int
    opensAt: Int
    closesAt: Int
    resolvesAt: Int
    resolvedAt: Int
    observedAt: Int!
    networkId: Int
    exchangeAddress: String
    categories: [PredictionCategory!]
    winningOutcomeId: String
    enrichedMetadata: PredictionMarketEnrichedMetadata
  }

  enum PredictionProtocol {
    POLYMARKET
    KALSHI
  }

  type PredictionResolution {
    result: String
    source: String
  }

  type PredictionSubSubcategory {
    name: String!
    slug: String!
  }

  type PredictionSubcategory {
    name: String!
    slug: String!
    subcategories: [PredictionSubSubcategory!]
  }

  type PredictionCategory {
    name: String!
    slug: String!
    subcategories: [PredictionSubcategory!]
  }

  enum PredictionMetadataType {
    SPORTS
  }

  type SportsTeam {
    abbreviation: String!
    altAbbreviations: [String!]
    name: String
    league: String
    logo: String
    alias: String
    color: String
    providerId: Int
    isHome: Boolean
  }

  enum SportsTimezone {
    UTC
  }

  type SportsMarketEnrichedMetadata {
    sportsMarketType: String
    league: String
    teams: [SportsTeam!]
    gameStartDate: String
    gameStartTime: String
    gameStartTimeSeconds: Int
    gameStartTimezone: SportsTimezone
  }

  type PredictionMarketEnrichedMetadata {
    metadataType: PredictionMetadataType!
    sports: SportsMarketEnrichedMetadata
  }
  ```

  ### Used By

  **Returned by**

  * [detailedPredictionEventStats](/api-reference/queries/detailedpredictioneventstats.md): Returns windowed and all-time stats for a prediction event.
  * [detailedPredictionMarketStats](/api-reference/queries/detailedpredictionmarketstats.md): Returns windowed and all-time stats for a prediction market.
  * [eventScopedFilterPredictionMarkets](/api-reference/queries/eventscopedfilterpredictionmarkets.md): Filters prediction markets within a single event and returns structured classification metadata for each market. Use this instead of `filterPredictionMarkets` when you need entrant/segment/ladder details (country codes, period+stat grouping, parsed numeric/date rungs) without re-parsing labels client-side.
  * [filterPredictionMarkets](/api-reference/queries/filterpredictionmarkets.md): Filters prediction markets using optional text, IDs, event constraints, and ranking criteria.
  * [filterPredictionTraderMarkets](/api-reference/queries/filterpredictiontradermarkets.md): Filters trader-market records using trader, market, event, and ranking criteria.
  * [onPredictionTradesCreated](/api-reference/subscriptions/onpredictiontradescreated.md): Streams new prediction trades as they are ingested.
  * [predictionEventBars](/api-reference/queries/predictioneventbars.md): Returns bar data for a prediction event.
  * [predictionEventTopMarketsBars](/api-reference/queries/predictioneventtopmarketsbars.md): Returns bar data for top markets inside a prediction event.
  * [predictionMarketBars](/api-reference/queries/predictionmarketbars.md): Returns OHLC-style bar data for a prediction market.
  * [predictionMarkets](/api-reference/queries/predictionmarkets.md): Returns prediction markets by ID.
  * [predictionTraderHoldings](/api-reference/queries/predictiontraderholdings.md): Returns all prediction token holdings for a specific trader.
  * [predictionTraderMarketsStats](/api-reference/queries/predictiontradermarketsstats.md): Returns per-market performance stats for a specific trader.
  * [predictionTrades](/api-reference/queries/predictiontrades.md): Returns prediction trades with cursor-based pagination.
</div>
