Binance C++ Connector 2.0.0
Official C++ connectors for the Binance APIs
Loading...
Searching...
No Matches
binance::derivatives_trading_usds_futures::websocket_api::WebsocketApiConnection Class Reference

A connection to the DerivativesTradingUsdsFutures WebSocket API, returned connected by WebsocketApi::connect(). More...

#include <websocket_api.hpp>

Public Member Functions

const common::WebsocketApiConfig & configuration () const noexcept
void disconnect ()
template<class CompletionToken>
auto async_disconnect (CompletionToken &&token)
bool is_connected () const
void ping_server ()
 Sends a ping frame on every open connection.
template<class F>
common::Subscription on_event (F &&callback)
 Registers a lifecycle callback (common::WebsocketEvent).
template<class T>
common::WebsocketApiResponse< T > send_message (std::string method, common::Params payload={}) const
 Calls a method the SDK does not wrap yet. T may be boost::json::value.
template<class T>
common::WebsocketApiResponse< T > send_signed_message (std::string method, common::Params payload={}) const
 Like send_message, but signed (adds apiKey, timestamp and signature).
template<class T, class CompletionToken>
auto async_send_message (std::string method, common::Params payload, CompletionToken &&token) const
template<class T, class CompletionToken>
auto async_send_signed_message (std::string method, common::Params payload, CompletionToken &&token) const
common::WebsocketApiResponse< AccountInformationResponseResult > account_information (const AccountInformationParams &params={}) const
 Account Information (USER_DATA).
template<class CompletionToken>
auto async_account_information (const AccountInformationParams &params, CompletionToken &&token) const
common::WebsocketApiResponse< AccountInformationV2ResponseResult > account_information_v2 (const AccountInformationV2Params &params={}) const
 Account Information V2 (USER_DATA).
template<class CompletionToken>
auto async_account_information_v2 (const AccountInformationV2Params &params, CompletionToken &&token) const
common::WebsocketApiResponse< std::vector< FuturesAccountBalanceResponseResultInner > > futures_account_balance (const FuturesAccountBalanceParams &params={}) const
 Futures Account Balance (USER_DATA).
template<class CompletionToken>
auto async_futures_account_balance (const FuturesAccountBalanceParams &params, CompletionToken &&token) const
common::WebsocketApiResponse< std::vector< FuturesAccountBalanceResponseResultInner > > futures_account_balance_v2 (const FuturesAccountBalanceV2Params &params={}) const
 Futures Account Balance V2 (USER_DATA).
template<class CompletionToken>
auto async_futures_account_balance_v2 (const FuturesAccountBalanceV2Params &params, CompletionToken &&token) const
common::WebsocketApiResponse< OrderBookResponseResult > order_book (const OrderBookParams &params) const
 Order Book.
template<class CompletionToken>
auto async_order_book (const OrderBookParams &params, CompletionToken &&token) const
common::WebsocketApiResponse< std::variant< SymbolOrderBookTickerResponse1Result, std::vector< SymbolOrderBookTickerResponse2ResultInner >, boost::json::value > > symbol_order_book_ticker (const SymbolOrderBookTickerParams &params={}) const
 Symbol Order Book Ticker.
template<class CompletionToken>
auto async_symbol_order_book_ticker (const SymbolOrderBookTickerParams &params, CompletionToken &&token) const
common::WebsocketApiResponse< std::variant< SymbolPriceTickerResponse1Result, std::vector< SymbolPriceTickerResponse2ResultInner >, boost::json::value > > symbol_price_ticker (const SymbolPriceTickerParams &params={}) const
 Symbol Price Ticker.
template<class CompletionToken>
auto async_symbol_price_ticker (const SymbolPriceTickerParams &params, CompletionToken &&token) const
common::WebsocketApiResponse< CancelAlgoOrderResponseResult > cancel_algo_order (const CancelAlgoOrderParams &params={}) const
 Cancel Algo Order (TRADE).
template<class CompletionToken>
auto async_cancel_algo_order (const CancelAlgoOrderParams &params, CompletionToken &&token) const
common::WebsocketApiResponse< CancelOrderResponseResult > cancel_order (const CancelOrderParams &params) const
 Cancel Order (TRADE).
template<class CompletionToken>
auto async_cancel_order (const CancelOrderParams &params, CompletionToken &&token) const
common::WebsocketApiResponse< ModifyOrderResponseResult > modify_order (const ModifyOrderParams &params) const
 Modify Order (TRADE).
