
Fetch
Start by implementing the following query to fetch the OHLCV data for a given token. Test this query in the Explorer →Render
Sample Response
o, h, l, c, t, and volume fields to render the chart. This is adapted from the TradingView documentation, and is intended to be used with their charting library here.
Realtime updates
Now that we have all the data we need to render a chart, we can use the onTokenBarsUpdated subscription to get realtime updates for all pairs of a given token. Note, you can also use onBarsUpdated to get realtime updates for a specific pair. Test this query in the Explorer →o, h, l, c, t, and volume fields to update the chart.
Confirmed vs. Unconfirmed data
The bars subscriptions accept an optionalcommitmentLevel argument. Omitting it gives you confirmed behavior by default.
confirmed(default): best for charts where accuracy matters more than latency, like historical analysis or finalized trade data.processed: best for live trading UIs and sniper bots, where the lowest possible latency matters more than perfect accuracy. Processed events may later be reorged out.
processed is currently available on Solana only.
Event subscriptions (not bars) use a separate
EventCommitmentLevel with its own values — Confirmed, Processed, and the even-earlier Preprocessed. See Commitment levels on the Subscriptions page for the tradeoffs.Aggregated Charts
Create token charts with aggregated data across all valid pairs with getTokenBars. Note that this data has limited historical data, back to timestamp1753121580.
For real-time aggregate charts, subscribe to onTokenBarsUpdated.
Check out all of our charting queries and subscriptions in the api reference