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 .
Kalshi does not provide trader data . These endpoints only work with Polymarket data. Kalshi’s API does not expose individual trader information due to privacy considerations on their regulated exchange.
This endpoint requires a Growth or Enterprise plan. Learn more . Returns PredictionTraderMarketFilterConnection
PredictionTraderMarketFilterConnection
See PredictionTraderMarketFilterConnection Total number of matching results.
results
[PredictionTraderMarketFilterResult!]!
The list of results.
See PredictionTraderMarketFilterResult The ID of the prediction trader.
The ID of the prediction market.
The ID of the prediction event.
Minimal trader info embedded in the result
See FilterTrader Labels applied to this entity.
Minimal market info embedded in the result
See FilterTraderMarket The ID of the prediction event.
The venue-specific market ID.
URL of the thumbnail image.
The timestamp when this entity closes.
The actual resolution timestamp.
Full trader entity (loaded via DataLoader)
See PredictionTrader The timestamp of the first trade.
The timestamp of the last trade.
The active markets count.
Labels applied to this entity.
The last update timestamp.
Full market entity (loaded via DataLoader)
See PredictionMarket The venue-specific market ID.
The venue-specific market slug.
The ID of the prediction event.
The venue-specific event ID.
A clean, UI-ready label derived from label/question with the parent event name stripped (and Kalshi Yes:/No: prefixes unwrapped). Falls back to question when label is missing or unknown.
Venue-specific outcome IDs.
URL of the thumbnail image.
The last update timestamp.
The timestamp when this entity opens.
The timestamp when this entity closes.
The expected resolution timestamp.
The actual resolution timestamp.
The last observation timestamp.
The exchange contract address.
The ID of the winning outcome.
enrichedMetadata
PredictionMarketEnrichedMetadata
Per-domain structured enrichment (sports market type/teams/start times today). Null when no domain-specific signal extracted.
See PredictionMarketEnrichedMetadata Discriminator naming which sub-block carries data.
See PredictionMetadataType Sports games (league, teams, start times).
sports
SportsMarketEnrichedMetadata
Populated when metadataType = SPORTS.
See SportsMarketEnrichedMetadata Market template slug (e.g. “moneyline”, “spreads”, “totals”, “ufc_method_of_victory”). Free string — list grows as venues add templates.
Soft-normalised league identifier (mirrors the parent event).
Teams referenced by this market, when known.
See SportsTeam Lowercased venue-canonical abbreviation.
Known alternate forms for the same team (rebrands, relocations, 2-vs-3-letter conventions). Excludes abbreviation.
Soft-normalised league for this team.
Provider-side identifier (e.g. Polymarket gamma id).
Whether this team is the home team in the event.
Game-start date in UTC (“YYYY-MM-DD”). Derived from gameStartTime when present.
Game-start clock value as canonical UTC ISO-8601.
Game-start as Unix seconds (UTC).
Timezone discriminator for gameStartTime / gameStartDate. Always UTC for any record produced after the ET→UTC normalisation rollout.
See SportsTimezone UTC. gameStartTime is canonical ISO-8601; gameStartTimeSeconds populated.
Whether the trader has an open position.
The ID of the winning outcome.
The total realized pnl usd.
The total realized pnl ct.
The total cost basis usd.
totalCurrentPositionValueUsd
The total current position value in USD. Returns 0 when there are no open held positions; null when any open held position is missing latest price data.
totalCurrentPositionValueCT
The total current position value in collateral token units. Returns 0 when there are no open held positions; null when any open held position is missing latest price data.
The total unrealized pnl in USD. Returns 0 when there are no open held positions; null when any open held position is missing latest price data.
The total unrealized pnl in collateral token units. Returns 0 when there are no open held positions; null when any open held position is missing latest price data.
The pnl per volume market.
The profit per trade usd.
The timestamp of the first trade.
The timestamp of the last trade.
outcome0
PredictionTraderOutcomeFilterResult!
Outcome 0 data.
See PredictionTraderOutcomeFilterResult The ID of the prediction outcome.
Buy volume in collateral token units.
Sell volume in collateral token units.
The current outcome price in USD. Null when latest price data is unavailable.
The current outcome price in collateral token units. Null when latest price data is unavailable.
The current position value in USD. Returns 0 for closed/no-share positions; null when latest price data is unavailable for an open position.
The current position value in collateral token units. Returns 0 for closed/no-share positions; null when latest price data is unavailable for an open position.
The unrealized pnl in USD. Returns 0 for closed/no-share positions; null when latest price data is unavailable for an open position.
The unrealized pnl in collateral token units. Returns 0 for closed/no-share positions; null when latest price data is unavailable for an open position.
pnlStatus
PredictionTraderMarketPnlStatus!
The timestamp of the first trade.
The timestamp of the last trade.
outcome1
PredictionTraderOutcomeFilterResult!
Outcome 1 data.
See PredictionTraderOutcomeFilterResult The ID of the prediction outcome.
Buy volume in collateral token units.
Sell volume in collateral token units.
The current outcome price in USD. Null when latest price data is unavailable.
The current outcome price in collateral token units. Null when latest price data is unavailable.
The current position value in USD. Returns 0 for closed/no-share positions; null when latest price data is unavailable for an open position.
The current position value in collateral token units. Returns 0 for closed/no-share positions; null when latest price data is unavailable for an open position.
The unrealized pnl in USD. Returns 0 for closed/no-share positions; null when latest price data is unavailable for an open position.
The unrealized pnl in collateral token units. Returns 0 for closed/no-share positions; null when latest price data is unavailable for an open position.
pnlStatus
PredictionTraderMarketPnlStatus!
The timestamp of the first trade.
The timestamp of the last trade.
Arguments filters
PredictionTraderMarketFilters
A set of filters to apply.
See PredictionTraderMarketFilters Filter by whether trader has an open position
outcome0PnlStatus
[PredictionTraderMarketPnlStatus!]
outcome1PnlStatus
[PredictionTraderMarketPnlStatus!]
The unix timestamp.
See NumberFilter Greater than or equal to.
The timestamp of the first trade.
See NumberFilter Greater than or equal to.
The timestamp of the last trade.
See NumberFilter Greater than or equal to.
The total realized pnl usd.
See NumberFilter Greater than or equal to.
The total realized pnl ct.
See NumberFilter Greater than or equal to.
The total volume usd.
See NumberFilter Greater than or equal to.
The total volume ct.
See NumberFilter Greater than or equal to.
The total volume shares.
See NumberFilter Greater than or equal to.
The total cost basis usd.
See NumberFilter Greater than or equal to.
The total cost basis ct.
See NumberFilter Greater than or equal to.
The total shares held.
See NumberFilter Greater than or equal to.
The pnl per volume market.
See NumberFilter Greater than or equal to.
The profit per trade usd.
See NumberFilter Greater than or equal to.
Outcome 0 realized pnl usd.
See NumberFilter Greater than or equal to.
Outcome 0 shares held.
See NumberFilter Greater than or equal to.
Outcome 0 cost basis usd.
See NumberFilter Greater than or equal to.
Outcome 1 realized pnl usd.
See NumberFilter Greater than or equal to.
Outcome 1 shares held.
See NumberFilter Greater than or equal to.
Outcome 1 cost basis usd.
See NumberFilter Greater than or equal to.
A phrase to search for. Can match trader alias, market label, or event label.
A list of trader IDs to filter by.
A list of trader IDs to exclude from results.
A list of market IDs to filter by.
A list of market IDs to exclude from results.
A list of event IDs to filter by (returns records for markets in these events).
A list of event IDs to exclude.
rankings
[PredictionTraderMarketRanking!]
The maximum number of results to return.
Where in the list the server should start when returning items.
Example: Top profitable trader positions
{
filterPredictionTraderMarkets (
rankings : [
{ attribute : totalRealizedPnlUsd , direction : DESC }
]
filters : {
status : RESOLVED
}
limit : 10
) {
count
page
results {
id
trader {
alias
primaryAddress
profileImageUrl
}
market {
question
eventLabel
status
closesAt
outcome0Label
outcome1Label
}
totalRealizedPnlUsd
totalVolumeUsd
totalTrades
totalBuys
totalSells
pnlPerVolumeMarket
profitPerTradeUsd
hasOpenPosition
outcome0 {
sharesHeld
avgEntryPriceUsd
realizedPnlUsd
pnlStatus
buys
sells
}
outcome1 {
sharesHeld
avgEntryPriceUsd
realizedPnlUsd
pnlStatus
buys
sells
}
}
}
}
Example Response (truncated)
{
"data" : {
"filterPredictionTraderMarkets" : {
"count" : 10 ,
"page" : 0 ,
"results" : [
{
"id" : "0x019782cab5d844f02bafb71f512758be78579f3c:Polymarket:0xc65e24cc10c071c4643186287441624cb41040a3c66a2971e5fc44479cc25146:Polymarket:0xc5d563a36ae78145c45a50134d48a1215220f80a:137" ,
"trader" : {
"alias" : "majorexploiter" ,
"primaryAddress" : null ,
"profileImageUrl" : null
},
"market" : {
"question" : "Will Arsenal FC win on 2026-03-01?" ,
"eventLabel" : "Arsenal FC vs. Chelsea FC" ,
"status" : "RESOLVED" ,
"closesAt" : 1772382600 ,
"outcome0Label" : "Yes" ,
"outcome1Label" : "No"
},
"totalRealizedPnlUsd" : "2416340.457365" ,
"totalVolumeUsd" : "11481708.960435" ,
"totalTrades" : 659 ,
"totalBuys" : 658 ,
"totalSells" : 1 ,
"pnlPerVolumeMarket" : "0.2105" ,
"profitPerTradeUsd" : "3666.6774770333839150227617602427921092564492" ,
"hasOpenPosition" : false ,
"outcome0" : {
"sharesHeld" : "0" ,
"avgEntryPriceUsd" : "0" ,
"realizedPnlUsd" : "2416340.457365" ,
"pnlStatus" : "WIN" ,
"buys" : 658 ,
"sells" : 1
},
"outcome1" : {
"sharesHeld" : "0" ,
"avgEntryPriceUsd" : "0" ,
"realizedPnlUsd" : "0" ,
"pnlStatus" : "NEUTRAL" ,
"buys" : 0 ,
"sells" : 0
}
},
// ... 9 more results
]
}
}
}
Usage Guidelines
ID formats :
Trader ID: <address>:<protocol> (e.g., 0x019782cab5d844f02bafb71f512758be78579f3c:Polymarket)
Market ID: <marketAddress>:<protocol>:<eventAddress>:<networkId> (e.g., 0xc65e24cc10c071c4643186287441624cb41040a3c66a2971e5fc44479cc25146:Polymarket:0xc5d563a36ae78145c45a50134d48a1215220f80a:137)
Event ID: <venueId>:<protocol>:<eventAddress>:<networkId> (e.g., 67284:Polymarket:0xc5d563a36ae78145c45a50134d48a1215220f80a:137)
Response limit: 100 trader-market records per request (configurable with limit parameter)
Use traderIds to track specific traders across markets, or marketIds to see all traders in specific markets
Filter by hasOpenPosition: true to find active positions, or false for closed positions only
Use eventIds to see trader activity across all markets within an event
PnL metrics (totalRealizedPnlUsd, pnlPerVolumeMarket) are only meaningful for resolved markets
Combine outcome0PnlStatus and outcome1PnlStatus filters to find winning or losing positions
Use phrase to search by trader alias, market label, or event label
Understanding Trader-Market Records
This query returns trader-market pairs - the performance of individual traders on specific markets:
One record per trader-market combination - if a trader traded on 10 markets, there are 10 records
Aggregated across all trades - totalVolumeUsd, totalTrades, totalBuys, totalSells sum up all activity
Separate outcome data - outcome0 and outcome1 show position details for each side
Use this query to:
Track individual trader performance on specific markets
Find which traders profited most on particular events
Identify traders with open positions in markets of interest
Analyze trading patterns (buy/sell ratios, average entry prices)
PnL Status Values
See the PredictionTraderMarketPnlStatus enum for all possible PnL status values and their meanings.
Troubleshooting Tips
What's the difference between totalRealizedPnlUsd and outcome PnL?
totalRealizedPnlUsd is the sum of realized PnL across both outcomes. Individual outcome PnL (outcome0.realizedPnlUsd, outcome1.realizedPnlUsd) shows profit/loss for each side. Traders often trade both sides, so check both outcomes to understand their full strategy.
What does pnlPerVolumeMarket tell me?
This is the profit-to-volume ratio, showing how efficiently a trader extracted profit relative to their trading volume. A value of 0.15 means they made 0.15 p r o f i t p e r 0.15 profit per 0.15 p ro f i tp er 1 traded. Higher values indicate more skilled trading or better market timing.
Why is sharesHeld not zero even though the market is resolved?
Some traders may not have sold their winning shares yet. On resolved markets, winning shares can be redeemed for $1 each. Check isWinningOutcome to see if held shares are valuable or worthless.
What's the difference between buys/sells counts and volume?
totalBuys and totalSells count the number of transactions, while totalVolumeUsd measures the dollar value. A trader with 100 small trades might have less volume than one with 5 large trades. Use profitPerTradeUsd to measure per-transaction efficiency.
Prediction Traders : Show a trader’s open positions, per-market P&L, and top traders for a market or event