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

#include <trade_api.hpp>

Public Member Functions

 TradeApi (std::shared_ptr< common::RestClient > client)
common::RestApiResponse< CreateSpecialKeyResponse > create_special_key (const CreateSpecialKeyParams &params) const
 Create Special Key(Low-Latency Trading) (TRADE).
template<class CompletionToken>
auto async_create_special_key (const CreateSpecialKeyParams &params, CompletionToken &&token) const
 Asynchronous create_special_key().
common::RestApiResponse< boost::json::value > delete_special_key (const DeleteSpecialKeyParams &params={}) const
 Delete Special Key(Low-Latency Trading) (TRADE).
template<class CompletionToken>
auto async_delete_special_key (const DeleteSpecialKeyParams &params, CompletionToken &&token) const
 Asynchronous delete_special_key().
common::RestApiResponse< QuerySpecialKeyResponse > query_special_key (const QuerySpecialKeyParams &params={}) const
 Query Special key(Low Latency Trading) (TRADE).
template<class CompletionToken>
auto async_query_special_key (const QuerySpecialKeyParams &params, CompletionToken &&token) const
 Asynchronous query_special_key().
common::RestApiResponse< boost::json::value > edit_ip_for_special_key (const EditIpForSpecialKeyParams &params) const
 Edit ip for Special Key(Low-Latency Trading) (TRADE).
template<class CompletionToken>
auto async_edit_ip_for_special_key (const EditIpForSpecialKeyParams &params, CompletionToken &&token) const
 Asynchronous edit_ip_for_special_key().
common::RestApiResponse< boost::json::value > exit_special_key_mode (const ExitSpecialKeyModeParams &params={}) const
 Exit Special Key Mode (TRADE).
template<class CompletionToken>
auto async_exit_special_key_mode (const ExitSpecialKeyModeParams &params, CompletionToken &&token) const
 Asynchronous exit_special_key_mode().
common::RestApiResponse< GetForceLiquidationRecordResponse > get_force_liquidation_record (const GetForceLiquidationRecordParams &params={}) const
 Get Force Liquidation Record (USER_DATA).
template<class CompletionToken>
auto async_get_force_liquidation_record (const GetForceLiquidationRecordParams &params, CompletionToken &&token) const
 Asynchronous get_force_liquidation_record().
common::RestApiResponse< std::vector< GetSmallLiabilityExchangeCoinListResponseInner > > get_small_liability_exchange_coin_list (const GetSmallLiabilityExchangeCoinListParams &params={}) const
 Get Small Liability Exchange Coin List (USER_DATA).
template<class CompletionToken>
auto async_get_small_liability_exchange_coin_list (const GetSmallLiabilityExchangeCoinListParams &params, CompletionToken &&token) const
 Asynchronous get_small_liability_exchange_coin_list().
common::RestApiResponse< boost::json::value > small_liability_exchange (const SmallLiabilityExchangeParams &params) const
 Small Liability Exchange (MARGIN).
template<class CompletionToken>
auto async_small_liability_exchange (const SmallLiabilityExchangeParams &params, CompletionToken &&token) const
 Asynchronous small_liability_exchange().
common::RestApiResponse< GetSmallLiabilityExchangeHistoryResponse > get_small_liability_exchange_history (const GetSmallLiabilityExchangeHistoryParams &params) const
 Get Small Liability Exchange History (USER_DATA).
template<class CompletionToken>
auto async_get_small_liability_exchange_history (const GetSmallLiabilityExchangeHistoryParams &params, CompletionToken &&token) const
 Asynchronous get_small_liability_exchange_history().
common::RestApiResponse< LiquidationLoanRepayResponse > liquidation_loan_repay (const LiquidationLoanRepayParams &params) const
 Liquidation Loan Repay (MARGIN).
template<class CompletionToken>
auto async_liquidation_loan_repay (const LiquidationLoanRepayParams &params, CompletionToken &&token) const
 Asynchronous liquidation_loan_repay().
common::RestApiResponse< std::vector< MarginAccountCancelAllOpenOrdersOnASymbolResponseInner > > margin_account_cancel_all_open_orders_on_a_symbol (const MarginAccountCancelAllOpenOrdersOnASymbolParams &params) const
 Margin Account Cancel all Open Orders on a Symbol (TRADE).
template<class CompletionToken>
auto async_margin_account_cancel_all_open_orders_on_a_symbol (const MarginAccountCancelAllOpenOrdersOnASymbolParams &params, CompletionToken &&token) const
 Asynchronous margin_account_cancel_all_open_orders_on_a_symbol().
common::RestApiResponse< std::vector< QueryMarginAccountsOpenOrdersResponseInner > > query_margin_accounts_open_orders (const QueryMarginAccountsOpenOrdersParams &params={}) const
 Query Margin Account's Open Orders (USER_DATA).
template<class CompletionToken>
auto async_query_margin_accounts_open_orders (const QueryMarginAccountsOpenOrdersParams &params, CompletionToken &&token) const
 Asynchronous query_margin_accounts_open_orders().
common::RestApiResponse< MarginAccountCancelOcoResponse > margin_account_cancel_oco (const MarginAccountCancelOcoParams &params) const
 Margin Account Cancel OCO (TRADE).
template<class CompletionToken>
auto async_margin_account_cancel_oco (const MarginAccountCancelOcoParams &params, CompletionToken &&token) const
 Asynchronous margin_account_cancel_oco().
common::RestApiResponse< QueryMarginAccountsOcoResponse > query_margin_accounts_oco (const QueryMarginAccountsOcoParams &params={}) const
 Query Margin Account's OCO (USER_DATA).
template<class CompletionToken>
auto async_query_margin_accounts_oco (const QueryMarginAccountsOcoParams &params, CompletionToken &&token) const
 Asynchronous query_margin_accounts_oco().
common::RestApiResponse< MarginAccountCancelOrderResponse > margin_account_cancel_order (const MarginAccountCancelOrderParams &params) const
 Margin Account Cancel Order (TRADE).
template<class CompletionToken>
auto async_margin_account_cancel_order (const MarginAccountCancelOrderParams &params, CompletionToken &&token) const
 Asynchronous margin_account_cancel_order().
