In this recipe we’ll show you how to fetch and render prediction market chart data at three levels: individual market outcome charts, event-level aggregated charts, and multi-market comparison charts within an event.
Prediction market charts differ from token charts: instead of a single price, you have dual outcome probabilities, bid/ask spreads, and market-level metrics like open interest. Three chart queries are available:
Prediction market charts differ from token charts: instead of a single price, you have dual outcome probabilities, bid/ask spreads, and market-level metrics like open interest. Three chart queries are available:
predictionMarketBars: single market, per-outcome OHLCpredictionEventBars: event-level aggregated volume/liquidity/OIpredictionEventTopMarketsBars: multi-market probability comparison
min1, min5, min15, min30, hour1, hour4, hour12, day1, week1.Step 1: Single Market Outcome Charts
The core chart for any prediction market detail page. It shows how each outcome’s probability has moved over time with full OHLC data. Use
predictionMarketBars to fetch per-outcome price, liquidity, bid/ask, and volume data.You will need a market ID to fetch charts. Use filterPredictionMarkets to grab a market ID.
Outcome probability chart with full OHLC data
Outcome probability chart with full OHLC data
Chart types you can render from this data:Outcome probability (candlestick or line):
- Use
outcome0.priceCollateralToken/outcome1.priceCollateralTokenfor OHLC candlestick charts - The close price (
c) represents the current implied probability (e.g., 0.65 = 65%) - For a simpler line chart, just plot the
c(close) values over time
- Plot
outcome0.bidCollateralToken.candoutcome0.askCollateralToken.cas two lines - The gap between them is the spread. Tighter = more liquid/efficient market
volumeUsdat the market level for total volume per bar- Per-outcome volume with
outcome0.volumeUsd/outcome1.volumeUsd - Buy/sell breakdown with
buyVolumeUsd/sellVolumeUsd
openInterestUsdat the market level shows total capital at risk
tradesanduniqueTradersper bar
Additional parameters:
countback: Instead offrom, specify “give me the last N bars fromto”, which is useful for “show last 100 candles”removeEmptyBars: Skip bars with no trading activity (useful for illiquid markets)
Step 2: Multi-Market Probability Comparison
The signature prediction market chart: multiple outcome lines on one chart, like Polymarket’s multi-candidate probability view. Use
predictionEventTopMarketsBars to get bars for the top markets in an event in a single request.Top 5 markets by volume
Top 5 markets by volume
How to use this data:
- Returns OHLC bars for up to 10 markets in a single request
- Each market in
marketBarshas its ownbarsarray - Plot
outcome0.priceCollateralToken.cfor each market as a separate colored line, labeled withpredictionMarket.label - Ranking options:
rankByfor market-level attributes (volumeUsd1w,trendingScore24h, etc.) orrankByOutcome+rankByOutcomeAttributefor outcome-level (bestAskCT,lastPriceUsd, etc.) marketIdsoverrides ranking. Use it when you want specific markets regardless of rank
Step 3: Event-Level Aggregated Charts
Shows aggregated activity across ALL markets in an event. This is useful for volume, liquidity, and open interest charts at the event level. Use
predictionEventBars.Event-level volume, liquidity, and open interest
Event-level volume, liquidity, and open interest
Chart types from this data:
- Volume bar chart:
volumeUsdper bar, optionally split intobuyVolumeUsd/sellVolumeUsdfor buy/sell pressure visualization - Liquidity area chart:
liquidityUsdOHLC. Usecfor a simple line, or shade betweenlandhfor a range - Open interest line:
openInterestUsdOHLC. Shows total capital committed across all markets - Activity line:
tradesanduniqueTradersper bar - Cumulative volume:
totalVolumeUsdis the running total
predictionEventTopMarketsBars for that.Step 4: Rendering with a Chart Library
Transform the API response into chart-ready data. This approach works with any library (lightweight-charts, TradingView, Chart.js, etc.):
Candlestick data (for outcome prices):Multi-line data (for probability comparison):Volume bars:
Candlestick data (for outcome prices):
Step 5: Resolution Selection
| Time range displayed | Recommended resolution |
|---|---|
| Last hour | min1 |
| Last 4 hours | min5 |
| Last 24 hours | min15 or min30 |
| Last week | hour1 |
| Last month | hour4 or hour12 |
| Last 3 months | day1 |
| All time | day1 or week1 |
- Higher resolutions (min1, min5) give more granular data but return more bars
- For markets with low activity, use
removeEmptyBars: trueto skip empty candles - Use
countbackinstead offromwhen you want a fixed number of bars regardless of time range
Putting It All Together
Recommended chart layout for a prediction event page:
- Top chart: Multi-market probability lines via
predictionEventTopMarketsBars, the hero visualization - Below: Volume bar chart via
predictionEventBars, showing overall event activity - Drill-down: When user clicks a specific market, show its detailed OHLC chart via
predictionMarketBarswith metric selector (price, liquidity, bid/ask, volume, OI)
Check out the related chart endpoints in their API reference pages: