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

#include <trade_api.hpp>

Public Member Functions

 TradeApi (std::shared_ptr< common::RestClient > client)
common::RestApiResponse< std::vector< AccountTradeListResponseInner > > account_trade_list (const AccountTradeListParams &params) const
 Account Trade List (USER_DATA).
template<class CompletionToken>
auto async_account_trade_list (const AccountTradeListParams &params, CompletionToken &&token) const
 Asynchronous account_trade_list().
common::RestApiResponse< std::vector< AllOrdersResponseInner > > all_orders (const AllOrdersParams &params={}) const
 All Orders (USER_DATA).
template<class CompletionToken>
auto async_all_orders (const AllOrdersParams &params, CompletionToken &&token) const
 Asynchronous all_orders().
common::RestApiResponse< AutoCancelAllOpenOrdersResponse > auto_cancel_all_open_orders (const AutoCancelAllOpenOrdersParams &params) const
 Auto-Cancel All Open Orders (TRADE).
template<class CompletionToken>
auto async_auto_cancel_all_open_orders (const AutoCancelAllOpenOrdersParams &params, CompletionToken &&token) const
 Asynchronous auto_cancel_all_open_orders().
common::RestApiResponse< CancelAlgoOrderResponse > 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
 Asynchronous cancel_algo_order().
common::RestApiResponse< NewAlgoOrderResponse > 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
 Asynchronous new_algo_order().
common::RestApiResponse< QueryAlgoOrderResponse > query_algo_order (const QueryAlgoOrderParams &params={}) const
 Query Algo Order (USER_DATA).
template<class CompletionToken>
auto async_query_algo_order (const QueryAlgoOrderParams &params, CompletionToken &&token) const
 Asynchronous query_algo_order().
common::RestApiResponse< CancelAllAlgoOpenOrdersResponse > cancel_all_algo_open_orders (const CancelAllAlgoOpenOrdersParams &params) const
 Cancel All Algo Open Orders (TRADE).
template<class CompletionToken>
auto async_cancel_all_algo_open_orders (const CancelAllAlgoOpenOrdersParams &params, CompletionToken &&token) const
 Asynchronous cancel_all_algo_open_orders().
common::RestApiResponse< CancelAllOpenOrdersResponse > cancel_all_open_orders (const CancelAllOpenOrdersParams &params) const
 Cancel All Open Orders (TRADE).
template<class CompletionToken>
auto async_cancel_all_open_orders (const CancelAllOpenOrdersParams &params, CompletionToken &&token) const
 Asynchronous cancel_all_open_orders().
common::RestApiResponse< std::vector< CancelMultipleOrdersResponseInner > > cancel_multiple_orders (const CancelMultipleOrdersParams &params) const
 Cancel Multiple Orders (TRADE).
template<class CompletionToken>
auto async_cancel_multiple_orders (const CancelMultipleOrdersParams &params, CompletionToken &&token) const
 Asynchronous cancel_multiple_orders().
common::RestApiResponse< std::vector< ModifyMultipleOrdersResponseInner > > modify_multiple_orders (const ModifyMultipleOrdersParams &params) const
 Modify Multiple Orders (TRADE).
template<class CompletionToken>
auto async_modify_multiple_orders (const ModifyMultipleOrdersParams &params, CompletionToken &&token) const
 Asynchronous modify_multiple_orders().
common::RestApiResponse< std::vector< PlaceMultipleOrdersResponseInner > > place_multiple_orders (const PlaceMultipleOrdersParams &params) const
 Place Multiple Orders (TRADE).
template<class CompletionToken>
auto async_place_multiple_orders (const PlaceMultipleOrdersParams &params, CompletionToken &&token) const
 Asynchronous place_multiple_orders().
common::RestApiResponse< CancelOrderResponse > cancel_order (const CancelOrderParams &params) const
 Cancel Order (TRADE).
template<class CompletionToken>
auto async_cancel_order (const CancelOrderParams &params, CompletionToken &&token) const
 Asynchronous cancel_order().
common::RestApiResponse< ModifyOrderResponse > modify_order (const ModifyOrderParams &params) const
 Modify Order (TRADE).
template<class CompletionToken>
auto async_modify_order (const ModifyOrderParams &params, CompletionToken &&token) const
 Asynchronous modify_order().
common::RestApiResponse< NewOrderResponse > new_order (const NewOrderParams &params) const
 New Order (TRADE).
template<class CompletionToken>
auto async_new_order (const NewOrderParams &params, CompletionToken &&token) const
 Asynchronous new_order().
common::RestApiResponse< QueryOrderResponse > query_order (const QueryOrderParams &params) const
 Query Order (USER_DATA).
template<class CompletionToken>
auto async_query_order (const QueryOrderParams &params, CompletionToken &&token) const
 Asynchronous query_order().
common::RestApiResponse< ChangeInitialLeverageResponse > change_initial_leverage (const ChangeInitialLeverageParams &params) const
 Change Initial Leverage (TRADE).
template<class CompletionToken>
auto async_change_initial_leverage (const ChangeInitialLeverageParams &params, CompletionToken &&token) const
 Asynchronous change_initial_leverage().
common::RestApiResponse< ChangeMarginTypeResponse > change_margin_type (const ChangeMarginTypeParams &params) const
 Change Margin Type (TRADE).
template<class CompletionToken>
auto async_change_margin_type (const ChangeMarginTypeParams &params, CompletionToken &&token) const
 Asynchronous change_margin_type().
common::RestApiResponse< ChangeMultiAssetsModeResponse > change_multi_assets_mode (const ChangeMultiAssetsModeParams &params) const
 Change Multi-Assets Mode (TRADE).
template<class CompletionToken>
auto async_change_multi_assets_mode (const ChangeMultiAssetsModeParams &params, CompletionToken &&token) const
 Asynchronous change_multi_assets_mode().
common::RestApiResponse< ChangePositionModeResponse > change_position_mode (const ChangePositionModeParams &params) const
 Change Position Mode (TRADE).
template<class CompletionToken>
auto async_change_position_mode (const ChangePositionModeParams &params, CompletionToken &&token) const
 Asynchronous change_position_mode().
common::RestApiResponse< std::vector< CurrentAllAlgoOpenOrdersResponseInner > > current_all_algo_open_orders (const CurrentAllAlgoOpenOrdersParams &params={}) const
 Current All Algo Open Orders (USER_DATA).
template<class CompletionToken>
auto async_current_all_algo_open_orders (const CurrentAllAlgoOpenOrdersParams &params, CompletionToken &&token) const
 Asynchronous current_all_algo_open_orders().
common::RestApiResponse< std::vector< CurrentAllOpenOrdersResponseInner > > current_all_open_orders (const CurrentAllOpenOrdersParams &params={}) const
 Current All Open Orders (USER_DATA).
template<class CompletionToken>
auto async_current_all_open_orders (const CurrentAllOpenOrdersParams &params, CompletionToken &&token) const
 Asynchronous current_all_open_orders().
common::RestApiResponse< FuturesTradfiPerpsContractResponse > futures_tradfi_perps_contract (const FuturesTradfiPerpsContractParams &params={}) const
 Futures TradFi Perps Contract (USER_DATA).
template<class CompletionToken>
auto async_futures_tradfi_perps_contract (const FuturesTradfiPerpsContractParams &params, CompletionToken &&token) const
 Asynchronous futures_tradfi_perps_contract().
common::RestApiResponse< std::vector< GetOrderModifyHistoryResponseInner > > get_order_modify_history (const GetOrderModifyHistoryParams &params) const
 Get Order Modify History (USER_DATA).
template<class CompletionToken>
auto async_get_order_modify_history (const GetOrderModifyHistoryParams &params, CompletionToken &&token) const
 Asynchronous get_order_modify_history().
common::RestApiResponse< std::vector< GetPositionMarginChangeHistoryResponseInner > > get_position_margin_change_history (const GetPositionMarginChangeHistoryParams &params) const
 Get Position Margin Change History (TRADE).
template<class CompletionToken>
auto async_get_position_margin_change_history (const GetPositionMarginChangeHistoryParams &params, CompletionToken &&token) const
 Asynchronous get_position_margin_change_history().
common::RestApiResponse< ModifyIsolatedPositionMarginResponse > modify_isolated_position_margin (const ModifyIsolatedPositionMarginParams &params) const
 Modify Isolated Position Margin (TRADE).
template<class CompletionToken>
auto async_modify_isolated_position_margin (const ModifyIsolatedPositionMarginParams &params, CompletionToken &&token) const
 Asynchronous modify_isolated_position_margin().
common::RestApiResponse< std::vector< PositionAdlQuantileEstimationResponseInner > > position_adl_quantile_estimation (const PositionAdlQuantileEstimationParams &params={}) const
 Position ADL Quantile Estimation (USER_DATA).
template<class CompletionToken>
auto async_position_adl_quantile_estimation (const PositionAdlQuantileEstimationParams &params, CompletionToken &&token) const
 Asynchronous position_adl_quantile_estimation().
common::RestApiResponse< std::vector< PositionInformationV2ResponseInner > > 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
 Asynchronous position_information_v2().
common::RestApiResponse< std::vector< PositionInformationV3ResponseInner > > position_information_v3 (const PositionInformationV3Params &params={}) const
 Position Information V3 (USER_DATA).
template<class CompletionToken>
auto async_position_information_v3 (const PositionInformationV3Params &params, CompletionToken &&token) const
 Asynchronous position_information_v3().
common::RestApiResponse< std::vector< QueryAllAlgoOrdersResponseInner > > query_all_algo_orders (const QueryAllAlgoOrdersParams &params) const
 Query All Algo Orders (USER_DATA).
template<class CompletionToken>
auto async_query_all_algo_orders (const QueryAllAlgoOrdersParams &params, CompletionToken &&token) const
 Asynchronous query_all_algo_orders().
common::RestApiResponse< QueryCurrentOpenOrderResponse > query_current_open_order (const QueryCurrentOpenOrderParams &params) const
 Query Current Open Order (USER_DATA).
template<class CompletionToken>
auto async_query_current_open_order (const QueryCurrentOpenOrderParams &params, CompletionToken &&token) const
 Asynchronous query_current_open_order().
common::RestApiResponse< TestOrderResponse > test_order (const TestOrderParams &params) const
 Test Order (TRADE).
template<class CompletionToken>
auto async_test_order (const TestOrderParams &params, CompletionToken &&token) const
 Asynchronous test_order().
common::RestApiResponse< std::vector< UsersForceOrdersResponseInner > > users_force_orders (const UsersForceOrdersParams &params={}) const
 User's Force Orders (USER_DATA).
template<class CompletionToken>
auto async_users_force_orders (const UsersForceOrdersParams &params, CompletionToken &&token) const
 Asynchronous users_force_orders().

Constructor & Destructor Documentation

◆ TradeApi()

binance::derivatives_trading_usds_futures::rest_api::TradeApi::TradeApi ( std::shared_ptr< common::RestClient > client)
explicit

Member Function Documentation