template<class CompletionToken>
auto async_modify_order (const ModifyOrderParams &params, CompletionToken &&token) const
common::WebsocketApiResponse< NewAlgoOrderResponseResult > new_algo_order (const NewAlgoOrderParams &params) const
 New Algo Order (TRADE).
template<class CompletionToken>
auto async_new_algo_order (const NewAlgoOrderParams &params, CompletionToken &&token) const
common::WebsocketApiResponse< NewOrderResponseResult > new_order (const NewOrderParams &params) const
 New Order (TRADE).
template<class CompletionToken>
auto async_new_order (const NewOrderParams &params, CompletionToken &&token) const
common::WebsocketApiResponse< std::vector< PositionInformationResponseResultInner > > position_information (const PositionInformationParams &params={}) const
 Position Information (USER_DATA).
template<class CompletionToken>
auto async_position_information (const PositionInformationParams &params, CompletionToken &&token) const
common::WebsocketApiResponse< std::vector< PositionInformationV2ResponseResultInner > > position_information_v2 (const PositionInformationV2Params &params={}) const
 Position Information V2 (USER_DATA).
template<class CompletionToken>
auto async_position_information_v2 (const PositionInformationV2Params &params, CompletionToken &&token) const
common::WebsocketApiResponse< QueryOrderResponseResult > query_order (const QueryOrderParams &params) const
 Query Order (USER_DATA).
template<class CompletionToken>
auto async_query_order (const QueryOrderParams &params, CompletionToken &&token) const
common::WebsocketApiResponse< boost::json::value > close_user_data_stream (const CloseUserDataStreamParams &params={}) const
 Close User Data Stream (USER_STREAM).
template<class CompletionToken>
auto async_close_user_data_stream (const CloseUserDataStreamParams &params, CompletionToken &&token) const
common::WebsocketApiResponse< KeepaliveUserDataStreamResponseResult > keepalive_user_data_stream (const KeepaliveUserDataStreamParams &params={}) const
 Keepalive User Data Stream (USER_STREAM).
template<class CompletionToken>
auto async_keepalive_user_data_stream (const KeepaliveUserDataStreamParams &params, CompletionToken &&token) const
common::WebsocketApiResponse< StartUserDataStreamResponseResult > start_user_data_stream (const StartUserDataStreamParams &params={}) const
 Start User Data Stream (USER_STREAM).
template<class CompletionToken>
auto async_start_user_data_stream (const StartUserDataStreamParams &params, CompletionToken &&token) const

Friends

class WebsocketApi

Detailed Description

A connection to the DerivativesTradingUsdsFutures WebSocket API, returned connected by WebsocketApi::connect().

Cheap to copy: copies share one common::WebsocketApi (connection pool and executor), which reconnects and renews its connections until disconnect().

Every method has a blocking form (name(params)) and an asynchronous form (async_name(params, token)) that accepts any Asio completion token.

Member Function Documentation

◆ configuration()

const common::WebsocketApiConfig & binance::derivatives_trading_usds_futures::websocket_api::WebsocketApiConnection::configuration ( ) const
inlinenodiscardnoexcept

◆ disconnect()

void binance::derivatives_trading_usds_futures::websocket_api::WebsocketApiConnection::disconnect ( )
inline

◆ async_disconnect()

template<class CompletionToken>
auto binance::derivatives_trading_usds_futures::websocket_api::WebsocketApiConnection::async_disconnect ( CompletionToken && token)
inline

◆ is_connected()

bool binance::derivatives_trading_usds_futures::websocket_api::WebsocketApiConnection::is_connected ( ) const
inlinenodiscard

◆ ping_server()

void binance::derivatives_trading_usds_futures::websocket_api::WebsocketApiConnection::ping_server ( )
inline

Sends a ping frame on every open connection.

◆ on_event()

template<class F>
common::Subscription binance::derivatives_trading_usds_futures::websocket_api::WebsocketApiConnection::on_event ( F && callback)
inline

Registers a lifecycle callback (common::WebsocketEvent).

Destroying the returned subscription removes it.

◆ send_message()

template<class T>
common::WebsocketApiResponse< T > binance::derivatives_trading_usds_futures::websocket_api::WebsocketApiConnection::send_message ( std::string method,
common::Params payload = {} ) const
inlinenodiscard

