Skip to main content
WS channel: ohlcv Enabled on your key on request: contact us. The forming candle of a token, pushed as it changes - same candle shape as REST /v1/token/ohlcv (time in unix seconds, TradingView-style), plus tradeAt (ms of the last folded trade). When a bucket rolls over, the closed candle is delivered first, then the first state of the new bucket.

Delivery model

  • One state per event. Each event carries the complete current candle (open, high, low, close, volume, volumeToken, trades), never a delta. Replace the candle at time in your chart with the payload as is.
  • Cadence. The forming candle is pushed as it changes, at the pace you choose with updatePeriod (default 0: every change as it lands). Intermediate states inside a period are folded into the next event, so the values you receive are exactly the values the REST candle converges to.
  • Bucket close. A closed candle is always delivered immediately, before the first state of the next bucket. Its time is the bucket that just closed.
  • Corrections. A closed candle may be delivered again (same time, "reason": "resync") when late data corrects it; replace the candle at that time, as for any event. Delivered live, such events are free.
  • First event. On subscribe you receive the candle currently in formation (seeded from history), so the chart is continuous with what /v1/token/ohlcv returned a moment before.
  • Volume. volume is in the candle’s own quote (native by default, usd on Solana), like REST; volumeToken is in units of the token itself and is never converted; trades counts the swaps folded into the candle (swaps, not transactions: the same rule as REST).

Parameters

string
required
Public chain id - evm:<id> or solana. Example: evm:8453
string
required
Token address (EVM hex, case-insensitive; Solana base58, case-sensitive). Example: 0xb2000000000000000000007bf6d5cbb0e24cb301
string
Candle interval - same set as REST: 1s 5s 15s 30s 1m 3m 5m 15m 30m 1h 2h 4h 6h 12h 1d 1w 1M (aliases 7d, 30d, 1min, 5min, 15min, 30min, 60). Default 1m. Example: 1m
string
native (default) or usd (Solana).
Native coins (0x0000…0000 and 0xeeee…eeee on every chain, Solana included, the wrapped native such as WETH or WBNB, and the SOL mint) stream in USD, the same candle as REST /v1/token/ohlcv: the candles of the coin’s main USD market, volume in USD and volumeToken in units of the coin. Omit quote or pass quote=usd (on every chain); quote=native and pools are refused with INVALID_PARAM. The native coin of a chain whose native is itself a USD stablecoin (Tempo, Arc, Stable) or that has no USD market (Robinhood Chain) is refused; its wrapped token keeps its own candles.
string
Optional. CSV of pool addresses to restrict the candle to. Omit for the default: the token’s main pool, the market we price the token from, the same one as REST /v1/token/ohlcv (its bonding-curve history stitched in front, the pool followed across the migration), kept up to date server-side as the token graduates. On every chain, Solana included. Every pool must belong to the token, as on REST: otherwise the subscription ends with an INVALID_PARAM error.
integer
Optional, milliseconds, 0 to 60000, default 0. Above 0, each period delivers only the latest state of the forming candle (and bounds the cost). Closed candles are always delivered immediately, whatever the period. The ack carries the value applied (snapped up to 0, 100, 250, 500, 1000, 2000, 5000, 10000, 30000, 60000); maxUpdatesPerMinute (1 to 6000) is accepted as an alias. Example: 1000

Limits

Per account: 20 ohlcv subscriptions across your keys and connections by default (each token x interval counts as one), within the account-wide stream limits (100 connections, 200 subscriptions in total). One subscription can serve as many charts as you like on your side; several clients subscribing to the same token and interval share the same server-side candle. Tell us your target and we raise the limits with you.

Billing

Each ohlcv event delivered costs 1 credit, like every other channel (see the streams overview); the connection itself is free. A subscription on a token that does not trade costs nothing. updatePeriod bounds the number of events, and therefore the cost, of a busy token. GET /v1/usage/breakdown reports it under the route WS ohlcv, where requests is the number of events delivered.

Backfill and reconnect

Load history with GET /v1/token/ohlcv (same interval, same main pool by default), then subscribe: the first event is the forming candle, which continues the history you loaded. Every event carries a cursor: after a reconnect, subscribe again with "since": "<cursor of the last candle you received>" and you receive the candles closed since then, then the forming candle (up to 5 minutes back). Candles that come back flagged "replay": true replace the candle with the same time. If the replay is not available, a REPLAY_TOO_OLD notice gives details.restFromMs: re-fetch the candles from there over REST, the subscription keeps going.

Close codes

The connection can be closed with: 4401 (auth failure - bad/missing/revoked key), 4402 (quota exceeded), 1012 (server restart: reconnect after the retryAfterMs of the JSON reason), 1013 (server at capacity: same), 1008 (policy - subscription limits, floods, slow consumer), 1001 (idle timeout). 4401, 4402 and 1008 need a fix before reconnecting; after the others, reconnect (with a backoff, see Reconnect & resume) and resume with since.
Ack
type:object

Server acknowledgement: the subscription is live.

Candle update
type:object

The complete current candle, one state per event (never a delta): 1 credit per message. A closed candle is delivered immediately; "reason": "resync" flags a closed candle sent again corrected, free.

Subscribe
type:object

Client frame opening the subscription (additive, ack is explicit).