◆ account_trade_list()

common::RestApiResponse< std::vector< AccountTradeListResponseInner > > binance::derivatives_trading_usds_futures::rest_api::TradeApi::account_trade_list ( const AccountTradeListParams & params) const
nodiscard

Account Trade List (USER_DATA).

GET /fapi/v1/userTrades.

Get trades for a specific account and symbol.

Weight(IP): 5

Security Type: USER_DATA

Notes:

  • If startTime and endTime are both not sent, then the last 7 days' data will be returned.
  • The time between startTime and endTime cannot be longer than 7 days.
  • The parameter fromId cannot be sent with startTime or endTime.
  • Only support querying trade in the past 3 months

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

◆ async_account_trade_list()

template<class CompletionToken>
auto binance::derivatives_trading_usds_futures::rest_api::TradeApi::async_account_trade_list ( const AccountTradeListParams & params,
CompletionToken && token ) const
inline

Asynchronous account_trade_list().

Completes with void(std::exception_ptr, common::RestApiResponse<std::vector<AccountTradeListResponseInner>>).

◆ all_orders()

common::RestApiResponse< std::vector< AllOrdersResponseInner > > binance::derivatives_trading_usds_futures::rest_api::TradeApi::all_orders ( const AllOrdersParams & params = {}) const
nodiscard

All Orders (USER_DATA).

GET /fapi/v1/allOrders.

Get all account orders; active, canceled, or filled.

  • 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): 5

Security Type: USER_DATA

Notes:

  • If orderId is set, it will get orders >= that orderId. Otherwise most recent orders are returned.
  • The query time period must be less then 7 days( default as the recent 7 days).

See https://developers.binance.com/en/docs/catalog/core-trading-derivatives-trading-usd-s-m-futures/api/rest-api/trade#all-orders

◆ async_all_orders()

template<class CompletionToken>
auto binance::derivatives_trading_usds_futures::rest_api::TradeApi::async_all_orders ( const AllOrdersParams & params,
CompletionToken && token ) const
inline

Asynchronous all_orders().

Completes with void(std::exception_ptr, common::RestApiResponse<std::vector<AllOrdersResponseInner>>).

◆ auto_cancel_all_open_orders()

common::RestApiResponse< AutoCancelAllOpenOrdersResponse > binance::derivatives_trading_usds_futures::rest_api::TradeApi::auto_cancel_all_open_orders ( const AutoCancelAllOpenOrdersParams & params) const
nodiscard

Auto-Cancel All Open Orders (TRADE).

POST /fapi/v1/countdownCancelAll.

Cancel all open orders of the specified symbol at the end of the specified countdown.

The endpoint should be called repeatedly as heartbeats so that the existing countdown time can be canceled and replaced by a new one.

Example usage:

Call this endpoint at 30s intervals with an countdownTime of 120000 (120s). If this endpoint is not called within 120 seconds, all your orders of the specified symbol will be automatically canceled. If this endpoint is called with an countdownTime of 0, the countdown timer will be stopped.

The system will check all countdowns approximately every 10 milliseconds, so please note that sufficient redundancy should be considered when using this function. We do not recommend setting the countdown time to be too precise or too small.

Weight(IP): 10

Security Type: TRADE

See https://developers.binance.com/en/docs/catalog/core-trading-derivatives-trading-usd-s-m-futures/api/rest-api/trade#auto-cancel-all-open-orders

◆ async_auto_cancel_all_open_orders()

template<class CompletionToken>
auto binance::derivatives_trading_usds_futures::rest_api::TradeApi::async_auto_cancel_all_open_orders ( const AutoCancelAllOpenOrdersParams & params,
CompletionToken && token ) const
inline

Asynchronous auto_cancel_all_open_orders().

Completes with void(std::exception_ptr, common::RestApiResponse<AutoCancelAllOpenOrdersResponse>).

◆ cancel_algo_order()

common::RestApiResponse< CancelAlgoOrderResponse > binance::derivatives_trading_usds_futures::rest_api::TradeApi::cancel_algo_order ( const CancelAlgoOrderParams & params = {}) const
nodiscard

Cancel Algo Order (TRADE).

DELETE /fapi/v1/algoOrder.

Cancel an active algo (conditional) order, including TP/SL (Take Profit / Stop Loss) and trailing stop orders on USD-M Futures.

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/rest-api/trade#cancel-algo-order

◆ async_cancel_algo_order()

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

Asynchronous cancel_algo_order().

Completes with void(std::exception_ptr, common::RestApiResponse<CancelAlgoOrderResponse>).

◆ new_algo_order()

common::RestApiResponse< NewAlgoOrderResponse > binance::derivatives_trading_usds_futures::rest_api::TradeApi::new_algo_order ( const NewAlgoOrderParams & params) const
nodiscard

New Algo Order (TRADE).

POST /fapi/v1/algoOrder.

Send in a new algo (conditional) order. Use this endpoint to place TP/SL (Take Profit / Stop Loss) and trailing stop orders on USD-M Futures. Supported order types under algoType=CONDITIONAL are STOP_MARKET, TAKE_PROFIT_MARKET, STOP, TAKE_PROFIT, and TRAILING_STOP_MARKET.

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:

  • Algo order with type STOP, parameter timeInForce can be sent (default GTC).
  • Algo order with type TAKE_PROFIT, parameter timeInForce can be sent ( default GTC).
  • 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/rest-api/trade#new-algo-order

◆ async_new_algo_order()

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

Asynchronous new_algo_order().

Completes with void(std::exception_ptr, common::RestApiResponse<NewAlgoOrderResponse>).

