candle channel delivers live OHLCV updates for a contract at a specified interval. The current open bar is pushed on change, throttled to at most one frame per 100 ms. When a bar closes at an interval boundary, the server pushes the finalized closed bar (with "closed": true) immediately followed by the first update for the new open bar — so your chart never misses a transition. The channel sends no snapshot on subscribe: load history from candleSnapshot, then apply the pushed bars on top.
Subscribing
string
required
asset (required) — The contract ID to receive candles for, as a string (for example "1").string
required
interval (required) — The candle interval. Accepts the same values as the candleSnapshot REST endpoint: 1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 8h, 12h, 1d, 3d, 1w, 1M.Push message format
Field reference
number
Server send timestamp in Unix milliseconds.
string
Contract ID. Matches the
asset value in your subscription.string
Interval of this candle (e.g.,
"1m").number
Bar open time — Unix milliseconds at the start of this interval bucket.
number
Bar close time — Unix milliseconds at the end of this interval bucket (exclusive).
string
Open price of the bar (raw string). This is the price of the first trade in the interval.
string
Highest trade price within the bar (raw string).
string
Lowest trade price within the bar (raw string).
string
Close price of the bar (raw string). For an open bar, this is the price of the most recent trade so far.
string
Total traded volume within the bar (raw string).
number
Number of individual trades that make up this bar.
boolean
false for an in-progress open bar. true for a finalized closed bar — this message is pushed exactly once at the interval boundary and will not be updated further.No snapshot on subscribe
The subscription does not replay any bars. Every frame on this channel carries a single bar indata, and the first frame arrives when the open bar next changes. Load the history your chart needs from candleSnapshot.
Initialising a chart
1
Subscribe, then load history
Subscribe first, then call
candleSnapshot for the window you want to display and render it as the initial chart state. Subscribing first means no bar that changes during the query is missed.2
Merge pushed bars on bar open time (t)
Each frame carries one bar. Key on
data.t: update the bar with a matching t, or append a new one. A pushed bar replaces the queried bar with the same t.3
Handle closed-bar events
A message with
"closed": true finalizes that bar. The next message carries the new open bar with a later t.4
Fill gaps after a reconnect via REST
After a reconnect, subscribe again and query
candleSnapshot for the time window the disconnect covered.Do not assume the time axis has no holes. Intervals that elapse while the service is restarting or stopped are not backfilled, leaving a permanent gap in history. Render missing ranges as “no data” — prices and volumes elsewhere remain correct.
An open bar is pushed only when it changes. If no trade has occurred since the last push, the same values are not re-sent.
All price and volume values are raw strings. Apply the contract’s decimal precision before rendering values on a chart.
