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 DetailedPredictionTraderStats
DetailedPredictionTraderStats
See DetailedPredictionTraderStats The ID of the prediction trader.
The trader.
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.
The timestamp of the last transaction.
statsHour1
EnhancedWindowedPredictionTraderStats
Stats for the 1-hour window.
See EnhancedWindowedPredictionTraderStats The timestamp of the last transaction.
statsCurrency
WindowedPredictionTraderCurrencyStats!
Currency stats for this window.
See WindowedPredictionTraderCurrencyStats Volume in collateral token units.
Buy volume in collateral token units.
Sell volume in collateral token units.
The realized profit percentage.
The average profit usd per trade.
The average profit ctper trade.
The average swap amount usd.
The average swap amount ct.
heldTokenAcquisitionCostUsd
The held token acquisition cost usd.
heldTokenAcquisitionCostCT
The held token acquisition cost ct.
soldTokenAcquisitionCostUsd
The sold token acquisition cost usd.
soldTokenAcquisitionCostCT
The sold token acquisition cost ct.
statsNonCurrency
WindowedPredictionTraderNonCurrencyStats!
statsChange
WindowedPredictionTraderChangeStats!
statsHour4
EnhancedWindowedPredictionTraderStats
Stats for the 4-hour window.
See EnhancedWindowedPredictionTraderStats The timestamp of the last transaction.
statsCurrency
WindowedPredictionTraderCurrencyStats!
Currency stats for this window.
See WindowedPredictionTraderCurrencyStats Volume in collateral token units.
Buy volume in collateral token units.
Sell volume in collateral token units.
The realized profit percentage.
The average profit usd per trade.
The average profit ctper trade.
The average swap amount usd.
The average swap amount ct.
heldTokenAcquisitionCostUsd
The held token acquisition cost usd.
heldTokenAcquisitionCostCT
The held token acquisition cost ct.
soldTokenAcquisitionCostUsd
The sold token acquisition cost usd.
soldTokenAcquisitionCostCT
The sold token acquisition cost ct.
statsNonCurrency
WindowedPredictionTraderNonCurrencyStats!
statsChange
WindowedPredictionTraderChangeStats!
statsHour12
EnhancedWindowedPredictionTraderStats
Stats for the 12-hour window.
See EnhancedWindowedPredictionTraderStats The timestamp of the last transaction.
statsCurrency
WindowedPredictionTraderCurrencyStats!
Currency stats for this window.
See WindowedPredictionTraderCurrencyStats Volume in collateral token units.
Buy volume in collateral token units.
Sell volume in collateral token units.
The realized profit percentage.
The average profit usd per trade.
The average profit ctper trade.
The average swap amount usd.
The average swap amount ct.
heldTokenAcquisitionCostUsd
The held token acquisition cost usd.
heldTokenAcquisitionCostCT
The held token acquisition cost ct.
soldTokenAcquisitionCostUsd
The sold token acquisition cost usd.
soldTokenAcquisitionCostCT
The sold token acquisition cost ct.
statsNonCurrency
WindowedPredictionTraderNonCurrencyStats!
statsChange
WindowedPredictionTraderChangeStats!
statsDay1
EnhancedWindowedPredictionTraderStats
Stats for the 1-day window.
See EnhancedWindowedPredictionTraderStats The timestamp of the last transaction.
statsCurrency
WindowedPredictionTraderCurrencyStats!
Currency stats for this window.
See WindowedPredictionTraderCurrencyStats Volume in collateral token units.
Buy volume in collateral token units.
Sell volume in collateral token units.
The realized profit percentage.
The average profit usd per trade.
The average profit ctper trade.
The average swap amount usd.
The average swap amount ct.
heldTokenAcquisitionCostUsd
The held token acquisition cost usd.
heldTokenAcquisitionCostCT
The held token acquisition cost ct.
soldTokenAcquisitionCostUsd
The sold token acquisition cost usd.
soldTokenAcquisitionCostCT
The sold token acquisition cost ct.
statsNonCurrency
WindowedPredictionTraderNonCurrencyStats!
statsChange
WindowedPredictionTraderChangeStats!
statsWeek1
EnhancedWindowedPredictionTraderStats
Stats for the 1-week window.
See EnhancedWindowedPredictionTraderStats The timestamp of the last transaction.
statsCurrency
WindowedPredictionTraderCurrencyStats!
Currency stats for this window.
See WindowedPredictionTraderCurrencyStats Volume in collateral token units.
Buy volume in collateral token units.
Sell volume in collateral token units.
The realized profit percentage.
The average profit usd per trade.
The average profit ctper trade.
The average swap amount usd.
The average swap amount ct.
heldTokenAcquisitionCostUsd
The held token acquisition cost usd.
heldTokenAcquisitionCostCT
The held token acquisition cost ct.
soldTokenAcquisitionCostUsd
The sold token acquisition cost usd.
soldTokenAcquisitionCostCT
The sold token acquisition cost ct.
statsNonCurrency
WindowedPredictionTraderNonCurrencyStats!
statsChange
WindowedPredictionTraderChangeStats!
statsDay30
EnhancedWindowedPredictionTraderStats
Stats for the Day30 window.
See EnhancedWindowedPredictionTraderStats The timestamp of the last transaction.
statsCurrency
WindowedPredictionTraderCurrencyStats!
Currency stats for this window.
See WindowedPredictionTraderCurrencyStats Volume in collateral token units.
Buy volume in collateral token units.
Sell volume in collateral token units.
The realized profit percentage.
The average profit usd per trade.
The average profit ctper trade.
The average swap amount usd.
The average swap amount ct.
heldTokenAcquisitionCostUsd
The held token acquisition cost usd.
heldTokenAcquisitionCostCT
The held token acquisition cost ct.
soldTokenAcquisitionCostUsd
The sold token acquisition cost usd.
soldTokenAcquisitionCostCT
The sold token acquisition cost ct.
statsNonCurrency
WindowedPredictionTraderNonCurrencyStats!
statsChange
WindowedPredictionTraderChangeStats!
allTimeStats
WindowedPredictionTraderAllTimeStats!
Arguments input
DetailedPredictionTraderStatsInput!
required
Input parameters used to select a trader and stat windows.
See DetailedPredictionTraderStatsInput The ID of the prediction trader.
durations
[PredictionTraderStatsDuration!]
Example: Get detailed stats for a specific trader
{
detailedPredictionTraderStats (
input : {
traderId : "0x6904db029589e17f69209646381b6d663d695b63:Polymarket"
}
) {
trader {
protocol
alias
primaryAddress
totalVolumeUsd
allTimeProfitUsd
totalTradesCount
activeMarketsCount
firstTradeTimestamp
lastTradeTimestamp
}
lastTransactionAt
statsHour1 {
start
end
statsCurrency {
volumeUsd
buyVolumeUsd
sellVolumeUsd
realizedPnlUsd
realizedProfitPercentage
}
statsNonCurrency {
trades
buys
sells
uniqueMarkets
wins
losses
}
}
statsDay1 {
statsCurrency {
volumeUsd
realizedPnlUsd
realizedProfitPercentage
averageProfitUsdPerTrade
}
statsNonCurrency {
trades
uniqueMarkets
wins
losses
}
}
statsWeek1 {
statsCurrency {
volumeUsd
realizedPnlUsd
}
statsNonCurrency {
trades
uniqueMarkets
}
}
allTimeStats {
totalVolumeUsd
totalProfitUsd
}
}
}
{
"data" : {
"detailedPredictionTraderStats" : {
"trader" : {
"protocol" : "POLYMARKET" ,
"alias" : "Humayun331" ,
"primaryAddress" : null ,
"totalVolumeUsd" : "986.210827" ,
"allTimeProfitUsd" : "-47.22606" ,
"totalTradesCount" : 47 ,
"activeMarketsCount" : 0 ,
"firstTradeTimestamp" : 1770930921 ,
"lastTradeTimestamp" : 1773267363
},
"lastTransactionAt" : 1773267363 ,
"statsHour1" : {
"start" : 1773331200 ,
"end" : 1773338400 ,
"statsCurrency" : {
"volumeUsd" : "0" ,
"buyVolumeUsd" : "0" ,
"sellVolumeUsd" : "0" ,
"realizedPnlUsd" : "0" ,
"realizedProfitPercentage" : 0
},
"statsNonCurrency" : {
"trades" : 0 ,
"buys" : 0 ,
"sells" : 0 ,
"uniqueMarkets" : 0 ,
"wins" : 0 ,
"losses" : 0
}
},
"statsDay1" : {
"statsCurrency" : {
"volumeUsd" : "5.988248" ,
"realizedPnlUsd" : "-0.005655" ,
"realizedProfitPercentage" : -0.0009434587112937931 ,
"averageProfitUsdPerTrade" : "-0.005655"
},
"statsNonCurrency" : {
"trades" : 1 ,
"uniqueMarkets" : 1 ,
"wins" : 0 ,
"losses" : 1
}
},
"statsWeek1" : {
"statsCurrency" : {
"volumeUsd" : "41.960793" ,
"realizedPnlUsd" : "-35.922884"
},
"statsNonCurrency" : {
"trades" : 12 ,
"uniqueMarkets" : 7
}
},
"allTimeStats" : {
"totalVolumeUsd" : "986.210827" ,
"totalProfitUsd" : "-47.22606"
}
}
}
}
Example: Query trader stats across multiple time windows
{
detailedPredictionTraderStats (
input : {
traderId : "0x6904db029589e17f69209646381b6d663d695b63:Polymarket"
durations : [ hour1 , hour4 , day1 , week1 ]
}
) {
traderId
trader {
alias
totalVolumeUsd
}
statsHour1 {
statsCurrency {
volumeUsd
realizedPnlUsd
}
statsChange {
volumeChange
realizedPnlChange
}
}
statsHour4 {
statsCurrency {
volumeUsd
realizedPnlUsd
}
statsChange {
volumeChange
}
}
statsDay1 {
statsCurrency {
volumeUsd
realizedPnlUsd
}
}
statsWeek1 {
statsCurrency {
volumeUsd
realizedPnlUsd
}
}
}
}
{
"data" : {
"detailedPredictionTraderStats" : {
"traderId" : "0x6904db029589e17f69209646381b6d663d695b63:Polymarket" ,
"trader" : {
"alias" : "Humayun331" ,
"totalVolumeUsd" : "986.210827"
},
"statsHour1" : {
"statsCurrency" : {
"volumeUsd" : "0" ,
"realizedPnlUsd" : "0"
},
"statsChange" : {
"volumeChange" : 0 ,
"realizedPnlChange" : 0
}
},
"statsHour4" : {
"statsCurrency" : {
"volumeUsd" : "0" ,
"realizedPnlUsd" : "0"
},
"statsChange" : {
"volumeChange" : 0
}
},
"statsDay1" : {
"statsCurrency" : {
"volumeUsd" : "5.988248" ,
"realizedPnlUsd" : "-0.005655"
}
},
"statsWeek1" : {
"statsCurrency" : {
"volumeUsd" : "41.960793" ,
"realizedPnlUsd" : "-35.922884"
}
}
}
}
}
Usage Guidelines
Use this query to get comprehensive statistics for a single prediction trader
Trader stats aggregate data from all markets and trades for that trader
Windowed statistics are available for multiple time periods: 1h, 4h, 12h, 1d, 1w, 30d
The traderId format is <address>:<protocol> (e.g., 0x6904db029589e17f69209646381b6d663d695b63:Polymarket)
Find trader IDs using filterPredictionTraders or from the trader { id } field on prediction trades
Returns null if the trader doesn’t exist or has no available data
Use the durations parameter to request only specific time windows and optimize query performance
Troubleshooting Tips
How is realized PnL calculated?
Realized PnL (profit and loss) represents actual profits or losses from closed positions within the time window. It’s calculated by comparing the sale price of outcome tokens to their acquisition cost. A positive realizedPnlUsd means the trader made a profit on closed positions, while negative values indicate losses. This excludes unrealized PnL from open positions. The realizedProfitPercentage shows this as a percentage return on invested capital.
What's the difference between wins/losses and positive/negative PnL?
wins and losses count the number of individual trades that were profitable vs. unprofitable. A trader could have more wins than losses but still have negative overall PnL if their losses were larger than their wins. The realizedPnlUsd metric shows the actual dollar amount of profit/loss, which is more important for evaluating trader performance than win/loss ratio alone.
What's the difference between trader stats and event stats?
Trader stats track the performance and activity of a specific wallet address across all prediction markets. Event stats aggregate all trading activity across all traders for a specific prediction event. Use detailedPredictionTraderStats to analyze individual trader behavior, profitability, and trading patterns. Use detailedPredictionEventStats to understand market-level activity.