Calls a method the SDK does not wrap yet. T may be boost::json::value.

◆ send_signed_message()

template<class T>
common::WebsocketApiResponse< T > binance::derivatives_trading_usds_futures::websocket_api::WebsocketApiConnection::send_signed_message ( std::string method,
common::Params payload = {} ) const
inlinenodiscard

Like send_message, but signed (adds apiKey, timestamp and signature).

◆ async_send_message()

template<class T, class CompletionToken>
auto binance::derivatives_trading_usds_futures::websocket_api::WebsocketApiConnection::async_send_message ( std::string method,
common::Params payload,
CompletionToken && token ) const
inline

◆ async_send_signed_message()

template<class T, class CompletionToken>
auto binance::derivatives_trading_usds_futures::websocket_api::WebsocketApiConnection::async_send_signed_message ( std::string method,
common::Params payload,
CompletionToken && token ) const
inline

◆ account_information()

common::WebsocketApiResponse< AccountInformationResponseResult > binance::derivatives_trading_usds_futures::websocket_api::WebsocketApiConnection::account_information ( const AccountInformationParams & params = {}) const
inlinenodiscard

Account Information (USER_DATA).

account.status.

Get current account information. User in single-asset/ multi-assets mode will see different value, see comments in response section for detail.

Weight(IP): 5

Security Type: USER_DATA

See https://developers.binance.com/en/docs/catalog/core-trading-derivatives-trading-usd-s-m-futures/api/ws-api/account#account-information

◆ async_account_information()

template<class CompletionToken>
auto binance::derivatives_trading_usds_futures::websocket_api::WebsocketApiConnection::async_account_information ( const AccountInformationParams & params,
CompletionToken && token ) const
inline

◆ account_information_v2()

common::WebsocketApiResponse< AccountInformationV2ResponseResult > binance::derivatives_trading_usds_futures::websocket_api::WebsocketApiConnection::account_information_v2 ( const AccountInformationV2Params & params = {}) const
inlinenodiscard

Account Information V2 (USER_DATA).

v2/account.status.

Get current account information. User in single-asset/ multi-assets mode will see different value, see comments in response section for detail.

Weight(IP): 5

Security Type: USER_DATA

See https://developers.binance.com/en/docs/catalog/core-trading-derivatives-trading-usd-s-m-futures/api/ws-api/account#account-information-v2

◆ async_account_information_v2()

template<class CompletionToken>
auto binance::derivatives_trading_usds_futures::websocket_api::WebsocketApiConnection::async_account_information_v2 ( const AccountInformationV2Params & params,
CompletionToken && token ) const
inline

◆ futures_account_balance()

common::WebsocketApiResponse< std::vector< FuturesAccountBalanceResponseResultInner > > binance::derivatives_trading_usds_futures::websocket_api::WebsocketApiConnection::futures_account_balance ( const FuturesAccountBalanceParams & params = {}) const
inlinenodiscard

Futures Account Balance (USER_DATA).

account.balance.

Futures Account Balance

Weight(IP): 5

Security Type: USER_DATA

See https://developers.binance.com/en/docs/catalog/core-trading-derivatives-trading-usd-s-m-futures/api/ws-api/account#futures-account-balance

◆ async_futures_account_balance()

template<class CompletionToken>
auto binance::derivatives_trading_usds_futures::websocket_api::WebsocketApiConnection::async_futures_account_balance ( const FuturesAccountBalanceParams & params,
CompletionToken && token ) const
inline

◆ futures_account_balance_v2()

common::WebsocketApiResponse< std::vector< FuturesAccountBalanceResponseResultInner > > binance::derivatives_trading_usds_futures::websocket_api::WebsocketApiConnection::futures_account_balance_v2 ( const FuturesAccountBalanceV2Params & params = {}) const
inlinenodiscard

Futures Account Balance V2 (USER_DATA).

v2/account.balance.

Futures Account Balance V2

Weight(IP): 5

Security Type: USER_DATA

See https://developers.binance.com/en/docs/catalog/core-trading-derivatives-trading-usd-s-m-futures/api/ws-api/account#futures-account-balance-v2

◆ async_futures_account_balance_v2()

template<class CompletionToken>
auto binance::derivatives_trading_usds_futures::websocket_api::WebsocketApiConnection::async_futures_account_balance_v2 ( const FuturesAccountBalanceV2Params & params,
CompletionToken && token ) const
inline

