Skip to main content

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.

Prediction Market data is currently in beta. It is actively being worked on and improved, but may be unreliable. Polymarket and Kalshi data are live.At least for the time being, this endpoint requires a Growth or Enterprise plan. Learn more.
This endpoint requires a Growth or Enterprise plan. Learn more.

Returns

DetailedPredictionMarketStats
DetailedPredictionMarketStats
See DetailedPredictionMarketStats

Arguments

input
DetailedPredictionMarketStatsInput!
required
Input parameters used to select a market and stat windows. See DetailedPredictionMarketStatsInput

Query example

Get detailed stats for a specific market
{
  detailedPredictionMarketStats(
    input: {
      marketId: "0x25aa90b3cd98305e849189b4e8b770fc77fe89bccb7cf9656468414e01145d38:Polymarket:0xc5d563a36ae78145c45a50134d48a1215220f80a:137"
    }
  ) {
    predictionMarket {
      protocol
      question
      label
      closesAt
      resolvedAt
      createdAt
      eventId
      venueMarketSlug
    }
    statsHour1 {
      core {
        volume {
          usd
        }
        trades
      }
      uniqueTraders {
        uniqueTraders
      }
      scores {
        trending
        relevance
        competitive
      }
    }
    statsHour4 {
      core {
        volume {
          usd
        }
      }
      statsChange {
        volumeChange
        uniqueTradersChange
      }
    }
    statsDay1 {
      core {
        volume {
          usd
        }
      }
      liquidity {
        liquidity {
          close {
            usd
          }
        }
      }
      openInterest {
        openInterest {
          close {
            usd
          }
        }
      }
      uniqueTraders {
        uniqueTraders
      }
      scores {
        trending
        relevance
        competitive
      }
    }
    allTimeStats {
      volume {
        usd
      }
      venueVolume {
        usd
      }
    }
  }
}
Example response
{
  "data": {
    "detailedPredictionMarketStats": {
      "predictionMarket": {
        "protocol": "POLYMARKET",
        "question": "Will the Fed increase interest rates by 25+ bps after the March 2026 meeting?",
        "label": "25+ bps increase",
        "closesAt": 1773792000,
        "resolvedAt": null,
        "createdAt": 1761685086,
        "eventId": "67284:Polymarket:0xc5d563a36ae78145c45a50134d48a1215220f80a:137",
        "venueMarketSlug": "will-the-fed-increase-interest-rates-by-25-bps-after-the-march-2026-meeting"
      },
      "statsHour1": {
        "core": {
          "volume": {
            "usd": "293166"
          },
          "trades": 45
        },
        "uniqueTraders": {
          "uniqueTraders": 36
        },
        "scores": {
          "trending": 0.21045977756048143,
          "relevance": 0.888706858311519,
          "competitive": 0.22740250415693916
        }
      },
      "statsHour4": {
        "core": {
          "volume": {
            "usd": "1649050"
          }
        },
        "statsChange": {
          "volumeChange": 4.743497401747029,
          "uniqueTradersChange": 0.19827586206896552
        }
      },
      "statsDay1": {
        "core": {
          "volume": {
            "usd": "4878915"
          }
        },
        "liquidity": {
          "liquidity": {
            "close": {
              "usd": "16546011"
            }
          }
        },
        "openInterest": {
          "openInterest": {
            "close": {
              "usd": "8237311"
            }
          }
        },
        "uniqueTraders": {
          "uniqueTraders": 554
        },
        "scores": {
          "trending": 0.2711821948088767,
          "relevance": 0.9832798636422668,
          "competitive": 0.33942966597666013
        }
      },
      "allTimeStats": {
        "volume": {
          "usd": "70882915"
        },
        "venueVolume": {
          "usd": "122908278"
        }
      }
    }
  }
}

Usage Guidelines

  • Use this query to get comprehensive statistics for a single prediction market
  • Market stats provide granular data for a specific outcome within an event
  • Windowed statistics are available for multiple time periods: 5min, 1h, 4h, 12h, 1d, 1w
  • Market ID formats vary by protocol:
    • Polymarket: <marketAddress>:Polymarket:<exchangeAddress>:<networkId> (e.g., 0x25aa90b3cd98305e849189b4e8b770fc77fe89bccb7cf9656468414e01145d38:Polymarket:0xc5d563a36ae78145c45a50134d48a1215220f80a:137)
    • Kalshi: <marketSlug>:Kalshi (e.g., KXMVECROSSCATEGORY-S2026A4A05B370DF-F1FBA451AA9:Kalshi)
  • Find market IDs using filterPredictionMarkets or from the id field on markets
  • Returns null if the market doesn’t exist or has no available data
  • For aggregated stats across all markets in an event, use detailedPredictionEventStats

Understanding Scores

  • trending - Measures what’s “heating up” - prioritizes growth velocity over absolute size (a small market with 10x volume growth scores higher than a large market with flat volume)
  • relevance - Measures what “matters” - based on absolute size and capital at stake, with no growth multipliers (large, established markets rank high even if quiet)
  • competitive - Measures genuine uncertainty - higher when prices are near 50%, trading is balanced on both sides, and there’s active price discovery

Troubleshooting Tips

Market stats show data for a single outcome, while event stats aggregate across all markets in an event. Use detailedPredictionEventStats for aggregated stats.
Use filterPredictionMarkets to search for markets, or get the id field from any market query.
  • Trending (0-1): 0.9+ = explosive growth (10x+ volume spikes, rapid trader influx)
  • Relevance (0-1): 0.9+ = large capital deployment (high volume, deep liquidity)
  • Competitive (0-1): 0.7+ = genuine uncertainty (prices near 50%, balanced trading). Low scores (< 0.3) = market reached consensus.