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.
This endpoint requires a Growth or Enterprise plan. Learn more.
Returns
See DetailedStats
Show Properties
Show Properties
The ID of the pair (
pairAddress:networkId).The token of interest used to calculate token-specific stats.
See TokenOfInterest
The type of statistics returned. Can be
FILTERED or UNFILTERED.
See TokenPairStatisticsTypeThe breakdown of stats over a 5 minute window.
See WindowedDetailedStats
Show Properties
Show Properties
The unix timestamp for the start of the window.
The unix timestamp for the end of the window.
The list of start/end timestamps broken down for each bucket within the window.
See DetailedStatsBucketTimestamp
The transaction count over the window.
See DetailedStatsNumberMetrics
The volume over the window.
See DetailedStatsStringMetrics
The number of buys over the window.
See DetailedStatsNumberMetrics
The number of sells over the window.
See DetailedStatsNumberMetrics
The number of unique buyers over the window.
See DetailedStatsNumberMetrics
The number of unique sellers over the window.
See DetailedStatsNumberMetrics
The number of unique traders over the window.
See DetailedStatsNumberMetrics
The buy volume over the window.
See DetailedStatsStringMetrics
The sell volume over the window.
See DetailedStatsStringMetrics
The breakdown of stats over an hour window.
See WindowedDetailedStats
Show Properties
Show Properties
The unix timestamp for the start of the window.
The unix timestamp for the end of the window.
The list of start/end timestamps broken down for each bucket within the window.
See DetailedStatsBucketTimestamp
The transaction count over the window.
See DetailedStatsNumberMetrics
The volume over the window.
See DetailedStatsStringMetrics
The number of buys over the window.
See DetailedStatsNumberMetrics
The number of sells over the window.
See DetailedStatsNumberMetrics
The number of unique buyers over the window.
See DetailedStatsNumberMetrics
The number of unique sellers over the window.
See DetailedStatsNumberMetrics
The number of unique traders over the window.
See DetailedStatsNumberMetrics
The buy volume over the window.
See DetailedStatsStringMetrics
The sell volume over the window.
See DetailedStatsStringMetrics
The breakdown of stats over a 4 hour window.
See WindowedDetailedStats
Show Properties
Show Properties
The unix timestamp for the start of the window.
The unix timestamp for the end of the window.
The list of start/end timestamps broken down for each bucket within the window.
See DetailedStatsBucketTimestamp
The transaction count over the window.
See DetailedStatsNumberMetrics
The volume over the window.
See DetailedStatsStringMetrics
The number of buys over the window.
See DetailedStatsNumberMetrics
The number of sells over the window.
See DetailedStatsNumberMetrics
The number of unique buyers over the window.
See DetailedStatsNumberMetrics
The number of unique sellers over the window.
See DetailedStatsNumberMetrics
The number of unique traders over the window.
See DetailedStatsNumberMetrics
The buy volume over the window.
See DetailedStatsStringMetrics
The sell volume over the window.
See DetailedStatsStringMetrics
The breakdown of stats over a 12 hour window.
See WindowedDetailedStats
Show Properties
Show Properties
The unix timestamp for the start of the window.
The unix timestamp for the end of the window.
The list of start/end timestamps broken down for each bucket within the window.
See DetailedStatsBucketTimestamp
The transaction count over the window.
See DetailedStatsNumberMetrics
The volume over the window.
See DetailedStatsStringMetrics
The number of buys over the window.
See DetailedStatsNumberMetrics
The number of sells over the window.
See DetailedStatsNumberMetrics
The number of unique buyers over the window.
See DetailedStatsNumberMetrics
The number of unique sellers over the window.
See DetailedStatsNumberMetrics
The number of unique traders over the window.
See DetailedStatsNumberMetrics
The buy volume over the window.
See DetailedStatsStringMetrics
The sell volume over the window.
See DetailedStatsStringMetrics
The breakdown of stats over a 24 hour window.
See WindowedDetailedStats
Show Properties
Show Properties
The unix timestamp for the start of the window.
The unix timestamp for the end of the window.
The list of start/end timestamps broken down for each bucket within the window.
See DetailedStatsBucketTimestamp
The transaction count over the window.
See DetailedStatsNumberMetrics
The volume over the window.
See DetailedStatsStringMetrics
The number of buys over the window.
See DetailedStatsNumberMetrics
The number of sells over the window.
See DetailedStatsNumberMetrics
The number of unique buyers over the window.
See DetailedStatsNumberMetrics
The number of unique sellers over the window.
See DetailedStatsNumberMetrics
The number of unique traders over the window.
See DetailedStatsNumberMetrics
The buy volume over the window.
See DetailedStatsStringMetrics
The sell volume over the window.
See DetailedStatsStringMetrics
Arguments
The ID of the pair (
address:networkId).The token of interest within the pair. Can be
token0 or token1.
See TokenOfInterestsubscription {
onDetailedStatsUpdated(
pairId: "BGm1tav58oGcsQJehL9WXBFXF7D27vZsKefj4xJKD5Y:1399811149"
tokenOfInterest: token0
) {
pairId
tokenOfInterest
statsType
stats_min5 {
windowSize
timestamp
endTimestamp
transactions {
change
currentValue
previousValue
}
volume {
change
currentValue
previousValue
}
buys {
change
currentValue
previousValue
}
sells {
change
currentValue
previousValue
}
buyers {
change
currentValue
previousValue
}
sellers {
change
currentValue
previousValue
}
}
stats_hour1 {
windowSize
timestamp
endTimestamp
transactions {
change
currentValue
previousValue
}
volume {
change
currentValue
previousValue
}
}
}
}
Example Response
{
"data": {
"onDetailedStatsUpdated": {
"pairId": "BGm1tav58oGcsQJehL9WXBFXF7D27vZsKefj4xJKD5Y:1399811149",
"tokenOfInterest": "token0",
"statsType": "UNFILTERED",
"stats_min5": {
"windowSize": "min5",
"timestamp": 1769561431,
"endTimestamp": 1769561732,
"transactions": {
"change": -0.38095238095238093,
"currentValue": 13,
"previousValue": 21
},
"volume": {
"change": -0.984327,
"currentValue": "533",
"previousValue": "34008"
},
"buys": {
"change": -0.631578947368421,
"currentValue": 7,
"previousValue": 19
},
"sells": {
"change": 2,
"currentValue": 6,
"previousValue": 2
},
"buyers": {
"change": -0.46153846153846156,
"currentValue": 7,
"previousValue": 13
},
"sellers": {
"change": 0.5,
"currentValue": 3,
"previousValue": 2
}
},
"stats_hour1": {
"windowSize": "hour1",
"timestamp": 1769558131,
"endTimestamp": 1769561732,
"transactions": {
"change": 0.5,
"currentValue": 150,
"previousValue": 100
},
"volume": {
"change": 0.465108,
"currentValue": "172014",
"previousValue": "117407"
}
}
}
}
}
Usage Guidelines
- Subscribe using
pairId(formatpairAddress:networkId) andtokenOfInterest(token0ortoken1) - Stats are provided across multiple time windows:
stats_min5,stats_hour1,stats_hour4,stats_hour12,stats_day1 - Each metric includes
currentValue,previousValue, andchange(percent change as a decimal) for easy comparison - Use
bucketson any metric for granular breakdowns within the window (e.g., per-minute data within the 5-minute window) - Available metrics:
transactions,volume,buys,sells,buyers,sellers,traders,buyVolume,sellVolume - Updates are streamed in real-time as trading activity changes the stats
Troubleshooting Tips
What's the difference between tokenOfInterest and quoteToken?
What's the difference between tokenOfInterest and quoteToken?
They serve the same purpose — selecting which token in the pair to focus on — but are used in different subscriptions.
onDetailedStatsUpdated uses tokenOfInterest, while onBarsUpdated and onEventsCreated use quoteToken. Both accept token0 or token1.What does the change field represent?
What does the change field represent?
change is the percent change between currentValue and previousValue, expressed as a decimal. For example, 0.25 means a 25% increase, and -0.5 means a 50% decrease.How do buckets work?
How do buckets work?
Each window is divided into equal time buckets. For example,
stats_min5 has 5 one-minute buckets, and stats_hour1 has 12 five-minute buckets. The buckets field on the parent returns the start/end timestamps for each bucket, and the buckets field on each metric returns the aggregated values per bucket.When should I use this vs onBarsUpdated?
When should I use this vs onBarsUpdated?
Use
onDetailedStatsUpdated for trading activity stats (transaction counts, buyer/seller counts, volume breakdowns with change percentages). Use onBarsUpdated for OHLCV price candlestick data. They complement each other — stats for activity, bars for price.