◆ order_book()

common::WebsocketApiResponse< OrderBookResponseResult > binance::derivatives_trading_usds_futures::websocket_api::WebsocketApiConnection::order_book ( const OrderBookParams & params) const
inlinenodiscard

Order Book.

depth.

Get current order book. Note that this request returns limited market depth.

If you need to continuously monitor order book updates, please consider using Websocket Market Streams:

  • <symbol>@depth<levels>
  • <symbol>@depth

You can use depth request together with <symbol>@depth streams to maintain a local order book.

Note:

  • Retail Price Improvement(RPI) orders are not visible and excluded in the response message.

Weight: Adjusted based on the limit:

Limit Weight
5, 10, 20, 50 2
100 5
500 10
1000 20

See https://developers.binance.com/en/docs/catalog/core-trading-derivatives-trading-usd-s-m-futures/api/ws-api/market-data#order-book

◆ async_order_book()

template<class CompletionToken>
auto binance::derivatives_trading_usds_futures::websocket_api::WebsocketApiConnection::async_order_book ( const OrderBookParams & params,
CompletionToken && token ) const
inline

◆ symbol_order_book_ticker()

common::WebsocketApiResponse< std::variant< SymbolOrderBookTickerResponse1Result, std::vector< SymbolOrderBookTickerResponse2ResultInner >, boost::json::value > > binance::derivatives_trading_usds_futures::websocket_api::WebsocketApiConnection::symbol_order_book_ticker ( const SymbolOrderBookTickerParams & params = {}) const
inlinenodiscard

Symbol Order Book Ticker.

ticker.book.

Best price/qty on the order book for a symbol or symbols.

Note:

  • Retail Price Improvement(RPI) orders are not visible and excluded in the response message.

Weight: 2 for a single symbol; 5 when the symbol parameter is omitted

Notes:

  • If the symbol is not sent, bookTickers for all symbols will be returned in an array.
  • The field X-MBX-USED-WEIGHT-1M in response header is not accurate from this endpoint, please ignore.

See https://developers.binance.com/en/docs/catalog/core-trading-derivatives-trading-usd-s-m-futures/api/ws-api/market-data#symbol-order-book-ticker

◆ async_symbol_order_book_ticker()

template<class CompletionToken>
auto binance::derivatives_trading_usds_futures::websocket_api::WebsocketApiConnection::async_symbol_order_book_ticker ( const SymbolOrderBookTickerParams & params,
CompletionToken && token ) const
inline

◆ symbol_price_ticker()

common::WebsocketApiResponse< std::variant< SymbolPriceTickerResponse1Result, std::vector< SymbolPriceTickerResponse2ResultInner >, boost::json::value > > binance::derivatives_trading_usds_futures::websocket_api::WebsocketApiConnection::symbol_price_ticker ( const SymbolPriceTickerParams & params = {}) const
inlinenodiscard

Symbol Price Ticker.

ticker.price.

Latest price for a symbol or symbols.

Weight: 1 for a single symbol; 2 when the symbol parameter is omitted

Notes:

  • If the symbol is not sent, prices for all symbols will be returned in an array.

See https://developers.binance.com/en/docs/catalog/core-trading-derivatives-trading-usd-s-m-futures/api/ws-api/market-data#symbol-price-ticker

◆ async_symbol_price_ticker()

template<class CompletionToken>
auto binance::derivatives_trading_usds_futures::websocket_api::WebsocketApiConnection::async_symbol_price_ticker ( const SymbolPriceTickerParams & params,
CompletionToken && token ) const
inline

◆ cancel_algo_order()

common::WebsocketApiResponse< CancelAlgoOrderResponseResult > binance::derivatives_trading_usds_futures::websocket_api::WebsocketApiConnection::cancel_algo_order ( const CancelAlgoOrderParams & params = {}) const
inlinenodiscard

Cancel Algo Order (TRADE).

algoOrder.cancel.

Cancel an active algo order.

Weight(IP): 1

Security Type: TRADE

Notes:

  • Either algoId or clientAlgoId must be sent.

See https://developers.binance.com/en/docs/catalog/core-trading-derivatives-trading-usd-s-m-futures/api/ws-api/trade#cancel-algo-order

◆ async_cancel_algo_order()

template<class CompletionToken>
auto binance::derivatives_trading_usds_futures::websocket_api::WebsocketApiConnection::async_cancel_algo_order ( const CancelAlgoOrderParams & params,
CompletionToken && token ) const
inline

◆ cancel_order()

common::WebsocketApiResponse< CancelOrderResponseResult > binance::derivatives_trading_usds_futures::websocket_api::WebsocketApiConnection::cancel_order ( const CancelOrderParams & params) const
inlinenodiscard

Cancel Order (TRADE).

order.cancel.

Cancel an active order.

Weight(IP): 1

Security Type: TRADE

Notes:

  • Either orderId or origClientOrderId must be sent.

See https://developers.binance.com/en/docs/catalog/core-trading-derivatives-trading-usd-s-m-futures/api/ws-api/trade#cancel-order

◆ async_cancel_order()

template<class CompletionToken>
auto binance::derivatives_trading_usds_futures::websocket_api::WebsocketApiConnection::async_cancel_order ( const CancelOrderParams & params,
CompletionToken && token ) const
inline

◆ modify_order()

common::WebsocketApiResponse< ModifyOrderResponseResult > binance::derivatives_trading_usds_futures::websocket_api::WebsocketApiConnection::modify_order ( const ModifyOrderParams & params) const
inlinenodiscard

Modify Order (TRADE).

order.modify.

Order modify function, currently only LIMIT order modification is supported, modified orders will be reordered in the match queue

Weight: 1 on 10s order rate limit(X-MBX-ORDER-COUNT-10S); 1 on 1min order rate limit(X-MBX-ORDER-COUNT-1M); 0 on IP rate limit(x-mbx-used-weight-1m)

Security Type: TRADE

Notes:

  • Either orderId or origClientOrderId must be sent, and the orderId will prevail if both are sent.
  • Both quantity and price must be sent. (After CM migration, the dapi modify order endpoint follows the same rule.)
  • When the new quantity or price doesn't satisfy PRICE_FILTER / PERCENT_FILTER / LOT_SIZE, amendment will be rejected and the order will stay as it is.
  • However the order will be cancelled by the amendment in the following situations:
  • when the order is in partially filled status and the new quantity <= executedQty
  • When the order is GTX and the new price will cause it to be executed immediately
  • One order can only be modfied for less than 10000 times
  • reduceOnly behavior:
    • false or omitted: behave as today — min_notional is enforced on the modified order.
    • true and the original order's reduceOnly attribute is also true (consistent): the min_notional check is skipped on the modified order, matching placement semantics.
    • true but the original order's reduceOnly attribute is false (inconsistent): the modify request is rejected with error code -5047, "The original order is not a reduce-only order".
    • reduceOnly is used purely for validation — passing true does not change the original order's reduceOnly attribute; that flag remains whatever it was set to at placement time.

See https://developers.binance.com/en/docs/catalog/core-trading-derivatives-trading-usd-s-m-futures/api/ws-api/trade#modify-order

◆ async_modify_order()

template<class CompletionToken>
auto binance::derivatives_trading_usds_futures::websocket_api::WebsocketApiConnection::async_modify_order ( const ModifyOrderParams & params,
CompletionToken && token ) const
inline

◆ new_algo_order()

common::WebsocketApiResponse< NewAlgoOrderResponseResult > binance::derivatives_trading_usds_futures::websocket_api::WebsocketApiConnection::new_algo_order ( const NewAlgoOrderParams & params) const
inlinenodiscard

New Algo Order (TRADE).

algoOrder.place.

Send in a new algo order.

Weight(IP): 0

Security Type: TRADE

Notes:

  • Condition orders will be triggered when:

  • If parameterpriceProtectis sent as true:
  • when price reaches the triggerPrice ,the difference rate between "MARK_PRICE" and "CONTRACT_PRICE" cannot be larger than the "triggerProtect" of the symbol
  • "triggerProtect" of a symbol can be got from GET /fapi/v1/exchangeInfo

  • STOP, STOP_MARKET:
  • BUY: latest price ("MARK_PRICE" or "CONTRACT_PRICE") >= triggerPrice
  • SELL: latest price ("MARK_PRICE" or "CONTRACT_PRICE") <= triggerPrice
  • TAKE_PROFIT, TAKE_PROFIT_MARKET:
  • BUY: latest price ("MARK_PRICE" or "CONTRACT_PRICE") <= triggerPrice
  • SELL: latest price ("MARK_PRICE" or "CONTRACT_PRICE") >= triggerPrice
  • TRAILING_STOP_MARKET:
  • BUY: the lowest price after order placed <= activatePrice, and the latest price >= the lowest price * (1 + callbackRate)
  • SELL: the highest price after order placed >= activatePrice, and the latest price <= the highest price * (1 - callbackRate)

  • For TRAILING_STOP_MARKET, if you got such error code.

