Candles
OHLCV bars, decoupled from any venue. A CandleSource supplies the three things every chart needs — symbol metadata, historical bars for a range, and a live subscription — so charts, adapters, and hooks are written against that interface rather than against an exchange.
createBinanceCandleSource is the reference source for major markets. Any venue that can answer those three questions plugs in the same way, and toTradingViewDatafeed turns any source into a TradingView Charting Library datafeed.
Every source declares a priceBasis. Binance’s is reference-exchange: it is a third-party venue’s perp price,
not the SYMMIO solver’s mark price a trade settles against. Surface that to anyone placing orders off the chart.
Unlike most of the SDK, a source is not derived from Config: a reference exchange is not a SYMMIO chain deployment, and which venue to chart is the consumer’s choice. Construct one and pass it in explicitly.
Each method and type has its own page with the full signature, parameters, return shape, examples, and query options.
Reads
Live bars
Build the reference source backed by Binance klines — REST history plus a live kline stream.
watchBinanceKlinesThe low-level kline stream, in Binance’s own vocabulary.
Adapters
Helpers
Types
One OHLCV bar — open time in unix milliseconds, aligned by the venue.
CandleSourceThe venue boundary every chart consumer is written against.
Query options
The history read ships a matching getCandlesQueryOptions factory and a getCandlesQueryKey builder for TanStack Query. The source’s id is folded into the key, so switching venues never reads another venue’s cached bars. See getCandlesQueryOptions for the exact call.
Errors
UNKNOWN_CANDLE_RESOLUTION—resolutionToMswas given a code outside the SDK’s vocabulary.UNSUPPORTED_CANDLE_RESOLUTION— the Binance market has no klines interval for the requested resolution.UNMAPPED_CANDLE_MARKET— no venue symbol is mapped for the market name.INVALID_BINANCE_KLINE— a kline arrived malformed or with non-numeric prices.FETCH_BINANCE_KLINES_FAILED— the history request failed.FETCH_BINANCE_EXCHANGE_INFO_FAILED— the exchange-info request failed.BINANCE_KLINES_SOCKET_ERROR— a transport or parse error on the kline stream.NO_WEBSOCKET_IMPLEMENTATION— noWebSocketis available and none was injected.
Related
- Candles hooks — the React layer over this slice.
- Majors chart guide — building a chart end to end.
- Orderbook — the same source pattern for market depth.