Learn how to build trader leaderboards, profiles, and portfolio analytics for prediction market traders
In this recipe we’ll show you how to discover top prediction market traders, display detailed trader profiles with performance stats, show their market positions and P&L, and chart their trading activity over time.Prediction market traders have rich on-chain performance data: win rate, P&L, volume, position sizing, and per-market breakdowns. This recipe covers 5 queries that work together: discover traders → view profile → see positions → chart performance → trade history.
Ranking attributes are available at multiple windows: 12h, 24h, 1w, 1m, and “All” (all-time).Volume filters (e.g., totalVolumeUsdAll: { gte: 10000 }) are essential for meaningful leaderboards. Filter out low-activity traders.P&L per volume (pnlPerVolumeAll) normalizes profit by capital deployed, making it better for comparing traders of different sizes.Search matches against alias, primary address, or venue trader ID.
The trader object has the all-time aggregate profile: total volume, profit, biggest win/loss, trade count, active markets
Windowed stats (statsHour1 through statsDay30) give recent performance breakdowns
statsCurrency has all the monetary metrics, statsNonCurrency has counts, statsChange has period-over-period changes
heldTokenAcquisitionCostUsd / soldTokenAcquisitionCostUsd show the cost basis of currently held and already-sold positions
realizedProfitPercentage is the return on capital for the window
Use the windowed stats to build a time-period toggle (1h, 4h, 12h, 24h, 1w, 30d) on the trader profile
Each toggle interval maps to one exact field name:
Time window
Field name
1 hour
statsHour1
4 hours
statsHour4
12 hours
statsHour12
24 hours
statsDay1
1 week
statsWeek1
30 days
statsDay30
All-time
allTimeStats
Note the one-week window is statsWeek1, not statsDay7.Note the 30-day window is statsDay30, not statsMonth1.These six windowed fields plus allTimeStats are the complete set. There is no statsDay7, statsDay3, statsDay14, or statsMonth1.
Per-outcome position data: Each result has outcome0 and outcome1 with shares held, avg entry price, cost basis, realized P&L.hasOpenPosition: Filter to show only active positions vs historical ones.pnlStatus: Indicates the P&L state for the outcome (e.g., PROFIT, LOSS).avgEntryPriceCT: The average price the trader paid. Compare with current market price to estimate unrealized P&L.Cross-referencing: Use marketIds to find top traders for a market, or eventIds for an event. This powers “Top Traders” tabs on market/event pages.
You can also use predictionTraderMarketsStats as a simpler alternative for fetching a trader’s per-market stats without the filtering/ranking system:
Grab the trader ID from the previous queries to use here. We’ve used a sample trader ID for this example. Feel free to change it.
Simple position list with predictionTraderMarketsStats
filterPredictionTraderMarkets(traderIds, hasOpenPosition: true): active positions table
predictionTraderBars: cumulative P&L chart
On tab switch:
filterPredictionTraderMarkets(traderIds): all positions (when user switches to “All Positions” tab)
predictionTrades(traderId): trade history (when user switches to “Trades” tab)
For a leaderboard page:
filterPredictionTraders: the main ranked list with configurable sort
Click a trader → navigate to their profile using the data flow above
Trader IDs: Format is typically protocol:address (e.g., Polymarket:0x1234...).CT vs USD: Collateral token (CT) values are preferred for prediction market P&L since the collateral is usually a stablecoin.Unrealized P&L: The API provides realized P&L. To estimate unrealized, compare avgEntryPriceCT from positions with current market price from filterPredictionMarkets.Win rate context: Always show win rate alongside trade count. A 100% win rate on 2 trades is less meaningful than 60% on 500 trades.Position sizing:totalCostBasisUsd shows how much capital a trader has deployed in a market, providing useful context alongside P&L.Cross-query use:filterPredictionTraderMarkets works bidirectionally. Filter by traderIds for a trader’s portfolio, or by marketIds/eventIds to find top traders for a market/event.
Check out the related endpoints in their respective API reference pages: