Binance C++ Connector 2.0.0
Official C++ connectors for the Binance APIs
Loading...
Searching...
No Matches
binance::derivatives_trading_coin_futures::websocket_streams::Api Class Reference

Each method subscribes to one stream (or queues the subscription while the connection reconnects) and returns its handle. More...

#include <api.hpp>

Public Member Functions

 Api (std::shared_ptr< common::WebsocketStreams > client)
common::WebsocketStream< AggregateTradeStreamsResponse > aggregate_trade_streams (const AggregateTradeStreamsParams &params) const
 Aggregate Trade Streams.
common::WebsocketStream< AllBookTickersStreamResponse > all_book_tickers_stream (const AllBookTickersStreamParams &params={}) const
 All Book Tickers Stream.
common::WebsocketStream< AllMarketLiquidationOrderStreamsResponse > all_market_liquidation_order_streams (const AllMarketLiquidationOrderStreamsParams &params={}) const
 All Market Liquidation Order Streams.
common::WebsocketStream< std::vector< AllMarketMiniTickersStreamResponseInner > > all_market_mini_tickers_stream (const AllMarketMiniTickersStreamParams &params={}) const
 All Market Mini Tickers Stream.
common::WebsocketStream< std::vector< AllMarketTickersStreamsResponseInner > > all_market_tickers_streams (const AllMarketTickersStreamsParams &params={}) const
 All Market Tickers Streams.
common::WebsocketStream< ContinuousContractKlineCandlestickStreamsResponse > continuous_contract_kline_candlestick_streams (const ContinuousContractKlineCandlestickStreamsParams &params) const
 Continuous Contract Kline/Candlestick Streams.
common::WebsocketStream< ContractInfoStreamResponse > contract_info_stream (const ContractInfoStreamParams &params={}) const
 Contract Info Stream.
common::WebsocketStream< DiffBookDepthStreamsResponse > diff_book_depth_streams (const DiffBookDepthStreamsParams &params) const
 Diff.
common::WebsocketStream< IndexKlineCandlestickStreamsResponse > index_kline_candlestick_streams (const IndexKlineCandlestickStreamsParams &params) const
 Index Kline/Candlestick Streams.
common::WebsocketStream< IndexPriceStreamResponse > index_price_stream (const IndexPriceStreamParams &params) const
 Index Price Stream.
common::WebsocketStream< IndividualSymbolBookTickerStreamsResponse > individual_symbol_book_ticker_streams (const IndividualSymbolBookTickerStreamsParams &params) const
 Individual Symbol Book Ticker Streams.
common::WebsocketStream< IndividualSymbolMiniTickerStreamResponse > individual_symbol_mini_ticker_stream (const IndividualSymbolMiniTickerStreamParams &params) const
 Individual Symbol Mini Ticker Stream.
common::WebsocketStream< IndividualSymbolTickerStreamsResponse > individual_symbol_ticker_streams (const IndividualSymbolTickerStreamsParams &params) const
 Individual Symbol Ticker Streams.
common::WebsocketStream< KlineCandlestickStreamsResponse > kline_candlestick_streams (const KlineCandlestickStreamsParams &params) const
 Kline/Candlestick Streams.
common::WebsocketStream< MarkPriceKlineCandlestickStreamsResponse > mark_price_kline_candlestick_streams (const MarkPriceKlineCandlestickStreamsParams &params) const
 Mark Price Kline/Candlestick Streams.
common::WebsocketStream< std::vector< MarkPriceOfAllSymbolsOfAPairResponseInner > > mark_price_of_all_symbols_of_a_pair (const MarkPriceOfAllSymbolsOfAPairParams &params) const
 Mark Price of All Symbols of a Pair.
common::WebsocketStream< MarkPriceStreamResponse > mark_price_stream (const MarkPriceStreamParams &params) const
 Mark Price Stream.
common::WebsocketStream< MarketLiquidationOrderStreamsResponse > market_liquidation_order_streams (const MarketLiquidationOrderStreamsParams &params) const
 Market Liquidation Order Streams.
common::WebsocketStream< PartialBookDepthStreamsResponse > partial_book_depth_streams (const PartialBookDepthStreamsParams &params) const
 Partial Book Depth Streams.

Detailed Description

Each method subscribes to one stream (or queues the subscription while the connection reconnects) and returns its handle.

Destroying the handle, or calling unsubscribe() on it, ends the subscription.

Constructor & Destructor Documentation

◆ Api()

binance::derivatives_trading_coin_futures::websocket_streams::Api::Api ( std::shared_ptr< common::WebsocketStreams > client)
explicit

Member Function Documentation

◆ aggregate_trade_streams()

common::WebsocketStream< AggregateTradeStreamsResponse > binance::derivatives_trading_coin_futures::websocket_streams::Api::aggregate_trade_streams ( const AggregateTradeStreamsParams & params) const
nodiscard

Aggregate Trade Streams.

<symbol>@aggTrade.

The Aggregate Trade Streams push market trade information that is aggregated for fills with same price and taking side every 100 milliseconds.

After CM migration, the payload is appended with a new st field (1 = UM, 2 = CM).

Update Speed: 100ms

See https://developers.binance.com/en/docs/catalog/core-trading-derivatives-trading-coin-m-futures/api/ws-streams/~#aggregate-trade-streams

◆ all_book_tickers_stream()

common::WebsocketStream< AllBookTickersStreamResponse > binance::derivatives_trading_coin_futures::websocket_streams::Api::all_book_tickers_stream ( const AllBookTickersStreamParams & params = {}) const
nodiscard

All Book Tickers Stream.

!bookTicker.

Pushes any update to the best bid or ask's price or quantity in real-time for all symbols.

After CM migration, this stream pushes the merged UM + CM universe (subscribable on both fstream and dstream); each payload is appended with a new st field (1 = UM, 2 = CM).

Update Speed: Real-time

See https://developers.binance.com/en/docs/catalog/core-trading-derivatives-trading-coin-m-futures/api/ws-streams/~#all-book-tickers-stream

◆ all_market_liquidation_order_streams()

common::WebsocketStream< AllMarketLiquidationOrderStreamsResponse > binance::derivatives_trading_coin_futures::websocket_streams::Api::all_market_liquidation_order_streams ( const AllMarketLiquidationOrderStreamsParams & params = {}) const
nodiscard

All Market Liquidation Order Streams.

!forceOrder@arr.

The All Liquidation Order Snapshot Streams push force liquidation order information for all symbols in the market. For each symbol,only the latest one liquidation order within 1000ms will be pushed as the snapshot. If no liquidation happens in the interval of 1000ms, no stream will be pushed.

After CM migration, this stream pushes the merged UM + CM universe (subscribable on both fstream and dstream); each payload is appended with a new st field (1 = UM, 2 = CM).

Update Speed: 1000ms

See https://developers.binance.com/en/docs/catalog/core-trading-derivatives-trading-coin-m-futures/api/ws-streams/~#all-market-liquidation-order-streams

◆ all_market_mini_tickers_stream()

common::WebsocketStream< std::vector< AllMarketMiniTickersStreamResponseInner > > binance::derivatives_trading_coin_futures::websocket_streams::Api::all_market_mini_tickers_stream ( const AllMarketMiniTickersStreamParams & params = {}) const
nodiscard

All Market Mini Tickers Stream.

!miniTicker@arr.

24hr rolling window mini-ticker statistics for all symbols. These are NOT the statistics of the UTC day, but a 24hr rolling window from requestTime to 24hrs before. Note that only tickers that have changed will be present in the array.

After CM migration, this stream pushes the merged UM + CM universe (subscribable on both fstream and dstream); each payload is appended with a new st field (1 = UM, 2 = CM).

Update Speed: 1000ms

See https://developers.binance.com/en/docs/catalog/core-trading-derivatives-trading-coin-m-futures/api/ws-streams/~#all-market-mini-tickers-stream

◆ all_market_tickers_streams()

common::WebsocketStream< std::vector< AllMarketTickersStreamsResponseInner > > binance::derivatives_trading_coin_futures::websocket_streams::Api::all_market_tickers_streams ( const AllMarketTickersStreamsParams & params = {}) const
nodiscard

All Market Tickers Streams.

!ticker@arr.

24hr rolling window ticker statistics for all symbols. These are NOT the statistics of the UTC day, but a 24hr rolling window from requestTime to 24hrs before. Note that only tickers that have changed will be present in the array.

After CM migration, this stream pushes the merged UM + CM universe (subscribable on both fstream and dstream); each payload is appended with a new st field (1 = UM, 2 = CM).

Update Speed: 1000ms

See https://developers.binance.com/en/docs/catalog/core-trading-derivatives-trading-coin-m-futures/api/ws-streams/~#all-market-tickers-streams

◆ continuous_contract_kline_candlestick_streams()

common::WebsocketStream< ContinuousContractKlineCandlestickStreamsResponse > binance::derivatives_trading_coin_futures::websocket_streams::Api::continuous_contract_kline_candlestick_streams ( const ContinuousContractKlineCandlestickStreamsParams & params) const
nodiscard

Continuous Contract Kline/Candlestick Streams.

<pair>_<contractType>@continuousKline_<interval>.

Kline update every second

After CM migration, both fstream and dstream may subscribe to either UM or CM symbols on this stream.

Update Speed: 250ms

See https://developers.binance.com/en/docs/catalog/core-trading-derivatives-trading-coin-m-futures/api/ws-streams/~#continuous-contract-kline-candlestick-streams

◆ contract_info_stream()

common::WebsocketStream< ContractInfoStreamResponse > binance::derivatives_trading_coin_futures::websocket_streams::Api::contract_info_stream ( const ContractInfoStreamParams & params = {}) const
nodiscard

Contract Info Stream.

!contractInfo.

ContractInfo stream pushes when contract info updates(listing/settlement/contract bracket update). bks field only shows up when bracket gets updated.

After CM migration, this stream pushes the merged UM + CM universe (subscribable on both fstream and dstream); each payload is appended with a new st field (1 = UM, 2 = CM).

Update Speed: Real-time

See https://developers.binance.com/en/docs/catalog/core-trading-derivatives-trading-coin-m-futures/api/ws-streams/~#contract-info-stream

◆ diff_book_depth_streams()

common::WebsocketStream< DiffBookDepthStreamsResponse > binance::derivatives_trading_coin_futures::websocket_streams::Api::diff_book_depth_streams ( const DiffBookDepthStreamsParams & params) const
nodiscard

Diff.

Book Depth Streams

<symbol>@depth@<updateSpeed>.

Bids and asks, pushed every 250 milliseconds, 500 milliseconds, or 100 milliseconds

After CM migration, the payload is appended with a new st field (1 = UM, 2 = CM).

Update Speed: 250ms or 500ms or 100ms

See https://developers.binance.com/en/docs/catalog/core-trading-derivatives-trading-coin-m-futures/api/ws-streams/~#diff-book-depth-streams

◆ index_kline_candlestick_streams()

common::WebsocketStream< IndexKlineCandlestickStreamsResponse > binance::derivatives_trading_coin_futures::websocket_streams::Api::index_kline_candlestick_streams ( const IndexKlineCandlestickStreamsParams & params) const
nodiscard

Index Kline/Candlestick Streams.

<pair>@indexPriceKline_<interval>.

Index Kline/Candlestick Streams

After CM migration, both fstream and dstream may subscribe to CM symbols on this stream.

Update Speed: 250ms

See https://developers.binance.com/en/docs/catalog/core-trading-derivatives-trading-coin-m-futures/api/ws-streams/~#index-kline-candlestick-streams

◆ index_price_stream()

common::WebsocketStream< IndexPriceStreamResponse > binance::derivatives_trading_coin_futures::websocket_streams::Api::index_price_stream ( const IndexPriceStreamParams & params) const
nodiscard

Index Price Stream.

<pair>@indexPrice@<updateSpeed>.

Index Price Stream

Update Speed: 3000ms OR 1000ms

See https://developers.binance.com/en/docs/catalog/core-trading-derivatives-trading-coin-m-futures/api/ws-streams/~#index-price-stream

◆ individual_symbol_book_ticker_streams()

common::WebsocketStream< IndividualSymbolBookTickerStreamsResponse > binance::derivatives_trading_coin_futures::websocket_streams::Api::individual_symbol_book_ticker_streams ( const IndividualSymbolBookTickerStreamsParams & params) const
nodiscard

Individual Symbol Book Ticker Streams.

<symbol>@bookTicker.

Pushes any update to the best bid or ask's price or quantity in real-time for a specified symbol.

After CM migration, the payload is appended with a new st field (1 = UM, 2 = CM).

Update Speed: Real-time

See https://developers.binance.com/en/docs/catalog/core-trading-derivatives-trading-coin-m-futures/api/ws-streams/~#individual-symbol-book-ticker-streams

◆ individual_symbol_mini_ticker_stream()

common::WebsocketStream< IndividualSymbolMiniTickerStreamResponse > binance::derivatives_trading_coin_futures::websocket_streams::Api::individual_symbol_mini_ticker_stream ( const IndividualSymbolMiniTickerStreamParams & params) const
nodiscard

Individual Symbol Mini Ticker Stream.

<symbol>@miniTicker.

24hr rolling window mini-ticker statistics for a single symbol. These are NOT the statistics of the UTC day, but a 24hr rolling window from requestTime to 24hrs before.

After CM migration, the payload is appended with a new st field (1 = UM, 2 = CM).

Update Speed: 500ms

See https://developers.binance.com/en/docs/catalog/core-trading-derivatives-trading-coin-m-futures/api/ws-streams/~#individual-symbol-mini-ticker-stream

◆ individual_symbol_ticker_streams()

common::WebsocketStream< IndividualSymbolTickerStreamsResponse > binance::derivatives_trading_coin_futures::websocket_streams::Api::individual_symbol_ticker_streams ( const IndividualSymbolTickerStreamsParams & params) const
nodiscard

Individual Symbol Ticker Streams.

<symbol>@ticker.

24hr rolling window ticker statistics for a single symbol. These are NOT the statistics of the UTC day, but a 24hr rolling window from requestTime to 24hrs before.

After CM migration, the payload is appended with a new st field (1 = UM, 2 = CM).

Update Speed: 500ms

See https://developers.binance.com/en/docs/catalog/core-trading-derivatives-trading-coin-m-futures/api/ws-streams/~#individual-symbol-ticker-streams

◆ kline_candlestick_streams()

common::WebsocketStream< KlineCandlestickStreamsResponse > binance::derivatives_trading_coin_futures::websocket_streams::Api::kline_candlestick_streams ( const KlineCandlestickStreamsParams & params) const
nodiscard

Kline/Candlestick Streams.

<symbol>@kline_<interval>.

The Kline/Candlestick Stream push updates to the current klines/candlestick every 250 milliseconds (if existing).

After CM migration, both fstream and dstream may subscribe to either UM or CM symbols on this stream.

Update Speed: 250ms

See https://developers.binance.com/en/docs/catalog/core-trading-derivatives-trading-coin-m-futures/api/ws-streams/~#kline-candlestick-streams

◆ mark_price_kline_candlestick_streams()

common::WebsocketStream< MarkPriceKlineCandlestickStreamsResponse > binance::derivatives_trading_coin_futures::websocket_streams::Api::mark_price_kline_candlestick_streams ( const MarkPriceKlineCandlestickStreamsParams & params) const
nodiscard

Mark Price Kline/Candlestick Streams.

<symbol>@markPriceKline_<interval>.

Mark Price Kline/Candlestick Streams

After CM migration, both fstream and dstream may subscribe to CM symbols on this stream.

Update Speed: 250ms

See https://developers.binance.com/en/docs/catalog/core-trading-derivatives-trading-coin-m-futures/api/ws-streams/~#mark-price-kline-candlestick-streams

◆ mark_price_of_all_symbols_of_a_pair()

common::WebsocketStream< std::vector< MarkPriceOfAllSymbolsOfAPairResponseInner > > binance::derivatives_trading_coin_futures::websocket_streams::Api::mark_price_of_all_symbols_of_a_pair ( const MarkPriceOfAllSymbolsOfAPairParams & params) const
nodiscard

Mark Price of All Symbols of a Pair.

<pair>@markPrice@<updateSpeed>.

Mark Price of All Symbols of a Pair

After CM migration, the payload is appended with a new st field (1 = UM, 2 = CM); both fstream and dstream may subscribe to either UM or CM symbols on this stream.

Update Speed: 3000ms OR 1000ms

See https://developers.binance.com/en/docs/catalog/core-trading-derivatives-trading-coin-m-futures/api/ws-streams/~#mark-price-of-all-symbols-of-apair

◆ mark_price_stream()

common::WebsocketStream< MarkPriceStreamResponse > binance::derivatives_trading_coin_futures::websocket_streams::Api::mark_price_stream ( const MarkPriceStreamParams & params) const
nodiscard

Mark Price Stream.

<symbol>@markPrice@<updateSpeed>.

Mark price update stream

After CM migration, the payload is appended with a new st field (1 = UM, 2 = CM); both fstream and dstream may subscribe to either UM or CM symbols on this stream.

Update Speed: 3000ms OR 1000ms

See https://developers.binance.com/en/docs/catalog/core-trading-derivatives-trading-coin-m-futures/api/ws-streams/~#mark-price-stream

◆ market_liquidation_order_streams()

common::WebsocketStream< MarketLiquidationOrderStreamsResponse > binance::derivatives_trading_coin_futures::websocket_streams::Api::market_liquidation_order_streams ( const MarketLiquidationOrderStreamsParams & params) const
nodiscard

Market Liquidation Order Streams.

<symbol>@forceOrder.

The Liquidation Order Snapshot Streams push force liquidation order information for specific symbol. For each symbol,only the latest one liquidation order within 1000ms will be pushed as the snapshot. If no liquidation happens in the interval of 1000ms, no stream will be pushed.

Update Speed: 1000ms

See https://developers.binance.com/en/docs/catalog/core-trading-derivatives-trading-coin-m-futures/api/ws-streams/~#market-liquidation-order-streams

◆ partial_book_depth_streams()

common::WebsocketStream< PartialBookDepthStreamsResponse > binance::derivatives_trading_coin_futures::websocket_streams::Api::partial_book_depth_streams ( const PartialBookDepthStreamsParams & params) const
nodiscard

Partial Book Depth Streams.

<symbol>@depth<levels>@<updateSpeed>.

Top levels bids and asks.

After CM migration, the payload is appended with a new st field (1 = UM, 2 = CM).

Update Speed: 250ms, 500ms or 100ms

See https://developers.binance.com/en/docs/catalog/core-trading-derivatives-trading-coin-m-futures/api/ws-streams/~#partial-book-depth-streams