Expand description
Live kline (candle) wire models common to BinanceSpot (@kline_)
and BinanceFuturesUsd (@continuousKline_).
Live Binance kline (candle) WebSocket payloads and their normalisation to
Candle.
Covers both the BinanceSpot @kline_<interval>
stream and the
BinanceFuturesUsdMarket
@continuousKline_<interval> stream (perpetual-only). Endpoints are public/unauthenticated.
§Closed candles only (no repaint)
rustrade emits closed candles only — an in-progress kline (k.x == false) yields an empty
MarketIter, so consumers never see a repainting/lookahead value.
The exclusive close_time boundary is recomputed library-side as open + interval (see
close_time_from_open), not taken from
Binance’s wire T (its period-end − 1ms convention) — consumers comparing against the raw T
will see a 1ms difference by design.
§Reconnection: no replay, no dedup (consumer policy)
Across a reconnect the underlying Connector /
ReconnectingStream re-subscribes but does not replay or de-duplicate: a closed candle
straddling the disconnect may be re-delivered or skipped. De-duplication and gap-back-fill
are consumer policy, not library policy (consistent with rustrade’s “no consumer-specific
policy in the library” rule). A consumer wanting a gapless series should reconcile the live
candle stream against a
fetch_candles
backfill keyed on close_time (the field both paths agree on, since open ≡ close − interval).
Structs§
- Binance
Continuous Kline BinanceFuturesUsdMarketreal-time continuous-contract (perpetual) kline message.- Binance
Kline BinanceSpotreal-time kline (candle) message.- Binance
Kline Data - The inner
kpayload shared by theBinanceSpot@kline_andBinanceFuturesUsdMarket@continuousKline_streams.