◆ query_algo_order()

common::RestApiResponse< QueryAlgoOrderResponse > binance::derivatives_trading_usds_futures::rest_api::TradeApi::query_algo_order ( const QueryAlgoOrderParams & params = {}) const
nodiscard

Query Algo Order (USER_DATA).

GET /fapi/v1/algoOrder.

Check the status of an algo (conditional) order, such as TP/SL (Take Profit / Stop Loss) or trailing stop orders on USD-M Futures.

  • 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:

  • Either algoId or clientAlgoId must be sent.
  • algoId is self-increment for each specific symbol

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

◆ async_query_algo_order()

template<class CompletionToken>
auto binance::derivatives_trading_usds_futures::rest_api::TradeApi::async_query_algo_order ( const QueryAlgoOrderParams & params,
CompletionToken && token ) const
inline

Asynchronous query_algo_order().

Completes with void(std::exception_ptr, common::RestApiResponse<QueryAlgoOrderResponse>).

◆ cancel_all_algo_open_orders()

common::RestApiResponse< CancelAllAlgoOpenOrdersResponse > binance::derivatives_trading_usds_futures::rest_api::TradeApi::cancel_all_algo_open_orders ( const CancelAllAlgoOpenOrdersParams & params) const
nodiscard

Cancel All Algo Open Orders (TRADE).

DELETE /fapi/v1/algoOpenOrders.

Cancel all open algo (conditional) orders on a symbol, including TP/SL (Take Profit / Stop Loss) and trailing stop orders on USD-M Futures.

Weight(IP): 1

Security Type: TRADE

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

◆ async_cancel_all_algo_open_orders()

template<class CompletionToken>
auto binance::derivatives_trading_usds_futures::rest_api::TradeApi::async_cancel_all_algo_open_orders ( const CancelAllAlgoOpenOrdersParams & params,
CompletionToken && token ) const
inline

Asynchronous cancel_all_algo_open_orders().

Completes with void(std::exception_ptr, common::RestApiResponse<CancelAllAlgoOpenOrdersResponse>).

◆ cancel_all_open_orders()

common::RestApiResponse< CancelAllOpenOrdersResponse > binance::derivatives_trading_usds_futures::rest_api::TradeApi::cancel_all_open_orders ( const CancelAllOpenOrdersParams & params) const
nodiscard

Cancel All Open Orders (TRADE).

DELETE /fapi/v1/allOpenOrders.

Cancel All Open Orders

Weight(IP): 1

Security Type: TRADE

See https://developers.binance.com/en/docs/catalog/core-trading-derivatives-trading-usd-s-m-futures/api/rest-api/trade#cancel-all-open-orders

◆ async_cancel_all_open_orders()

template<class CompletionToken>
auto binance::derivatives_trading_usds_futures::rest_api::TradeApi::async_cancel_all_open_orders ( const CancelAllOpenOrdersParams & params,
CompletionToken && token ) const
inline

Asynchronous cancel_all_open_orders().

Completes with void(std::exception_ptr, common::RestApiResponse<CancelAllOpenOrdersResponse>).

◆ cancel_multiple_orders()

common::RestApiResponse< std::vector< CancelMultipleOrdersResponseInner > > binance::derivatives_trading_usds_futures::rest_api::TradeApi::cancel_multiple_orders ( const CancelMultipleOrdersParams & params) const
nodiscard

Cancel Multiple Orders (TRADE).

DELETE /fapi/v1/batchOrders.

Cancel Multiple Orders

Weight(IP): 1

Security Type: TRADE

Notes:

  • Either orderIdList or origClientOrderIdList must be sent.

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

◆ async_cancel_multiple_orders()

template<class CompletionToken>
auto binance::derivatives_trading_usds_futures::rest_api::TradeApi::async_cancel_multiple_orders ( const CancelMultipleOrdersParams & params,
CompletionToken && token ) const
inline

Asynchronous cancel_multiple_orders().

Completes with void(std::exception_ptr, common::RestApiResponse<std::vector<CancelMultipleOrdersResponseInner>>).

◆ modify_multiple_orders()

common::RestApiResponse< std::vector< ModifyMultipleOrdersResponseInner > > binance::derivatives_trading_usds_futures::rest_api::TradeApi::modify_multiple_orders ( const ModifyMultipleOrdersParams & params) const
nodiscard

Modify Multiple Orders (TRADE).

PUT /fapi/v1/batchOrders.

Modify Multiple Orders (TRADE)

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

Security Type: TRADE

Notes:

  • Parameter rules are same with Modify Order
  • Batch modify orders are processed concurrently, and the order of matching is not guaranteed.
  • The order of returned contents for batch modify orders is the same as the order of the order list.
  • One order can only be modfied for less than 10000 times

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

◆ async_modify_multiple_orders()

template<class CompletionToken>
auto binance::derivatives_trading_usds_futures::rest_api::TradeApi::async_modify_multiple_orders ( const ModifyMultipleOrdersParams & params,
CompletionToken && token ) const
inline

Asynchronous modify_multiple_orders().

Completes with void(std::exception_ptr, common::RestApiResponse<std::vector<ModifyMultipleOrdersResponseInner>>).

◆ place_multiple_orders()

common::RestApiResponse< std::vector< PlaceMultipleOrdersResponseInner > > binance::derivatives_trading_usds_futures::rest_api::TradeApi::place_multiple_orders ( const PlaceMultipleOrdersParams & params) const
nodiscard

Place Multiple Orders (TRADE).

POST /fapi/v1/batchOrders.

Place Multiple Orders

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

Security Type: TRADE