common::RestApiResponse< MarginAccountNewOrderResponse > margin_account_new_order (const MarginAccountNewOrderParams &params) const
 Margin Account New Order (TRADE).
template<class CompletionToken>
auto async_margin_account_new_order (const MarginAccountNewOrderParams &params, CompletionToken &&token) const
 Asynchronous margin_account_new_order().
common::RestApiResponse< QueryMarginAccountsOrderResponse > query_margin_accounts_order (const QueryMarginAccountsOrderParams &params) const
 Query Margin Account's Order (USER_DATA).
template<class CompletionToken>
auto async_query_margin_accounts_order (const QueryMarginAccountsOrderParams &params, CompletionToken &&token) const
 Asynchronous query_margin_accounts_order().
common::RestApiResponse< MarginAccountNewOcoResponse > margin_account_new_oco (const MarginAccountNewOcoParams &params) const
 Margin Account New OCO (TRADE).
template<class CompletionToken>
auto async_margin_account_new_oco (const MarginAccountNewOcoParams &params, CompletionToken &&token) const
 Asynchronous margin_account_new_oco().
common::RestApiResponse< MarginAccountNewOtoResponse > margin_account_new_oto (const MarginAccountNewOtoParams &params) const
 Margin Account New OTO (TRADE).
template<class CompletionToken>
auto async_margin_account_new_oto (const MarginAccountNewOtoParams &params, CompletionToken &&token) const
 Asynchronous margin_account_new_oto().
common::RestApiResponse< MarginAccountNewOtocoResponse > margin_account_new_otoco (const MarginAccountNewOtocoParams &params) const
 Margin Account New OTOCO (TRADE).
template<class CompletionToken>
auto async_margin_account_new_otoco (const MarginAccountNewOtocoParams &params, CompletionToken &&token) const
 Asynchronous margin_account_new_otoco().
common::RestApiResponse< MarginManualLiquidationResponse > margin_manual_liquidation (const MarginManualLiquidationParams &params) const
 Margin Manual Liquidation (TRADE).
template<class CompletionToken>
auto async_margin_manual_liquidation (const MarginManualLiquidationParams &params, CompletionToken &&token) const
 Asynchronous margin_manual_liquidation().
common::RestApiResponse< std::vector< QueryCurrentMarginOrderCountUsageResponseInner > > query_current_margin_order_count_usage (const QueryCurrentMarginOrderCountUsageParams &params={}) const
 Query Current Margin Order Count Usage (TRADE).
template<class CompletionToken>
auto async_query_current_margin_order_count_usage (const QueryCurrentMarginOrderCountUsageParams &params, CompletionToken &&token) const
 Asynchronous query_current_margin_order_count_usage().
common::RestApiResponse< QueryLiquidationLoanResponse > query_liquidation_loan (const QueryLiquidationLoanParams &params={}) const
 Query Liquidation Loan (USER_DATA).
template<class CompletionToken>
auto async_query_liquidation_loan (const QueryLiquidationLoanParams &params, CompletionToken &&token) const
 Asynchronous query_liquidation_loan().
common::RestApiResponse< QueryLiquidationLoanRepayHistoryResponse > query_liquidation_loan_repay_history (const QueryLiquidationLoanRepayHistoryParams &params={}) const
 Query Liquidation Loan Repay History (USER_DATA).
template<class CompletionToken>
auto async_query_liquidation_loan_repay_history (const QueryLiquidationLoanRepayHistoryParams &params, CompletionToken &&token) const
 Asynchronous query_liquidation_loan_repay_history().
common::RestApiResponse< std::vector< QueryMarginAccountsAllOcoResponseInner > > query_margin_accounts_all_oco (const QueryMarginAccountsAllOcoParams &params={}) const
 Query Margin Account's all OCO (USER_DATA).
template<class CompletionToken>
auto async_query_margin_accounts_all_oco (const QueryMarginAccountsAllOcoParams &params, CompletionToken &&token) const
 Asynchronous query_margin_accounts_all_oco().
common::RestApiResponse< std::vector< QueryMarginAccountsAllOrdersResponseInner > > query_margin_accounts_all_orders (const QueryMarginAccountsAllOrdersParams &params) const
 Query Margin Account's All Orders (USER_DATA).
template<class CompletionToken>
auto async_query_margin_accounts_all_orders (const QueryMarginAccountsAllOrdersParams &params, CompletionToken &&token) const
 Asynchronous query_margin_accounts_all_orders().
common::RestApiResponse< std::vector< QueryMarginAccountsOpenOcoResponseInner > > query_margin_accounts_open_oco (const QueryMarginAccountsOpenOcoParams &params={}) const
 Query Margin Account's Open OCO (USER_DATA).
template<class CompletionToken>
auto async_query_margin_accounts_open_oco (const QueryMarginAccountsOpenOcoParams &params, CompletionToken &&token) const
 Asynchronous query_margin_accounts_open_oco().
common::RestApiResponse< std::vector< QueryMarginAccountsOpenOtootocoOrderListsResponseInner > > query_margin_accounts_open_otootoco_order_lists (const QueryMarginAccountsOpenOtootocoOrderListsParams &params={}) const
 Query Margin Account's Open OTO/OTOCO Order Lists (USER_DATA).
template<class CompletionToken>
auto async_query_margin_accounts_open_otootoco_order_lists (const QueryMarginAccountsOpenOtootocoOrderListsParams &params, CompletionToken &&token) const
 Asynchronous query_margin_accounts_open_otootoco_order_lists().
common::RestApiResponse< std::vector< QueryMarginAccountsTradeListResponseInner > > query_margin_accounts_trade_list (const QueryMarginAccountsTradeListParams &params) const
 Query Margin Account's Trade List (USER_DATA).
template<class CompletionToken>
auto async_query_margin_accounts_trade_list (const QueryMarginAccountsTradeListParams &params, CompletionToken &&token) const
 Asynchronous query_margin_accounts_trade_list().
common::RestApiResponse< std::vector< QueryPreventedMatchesResponseInner > > query_prevented_matches (const QueryPreventedMatchesParams &params) const
 Query Prevented Matches (USER_DATA).
template<class CompletionToken>
auto async_query_prevented_matches (const QueryPreventedMatchesParams &params, CompletionToken &&token) const
 Asynchronous query_prevented_matches().
common::RestApiResponse< std::vector< QuerySpecialKeyListResponseInner > > query_special_key_list (const QuerySpecialKeyListParams &params={}) const
 Query Special key List(Low Latency Trading) (TRADE).
template<class CompletionToken>
auto async_query_special_key_list (const QuerySpecialKeyListParams &params, CompletionToken &&token) const
 Asynchronous query_special_key_list().

Constructor & Destructor Documentation

◆ TradeApi()

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

Member Function Documentation

◆ create_special_key()

common::RestApiResponse< CreateSpecialKeyResponse > binance::margin_trading::rest_api::TradeApi::create_special_key ( const CreateSpecialKeyParams & params) const
nodiscard

Create Special Key(Low-Latency Trading) (TRADE).

POST /sapi/v1/margin/apiKey.

Eligibility

  • Binance Margin offers low-latency trading through a special key, available exclusively to users with VIP level 7 or higher.
  • If you are VIP level 6 or below, please contact your VIP manager for eligibility criterias.
  • All new Margin Special Key users are required to read, understand, and agree to the Margin Special Key Supplemental Product Terms at the master account level before creating a Margin Special Key.
  • Once signed at the master account level, the agreement applies to all sub-accounts. The master account and all sub-accounts (Cross Margin Classic and Portfolio Margin Pro) are authorized to create a Margin Special Key and are subject to the LiquidationLoan policy.

For more information, please refer to FAQ.

Supported Products:

  • Cross Margin
  • Isolated Margin
  • Portfolio Margin Pro

Unsupported Products:

  • Portfolio Margin

We support several types of API keys:

  • Ed25519 (recommended)
  • HMAC
  • RSA

We recommend to use Ed25519 API keys as it should provide the best performance and security out of all supported key types. We accept PKCS#8 (BEGIN PUBLIC KEY). For how to generate an RSA key pair to send API requests on Binance. Please refer to the document below FAQ .

How to use the Margin Special Key

  • Use the below sapi endpoint to create your margin special API Key.
  • For accessing the Cross Margin account, do not send the symbol parameter.
  • For accessing the Isolated Margin account(s), pass the relevant symbol parameter in the API Key creation request.
  • Use the generated API Key (and Secret key, if applicable) to perform margin trading and listenKey generation via Spot REST API (https://api.binance.com/api/v3/*) endpoints.

Read REST API or WebSocket API documentation to learn how to use different API keys

You need to enable Permits “Enable Spot & Margin Trading” option for the API Key which requests this endpoint.

Weight(UID): 1

Security Type: TRADE

Response Notes:

  • Error Code Description
  • UNSUPPORTED_OPERATION : Portfolio Margin is an unsupported product, please change the account type to a supported margin product.
  • Forbidden: Cross Margin Pro accounts require additional agreements, please contact your relationship manager.

See https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/trade#create-special-key

◆ async_create_special_key()

template<class CompletionToken>
auto binance::margin_trading::rest_api::TradeApi::async_create_special_key ( const CreateSpecialKeyParams & params,
CompletionToken && token ) const
inline

Asynchronous create_special_key().

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

◆ delete_special_key()

common::RestApiResponse< boost::json::value > binance::margin_trading::rest_api::TradeApi::delete_special_key ( const DeleteSpecialKeyParams & params = {}) const
nodiscard

Delete Special Key(Low-Latency Trading) (TRADE).

DELETE /sapi/v1/margin/apiKey.

Deleting your Margin Special Key alone does not exit you from the Margin Special Key framework or discharge your obligations under the Margin Special Key Supplemental Product Terms. To fully exit, you must:

  1. Delete your Margin Special Key.
  2. Ensure there are no outstanding liabilities on the account.
  3. Call the Exit Margin Special Key API endpoint.
  4. Confirm the exit status via the API response.

Only after step 4 is completed and the exit status is confirmed by Binance will your account revert to standard liquidation logic and no longer be subject to the Margin Special Key Supplemental Product Terms.

If apiKey is given, apiName will be ignored. If apiName is given with no apiKey, all apikeys with given apiName will be deleted.

You need to enable Permits “Enable Spot & Margin” option for the API Key which requests this endpoint.

Weight(UID): 1

Security Type: TRADE

See https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/trade#delete-special-key

◆ async_delete_special_key()

template<class CompletionToken>
auto binance::margin_trading::rest_api::TradeApi::async_delete_special_key ( const DeleteSpecialKeyParams & params,
CompletionToken && token ) const
inline

Asynchronous delete_special_key().

Completes with void(std::exception_ptr, common::RestApiResponse<boost::json::value>).

◆ query_special_key()

common::RestApiResponse< QuerySpecialKeyResponse > binance::margin_trading::rest_api::TradeApi::query_special_key ( const QuerySpecialKeyParams & params = {}) const
nodiscard

Query Special key(Low Latency Trading) (TRADE).

GET /sapi/v1/margin/apiKey.

Query Special Key Information.

This only applies to Special Key for Low Latency Trading.

Weight(UID): 1

Security Type: TRADE

See https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/trade#query-special-key

◆ async_query_special_key()

template<class CompletionToken>
auto binance::margin_trading::rest_api::TradeApi::async_query_special_key ( const QuerySpecialKeyParams & params,
CompletionToken && token ) const
inline

Asynchronous query_special_key().

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

◆ edit_ip_for_special_key()

common::RestApiResponse< boost::json::value > binance::margin_trading::rest_api::TradeApi::edit_ip_for_special_key ( const EditIpForSpecialKeyParams & params) const
nodiscard

Edit ip for Special Key(Low-Latency Trading) (TRADE).

PUT /sapi/v1/margin/apiKey/ip.

Edit ip restriction. This only applies to Special Key for Low Latency Trading.

You need to enable Permits “Enable Spot & Margin” option for the API Key which requests this endpoint.

Weight(UID): 1

Security Type: TRADE

See https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/trade#edit-ip-for-special-key

◆ async_edit_ip_for_special_key()

template<class CompletionToken>
auto binance::margin_trading::rest_api::TradeApi::async_edit_ip_for_special_key ( const EditIpForSpecialKeyParams & params,
CompletionToken && token ) const
inline

Asynchronous edit_ip_for_special_key().

Completes with void(std::exception_ptr, common::RestApiResponse<boost::json::value>).

◆ exit_special_key_mode()

common::RestApiResponse< boost::json::value > binance::margin_trading::rest_api::TradeApi::exit_special_key_mode ( const ExitSpecialKeyModeParams & params = {}) const
nodiscard

Exit Special Key Mode (TRADE).

POST /sapi/v1/margin/exit-special-key-mode.

Exit the Margin Special Key mode for Cross Margin Classic accounts.

All outstanding liabilities under the Cross Margin Classic account must be fully repaid before calling this endpoint. Deleting the Margin Special Key alone does not constitute a valid exit.

When a user creates a Margin Special API Key, the account enters "Special Key Mode". Upon a successful request, the following actions will be performed atomically:

  1. All existing Margin Special API Keys under the Cross Margin Classic mode account will be deleted.
  2. All pre-execution margin checks (including Open-order-loss calculation) will revert to standard mode.
  3. A cooldown period (default: 24 hours) will be enforced, during which the account will not be permitted to create new Margin Special API Keys.

For more information, please refer to FAQ.

Preconditions:

The following conditions must be met; otherwise the request will be rejected:

  • Account type must be Cross Margin Classic.
  • Account must currently be in Special Key Mode. If not, the request silently succeeds.
  • Account must not be in liquidation.
  • Account must have no liability.

You need to enable "Permits Enable Spot & Margin Trading" option for the API Key which requests this endpoint.

Weight(UID): 10

Security Type: TRADE

See https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/trade#exit-special-key-mode

◆ async_exit_special_key_mode()

template<class CompletionToken>
auto binance::margin_trading::rest_api::TradeApi::async_exit_special_key_mode ( const ExitSpecialKeyModeParams & params,
CompletionToken && token ) const
inline

Asynchronous exit_special_key_mode().

Completes with void(std::exception_ptr, common::RestApiResponse<boost::json::value>).

◆ get_force_liquidation_record()

common::RestApiResponse< GetForceLiquidationRecordResponse > binance::margin_trading::rest_api::TradeApi::get_force_liquidation_record ( const GetForceLiquidationRecordParams & params = {}) const
nodiscard

Get Force Liquidation Record (USER_DATA).

GET /sapi/v1/margin/forceLiquidationRec.

Get Force Liquidation Record

Weight(IP): 1

Security Type: USER_DATA

Notes:

  • Response in descending order

See https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/trade#get-force-liquidation-record

◆ async_get_force_liquidation_record()

template<class CompletionToken>
auto binance::margin_trading::rest_api::TradeApi::async_get_force_liquidation_record ( const GetForceLiquidationRecordParams & params,
CompletionToken && token ) const
inline

Asynchronous get_force_liquidation_record().

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

◆ get_small_liability_exchange_coin_list()

common::RestApiResponse< std::vector< GetSmallLiabilityExchangeCoinListResponseInner > > binance::margin_trading::rest_api::TradeApi::get_small_liability_exchange_coin_list ( const GetSmallLiabilityExchangeCoinListParams & params = {}) const
nodiscard

Get Small Liability Exchange Coin List (USER_DATA).

GET /sapi/v1/margin/exchange-small-liability.

Query the coins which can be small liability exchange

Weight(IP): 100

Security Type: USER_DATA

See https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/trade#get-small-liability-exchange-coin-list

◆ async_get_small_liability_exchange_coin_list()

template<class CompletionToken>
auto binance::margin_trading::rest_api::TradeApi::async_get_small_liability_exchange_coin_list ( const GetSmallLiabilityExchangeCoinListParams & params,
CompletionToken && token ) const
inline

Asynchronous get_small_liability_exchange_coin_list().

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

◆ small_liability_exchange()

common::RestApiResponse< boost::json::value > binance::margin_trading::rest_api::TradeApi::small_liability_exchange ( const SmallLiabilityExchangeParams & params) const
nodiscard

Small Liability Exchange (MARGIN).

POST /sapi/v1/margin/exchange-small-liability.

Small Liability Exchange

Weight(UID): 3000

Security Type: MARGIN

Notes:

  • Only convert once within 6 hours
  • Only liability valuation less than 10 USDT are supported
  • The maximum number of coin is 10

See https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/trade#small-liability-exchange

◆ async_small_liability_exchange()

template<class CompletionToken>
auto binance::margin_trading::rest_api::TradeApi::async_small_liability_exchange ( const SmallLiabilityExchangeParams & params,
CompletionToken && token ) const
inline

Asynchronous small_liability_exchange().

Completes with void(std::exception_ptr, common::RestApiResponse<boost::json::value>).

◆ get_small_liability_exchange_history()

common::RestApiResponse< GetSmallLiabilityExchangeHistoryResponse > binance::margin_trading::rest_api::TradeApi::get_small_liability_exchange_history ( const GetSmallLiabilityExchangeHistoryParams & params) const
nodiscard

Get Small Liability Exchange History (USER_DATA).

GET /sapi/v1/margin/exchange-small-liability-history.

Get Small liability Exchange History

Weight(UID): 100

Security Type: USER_DATA

See https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/trade#get-small-liability-exchange-history

◆ async_get_small_liability_exchange_history()

template<class CompletionToken>
auto binance::margin_trading::rest_api::TradeApi::async_get_small_liability_exchange_history ( const GetSmallLiabilityExchangeHistoryParams & params,
CompletionToken && token ) const
inline

◆ liquidation_loan_repay()

common::RestApiResponse< LiquidationLoanRepayResponse > binance::margin_trading::rest_api::TradeApi::liquidation_loan_repay ( const LiquidationLoanRepayParams & params) const
nodiscard

Liquidation Loan Repay (MARGIN).

POST /sapi/v1/margin/liquidation-loan/repay.

Repays the outstanding cross-margin liquidation loan from the user's spot wallet. A liquidation loan represents the account deficit incurred when account equity turns negative during liquidation (bankruptcy). The repayment amount must be greater than 0 and cannot exceed the remaining loan balance. If the Spot Account has insufficient USDC balance, the repayment will fail.

Weight(UID): 100

Security Type: MARGIN

See https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/trade#liquidation-loan-repay

◆ async_liquidation_loan_repay()

template<class CompletionToken>
auto binance::margin_trading::rest_api::TradeApi::async_liquidation_loan_repay ( const LiquidationLoanRepayParams & params,
CompletionToken && token ) const
inline

Asynchronous liquidation_loan_repay().

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

◆ margin_account_cancel_all_open_orders_on_a_symbol()

common::RestApiResponse< std::vector< MarginAccountCancelAllOpenOrdersOnASymbolResponseInner > > binance::margin_trading::rest_api::TradeApi::margin_account_cancel_all_open_orders_on_a_symbol ( const MarginAccountCancelAllOpenOrdersOnASymbolParams & params) const
nodiscard

Margin Account Cancel all Open Orders on a Symbol (TRADE).

DELETE /sapi/v1/margin/openOrders.

Cancels all active orders on a symbol for margin account.

This includes OCO orders.

Weight(IP): 1

Security Type: TRADE

See https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/trade#margin-account-cancel-all-open-orders-on-asymbol

◆ async_margin_account_cancel_all_open_orders_on_a_symbol()

template<class CompletionToken>
auto binance::margin_trading::rest_api::TradeApi::async_margin_account_cancel_all_open_orders_on_a_symbol ( const MarginAccountCancelAllOpenOrdersOnASymbolParams & params,
CompletionToken && token ) const
inline

◆ query_margin_accounts_open_orders()

common::RestApiResponse< std::vector< QueryMarginAccountsOpenOrdersResponseInner > > binance::margin_trading::rest_api::TradeApi::query_margin_accounts_open_orders ( const QueryMarginAccountsOpenOrdersParams & params = {}) const
nodiscard

Query Margin Account's Open Orders (USER_DATA).

GET /sapi/v1/margin/openOrders.

Query Margin Account's Open Orders

Weight(IP): 10

Security Type: USER_DATA

Notes:

  • If the symbol is not sent, orders for all symbols will be returned in an array.
  • When all symbols are returned, the number of requests counted against the rate limiter is equal to the number of symbols currently trading on the exchange.
  • If isIsolated ="TRUE", symbol must be sent.

See https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/trade#query-margin-accounts-open-orders

◆ async_query_margin_accounts_open_orders()

template<class CompletionToken>
auto binance::margin_trading::rest_api::TradeApi::async_query_margin_accounts_open_orders ( const QueryMarginAccountsOpenOrdersParams & params,
CompletionToken && token ) const
inline

Asynchronous query_margin_accounts_open_orders().

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

◆ margin_account_cancel_oco()

common::RestApiResponse< MarginAccountCancelOcoResponse > binance::margin_trading::rest_api::TradeApi::margin_account_cancel_oco ( const MarginAccountCancelOcoParams & params) const
nodiscard

Margin Account Cancel OCO (TRADE).

DELETE /sapi/v1/margin/orderList.

Cancel an entire Order List for a margin account.

Weight(UID): 1

Security Type: TRADE

Notes:

  • Canceling an individual leg will cancel the entire OCO

See https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/trade#margin-account-cancel-oco

◆ async_margin_account_cancel_oco()

template<class CompletionToken>
auto binance::margin_trading::rest_api::TradeApi::async_margin_account_cancel_oco ( const MarginAccountCancelOcoParams & params,
CompletionToken && token ) const
inline

Asynchronous margin_account_cancel_oco().

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

◆ query_margin_accounts_oco()

common::RestApiResponse< QueryMarginAccountsOcoResponse > binance::margin_trading::rest_api::TradeApi::query_margin_accounts_oco ( const QueryMarginAccountsOcoParams & params = {}) const
nodiscard

Query Margin Account's OCO (USER_DATA).

GET /sapi/v1/margin/orderList.

Retrieves a specific OCO based on provided optional parameters

Weight(IP): 10

Security Type: USER_DATA

See https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/trade#query-margin-accounts-oco

◆ async_query_margin_accounts_oco()

template<class CompletionToken>
auto binance::margin_trading::rest_api::TradeApi::async_query_margin_accounts_oco ( const QueryMarginAccountsOcoParams & params,
CompletionToken && token ) const
inline

Asynchronous query_margin_accounts_oco().

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

◆ margin_account_cancel_order()

common::RestApiResponse< MarginAccountCancelOrderResponse > binance::margin_trading::rest_api::TradeApi::margin_account_cancel_order ( const MarginAccountCancelOrderParams & params) const
nodiscard

Margin Account Cancel Order (TRADE).

DELETE /sapi/v1/margin/order.

Cancel an active order for margin account.

Weight(IP): 10

Security Type: TRADE

Notes:

  • Either orderId or origClientOrderId must be sent.

See https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/trade#margin-account-cancel-order

◆ async_margin_account_cancel_order()

template<class CompletionToken>
auto binance::margin_trading::rest_api::TradeApi::async_margin_account_cancel_order ( const MarginAccountCancelOrderParams & params,
CompletionToken && token ) const
inline

Asynchronous margin_account_cancel_order().

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

◆ margin_account_new_order()

common::RestApiResponse< MarginAccountNewOrderResponse > binance::margin_trading::rest_api::TradeApi::margin_account_new_order ( const MarginAccountNewOrderParams & params) const
nodiscard

Margin Account New Order (TRADE).

POST /sapi/v1/margin/order.

Post a new order for margin account.

Weight: 6(UID) or 1500(UID) when sideEffectType is MARGIN_BUY or AUTO_BORROW_REPAY

Security Type: TRADE

Notes:

  • autoRepayAtCancel is suggested to set as “FALSE” to keep liability unrepaid under high frequent new order/cancel order execution

See https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/trade#margin-account-new-order

◆ async_margin_account_new_order()

template<class CompletionToken>
auto binance::margin_trading::rest_api::TradeApi::async_margin_account_new_order ( const MarginAccountNewOrderParams & params,
CompletionToken && token ) const
inline

Asynchronous margin_account_new_order().

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

◆ query_margin_accounts_order()

common::RestApiResponse< QueryMarginAccountsOrderResponse > binance::margin_trading::rest_api::TradeApi::query_margin_accounts_order ( const QueryMarginAccountsOrderParams & params) const
nodiscard

Query Margin Account's Order (USER_DATA).

GET /sapi/v1/margin/order.

Query Margin Account's Order

Weight(IP): 10

Security Type: USER_DATA

Notes:

  • Either orderId or origClientOrderId must be sent.
  • For some historical orders cummulativeQuoteQty will be < 0, meaning the data is not available at this time.

See https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/trade#query-margin-accounts-order

◆ async_query_margin_accounts_order()

template<class CompletionToken>
auto binance::margin_trading::rest_api::TradeApi::async_query_margin_accounts_order ( const QueryMarginAccountsOrderParams & params,
CompletionToken && token ) const
inline

Asynchronous query_margin_accounts_order().

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

◆ margin_account_new_oco()

common::RestApiResponse< MarginAccountNewOcoResponse > binance::margin_trading::rest_api::TradeApi::margin_account_new_oco ( const MarginAccountNewOcoParams & params) const
nodiscard

Margin Account New OCO (TRADE).

POST /sapi/v1/margin/order/oco.

Send in a new OCO for a margin account

Weight: 6(UID) or 1500(UID) when sideEffectType is MARGIN_BUY or AUTO_BORROW_REPAY

Security Type: TRADE

Notes:

  • autoRepayAtCancel is suggested to set as “FALSE” to keep liability unrepaid under high frequent new order/cancel order execution

See https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/trade#margin-account-new-oco

◆ async_margin_account_new_oco()

template<class CompletionToken>
auto binance::margin_trading::rest_api::TradeApi::async_margin_account_new_oco ( const MarginAccountNewOcoParams & params,
CompletionToken && token ) const
inline

Asynchronous margin_account_new_oco().

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

◆ margin_account_new_oto()

common::RestApiResponse< MarginAccountNewOtoResponse > binance::margin_trading::rest_api::TradeApi::margin_account_new_oto ( const MarginAccountNewOtoParams & params) const
nodiscard

Margin Account New OTO (TRADE).

POST /sapi/v1/margin/order/oto.

Post a new OTO order for margin account:

  • An OTO (One-Triggers-the-Other) is an order list comprised of 2 orders.
  • The first order is called the working order and must be LIMIT or LIMIT_MAKER. Initially, only the working order goes on the order book.
  • The second order is called the pending order. It can be any order type except for MARKET orders using parameter quoteOrderQty. The pending order is only placed on the order book when the working order gets fully filled.
  • If either the working order or the pending order is cancelled individually, the other order in the order list will also be canceled or expired.
  • When the order list is placed, if the working order gets immediately fully filled, the placement response will show the working order as FILLED but the pending order will still appear as PENDING_NEW. You need to query the status of the pending order again to see its updated status.
  • OTOs add 2 orders to the unfilled order count, EXCHANGE_MAX_NUM_ORDERS filter and MAX_NUM_ORDERS filter.

Weight: 6(UID) or 1500(UID) when sideEffectType is MARGIN_BUY or AUTO_BORROW_REPAY

Security Type: TRADE

Notes:

  • autoRepayAtCancel is suggested to set as “FALSE” to keep liability unrepaid under high frequent new order/cancel order execution
  • Depending on the pendingType or workingType, some optional parameters will become mandatory:
Type Additional mandatory parameters Additional information
workingType = LIMIT workingTimeInForce
pendingType = LIMIT pendingPrice, pendingTimeInForce

| pendingType = STOP_LOSS or TAKE_PROFIT | pendingStopPrice and/or pendingTrailingDelta | | | pendingType = STOP_LOSS_LIMIT or TAKE_PROFIT_LIMIT | pendingPrice, pendingStopPrice and/or pendingTrailingDelta, pendingTimeInForce | | | pendingTrailingDelta is provided | pendingPrice | |

See https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/trade#margin-account-new-oto

◆ async_margin_account_new_oto()

template<class CompletionToken>
auto binance::margin_trading::rest_api::TradeApi::async_margin_account_new_oto ( const MarginAccountNewOtoParams & params,
CompletionToken && token ) const
inline

Asynchronous margin_account_new_oto().

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

◆ margin_account_new_otoco()

common::RestApiResponse< MarginAccountNewOtocoResponse > binance::margin_trading::rest_api::TradeApi::margin_account_new_otoco ( const MarginAccountNewOtocoParams & params) const
nodiscard

Margin Account New OTOCO (TRADE).

POST /sapi/v1/margin/order/otoco.

Post a new OTOCO order for margin account:

  • An OTOCO (One-Triggers-One-Cancels-the-Other) is an order list comprised of 3 orders.
  • The first order is called the working order and must be LIMIT or LIMIT_MAKER. Initially, only the working order goes on the order book.
    • The behavior of the working order is the same as the OTO.
  • OTOCO has 2 pending orders (pending above and pending below), forming an OCO pair. The pending orders are only placed on the order book when the working order gets fully filled.
    • The rules of the pending above and pending below follow the same rules as the Order List OCO.
  • OTOCOs add 3 orders against the unfilled order count, EXCHANGE_MAX_NUM_ORDERS filter, and MAX_NUM_ORDERS filter.

Weight: 6(UID) or 1500(UID) when sideEffectType is MARGIN_BUY or AUTO_BORROW_REPAY

Security Type: TRADE

Notes:

  • autoRepayAtCancel is suggested to set as “FALSE” to keep liability unrepaid under high frequent new order/cancel order execution
  • Depending on the pendingAboveType/pendingBelowType or workingType, some optional parameters will become mandatory: | Type | Additional mandatory parameters | Additional information | | ---------------------------------— | ---------------------------------------------------------— | -------------------— | | workingType = LIMIT | workingTimeInForce | | | pendingAboveType= LIMIT_MAKER | pendingAbovePrice | | | pendingAboveType= STOP_LOSS | pendingAboveStopPrice and/or pendingAboveTrailingDelta | | | pendingAboveType=STOP_LOSS_LIMIT | pendingAbovePrice, pendingAboveStopPrice and/or pendingAboveTrailingDelta, pendingAboveTimeInForce | | | pendingBelowType= LIMIT_MAKER | pendingBelowPrice | | | pendingBelowType= STOP_LOSS | pendingBelowStopPrice and/or pendingBelowTrailingDelta | | | pendingBelowType=STOP_LOSS_LIMIT | pendingBelowPrice, pendingBelowStopPrice and/or pendingBelowTrailingDelta, pendingBelowTimeInForce | | | pendingAboveTrailingDelta is provided | pendingAbovePrice | | | pendingBelowTrailingDelta is provided | pendingBelowPrice | |

See https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/trade#margin-account-new-otoco

◆ async_margin_account_new_otoco()

template<class CompletionToken>
auto binance::margin_trading::rest_api::TradeApi::async_margin_account_new_otoco ( const MarginAccountNewOtocoParams & params,
CompletionToken && token ) const
inline

Asynchronous margin_account_new_otoco().

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

◆ margin_manual_liquidation()

common::RestApiResponse< MarginManualLiquidationResponse > binance::margin_trading::rest_api::TradeApi::margin_manual_liquidation ( const MarginManualLiquidationParams & params) const
nodiscard

Margin Manual Liquidation (TRADE).

POST /sapi/v1/margin/manual-liquidation.

Margin Manual Liquidation

Weight(UID): 3000

Security Type: TRADE

Notes:

  • This endpoint supports Cross Margin Classic Mode and Pro Mode.
  • Isolated Margin is only supported in restricted regions.

See https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/trade#margin-manual-liquidation

◆ async_margin_manual_liquidation()

template<class CompletionToken>
auto binance::margin_trading::rest_api::TradeApi::async_margin_manual_liquidation ( const MarginManualLiquidationParams & params,
CompletionToken && token ) const
inline

Asynchronous margin_manual_liquidation().

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

◆ query_current_margin_order_count_usage()

common::RestApiResponse< std::vector< QueryCurrentMarginOrderCountUsageResponseInner > > binance::margin_trading::rest_api::TradeApi::query_current_margin_order_count_usage ( const QueryCurrentMarginOrderCountUsageParams & params = {}) const
nodiscard

Query Current Margin Order Count Usage (TRADE).

GET /sapi/v1/margin/rateLimit/order.

Displays the user's current margin order count usage for all intervals.

Weight(IP): 20

Security Type: TRADE

See https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/trade#query-current-margin-order-count-usage

◆ async_query_current_margin_order_count_usage()

template<class CompletionToken>
auto binance::margin_trading::rest_api::TradeApi::async_query_current_margin_order_count_usage ( const QueryCurrentMarginOrderCountUsageParams & params,
CompletionToken && token ) const
inline

Asynchronous query_current_margin_order_count_usage().

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

◆ query_liquidation_loan()

common::RestApiResponse< QueryLiquidationLoanResponse > binance::margin_trading::rest_api::TradeApi::query_liquidation_loan ( const QueryLiquidationLoanParams & params = {}) const
nodiscard

Query Liquidation Loan (USER_DATA).

GET /sapi/v1/margin/liquidation-loan.

Query the current user's cross-margin liquidation loan information, including the original loan amount, repaid amount, and remaining amount. When a cross-margin account is liquidated and the account equity turns negative (bankruptcy), the system generates a liquidation loan record representing the deficit. This represents the shortfall amount denominated in USDC.

Weight(UID): 100

Security Type: USER_DATA

See https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/trade#query-liquidation-loan

◆ async_query_liquidation_loan()

template<class CompletionToken>
auto binance::margin_trading::rest_api::TradeApi::async_query_liquidation_loan ( const QueryLiquidationLoanParams & params,
CompletionToken && token ) const
inline

Asynchronous query_liquidation_loan().

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

◆ query_liquidation_loan_repay_history()

common::RestApiResponse< QueryLiquidationLoanRepayHistoryResponse > binance::margin_trading::rest_api::TradeApi::query_liquidation_loan_repay_history ( const QueryLiquidationLoanRepayHistoryParams & params = {}) const
nodiscard

Query Liquidation Loan Repay History (USER_DATA).

GET /sapi/v1/margin/liquidation-loan/repay-history.

Query the repayment history of cross-margin liquidation loans (deficit caused by bankruptcy during liquidation). Supports time-range filtering and pagination.

Weight(UID): 100

Security Type: USER_DATA

Notes:

  • The maximum query range is 90 days. If startTime is earlier than 90 days ago, it will be clamped to 90 days ago.
  • Only records with status SUCCESS or PENDING are returned. Failed repayment records are excluded.

See https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/trade#query-liquidation-loan-repay-history

◆ async_query_liquidation_loan_repay_history()

template<class CompletionToken>
auto binance::margin_trading::rest_api::TradeApi::async_query_liquidation_loan_repay_history ( const QueryLiquidationLoanRepayHistoryParams & params,
CompletionToken && token ) const
inline

◆ query_margin_accounts_all_oco()

common::RestApiResponse< std::vector< QueryMarginAccountsAllOcoResponseInner > > binance::margin_trading::rest_api::TradeApi::query_margin_accounts_all_oco ( const QueryMarginAccountsAllOcoParams & params = {}) const
nodiscard

Query Margin Account's all OCO (USER_DATA).

GET /sapi/v1/margin/allOrderList.

Retrieves all OCO for a specific margin account based on provided optional parameters

Weight(IP): 200

Security Type: USER_DATA

See https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/trade#query-margin-accounts-all-oco

◆ async_query_margin_accounts_all_oco()

template<class CompletionToken>
auto binance::margin_trading::rest_api::TradeApi::async_query_margin_accounts_all_oco ( const QueryMarginAccountsAllOcoParams & params,
CompletionToken && token ) const
inline

Asynchronous query_margin_accounts_all_oco().

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

◆ query_margin_accounts_all_orders()

common::RestApiResponse< std::vector< QueryMarginAccountsAllOrdersResponseInner > > binance::margin_trading::rest_api::TradeApi::query_margin_accounts_all_orders ( const QueryMarginAccountsAllOrdersParams & params) const
nodiscard

Query Margin Account's All Orders (USER_DATA).

GET /sapi/v1/margin/allOrders.

Query Margin Account's All Orders

Weight(IP): 200

Security Type: USER_DATA

Notes:

  • If orderId is set, it will get orders >= that orderId. Otherwise the orders within 24 hours are returned.
  • For some historical orders cummulativeQuoteQty will be < 0, meaning the data is not available at this time.
  • Less than 24 hours between startTime and endTime.

See https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/trade#query-margin-accounts-all-orders

◆ async_query_margin_accounts_all_orders()

template<class CompletionToken>
auto binance::margin_trading::rest_api::TradeApi::async_query_margin_accounts_all_orders ( const QueryMarginAccountsAllOrdersParams & params,
CompletionToken && token ) const
inline

Asynchronous query_margin_accounts_all_orders().

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

◆ query_margin_accounts_open_oco()

common::RestApiResponse< std::vector< QueryMarginAccountsOpenOcoResponseInner > > binance::margin_trading::rest_api::TradeApi::query_margin_accounts_open_oco ( const QueryMarginAccountsOpenOcoParams & params = {}) const
nodiscard

Query Margin Account's Open OCO (USER_DATA).

GET /sapi/v1/margin/openOrderList.

Query Margin Account's Open OCO

Weight(IP): 10

Security Type: USER_DATA

See https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/trade#query-margin-accounts-open-oco

◆ async_query_margin_accounts_open_oco()

template<class CompletionToken>
auto binance::margin_trading::rest_api::TradeApi::async_query_margin_accounts_open_oco ( const QueryMarginAccountsOpenOcoParams & params,
CompletionToken && token ) const
inline

Asynchronous query_margin_accounts_open_oco().

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

◆ query_margin_accounts_open_otootoco_order_lists()

common::RestApiResponse< std::vector< QueryMarginAccountsOpenOtootocoOrderListsResponseInner > > binance::margin_trading::rest_api::TradeApi::query_margin_accounts_open_otootoco_order_lists ( const QueryMarginAccountsOpenOtootocoOrderListsParams & params = {}) const
nodiscard

Query Margin Account's Open OTO/OTOCO Order Lists (USER_DATA).

GET /sapi/v1/margin/oto/openOrderList.

Retrieves all open OTO / OTOCO order lists of the margin account.

Notes:

  • The returned list contains order lists whose listOrderStatus is EXECUTING, i.e. at least one order of the list is still open (NEW / PARTIALLY_FILLED).
  • For OTO, the orders array contains 2 orders: the working order and the pending order.
  • For OTOCO, the orders array contains 3 orders: the working order and the two pending orders (pending above / pending below).

Weight(UID): 10

Security Type: USER_DATA

See https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/trade#query-margin-accounts-open-otootoco-order-lists

◆ async_query_margin_accounts_open_otootoco_order_lists()

template<class CompletionToken>
auto binance::margin_trading::rest_api::TradeApi::async_query_margin_accounts_open_otootoco_order_lists ( const QueryMarginAccountsOpenOtootocoOrderListsParams & params,
CompletionToken && token ) const
inline

◆ query_margin_accounts_trade_list()

common::RestApiResponse< std::vector< QueryMarginAccountsTradeListResponseInner > > binance::margin_trading::rest_api::TradeApi::query_margin_accounts_trade_list ( const QueryMarginAccountsTradeListParams & params) const
nodiscard

Query Margin Account's Trade List (USER_DATA).

GET /sapi/v1/margin/myTrades.

Query Margin Account's Trade List

Weight(IP): 10

Security Type: USER_DATA

Notes:

  • If fromId is set, it will get trades >= that fromId. Otherwise the trades within 24 hours are returned.
  • Less than 24 hours between startTime and endTime.

See https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/trade#query-margin-accounts-trade-list

◆ async_query_margin_accounts_trade_list()

template<class CompletionToken>
auto binance::margin_trading::rest_api::TradeApi::async_query_margin_accounts_trade_list ( const QueryMarginAccountsTradeListParams & params,
CompletionToken && token ) const
inline

Asynchronous query_margin_accounts_trade_list().

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

◆ query_prevented_matches()

common::RestApiResponse< std::vector< QueryPreventedMatchesResponseInner > > binance::margin_trading::rest_api::TradeApi::query_prevented_matches ( const QueryPreventedMatchesParams & params) const
nodiscard

Query Prevented Matches (USER_DATA).

GET /sapi/v1/margin/myPreventedMatches.

Displays the list of orders that were expired due to STP. (Self-Trade Prevention).

Weight(IP): 10

Security Type: USER_DATA

Notes:

  • Supported parameter combinations:
  • symbol + preventedMatchId
  • symbol + orderId
  • symbol + orderId + fromPreventedMatchId
  • If orderId is provided, all prevented matches for that order will be returned.
  • If preventedMatchId is provided, the specific prevented match will be returned.
  • A single request returns a maximum of 500 records. If there are more than 500 records, use symbol + orderId + fromPreventedMatchId combination for pagination.

See https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/trade#query-prevented-matches

◆ async_query_prevented_matches()

template<class CompletionToken>
auto binance::margin_trading::rest_api::TradeApi::async_query_prevented_matches ( const QueryPreventedMatchesParams & params,
CompletionToken && token ) const
inline

Asynchronous query_prevented_matches().

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

◆ query_special_key_list()

common::RestApiResponse< std::vector< QuerySpecialKeyListResponseInner > > binance::margin_trading::rest_api::TradeApi::query_special_key_list ( const QuerySpecialKeyListParams & params = {}) const
nodiscard

Query Special key List(Low Latency Trading) (TRADE).

GET /sapi/v1/margin/api-key-list.

This only applies to Special Key for Low Latency Trading.

Weight(UID): 1

Security Type: TRADE

See https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/trade#query-special-key-list

◆ async_query_special_key_list()

template<class CompletionToken>
auto binance::margin_trading::rest_api::TradeApi::async_query_special_key_list ( const QuerySpecialKeyListParams & params,
CompletionToken && token ) const
inline

Asynchronous query_special_key_list().

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