Skip to main content
Every serious terminal renders its chart with TradingView, and our candles were shaped for it: time in unix seconds, TradingView-style interval keys accepted as aliases, a dense time axis with no gaps, and pagination that maps one-to-one to getBars. This guide wires GET /v1/token/ohlcv into both TradingView products, then makes the bars live.
  • Advanced Charts (the Charting Library): the full-featured widget behind Axiom, GMGN and every major terminal. Free, but TradingView grants the library access on request; you host the files, you feed the data.
  • Lightweight Charts: TradingView’s open-source npm package. A few KB, no approval process, perfect for list previews and compact charts.

The symbol convention

A chart needs one string per market. Use the token’s identity as the ticker, <chain>:<address>:
chain is a public chain id (evm:8453, solana), so the same datafeed serves all 18 EVM chains and Solana.

Resolutions

Our intervals cover every resolution the widget offers, seconds included. The full map:

The datafeed

The whole integration is one object implementing four methods. getBars is a direct translation of the endpoint’s paging contract: endTime is TradingView’s to (both unix seconds), limit is countBack, and noData is true when a page comes back empty with meta.hasMore false.
datafeed.ts
Two behaviors you get without writing anything: the time axis is dense (a quiet bucket is a flat candle at the previous close, so thin tokens still chart), and a token that graduated from a bonding curve draws one continuous series across the migration, curve history stitched in server-side. Mounting the widget is standard TradingView:

Live bars

subscribeBars folds the trades stream: subscribe the token on the trades channel and fold each event into the forming bar, exactly the pattern of the terminal guide:
On a WebSocket reconnect, delivery is at-most-once: call the widget’s onResetCacheNeededCallback and chart.resetData() so getBars re-seeds the series from REST, then re-subscribe.

Lightweight Charts

The open-source package expects time in unix seconds: our candles drop in with no conversion at all.

The details that bite

  • Time units. REST candles and Lightweight Charts use unix seconds; Advanced Charts bars want milliseconds. The * 1000 in getBars is the whole difference.
  • pricescale must be an integer power of ten. Size it from the token’s price at resolveSymbol time (helper above) or microcap charts render as a flat line.
  • Volume. volumeToken is the base-asset volume, the number a TradingView volume pane expects. volume is the quote-side value if you prefer notional.
  • Paging depth. Up to 2000 candles per getBars call, limit honoured however quiet the token is; historical pages are immutable and cached, so scroll-back stays fast.
  • Interval aliases. The API also accepts 1min, 5min, 15min, 30min, 60, 7d, 30d directly and echoes the canonical key in meta.interval, so a partial map still works during a migration from another provider.
  • Credits. A getBars page is 5 credits; live bars bill 1 credit per delivered event, and maxUpdatesPerMinute on the subscription caps the burn of a busy token. Full grid on Authentication & Limits.

Build a Trading Terminal

The rest of the terminal around this chart: discovery, tape, panels, portfolio.

Candles (OHLCV) reference

Every parameter and semantic of the endpoint behind the datafeed.