Notes:

  • Paremeter rules are same with New Order
  • Batch orders are processed concurrently, and the order of matching is not guaranteed.
  • The order of returned contents for batch orders is the same as the order of the order list.

See https://developers.binance.com/en/docs/catalog/core-trading-derivatives-trading-usd-s-m-futures/api/rest-api/trade#place-multiple-orders

◆ async_place_multiple_orders()

template<class CompletionToken>
auto binance::derivatives_trading_usds_futures::rest_api::TradeApi::async_place_multiple_orders ( const PlaceMultipleOrdersParams & params,
CompletionToken && token ) const
inline

Asynchronous place_multiple_orders().

Completes with void(std::exception_ptr, common::RestApiResponse<std::vector<PlaceMultipleOrdersResponseInner>>).

◆ cancel_order()

common::RestApiResponse< CancelOrderResponse > binance::derivatives_trading_usds_futures::rest_api::TradeApi::cancel_order ( const CancelOrderParams & params) const
nodiscard

Cancel Order (TRADE).

DELETE /fapi/v1/order.

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/rest-api/trade#cancel-order

◆ async_cancel_order()

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

Asynchronous cancel_order().

Completes with void(std::exception_ptr, common::RestApiResponse<CancelOrderResponse>).

◆ modify_order()

common::RestApiResponse< ModifyOrderResponse > binance::derivatives_trading_usds_futures::rest_api::TradeApi::modify_order ( const ModifyOrderParams & params) const
nodiscard

Modify Order (TRADE).

PUT /fapi/v1/order.

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, which is different from dapi modify order endpoint.
  • 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/rest-api/trade#modify-order

◆ async_modify_order()

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

Asynchronous modify_order().

Completes with void(std::exception_ptr, common::RestApiResponse<ModifyOrderResponse>).

◆ new_order()

common::RestApiResponse< NewOrderResponse > binance::derivatives_trading_usds_futures::rest_api::TradeApi::new_order ( const NewOrderParams & params) const
nodiscard

New Order (TRADE).

POST /fapi/v1/order.

Send in a new order.

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: Additional mandatory parameters based on type:

Type Additional mandatory parameters
LIMIT timeInForce, quantity, price
MARKET quantity
  • If newOrderRespType is sent as RESULT:
    • MARKET order: the final FILLED result of the order will be returned 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 is set to IOC, GTC, or GTD.
  • In extreme market conditions, timeInForce GTD order auto-cancel time might be delayed compared to goodTillDate.

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

◆ async_new_order()

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

Asynchronous new_order().

Completes with void(std::exception_ptr, common::RestApiResponse<NewOrderResponse>).

◆ query_order()

common::RestApiResponse< QueryOrderResponse > binance::derivatives_trading_usds_futures::rest_api::TradeApi::query_order ( const QueryOrderParams & params) const
nodiscard

Query Order (USER_DATA).

GET /fapi/v1/order.

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:

  • 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/rest-api/trade#query-order

◆ async_query_order()

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

Asynchronous query_order().

Completes with void(std::exception_ptr, common::RestApiResponse<QueryOrderResponse>).

◆ change_initial_leverage()

common::RestApiResponse< ChangeInitialLeverageResponse > binance::derivatives_trading_usds_futures::rest_api::TradeApi::change_initial_leverage ( const ChangeInitialLeverageParams & params) const
nodiscard

Change Initial Leverage (TRADE).

POST /fapi/v1/leverage.

Change user's initial leverage of specific symbol market.

Weight(IP): 1

Security Type: TRADE

See https://developers.binance.com/en/docs/catalog/core-trading-derivatives-trading-usd-s-m-futures/api/rest-api/trade#change-initial-leverage

◆ async_change_initial_leverage()

template<class CompletionToken>
auto binance::derivatives_trading_usds_futures::rest_api::TradeApi::async_change_initial_leverage ( const ChangeInitialLeverageParams & params,
CompletionToken && token ) const
inline

Asynchronous change_initial_leverage().

Completes with void(std::exception_ptr, common::RestApiResponse<ChangeInitialLeverageResponse>).

◆ change_margin_type()

common::RestApiResponse< ChangeMarginTypeResponse > binance::derivatives_trading_usds_futures::rest_api::TradeApi::change_margin_type ( const ChangeMarginTypeParams & params) const
nodiscard

Change Margin Type (TRADE).

POST /fapi/v1/marginType.

Change symbol level margin type

Weight(IP): 1

Security Type: TRADE

See https://developers.binance.com/en/docs/catalog/core-trading-derivatives-trading-usd-s-m-futures/api/rest-api/trade#change-margin-type

◆ async_change_margin_type()

template<class CompletionToken>
auto binance::derivatives_trading_usds_futures::rest_api::TradeApi::async_change_margin_type ( const ChangeMarginTypeParams & params,
CompletionToken && token ) const
inline

Asynchronous change_margin_type().

Completes with void(std::exception_ptr, common::RestApiResponse<ChangeMarginTypeResponse>).

◆ change_multi_assets_mode()

common::RestApiResponse< ChangeMultiAssetsModeResponse > binance::derivatives_trading_usds_futures::rest_api::TradeApi::change_multi_assets_mode ( const ChangeMultiAssetsModeParams & params) const
nodiscard

Change Multi-Assets Mode (TRADE).

POST /fapi/v1/multiAssetsMargin.

Change user's Multi-Assets mode (Multi-Assets Mode or Single-Asset Mode) on Every symbol

Weight(IP): 1

Security Type: TRADE

See https://developers.binance.com/en/docs/catalog/core-trading-derivatives-trading-usd-s-m-futures/api/rest-api/trade#change-multi-assets-mode

◆ async_change_multi_assets_mode()

template<class CompletionToken>
auto binance::derivatives_trading_usds_futures::rest_api::TradeApi::async_change_multi_assets_mode ( const ChangeMultiAssetsModeParams & params,
CompletionToken && token ) const
inline

Asynchronous change_multi_assets_mode().

Completes with void(std::exception_ptr, common::RestApiResponse<ChangeMultiAssetsModeResponse>).

◆ change_position_mode()

common::RestApiResponse< ChangePositionModeResponse > binance::derivatives_trading_usds_futures::rest_api::TradeApi::change_position_mode ( const ChangePositionModeParams & params) const
nodiscard

Change Position Mode (TRADE).

POST /fapi/v1/positionSide/dual.

Change user's position mode (Hedge Mode or One-way Mode ) on EVERY symbol.

After CM migration, UM and CM share the same dualSidePosition setting. Calling this endpoint flips both UM and CM at once. If either side has any open order or open position, the change is rejected:

  • -4067 (open orders exist)
  • -4068 (open position exists)

Weight(IP): 1

Security Type: TRADE

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

◆ async_change_position_mode()

template<class CompletionToken>
auto binance::derivatives_trading_usds_futures::rest_api::TradeApi::async_change_position_mode ( const ChangePositionModeParams & params,
CompletionToken && token ) const
inline

Asynchronous change_position_mode().

Completes with void(std::exception_ptr, common::RestApiResponse<ChangePositionModeResponse>).

◆ current_all_algo_open_orders()

common::RestApiResponse< std::vector< CurrentAllAlgoOpenOrdersResponseInner > > binance::derivatives_trading_usds_futures::rest_api::TradeApi::current_all_algo_open_orders ( const CurrentAllAlgoOpenOrdersParams & params = {}) const
nodiscard

Current All Algo Open Orders (USER_DATA).

GET /fapi/v1/openAlgoOrders.

Get all open algo (conditional) orders on a symbol, including TP/SL (Take Profit / Stop Loss) and trailing stop orders on USD-M Futures.

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

Careful when accessing this with no symbol.

Security Type: USER_DATA

Notes:

  • If the symbol is not sent, orders 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/rest-api/trade#current-all-algo-open-orders

◆ async_current_all_algo_open_orders()

template<class CompletionToken>
auto binance::derivatives_trading_usds_futures::rest_api::TradeApi::async_current_all_algo_open_orders ( const CurrentAllAlgoOpenOrdersParams & params,
CompletionToken && token ) const
inline

Asynchronous current_all_algo_open_orders().

Completes with void(std::exception_ptr, common::RestApiResponse<std::vector<CurrentAllAlgoOpenOrdersResponseInner>>).

◆ current_all_open_orders()

common::RestApiResponse< std::vector< CurrentAllOpenOrdersResponseInner > > binance::derivatives_trading_usds_futures::rest_api::TradeApi::current_all_open_orders ( const CurrentAllOpenOrdersParams & params = {}) const
nodiscard

Current All Open Orders (USER_DATA).

GET /fapi/v1/openOrders.

Get all open orders on a symbol.

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

Careful when accessing this with no symbol.

Security Type: USER_DATA

Notes:

  • If the symbol is not sent, orders 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/rest-api/trade#current-all-open-orders

◆ async_current_all_open_orders()

template<class CompletionToken>
auto binance::derivatives_trading_usds_futures::rest_api::TradeApi::async_current_all_open_orders ( const CurrentAllOpenOrdersParams & params,
CompletionToken && token ) const
inline

Asynchronous current_all_open_orders().

Completes with void(std::exception_ptr, common::RestApiResponse<std::vector<CurrentAllOpenOrdersResponseInner>>).

◆ futures_tradfi_perps_contract()

common::RestApiResponse< FuturesTradfiPerpsContractResponse > binance::derivatives_trading_usds_futures::rest_api::TradeApi::futures_tradfi_perps_contract ( const FuturesTradfiPerpsContractParams & params = {}) const
nodiscard

Futures TradFi Perps Contract (USER_DATA).

POST /fapi/v1/stock/contract.

Sign TradFi-Perps agreement contract

Weight(IP): 50

Security Type: USER_DATA

See https://developers.binance.com/en/docs/catalog/core-trading-derivatives-trading-usd-s-m-futures/api/rest-api/trade#futures-tradfi-perps-contract

◆ async_futures_tradfi_perps_contract()

template<class CompletionToken>
auto binance::derivatives_trading_usds_futures::rest_api::TradeApi::async_futures_tradfi_perps_contract ( const FuturesTradfiPerpsContractParams & params,
CompletionToken && token ) const
inline

Asynchronous futures_tradfi_perps_contract().

Completes with void(std::exception_ptr, common::RestApiResponse<FuturesTradfiPerpsContractResponse>).

◆ get_order_modify_history()

common::RestApiResponse< std::vector< GetOrderModifyHistoryResponseInner > > binance::derivatives_trading_usds_futures::rest_api::TradeApi::get_order_modify_history ( const GetOrderModifyHistoryParams & params) const
nodiscard

Get Order Modify History (USER_DATA).

GET /fapi/v1/orderAmendment.

Get order modification history

Weight(IP): 1

Security Type: USER_DATA

Notes:

  • Either orderId or origClientOrderId must be sent, and the orderId will prevail if both are sent.
  • Order modify history longer than 3 month is not avaliable

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

◆ async_get_order_modify_history()

template<class CompletionToken>
auto binance::derivatives_trading_usds_futures::rest_api::TradeApi::async_get_order_modify_history ( const GetOrderModifyHistoryParams & params,
CompletionToken && token ) const
inline

Asynchronous get_order_modify_history().

Completes with void(std::exception_ptr, common::RestApiResponse<std::vector<GetOrderModifyHistoryResponseInner>>).

◆ get_position_margin_change_history()

common::RestApiResponse< std::vector< GetPositionMarginChangeHistoryResponseInner > > binance::derivatives_trading_usds_futures::rest_api::TradeApi::get_position_margin_change_history ( const GetPositionMarginChangeHistoryParams & params) const
nodiscard

Get Position Margin Change History (TRADE).

GET /fapi/v1/positionMargin/history.

Get Position Margin Change History

Weight(IP): 1

Security Type: TRADE

Notes:

  • Support querying future histories that are not older than 30 days
  • The time between startTime and endTimecan't be more than 30 days

See https://developers.binance.com/en/docs/catalog/core-trading-derivatives-trading-usd-s-m-futures/api/rest-api/trade#get-position-margin-change-history

◆ async_get_position_margin_change_history()

template<class CompletionToken>
auto binance::derivatives_trading_usds_futures::rest_api::TradeApi::async_get_position_margin_change_history ( const GetPositionMarginChangeHistoryParams & params,
CompletionToken && token ) const
inline

Asynchronous get_position_margin_change_history().

Completes with void(std::exception_ptr, common::RestApiResponse<std::vector<GetPositionMarginChangeHistoryResponseInner>>).

◆ modify_isolated_position_margin()

common::RestApiResponse< ModifyIsolatedPositionMarginResponse > binance::derivatives_trading_usds_futures::rest_api::TradeApi::modify_isolated_position_margin ( const ModifyIsolatedPositionMarginParams & params) const
nodiscard

Modify Isolated Position Margin (TRADE).

POST /fapi/v1/positionMargin.

Modify Isolated Position Margin

Weight(IP): 1

Security Type: TRADE

Notes:

  • Only for isolated symbol

See https://developers.binance.com/en/docs/catalog/core-trading-derivatives-trading-usd-s-m-futures/api/rest-api/trade#modify-isolated-position-margin

◆ async_modify_isolated_position_margin()

template<class CompletionToken>
auto binance::derivatives_trading_usds_futures::rest_api::TradeApi::async_modify_isolated_position_margin ( const ModifyIsolatedPositionMarginParams & params,
CompletionToken && token ) const
inline

◆ position_adl_quantile_estimation()

common::RestApiResponse< std::vector< PositionAdlQuantileEstimationResponseInner > > binance::derivatives_trading_usds_futures::rest_api::TradeApi::position_adl_quantile_estimation ( const PositionAdlQuantileEstimationParams & params = {}) const
nodiscard

Position ADL Quantile Estimation (USER_DATA).

GET /fapi/v1/adlQuantile.

Position ADL Quantile Estimation

  • Values update every 30s.
  • Values 0, 1, 2, 3, 4 shows the queue position and possibility of ADL from low to high.
  • For positions of the symbol are in One-way Mode or isolated margined in Hedge Mode, "LONG", "SHORT", and "BOTH" will be returned to show the positions' adl quantiles of different position sides.
  • If the positions of the symbol are crossed margined in Hedge Mode:
    • "HEDGE" as a sign will be returned instead of "BOTH";
    • A same value caculated on unrealized pnls on long and short sides' positions will be shown for "LONG" and "SHORT" when there are positions in both of long and short sides.

Weight(IP): 5

Security Type: USER_DATA

See https://developers.binance.com/en/docs/catalog/core-trading-derivatives-trading-usd-s-m-futures/api/rest-api/trade#position-adl-quantile-estimation

◆ async_position_adl_quantile_estimation()

template<class CompletionToken>
auto binance::derivatives_trading_usds_futures::rest_api::TradeApi::async_position_adl_quantile_estimation ( const PositionAdlQuantileEstimationParams & params,
CompletionToken && token ) const
inline

Asynchronous position_adl_quantile_estimation().

Completes with void(std::exception_ptr, common::RestApiResponse<std::vector<PositionAdlQuantileEstimationResponseInner>>).

◆ position_information_v2()

common::RestApiResponse< std::vector< PositionInformationV2ResponseInner > > binance::derivatives_trading_usds_futures::rest_api::TradeApi::position_information_v2 ( const PositionInformationV2Params & params = {}) const
nodiscard

Position Information V2 (USER_DATA).

GET /fapi/v2/positionRisk.

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/rest-api/trade#position-information-v2

◆ async_position_information_v2()

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

Asynchronous position_information_v2().

Completes with void(std::exception_ptr, common::RestApiResponse<std::vector<PositionInformationV2ResponseInner>>).

◆ position_information_v3()

common::RestApiResponse< std::vector< PositionInformationV3ResponseInner > > binance::derivatives_trading_usds_futures::rest_api::TradeApi::position_information_v3 ( const PositionInformationV3Params & params = {}) const
nodiscard

Position Information V3 (USER_DATA).

GET /fapi/v3/positionRisk.

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/rest-api/trade#position-information-v3

◆ async_position_information_v3()

template<class CompletionToken>
auto binance::derivatives_trading_usds_futures::rest_api::TradeApi::async_position_information_v3 ( const PositionInformationV3Params & params,
CompletionToken && token ) const
inline

Asynchronous position_information_v3().

Completes with void(std::exception_ptr, common::RestApiResponse<std::vector<PositionInformationV3ResponseInner>>).

◆ query_all_algo_orders()

common::RestApiResponse< std::vector< QueryAllAlgoOrdersResponseInner > > binance::derivatives_trading_usds_futures::rest_api::TradeApi::query_all_algo_orders ( const QueryAllAlgoOrdersParams & params) const
nodiscard

Query All Algo Orders (USER_DATA).

GET /fapi/v1/allAlgoOrders.

Get all algo (conditional) orders — active, CANCELED, TRIGGERED, or FINISHED — including TP/SL (Take Profit / Stop Loss) and trailing stop orders on USD-M Futures.

  • 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): 5

Security Type: USER_DATA

Notes:

  • If algoId is set, it will get orders >= that algoId. Otherwise most recent orders are returned.
  • The query time period must be less then 7 days( default as the recent 7 days).

See https://developers.binance.com/en/docs/catalog/core-trading-derivatives-trading-usd-s-m-futures/api/rest-api/trade#query-all-algo-orders

◆ async_query_all_algo_orders()

template<class CompletionToken>
auto binance::derivatives_trading_usds_futures::rest_api::TradeApi::async_query_all_algo_orders ( const QueryAllAlgoOrdersParams & params,
CompletionToken && token ) const
inline

Asynchronous query_all_algo_orders().

Completes with void(std::exception_ptr, common::RestApiResponse<std::vector<QueryAllAlgoOrdersResponseInner>>).

◆ query_current_open_order()

common::RestApiResponse< QueryCurrentOpenOrderResponse > binance::derivatives_trading_usds_futures::rest_api::TradeApi::query_current_open_order ( const QueryCurrentOpenOrderParams & params) const
nodiscard

Query Current Open Order (USER_DATA).

GET /fapi/v1/openOrder.

Query open order

Weight(IP): 1

Security Type: USER_DATA

Notes:

  • EitherorderId or origClientOrderId must be sent
  • If the queried order has been filled or cancelled, the error message "Order does not exist" will be returned.

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

◆ async_query_current_open_order()

template<class CompletionToken>
auto binance::derivatives_trading_usds_futures::rest_api::TradeApi::async_query_current_open_order ( const QueryCurrentOpenOrderParams & params,
CompletionToken && token ) const
inline

Asynchronous query_current_open_order().

Completes with void(std::exception_ptr, common::RestApiResponse<QueryCurrentOpenOrderResponse>).

◆ test_order()

common::RestApiResponse< TestOrderResponse > binance::derivatives_trading_usds_futures::rest_api::TradeApi::test_order ( const TestOrderParams & params) const
nodiscard

Test Order (TRADE).

POST /fapi/v1/order/test.

Testing order request, this order will not be submitted to matching engine

Security Type: TRADE

Notes: Additional mandatory parameters based on type:

Type Additional mandatory parameters
LIMIT timeInForce, quantity, price
MARKET quantity
STOP/TAKE_PROFIT quantity, price, stopPrice
STOP_MARKET/TAKE_PROFIT_MARKET stopPrice
TRAILING_STOP_MARKET callbackRate
  • Order with type STOP, parameter timeInForce can be sent ( default GTC).
  • Order with type TAKE_PROFIT, parameter timeInForce can be sent (default GTC).
  • Condition orders will be triggered when:
    • If parameterpriceProtectis sent as true:
      • when price reaches the stopPrice ,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") >= stopPrice
      • SELL: latest price ("MARK_PRICE" or "CONTRACT_PRICE") <= stopPrice
    • TAKE_PROFIT, TAKE_PROFIT_MARKET:
      • BUY: latest price ("MARK_PRICE" or "CONTRACT_PRICE") <= stopPrice
      • SELL: latest price ("MARK_PRICE" or "CONTRACT_PRICE") >= stopPrice
    • TRAILING_STOP_MARKET:
      • BUY: the lowest price after order placed <= activationPrice, and the latest price >= the lowest price * (1 + callbackRate)
      • SELL: the highest price after order placed >= activationPrice, 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: activationPrice should be smaller than latest price.
    • SELL: activationPrice should be larger than latest price.
  • 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.
  • 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.
  • 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/rest-api/trade#test-order

◆ async_test_order()

template<class CompletionToken>
auto binance::derivatives_trading_usds_futures::rest_api::TradeApi::async_test_order ( const TestOrderParams & params,
CompletionToken && token ) const
inline

Asynchronous test_order().

Completes with void(std::exception_ptr, common::RestApiResponse<TestOrderResponse>).

◆ users_force_orders()

common::RestApiResponse< std::vector< UsersForceOrdersResponseInner > > binance::derivatives_trading_usds_futures::rest_api::TradeApi::users_force_orders ( const UsersForceOrdersParams & params = {}) const
nodiscard

User's Force Orders (USER_DATA).

GET /fapi/v1/forceOrders.

Query user's Force Orders

Weight: 20 with symbol, 50 without symbol

Security Type: USER_DATA

Notes:

  • If "autoCloseType" is not sent, orders with both of the types will be returned
  • If "startTime" is not sent, data within 7 days before "endTime" can be queried

See https://developers.binance.com/en/docs/catalog/core-trading-derivatives-trading-usd-s-m-futures/api/rest-api/trade#users-force-orders

◆ async_users_force_orders()

template<class CompletionToken>
auto binance::derivatives_trading_usds_futures::rest_api::TradeApi::async_users_force_orders ( const UsersForceOrdersParams & params,
CompletionToken && token ) const
inline

Asynchronous users_force_orders().

Completes with void(std::exception_ptr, common::RestApiResponse<std::vector<UsersForceOrdersResponseInner>>).