Subscriptions (WebSockets) require a Growth or Enterprise plan. Learn more.
Example Response
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.