Skip to main content

Returns

Arguments

Usage Guidelines

  • For data from mid-2025 onwards (timestamp 1753121580), getTokenBars returns an aggregated price across all pools. Anything before that falls back to the top pair.
  • Historical data only includes OHLC data; volume/traders data cannot be aggregated across all pools on the fly.
  • Includes more historical data than getBars because it iterates through top pairs rather than using a single pair.
  • Response time is slightly faster for current data, but the difference from getBars is negligible.
  • Refer to getBars for additional usage guidelines and troubleshooting tips.
Pricing for aggregate charts will no longer only use the top pair. Weighted average pricing will be used across a token’s top pairs, based on liquidity/recency, while filtering out lower quality pairs from contributing.

Troubleshooting Tips

Use getTokenBars when you want aggregate price data for a token across all its trading pairs — it uses weighted average pricing based on liquidity. Use getBars when you want price data for a specific trading pair.
  • Check that your timestamp window is accurate and long enough for the resolution requested
  • Ensure the token has started trading (we do not index tokens until trades occur)
  • Use removeLeadingNullValues: true
You can use getTokenBars to do an initial fetch of bars and then subscribe to onTokenBarsUpdated to keep it updated in real-time. More info on creating real-time charts is available here.
Our chart data for under 1m (1S, 5S, 15S, 30S) only goes back 24 hours due to the volume of data required at those resolutions.