{"code": -2021, "msg": "Order would immediately trigger."}

means that the parameters you send do not meet the following requirements:

  • BUY: activatePrice should be smaller than latest price.
  • SELL: activatePrice should be larger than latest price.

  • STOP_MARKET, TAKE_PROFIT_MARKET with closePosition=true:
  • Follow the same rules for condition orders.
  • If triggered,**close all** current long position( if SELL) or current short position( if BUY).
  • Cannot be used with quantity paremeter
  • Cannot be used with reduceOnly parameter
  • In Hedge Mode,cannot be used with BUY orders in LONG position side. and cannot be used with SELL orders in SHORT position side
  • selfTradePreventionMode is only effective when timeInForce set to IOC or GTC or GTD.

See https://developers.binance.com/en/docs/catalog/core-trading-derivatives-trading-usd-s-m-futures/api/ws-api/trade#new-algo-order

◆ async_new_algo_order()

template<class CompletionToken>
auto binance::derivatives_trading_usds_futures::websocket_api::WebsocketApiConnection::async_new_algo_order ( const NewAlgoOrderParams & params,
CompletionToken && token ) const
inline

◆ new_order()

common::WebsocketApiResponse< NewOrderResponseResult > binance::derivatives_trading_usds_futures::websocket_api::WebsocketApiConnection::new_order ( const NewOrderParams & params) const
inlinenodiscard

New Order (TRADE).

order.place.

Send in a new order.

Weight(IP): 0

Security Type: TRADE

Notes: Additional mandatory parameters based on type:

  • LIMIT: timeInForce, quantity, price
  • MARKET: quantity
  • If newOrderRespType is sent as RESULT:
    • MARKET order: the final FILLED result of the order will be return directly.
    • LIMIT order with special timeInForce: the final status result of the order(FILLED or EXPIRED) will be returned directly.
  • selfTradePreventionMode is only effective when timeInForce set to IOC or GTC or GTD. > * In extreme market conditions, timeInForce GTD order auto cancel time might be delayed comparing to goodTillDate

See https://developers.binance.com/en/docs/catalog/core-trading-derivatives-trading-usd-s-m-futures/api/ws-api/trade#new-order

◆ async_new_order()

template<class CompletionToken>
auto binance::derivatives_trading_usds_futures::websocket_api::WebsocketApiConnection::async_new_order ( const NewOrderParams & params,
CompletionToken && token ) const
inline

◆ position_information()

common::WebsocketApiResponse< std::vector< PositionInformationResponseResultInner > > binance::derivatives_trading_usds_futures::websocket_api::WebsocketApiConnection::position_information ( const PositionInformationParams & params = {}) const
inlinenodiscard

Position Information (USER_DATA).

account.position.

Get current position information.

Weight(IP): 5

Security Type: USER_DATA

Notes:

  • Please use with user data stream ACCOUNT_UPDATE to meet your timeliness and accuracy needs.

See https://developers.binance.com/en/docs/catalog/core-trading-derivatives-trading-usd-s-m-futures/api/ws-api/trade#position-information

◆ async_position_information()

template<class CompletionToken>
auto binance::derivatives_trading_usds_futures::websocket_api::WebsocketApiConnection::async_position_information ( const PositionInformationParams & params,
CompletionToken && token ) const
inline

◆ position_information_v2()

common::WebsocketApiResponse< std::vector< PositionInformationV2ResponseResultInner > > binance::derivatives_trading_usds_futures::websocket_api::WebsocketApiConnection::position_information_v2 ( const PositionInformationV2Params & params = {}) const
inlinenodiscard

Position Information V2 (USER_DATA).

v2/account.position.

Get current position information(only symbol that has position or open orders will be returned).

Weight(IP): 5

Security Type: USER_DATA

Notes:

  • Please use with user data stream ACCOUNT_UPDATE to meet your timeliness and accuracy needs.

