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.
Returns
Arguments
Example: Get top token holders for a prediction market
Usage Guidelines
- Market ID format:
- Polymarket:
<marketAddress>:Polymarket:<exchangeAddress>:<networkId>(e.g.,0x25aa90b3cd98305e849189b4e8b770fc77fe89bccb7cf9656468414e01145d38:Polymarket:0xc5d563a36ae78145c45a50134d48a1215220f80a:137) - Kalshi:
<marketSlug>:Kalshi(e.g.,KXMVECROSSCATEGORY-S2026A4A05B370DF-F1FBA451AA9:Kalshi)
- Polymarket:
- Getting token IDs: Query a market using
predictionMarketsand retrieve theoutcomeIdsarray. EachoutcomeIdis a compound string (e.g.,46553...232024:Polymarket:0xc5d5...80a:137). ThetokenIdis the first segment before the first colon (e.g.,46553...232024). For binary markets,outcomeIds[0]is “Yes” andoutcomeIds[1]is “No”. - Token holder sorting: Results are sorted by
amountin descending order (largest holders first) - Trader profiles: The
predictionTraderfield may benullif the wallet address hasn’t been indexed as a trader (alwaysnullfor Kalshi, though Kalshi markets don’t support this endpoint) - Pagination: Returns paginated results - use
cursorfor pagination through large holder lists
Understanding Token Holder Data
- Amounts are returned as strings to preserve precision for large numbers
predictionTraderwill benullfor wallets that only hold tokens but haven’t placed trades- Results are sorted by token amount (highest balances first)
Troubleshooting Tips
Why is predictionTrader null for some holders?
Why is predictionTrader null for some holders?
predictionTrader field is only populated for wallets that have been indexed as active traders with trading history. Wallets that only received tokens through transfers (not trades) or very new wallets may not have an associated trader profile yet. These holders will show walletAddress and amount but have null for predictionTrader.What format is the amount field in?
What format is the amount field in?
amount field represents the raw token balance in the smallest unit (similar to wei for ETH). For Polymarket, these are typically 18-decimal precision numbers. To convert to a human-readable format, divide by 10^18. For example, “125000000000000000000” equals 125 tokens. Always use string parsing for precision to avoid JavaScript number overflow.Are token holders updated in real-time?
Are token holders updated in real-time?
Can I filter token holders by minimum amount?
Can I filter token holders by minimum amount?
How do I get holders for both outcomes in a binary market?
How do I get holders for both outcomes in a binary market?
tokenId. Use the market’s outcomeIds array to get both outcome IDs, then extract the tokenId from each by taking the first segment before the colon (e.g., from 46553...232024:Polymarket:0xc5d5...80a:137, the tokenId is 46553...232024). Query predictionTokenHolders once for each.What if I want to track a specific trader's positions across markets?
What if I want to track a specific trader's positions across markets?
predictionTraderMarketsStats with the trader’s ID (Polymarket only). That query returns per-market statistics including shares held for each outcome.Does this work for Kalshi markets?
Does this work for Kalshi markets?
Related Recipes
- Prediction Event Dashboard: Show token holders as part of a single-market drill-down