See https://developers.binance.com/en/docs/catalog/core-trading-derivatives-trading-usd-s-m-futures/api/ws-api/trade#position-information-v2

◆ async_position_information_v2()

template<class CompletionToken>
auto binance::derivatives_trading_usds_futures::websocket_api::WebsocketApiConnection::async_position_information_v2 ( const PositionInformationV2Params & params,
CompletionToken && token ) const
inline

◆ query_order()

common::WebsocketApiResponse< QueryOrderResponseResult > binance::derivatives_trading_usds_futures::websocket_api::WebsocketApiConnection::query_order ( const QueryOrderParams & params) const
inlinenodiscard

Query Order (USER_DATA).

order.status.

Check an order's status.

  • These orders will not be found:
    • order status is CANCELED or EXPIRED AND order has NO filled trade AND created time + 3 days < current time
    • order create time + 90 days < current time

Weight(IP): 1

Security Type: USER_DATA

Notes: Notes:

  • Either orderId or origClientOrderId must be sent.
  • orderId is self-increment for each specific symbol

See https://developers.binance.com/en/docs/catalog/core-trading-derivatives-trading-usd-s-m-futures/api/ws-api/trade#query-order

◆ async_query_order()

template<class CompletionToken>
auto binance::derivatives_trading_usds_futures::websocket_api::WebsocketApiConnection::async_query_order ( const QueryOrderParams & params,
CompletionToken && token ) const
inline

◆ close_user_data_stream()

common::WebsocketApiResponse< boost::json::value > binance::derivatives_trading_usds_futures::websocket_api::WebsocketApiConnection::close_user_data_stream ( const CloseUserDataStreamParams & params = {}) const
inlinenodiscard

Close User Data Stream (USER_STREAM).

userDataStream.stop.

Close out a user data stream.

Weight(IP): 1

Security Type: USER_STREAM

See https://developers.binance.com/en/docs/catalog/core-trading-derivatives-trading-usd-s-m-futures/api/ws-api/user-data-streams#close-user-data-stream

◆ async_close_user_data_stream()

template<class CompletionToken>
auto binance::derivatives_trading_usds_futures::websocket_api::WebsocketApiConnection::async_close_user_data_stream ( const CloseUserDataStreamParams & params,
CompletionToken && token ) const
inline

◆ keepalive_user_data_stream()

common::WebsocketApiResponse< KeepaliveUserDataStreamResponseResult > binance::derivatives_trading_usds_futures::websocket_api::WebsocketApiConnection::keepalive_user_data_stream ( const KeepaliveUserDataStreamParams & params = {}) const
inlinenodiscard

Keepalive User Data Stream (USER_STREAM).

userDataStream.ping.

Keepalive a user data stream to prevent a time out. User data streams will close after 60 minutes. It's recommended to send a ping about every 60 minutes.

Weight(IP): 1

Security Type: USER_STREAM

See https://developers.binance.com/en/docs/catalog/core-trading-derivatives-trading-usd-s-m-futures/api/ws-api/user-data-streams#keepalive-user-data-stream

◆ async_keepalive_user_data_stream()

template<class CompletionToken>
auto binance::derivatives_trading_usds_futures::websocket_api::WebsocketApiConnection::async_keepalive_user_data_stream ( const KeepaliveUserDataStreamParams & params,
CompletionToken && token ) const
inline

◆ start_user_data_stream()

common::WebsocketApiResponse< StartUserDataStreamResponseResult > binance::derivatives_trading_usds_futures::websocket_api::WebsocketApiConnection::start_user_data_stream ( const StartUserDataStreamParams & params = {}) const
inlinenodiscard

Start User Data Stream (USER_STREAM).

userDataStream.start.

Start a new user data stream. The stream will close after 60 minutes unless a keepalive is sent. If the account has an active listenKey, that listenKey will be returned and its validity will be extended for 60 minutes.

Weight(IP): 1

Security Type: USER_STREAM

See https://developers.binance.com/en/docs/catalog/core-trading-derivatives-trading-usd-s-m-futures/api/ws-api/user-data-streams#start-user-data-stream

◆ async_start_user_data_stream()

template<class CompletionToken>
auto binance::derivatives_trading_usds_futures::websocket_api::WebsocketApiConnection::async_start_user_data_stream ( const StartUserDataStreamParams & params,
CompletionToken && token ) const
inline

◆ WebsocketApi

friend class WebsocketApi
friend