From d6399b92aaba3a13d8eb0dff61b4b57846d371a7 Mon Sep 17 00:00:00 2001 From: Disney <4507101+discountry@users.noreply.github.com> Date: Fri, 27 Feb 2026 11:37:44 +0800 Subject: [PATCH] Feat/support binance (#22) * add docs * Add Binance exchange support - Updated the environment configuration to include Binance as a selectable exchange option. - Enhanced the README documentation to reflect the addition of Binance. - Implemented the Binance exchange adapter and integrated it into the existing exchange framework. - Modified the basis arbitrage strategy to support Binance alongside existing exchanges. - Added tests to ensure proper functionality and integration of Binance within the trading system. * Enhance README with detailed Binance exchange configuration - Added comprehensive instructions for setting up Binance as an exchange option. - Included environment variable specifications for API keys, market types, and trading symbols. - Provided examples for both perpetual and spot trading strategies. - Clarified the use of WebSocket and REST for the Binance adapter. * Enhance exchange support and testing framework - Added a new test suite for exchange contracts to ensure consistency and functionality across supported exchanges. - Refactored exchange ID handling to utilize a centralized list of supported exchanges, improving maintainability. - Updated CLI argument parsing and help documentation to reflect the new exchange structure. - Introduced utility functions for validating supported exchanges and their display names. - Enhanced the BasisApp and strategy runner to leverage the new exchange validation logic. - Added a new test command for running exchange-related tests. * Refactor exchange contract tests and update CLI commands - Removed the trailing supported exchanges set and simplified the logic for trailing stop support in the exchange contract tests. - Updated the test command for exchange contracts to exclude unnecessary tests, streamlining the testing process. - Enhanced test descriptions for clarity and improved understanding of the functionality being tested. --- .env.example | 13 +- README.md | 34 +- README_en.md | 34 +- docs/binance/binance-spot/CHANGELOG.md | 2906 +++++++++ .../binance/binance-spot/PROD-TERMS-OF-USE.md | 9 + docs/binance/binance-spot/README.md | 255 + docs/binance/binance-spot/demo-mode.md | 16 + .../binance-spot/demo-mode_CHANGELOG.md | 16 + .../demo-mode_DEMO-TERMS-OF-USE.md | 9 + .../binance-spot/demo-mode_general-info.md | 148 + docs/binance/binance-spot/enums.md | 239 + docs/binance/binance-spot/errors.md | 832 +++ .../binance-spot/faqs_api_key_types.md | 87 + .../binance-spot/faqs_commission_faq.md | 137 + .../binance-spot/faqs_market_data_only.md | 47 + docs/binance/binance-spot/faqs_opo.md | 64 + .../faqs_order_amend_keep_priority.md | 286 + .../faqs_order_count_decrement.md | 391 ++ .../binance-spot/faqs_pegged_orders.md | 150 + docs/binance/binance-spot/faqs_sbe_faq.md | 158 + docs/binance/binance-spot/faqs_sor_faq.md | 165 + .../binance-spot/faqs_spot_glossary.md | 608 ++ docs/binance/binance-spot/faqs_stp_faq.md | 369 ++ .../binance-spot/faqs_trailing-stop-faq.md | 275 + docs/binance/binance-spot/filters.md | 324 + docs/binance/binance-spot/fix-api.md | 5585 +++++++++++++++++ docs/binance/binance-spot/index.md | 2906 +++++++++ .../binance-spot/rest-api.md.error.txt | 2 + .../rest-api_account-endpoints.md | 976 +++ .../binance-spot/rest-api_data-sources.md | 15 + .../binance-spot/rest-api_error-codes.md | 14 + .../rest-api_general-api-information.md | 32 + .../rest-api_general-endpoints.md | 137 + ...st-api_general-information-on-endpoints.md | 9 + .../rest-api_http-return-codes.md | 11 + docs/binance/binance-spot/rest-api_limits.md | 39 + .../rest-api_market-data-endpoints.md | 981 +++ .../binance-spot/rest-api_request-security.md | 600 ++ .../rest-api_trading-endpoints.md | 3306 ++++++++++ .../binance-spot/sbe-market-data-streams.md | 100 + docs/binance/binance-spot/testnet.md | 1204 ++++ .../testnet_TESTNET-TERMS-OF-USE.md | 9 + docs/binance/binance-spot/testnet_enums.md | 213 + docs/binance/binance-spot/testnet_errors.md | 833 +++ docs/binance/binance-spot/testnet_filters.md | 324 + docs/binance/binance-spot/testnet_fix-api.md | 5582 ++++++++++++++++ .../binance-spot/testnet_general-info.md | 235 + .../testnet_rest-api_account-endpoints.md | 910 +++ .../testnet_rest-api_data-sources.md | 15 + .../testnet_rest-api_error-codes.md | 14 + ...estnet_rest-api_general-api-information.md | 22 + .../testnet_rest-api_general-endpoints.md | 138 + ...st-api_general-information-on-endpoints.md | 9 + .../testnet_rest-api_http-return-codes.md | 11 + .../binance-spot/testnet_rest-api_limits.md | 39 + .../testnet_rest-api_market-data-endpoints.md | 981 +++ .../testnet_rest-api_request-security.md | 600 ++ .../testnet_rest-api_trading-endpoints.md | 3185 ++++++++++ .../testnet_sbe-market-data-streams.md | 99 + .../binance-spot/testnet_user-data-stream.md | 293 + .../testnet_web-socket-streams.md | 434 ++ .../testnet_websocket-api_account-requests.md | 1149 ++++ ...t_websocket-api_authentication-requests.md | 111 + .../testnet_websocket-api_data-sources.md | 37 + .../testnet_websocket-api_event-format.md | 42 + ...t_websocket-api_general-api-information.md | 29 + .../testnet_websocket-api_general-requests.md | 130 + ...tnet_websocket-api_market-data-requests.md | 1037 +++ .../testnet_websocket-api_rate-limits.md | 178 + .../testnet_websocket-api_request-format.md | 54 + .../testnet_websocket-api_request-security.md | 589 ++ .../testnet_websocket-api_response-format.md | 86 + ...et_websocket-api_session-authentication.md | 37 + .../testnet_websocket-api_trading-requests.md | 3324 ++++++++++ ...websocket-api_user-data-stream-requests.md | 164 + docs/binance/binance-spot/user-data-stream.md | 293 + .../binance-spot/web-socket-api.md.error.txt | 2 + .../binance-spot/web-socket-streams.md | 434 ++ .../websocket-api_account-requests.md | 1147 ++++ .../websocket-api_authentication-requests.md | 111 + .../websocket-api_data-sources.md | 37 + .../websocket-api_event-format.md | 42 + .../websocket-api_general-api-information.md | 30 + .../websocket-api_general-requests.md | 131 + .../websocket-api_market-data-requests.md | 1037 +++ .../binance-spot/websocket-api_rate-limits.md | 178 + .../websocket-api_request-format.md | 54 + .../websocket-api_request-security.md | 589 ++ .../websocket-api_response-format.md | 86 + .../websocket-api_session-authentication.md | 37 + .../websocket-api_trading-requests.md | 3564 +++++++++++ ...websocket-api_user-data-stream-requests.md | 164 + .../docs_derivatives_Introduction.md | 10 + .../docs_derivatives_change-log.md | 3369 ++++++++++ ..._coin-margined-futures_account_rest-api.md | 12 + ...es_account_rest-api_Account-Information.md | 55 + ...ccount_rest-api_Futures-Account-Balance.md | 52 + ...ount_rest-api_Get-Current-Position-Mode.md | 52 + ...t-Download-Id-For-Futures-Order-History.md | 71 + ...t-Download-Id-For-Futures-Trade-History.md | 71 + ...load-Id-For-Futures-Transaction-History.md | 71 + ...Future-Account-Transaction-History-List.md | 8 + ...tures-Order-History-Download-Link-by-Id.md | 70 + ...i_Get-Futures-Trade-Download-Link-by-Id.md | 70 + ...Transaction-History-Download-Link-by-Id.md | 70 + ...res_account_rest-api_Get-Income-History.md | 100 + ...ount_rest-api_Notional-Bracket-for-Pair.md | 60 + ...nt_rest-api_Notional-Bracket-for-Symbol.md | 58 + ...s_account_rest-api_User-Commission-Rate.md | 58 + ...-margined-futures_account_websocket-api.md | 59 + ...count_websocket-api_Account-Information.md | 59 + ...coin-margined-futures_common-definition.md | 248 + ...atives_coin-margined-futures_error-code.md | 823 +++ ...ives_coin-margined-futures_general-info.md | 416 ++ ...n-margined-futures_market-data_rest-api.md | 34 + ...api_24hr-Ticker-Price-Change-Statistics.md | 56 + ...ined-futures_market-data_rest-api_Basis.md | 87 + ..._market-data_rest-api_Check-Server-time.md | 34 + ...st-api_Compressed-Aggregate-Trades-List.md | 84 + ...tinuous-Contract-Kline-Candlestick-Data.md | 107 + ...es_market-data_rest-api_Delist-Schedule.md | 12 + ...rket-data_rest-api_Exchange-Information.md | 34 + ...s_market-data_rest-api_Get-Funding-Info.md | 24 + ...nding-Rate-History-of-Perpetual-Futures.md | 72 + ...market-data_rest-api_Index-Constituents.md | 46 + ...-api_Index-Price-Kline-Candlestick-Data.md | 96 + ...ata_rest-api_Index-Price-and-Mark-Price.md | 54 + ...et-data_rest-api_Kline-Candlestick-Data.md | 116 + ...s_market-data_rest-api_Long-Short-Ratio.md | 79 + ...t-api_Mark-Price-Kline-Candlestick-Data.md | 96 + ..._market-data_rest-api_Old-Trades-Lookup.md | 64 + ...-data_rest-api_Open-Interest-Statistics.md | 87 + ...ures_market-data_rest-api_Open-Interest.md | 46 + ...futures_market-data_rest-api_Order-Book.md | 74 + ...-data_rest-api_Premium-Index-Kline-Data.md | 94 + ...market-data_rest-api_Recent-Trades-List.md | 56 + ...-data_rest-api_Symbol-Order-Book-Ticker.md | 56 + ...arket-data_rest-api_Symbol-Price-Ticker.md | 56 + ...ket-data_rest-api_Taker-Buy-Sell-Volume.md | 87 + ...a_rest-api_Top-Long-Short-Account-Ratio.md | 77 + ...ta_rest-api_Top-Trader-Long-Short-Ratio.md | 79 + ...ined-futures_portfolio-margin-endpoints.md | 54 + ...es_coin-margined-futures_trade_rest-api.md | 251 + ...tures_trade_rest-api_Account-Trade-List.md | 107 + ...gined-futures_trade_rest-api_All-Orders.md | 102 + ...de_rest-api_Auto-Cancel-All-Open-Orders.md | 72 + ...s_trade_rest-api_Cancel-All-Open-Orders.md | 58 + ...s_trade_rest-api_Cancel-Multiple-Orders.md | 78 + ...ned-futures_trade_rest-api_Cancel-Order.md | 69 + ..._trade_rest-api_Change-Initial-Leverage.md | 67 + ...tures_trade_rest-api_Change-Margin-Type.md | 67 + ...res_trade_rest-api_Change-Position-Mode.md | 60 + ..._trade_rest-api_Current-All-Open-Orders.md | 64 + ...trade_rest-api_Get-Order-Modify-History.md | 97 + ...-api_Get-Position-Margin-Change-History.md | 86 + ...est-api_Modify-Isolated-Position-Margin.md | 82 + ...s_trade_rest-api_Modify-Multiple-Orders.md | 127 + ...ned-futures_trade_rest-api_Modify-Order.md | 108 + ...es_trade_rest-api_Place-Multiple-Orders.md | 201 + ...st-api_Position-ADL-Quantile-Estimation.md | 65 + ...res_trade_rest-api_Position-Information.md | 72 + ...trade_rest-api_Query-Current-Open-Order.md | 73 + ...ined-futures_trade_rest-api_Query-Order.md | 76 + ...tures_trade_rest-api_Users-Force-Orders.md | 41 + ...in-margined-futures_trade_websocket-api.md | 251 + ...utures_trade_websocket-api_Cancel-Order.md | 79 + ...utures_trade_websocket-api_Modify-Order.md | 115 + ...rade_websocket-api_Position-Information.md | 75 + ...futures_trade_websocket-api_Query-Order.md | 86 + ...coin-margined-futures_user-data-streams.md | 38 + ...data-streams_Close-User-Data-Stream-Wsp.md | 55 + ...ser-data-streams_Close-User-Data-Stream.md | 34 + ...eams_Event-Account-Configuration-Update.md | 24 + ...reams_Event-Balance-and-Position-Update.md | 47 + ...res_user-data-streams_Event-GRID-UPDATE.md | 31 + ...res_user-data-streams_Event-Margin-Call.md | 26 + ...es_user-data-streams_Event-Order-Update.md | 92 + ...user-data-streams_Event-STRATEGY-UPDATE.md | 49 + ...-streams_Event-User-Data-Stream-Expired.md | 30 + ...-streams_Keepalive-User-Data-Stream-Wsp.md | 55 + ...data-streams_Keepalive-User-Data-Stream.md | 34 + ...data-streams_Start-User-Data-Stream-Wsp.md | 55 + ...ser-data-streams_Start-User-Data-Stream.md | 34 + ...ined-futures_websocket-api-general-info.md | 338 + ...rgined-futures_websocket-market-streams.md | 31 + ...-market-streams_Aggregate-Trade-Streams.md | 29 + ...-market-streams_All-Book-Tickers-Stream.md | 29 + ...ms_All-Market-Liquidation-Order-Streams.md | 29 + ...-streams_All-Market-Mini-Tickers-Stream.md | 29 + ...rket-streams_All-Market-Tickers-Streams.md | 29 + ...uous-Contract-Kline-Candlestick-Streams.md | 55 + ...ket-market-streams_Contract-Info-Stream.md | 29 + ...-market-streams_Diff-Book-Depth-Streams.md | 29 + ...-to-manage-a-local-order-book-correctly.md | 21 + ...streams_Index-Kline-Candlestick-Streams.md | 51 + ...ocket-market-streams_Index-Price-Stream.md | 29 + ...s_Individual-Symbol-Book-Ticker-Streams.md | 29 + ...ms_Individual-Symbol-Mini-Ticker-Stream.md | 29 + ...treams_Individual-Symbol-Ticker-Streams.md | 29 + ...arket-streams_Kline-Candlestick-Streams.md | 49 + ...arket-streams_Liquidation-Order-Streams.md | 31 + ...ve-Subscribing-Unsubscribing-to-streams.md | 87 + ...ms_Mark-Price-Kline-Candlestick-Streams.md | 51 + ...socket-market-streams_Mark-Price-Stream.md | 29 + ...ams_Mark-Price-of-All-Symbols-of-a-Pair.md | 29 + ...rket-streams_Partial-Book-Depth-Streams.md | 29 + ...ocs_derivatives_options-trading_account.md | 52 + ...ns-trading_account_Account-Funding-Flow.md | 92 + ..._options-trading_account_Funds-Transfer.md | 16 + ...tives_options-trading_common-definition.md | 150 + ..._derivatives_options-trading_error-code.md | 651 ++ ...erivatives_options-trading_general-info.md | 276 + ...derivatives_options-trading_market-data.md | 34 + ...ata_24hr-Ticker-Price-Change-Statistics.md | 48 + ...rading_market-data_Exchange-Information.md | 34 + ...market-data_Historical-Exercise-Records.md | 75 + ...ding_market-data_Kline-Candlestick-Data.md | 82 + ...tions-trading_market-data_Open-Interest.md | 56 + ...s-trading_market-data_Option-Mark-Price.md | 48 + ..._options-trading_market-data_Order-Book.md | 74 + ...ing_market-data_Recent-Block-Trade-List.md | 56 + ...-trading_market-data_Recent-Trades-List.md | 56 + ...trading_market-data_Symbol-Price-Ticker.md | 48 + ...s-trading_market-data_Test-Connectivity.md | 34 + ...ptions-trading_market-maker-block-trade.md | 70 + ...er-block-trade_Accept-Block-Trade-Order.md | 60 + ...er-block-trade_Account-Block-Trade-List.md | 72 + ...er-block-trade_Cancel-Block-Trade-Order.md | 60 + ...er-block-trade_Extend-Block-Trade-Order.md | 60 + ...er-block-trade_Query-Block-Trade-Detail.md | 60 + ...ker-block-trade_Query-Block-Trade-Order.md | 80 + ..._options-trading_market-maker-endpoints.md | 60 + ...s_Auto-Cancel-All-Open-Orders-Heartbeat.md | 62 + ..._Get-Auto-Cancel-All-Open-Orders-Config.md | 62 + ...ts_Reset-Market-Maker-Protection-Config.md | 60 + ..._Set-Auto-Cancel-All-Open-Orders-Config.md | 72 + ...ints_Set-Market-Maker-Protection-Config.md | 92 + .../docs_derivatives_options-trading_trade.md | 145 + ...ptions-trading_trade_Account-Trade-List.md | 92 + ..._Cancel-All-Option-Orders-By-Underlying.md | 60 + ...ing_trade_Cancel-Multiple-Option-Orders.md | 78 + ...tions-trading_trade_Cancel-Option-Order.md | 75 + ...el-all-Option-orders-on-specific-symbol.md | 60 + ...ading_trade_Option-Position-Information.md | 60 + ...ons-trading_trade_Place-Multiple-Orders.md | 175 + ..._trade_Query-Current-Open-Option-Orders.md | 84 + ...rading_trade_Query-Option-Order-History.md | 92 + ...ptions-trading_trade_Query-Single-Order.md | 89 + ...s_options-trading_trade_User-Commission.md | 52 + ...ions-trading_trade_User-Exercise-Record.md | 84 + ...tives_options-trading_user-data-streams.md | 17 + ...ser-data-streams_Close-User-Data-Stream.md | 34 + ...ng_user-data-streams_Event-Account-data.md | 37 + ...reams_Event-Balance-and-Position-Update.md | 37 + ...ng_user-data-streams_Event-Greek-Update.md | 29 + ...ng_user-data-streams_Event-Order-update.md | 65 + ...er-data-streams_Event-Risk-level-change.md | 40 + ...-streams_Event-User-Data-Stream-Expired.md | 30 + ...data-streams_Keepalive-User-Data-Stream.md | 34 + ...ser-data-streams_Start-User-Data-Stream.md | 34 + ...ptions-trading_websocket-market-streams.md | 46 + ...websocket-market-streams_24-hour-TICKER.md | 34 + ...ing_websocket-market-streams_Bookticker.md | 34 + ...-market-streams_Diff-Book-Depth-Streams.md | 34 + ...-to-manage-a-local-order-book-correctly.md | 21 + ...cket-market-streams_Index-Price-Streams.md | 32 + ...arket-streams_Kline-Candlestick-Streams.md | 40 + ...ve-Subscribing-Unsubscribing-to-streams.md | 130 + ...ing_websocket-market-streams_Mark-Price.md | 34 + ...ebsocket-market-streams_New-Symbol-Info.md | 34 + ..._websocket-market-streams_Open-Interest.md | 34 + ...rket-streams_Partial-Book-Depth-Streams.md | 34 + ..._websocket-market-streams_Trade-Streams.md | 34 + ...erivatives_portfolio-margin-pro_account.md | 52 + ...rtfolio-margin-pro_account_BNB-transfer.md | 68 + ...ccount_Change-Auto-repay-futures-Status.md | 60 + ...-Portfolio-Margin-Bankruptcy-Loan-Repay.md | 62 + ...margin-pro_account_Fund-Auto-collection.md | 55 + ...in-pro_account_Fund-Collection-by-Asset.md | 60 + ...o_account_Get-Auto-repay-futures-Status.md | 52 + ...lassic-Portfolio-Margin-Account-Info-V2.md | 52 + ...t-Classic-Portfolio-Margin-Balance-Info.md | 58 + ...argin-pro_account_Get-Delta-Mode-Status.md | 52 + ...ble-Earn-Asset-Balance-Portfolio-Margin.md | 68 + ...Portfolio-Margin-Bankruptcy-Loan-Amount.md | 54 + ...argin-Negative-Balance-Interest-History.md | 78 + ...argin-Pro-Bankruptcy-Loan-Repay-History.md | 85 + ..._account_Repay-futures-Negative-Balance.md | 60 + ...io-margin-pro_account_Switch-Delta-Mode.md | 60 + ...ccount_Transfer-LDUSDT-Portfolio-Margin.md | 74 + ...vatives_portfolio-margin-pro_error-code.md | 1444 +++++ ...tives_portfolio-margin-pro_general-info.md | 456 ++ ...atives_portfolio-margin-pro_market-data.md | 46 + ...lassic-Portfolio-Margin-Collateral-Rate.md | 34 + ...ata_Get-Portfolio-Margin-Asset-Leverage.md | 29 + ...folio-Margin-Pro-Tiered-Collateral-Rate.md | 52 + ...o_portfolio-margin-pro-user-data-stream.md | 10 + ...-user-data-stream_Event-riskLevelChange.md | 27 + ...cs_derivatives_portfolio-margin_account.md | 64 + ...olio-margin_account_Account-Information.md | 52 + ...s_portfolio-margin_account_BNB-transfer.md | 70 + ...count_CM-Notional-and-Leverage-Brackets.md | 58 + ...ccount_Change-Auto-repay-futures-Status.md | 60 + ...rgin_account_Change-CM-Initial-Leverage.md | 66 + ...-margin_account_Change-CM-Position-Mode.md | 60 + ...rgin_account_Change-UM-Initial-Leverage.md | 66 + ...-margin_account_Change-UM-Position-Mode.md | 60 + ...lio-margin_account_Fund-Auto-collection.md | 57 + ...margin_account_Fund-Collection-by-Asset.md | 60 + ...n_account_Get-Auto-repay-futures-Status.md | 52 + ...io-margin_account_Get-CM-Account-Detail.md | 52 + ...in_account_Get-CM-Current-Position-Mode.md | 52 + ...io-margin_account_Get-CM-Income-History.md | 101 + ...ownload-Id-For-UM-Futures-Order-History.md | 71 + ...ownload-Id-For-UM-Futures-Trade-History.md | 71 + ...d-Id-For-UM-Futures-Transaction-History.md | 71 + ..._Get-Margin-BorrowLoan-Interest-History.md | 108 + ...margin_account_Get-UM-Account-Detail-V2.md | 52 + ...io-margin_account_Get-UM-Account-Detail.md | 52 + ...in_account_Get-UM-Current-Position-Mode.md | 52 + ...n_account_Get-UM-Futures-Account-Config.md | 52 + ...et-UM-Futures-Order-Download-Link-by-Id.md | 70 + ...in_account_Get-UM-Futures-Symbol-Config.md | 58 + ...et-UM-Futures-Trade-Download-Link-by-Id.md | 70 + ...Futures-Transaction-Download-Link-by-Id.md | 70 + ...io-margin_account_Get-UM-Income-History.md | 101 + ...account_Get-User-Commission-Rate-for-CM.md | 58 + ...account_Get-User-Commission-Rate-for-UM.md | 58 + ...tfolio-margin_account_Margin-Max-Borrow.md | 60 + ...M-Trading-Quantitative-Rules-Indicators.md | 64 + ...n_account_Query-CM-Position-Information.md | 80 + ...margin_account_Query-Margin-Loan-Record.md | 110 + ...argin_account_Query-Margin-Max-Withdraw.md | 60 + ...argin_account_Query-Margin-repay-Record.md | 110 + ...argin-Negative-Balance-Interest-History.md | 84 + ...n_account_Query-UM-Position-Information.md | 71 + ...r-Negative-Balance-Auto-Exchange-Record.md | 71 + ...io-margin_account_Query-User-Rate-Limit.md | 52 + ..._account_Repay-futures-Negative-Balance.md | 52 + ...count_UM-Notional-and-Leverage-Brackets.md | 58 + ...ives_portfolio-margin_common-definition.md | 255 + ...derivatives_portfolio-margin_error-code.md | 891 +++ ...rivatives_portfolio-margin_general-info.md | 392 ++ ...erivatives_portfolio-margin_market-data.md | 34 + ...docs_derivatives_portfolio-margin_trade.md | 166 + ...olio-margin_trade_CM-Account-Trade-List.md | 101 + ...ade_CM-Position-ADL-Quantile-Estimation.md | 64 + ...e_Cancel-All-CM-Open-Conditional-Orders.md | 58 + ...-margin_trade_Cancel-All-CM-Open-Orders.md | 58 + ...e_Cancel-All-UM-Open-Conditional-Orders.md | 58 + ...-margin_trade_Cancel-All-UM-Open-Orders.md | 58 + ...argin_trade_Cancel-CM-Conditional-Order.md | 72 + ..._portfolio-margin_trade_Cancel-CM-Order.md | 72 + ...gin-Account-All-Open-Orders-on-a-Symbol.md | 60 + ..._trade_Cancel-Margin-Account-OCO-Orders.md | 86 + ...argin_trade_Cancel-Margin-Account-Order.md | 82 + ...argin_trade_Cancel-UM-Conditional-Order.md | 72 + ..._portfolio-margin_trade_Cancel-UM-Order.md | 72 + ...in_trade_Get-UM-Futures-BNB-Burn-Status.md | 52 + ...olio-margin_trade_Margin-Account-Borrow.md | 66 + ...lio-margin_trade_Margin-Account-New-OCO.md | 163 + ...-margin_trade_Margin-Account-Repay-Debt.md | 79 + ...folio-margin_trade_Margin-Account-Repay.md | 66 + ...-margin_trade_Margin-Account-Trade-List.md | 99 + ..._portfolio-margin_trade_Modify-CM-Order.md | 107 + ..._portfolio-margin_trade_Modify-UM-Order.md | 107 + ...o-margin_trade_New-CM-Conditional-Order.md | 201 + ...ves_portfolio-margin_trade_New-CM-Order.md | 148 + ...portfolio-margin_trade_New-Margin-Order.md | 156 + ...o-margin_trade_New-UM-Conditional-Order.md | 229 + ...n_trade_Query-All-CM-Conditional-Orders.md | 94 + ...tfolio-margin_trade_Query-All-CM-Orders.md | 97 + ...-All-Current-CM-Open-Conditional-Orders.md | 60 + ..._trade_Query-All-Current-CM-Open-Orders.md | 66 + ...-All-Current-UM-Open-Conditional-Orders.md | 59 + ..._trade_Query-All-Current-UM-Open-Orders.md | 60 + ...n_trade_Query-All-Margin-Account-Orders.md | 91 + ...n_trade_Query-All-UM-Conditional-Orders.md | 90 + ...tfolio-margin_trade_Query-All-UM-Orders.md | 92 + ...rade_Query-CM-Conditional-Order-History.md | 81 + ...gin_trade_Query-CM-Modify-Order-History.md | 96 + ...s_portfolio-margin_trade_Query-CM-Order.md | 78 + ...Query-Current-CM-Open-Conditional-Order.md | 75 + ...argin_trade_Query-Current-CM-Open-Order.md | 75 + ...n_trade_Query-Current-Margin-Open-Order.md | 65 + ...Query-Current-UM-Open-Conditional-Order.md | 75 + ...argin_trade_Query-Current-UM-Open-Order.md | 75 + ...o-margin_trade_Query-Margin-Account-OCO.md | 70 + ...gin_trade_Query-Margin-Account-Open-OCO.md | 54 + ...margin_trade_Query-Margin-Account-Order.md | 77 + ...rgin_trade_Query-Margin-Account-all-OCO.md | 82 + ...rade_Query-UM-Conditional-Order-History.md | 79 + ...gin_trade_Query-UM-Modify-Order-History.md | 96 + ...s_portfolio-margin_trade_Query-UM-Order.md | 78 + ...argin_trade_Query-Users-CM-Force-Orders.md | 91 + ...n_trade_Query-Users-Margin-Force-Orders.md | 82 + ...argin_trade_Query-Users-UM-Force-Orders.md | 91 + ...ade_Toggle-BNB-Burn-On-UM-Futures-Trade.md | 62 + ...olio-margin_trade_UM-Account-Trade-List.md | 90 + ...ade_UM-Position-ADL-Quantile-Estimation.md | 65 + ...ives_portfolio-margin_user-data-streams.md | 23 + ...ser-data-streams_Close-User-Data-Stream.md | 34 + ...ms_Event-Conditional-Order-Trade-Update.md | 60 + ...nt-Futures-Account-Configuration-Update.md | 24 + ...ent-Futures-Balance-and-Position-Update.md | 60 + ...data-streams_Event-Futures-Order-update.md | 66 + ...ser-data-streams_Event-Liability-Update.md | 24 + ...ata-streams_Event-Margin-Account-Update.md | 24 + ...ata-streams_Event-Margin-Balance-Update.md | 24 + ...-data-streams_Event-Margin-Order-Update.md | 33 + ...data-streams_Event-OpenOrderLoss-Update.md | 24 + ...-streams_Event-User-Data-Stream-Expired.md | 30 + ...user-data-streams_Event-riskLevelChange.md | 27 + ...data-streams_Keepalive-User-Data-Stream.md | 34 + ...ser-data-streams_Start-User-Data-Stream.md | 34 + .../docs_derivatives_quick-start.md | 64 + ..._usds-margined-futures_account_rest-api.md | 12 + ...futures_account_rest-api_Account-Config.md | 52 + ...account_rest-api_Account-Information-V2.md | 60 + ...account_rest-api_Account-Information-V3.md | 60 + ...unt_rest-api_Futures-Account-Balance-V2.md | 52 + ...unt_rest-api_Futures-Account-Balance-V3.md | 52 + ...s-Trading-Quantitative-Rules-Indicators.md | 67 + ...es_account_rest-api_Get-BNB-Burn-Status.md | 52 + ..._rest-api_Get-Current-Multi-Assets-Mode.md | 52 + ...ount_rest-api_Get-Current-Position-Mode.md | 52 + ...t-Download-Id-For-Futures-Order-History.md | 71 + ...t-Download-Id-For-Futures-Trade-History.md | 71 + ...load-Id-For-Futures-Transaction-History.md | 71 + ...Future-Account-Transaction-History-List.md | 8 + ...tures-Order-History-Download-Link-by-Id.md | 70 + ...i_Get-Futures-Trade-Download-Link-by-Id.md | 70 + ...Transaction-History-Download-Link-by-Id.md | 70 + ...res_account_rest-api_Get-Income-History.md | 101 + ...rest-api_Notional-and-Leverage-Brackets.md | 66 + ...tures_account_rest-api_Query-Rate-Limit.md | 52 + ...-futures_account_rest-api_Symbol-Config.md | 58 + ...st-api_Toggle-BNB-Burn-On-Futures-Trade.md | 60 + ...s_account_rest-api_User-Commission-Rate.md | 58 + ...-margined-futures_account_websocket-api.md | 59 + ...nt_websocket-api_Account-Information-V2.md | 67 + ...count_websocket-api_Account-Information.md | 67 + ...t_websocket-api_Futures-Account-Balance.md | 59 + ...usds-margined-futures_common-definition.md | 274 + ...rivatives_usds-margined-futures_convert.md | 60 + ...s-margined-futures_convert_Accept-Quote.md | 60 + ...s-margined-futures_convert_Order-Status.md | 56 + ...ined-futures_convert_Send-quote-request.md | 95 + ...atives_usds-margined-futures_error-code.md | 1079 ++++ ...tives_usds-margined-futures_faq_stp-faq.md | 196 + ...ives_usds-margined-futures_general-info.md | 445 ++ ...s-margined-futures_market-data_rest-api.md | 34 + ...api_24hr-Ticker-Price-Change-Statistics.md | 58 + ...d-futures_market-data_rest-api_ADL-Risk.md | 54 + ...ined-futures_market-data_rest-api_Basis.md | 87 + ..._market-data_rest-api_Check-Server-Time.md | 34 + ...-api_Composite-Index-Symbol-Information.md | 48 + ...st-api_Compressed-Aggregate-Trades-List.md | 88 + ...tinuous-Contract-Kline-Candlestick-Data.md | 106 + ...es_market-data_rest-api_Delist-Schedule.md | 12 + ...res_market-data_rest-api_Delivery-Price.md | 48 + ...rket-data_rest-api_Exchange-Information.md | 34 + ...-data_rest-api_Get-Funding-Rate-History.md | 74 + ...ket-data_rest-api_Get-Funding-Rate-Info.md | 32 + ...market-data_rest-api_Index-Constituents.md | 50 + ...-api_Index-Price-Kline-Candlestick-Data.md | 94 + ...et-data_rest-api_Insurance-Fund-Balance.md | 54 + ...et-data_rest-api_Kline-Candlestick-Data.md | 94 + ...s_market-data_rest-api_Long-Short-Ratio.md | 78 + ...t-api_Mark-Price-Kline-Candlestick-Data.md | 94 + ...futures_market-data_rest-api_Mark-Price.md | 54 + ..._rest-api_Multi-Assets-Mode-Asset-Index.md | 56 + ..._market-data_rest-api_Old-Trades-Lookup.md | 65 + ...-data_rest-api_Open-Interest-Statistics.md | 78 + ...ures_market-data_rest-api_Open-Interest.md | 46 + ...res_market-data_rest-api_Order-Book-RPI.md | 66 + ...futures_market-data_rest-api_Order-Book.md | 78 + ...-data_rest-api_Premium-Index-Kline-Data.md | 94 + ...market-data_rest-api_Recent-Trades-List.md | 56 + ...-data_rest-api_Symbol-Order-Book-Ticker.md | 60 + ...et-data_rest-api_Symbol-Price-Ticker-v2.md | 55 + ...arket-data_rest-api_Symbol-Price-Ticker.md | 54 + ...rket-data_rest-api_Taker-BuySell-Volume.md | 78 + ...a_rest-api_Top-Long-Short-Account-Ratio.md | 73 + ...ta_rest-api_Top-Trader-Long-Short-Ratio.md | 78 + ...s_market-data_rest-api_Trading-Schedule.md | 34 + ...gined-futures_market-data_websocket-api.md | 90 + ..._websocket-api_Symbol-Order-Book-Ticker.md | 67 + ...-data_websocket-api_Symbol-Price-Ticker.md | 61 + ...ined-futures_portfolio-margin-endpoints.md | 60 + ...es_usds-margined-futures_trade_rest-api.md | 164 + ...tures_trade_rest-api_Account-Trade-List.md | 99 + ...gined-futures_trade_rest-api_All-Orders.md | 93 + ...de_rest-api_Auto-Cancel-All-Open-Orders.md | 69 + ...utures_trade_rest-api_Cancel-Algo-Order.md | 66 + ...de_rest-api_Cancel-All-Algo-Open-Orders.md | 58 + ...s_trade_rest-api_Cancel-All-Open-Orders.md | 58 + ...s_trade_rest-api_Cancel-Multiple-Orders.md | 78 + ...ned-futures_trade_rest-api_Cancel-Order.md | 72 + ..._trade_rest-api_Change-Initial-Leverage.md | 66 + ...tures_trade_rest-api_Change-Margin-Type.md | 66 + ...trade_rest-api_Change-Multi-Assets-Mode.md | 60 + ...res_trade_rest-api_Change-Position-Mode.md | 60 + ...e_rest-api_Current-All-Algo-Open-Orders.md | 74 + ..._trade_rest-api_Current-All-Open-Orders.md | 62 + ...trade_rest-api_Get-Order-Modify-History.md | 97 + ...-api_Get-Position-Margin-Change-History.md | 91 + ...est-api_Modify-Isolated-Position-Margin.md | 82 + ...s_trade_rest-api_Modify-Multiple-Orders.md | 143 + ...ned-futures_trade_rest-api_Modify-Order.md | 108 + ...d-futures_trade_rest-api_New-Algo-Order.md | 237 + ...d-futures_trade_rest-api_New-Order-Test.md | 255 + ...es_trade_rest-api_Place-Multiple-Orders.md | 169 + ...st-api_Position-ADL-Quantile-Estimation.md | 65 + ..._trade_rest-api_Position-Information-V2.md | 70 + ..._trade_rest-api_Position-Information-V3.md | 70 + ...futures_trade_rest-api_Query-Algo-Order.md | 73 + ...es_trade_rest-api_Query-All-Algo-Orders.md | 99 + ...trade_rest-api_Query-Current-Open-Order.md | 73 + ...ined-futures_trade_rest-api_Query-Order.md | 79 + ...ned-futures_trade_rest-api_TradFi-Perps.md | 52 + ...tures_trade_rest-api_Users-Force-Orders.md | 89 + ...ds-margined-futures_trade_websocket-api.md | 263 + ...s_trade_websocket-api_Cancel-Algo-Order.md | 73 + ...utures_trade_websocket-api_Cancel-Order.md | 79 + ...utures_trade_websocket-api_Modify-Order.md | 115 + ...ures_trade_websocket-api_New-Algo-Order.md | 241 + ...es_trade_websocket-api_Position-Info-V2.md | 77 + ...rade_websocket-api_Position-Information.md | 77 + ...futures_trade_websocket-api_Query-Order.md | 86 + ...usds-margined-futures_user-data-streams.md | 25 + ...data-streams_Close-User-Data-Stream-Wsp.md | 41 + ...ser-data-streams_Close-User-Data-Stream.md | 34 + ...uration-Update-previous-Leverage-Update.md | 32 + ...er-data-streams_Event-Algo-Order-Update.md | 34 + ...reams_Event-Balance-and-Position-Update.md | 55 + ..._Event-Conditional-Order-Trigger-Reject.md | 24 + ...res_user-data-streams_Event-GRID-UPDATE.md | 29 + ...res_user-data-streams_Event-Margin-Call.md | 26 + ...es_user-data-streams_Event-Order-Update.md | 92 + ...user-data-streams_Event-STRATEGY-UPDATE.md | 49 + ...ures_user-data-streams_Event-Trade-Lite.md | 24 + ...-streams_Event-User-Data-Stream-Expired.md | 30 + ...-streams_Keepalive-User-Data-Stream-Wsp.md | 41 + ...data-streams_Keepalive-User-Data-Stream.md | 34 + ...data-streams_Start-User-Data-Stream-Wsp.md | 53 + ...ser-data-streams_Start-User-Data-Stream.md | 34 + ...ined-futures_websocket-api-general-info.md | 336 + ...rgined-futures_websocket-market-streams.md | 31 + ...-market-streams_Aggregate-Trade-Streams.md | 33 + ...-market-streams_All-Book-Tickers-Stream.md | 33 + ...ms_All-Market-Liquidation-Order-Streams.md | 29 + ...-streams_All-Market-Mini-Tickers-Stream.md | 29 + ...rket-streams_All-Market-Tickers-Streams.md | 29 + ...posite-Index-Symbol-Information-Streams.md | 29 + ...uous-Contract-Kline-Candlestick-Streams.md | 55 + ...ket-market-streams_Contract-Info-Stream.md | 29 + ...ket-streams_Diff-Book-Depth-Streams-RPI.md | 33 + ...-market-streams_Diff-Book-Depth-Streams.md | 33 + ...-to-manage-a-local-order-book-correctly.md | 21 + ...s_Individual-Symbol-Book-Ticker-Streams.md | 33 + ...ms_Individual-Symbol-Mini-Ticker-Stream.md | 29 + ...treams_Individual-Symbol-Ticker-Streams.md | 29 + ...arket-streams_Kline-Candlestick-Streams.md | 49 + ...arket-streams_Liquidation-Order-Streams.md | 29 + ...ve-Subscribing-Unsubscribing-to-streams.md | 130 + ...treams_Mark-Price-Stream-for-All-market.md | 33 + ...socket-market-streams_Mark-Price-Stream.md | 29 + ...t-streams_Multi-Assets-Mode-Asset-Index.md | 29 + ...rket-streams_Partial-Book-Depth-Streams.md | 33 + ...t-market-streams_Trading-Session-Stream.md | 29 + package.json | 1 + src/cli/args.ts | 17 +- src/cli/strategy-runner.ts | 6 +- src/config.ts | 3 + src/exchanges/binance/adapter.ts | 231 + src/exchanges/binance/gateway.ts | 1703 +++++ src/exchanges/binance/order.ts | 100 + src/exchanges/create-adapter.ts | 112 +- src/exchanges/order-router.ts | 23 +- src/exchanges/resolve-from-env.ts | 86 +- src/i18n/index.ts | 4 +- src/strategy/basis-arb-engine.ts | 7 +- src/ui/BasisApp.tsx | 4 +- tests/basis-arb-engine.test.ts | 11 +- tests/config.test.ts | 7 + tests/exchange-contract-suite.test.ts | 261 + tests/exchange-factory.test.ts | 13 + 588 files changed, 96879 insertions(+), 106 deletions(-) create mode 100644 docs/binance/binance-spot/CHANGELOG.md create mode 100644 docs/binance/binance-spot/PROD-TERMS-OF-USE.md create mode 100644 docs/binance/binance-spot/README.md create mode 100644 docs/binance/binance-spot/demo-mode.md create mode 100644 docs/binance/binance-spot/demo-mode_CHANGELOG.md create mode 100644 docs/binance/binance-spot/demo-mode_DEMO-TERMS-OF-USE.md create mode 100644 docs/binance/binance-spot/demo-mode_general-info.md create mode 100644 docs/binance/binance-spot/enums.md create mode 100644 docs/binance/binance-spot/errors.md create mode 100644 docs/binance/binance-spot/faqs_api_key_types.md create mode 100644 docs/binance/binance-spot/faqs_commission_faq.md create mode 100644 docs/binance/binance-spot/faqs_market_data_only.md create mode 100644 docs/binance/binance-spot/faqs_opo.md create mode 100644 docs/binance/binance-spot/faqs_order_amend_keep_priority.md create mode 100644 docs/binance/binance-spot/faqs_order_count_decrement.md create mode 100644 docs/binance/binance-spot/faqs_pegged_orders.md create mode 100644 docs/binance/binance-spot/faqs_sbe_faq.md create mode 100644 docs/binance/binance-spot/faqs_sor_faq.md create mode 100644 docs/binance/binance-spot/faqs_spot_glossary.md create mode 100644 docs/binance/binance-spot/faqs_stp_faq.md create mode 100644 docs/binance/binance-spot/faqs_trailing-stop-faq.md create mode 100644 docs/binance/binance-spot/filters.md create mode 100644 docs/binance/binance-spot/fix-api.md create mode 100644 docs/binance/binance-spot/index.md create mode 100644 docs/binance/binance-spot/rest-api.md.error.txt create mode 100644 docs/binance/binance-spot/rest-api_account-endpoints.md create mode 100644 docs/binance/binance-spot/rest-api_data-sources.md create mode 100644 docs/binance/binance-spot/rest-api_error-codes.md create mode 100644 docs/binance/binance-spot/rest-api_general-api-information.md create mode 100644 docs/binance/binance-spot/rest-api_general-endpoints.md create mode 100644 docs/binance/binance-spot/rest-api_general-information-on-endpoints.md create mode 100644 docs/binance/binance-spot/rest-api_http-return-codes.md create mode 100644 docs/binance/binance-spot/rest-api_limits.md create mode 100644 docs/binance/binance-spot/rest-api_market-data-endpoints.md create mode 100644 docs/binance/binance-spot/rest-api_request-security.md create mode 100644 docs/binance/binance-spot/rest-api_trading-endpoints.md create mode 100644 docs/binance/binance-spot/sbe-market-data-streams.md create mode 100644 docs/binance/binance-spot/testnet.md create mode 100644 docs/binance/binance-spot/testnet_TESTNET-TERMS-OF-USE.md create mode 100644 docs/binance/binance-spot/testnet_enums.md create mode 100644 docs/binance/binance-spot/testnet_errors.md create mode 100644 docs/binance/binance-spot/testnet_filters.md create mode 100644 docs/binance/binance-spot/testnet_fix-api.md create mode 100644 docs/binance/binance-spot/testnet_general-info.md create mode 100644 docs/binance/binance-spot/testnet_rest-api_account-endpoints.md create mode 100644 docs/binance/binance-spot/testnet_rest-api_data-sources.md create mode 100644 docs/binance/binance-spot/testnet_rest-api_error-codes.md create mode 100644 docs/binance/binance-spot/testnet_rest-api_general-api-information.md create mode 100644 docs/binance/binance-spot/testnet_rest-api_general-endpoints.md create mode 100644 docs/binance/binance-spot/testnet_rest-api_general-information-on-endpoints.md create mode 100644 docs/binance/binance-spot/testnet_rest-api_http-return-codes.md create mode 100644 docs/binance/binance-spot/testnet_rest-api_limits.md create mode 100644 docs/binance/binance-spot/testnet_rest-api_market-data-endpoints.md create mode 100644 docs/binance/binance-spot/testnet_rest-api_request-security.md create mode 100644 docs/binance/binance-spot/testnet_rest-api_trading-endpoints.md create mode 100644 docs/binance/binance-spot/testnet_sbe-market-data-streams.md create mode 100644 docs/binance/binance-spot/testnet_user-data-stream.md create mode 100644 docs/binance/binance-spot/testnet_web-socket-streams.md create mode 100644 docs/binance/binance-spot/testnet_websocket-api_account-requests.md create mode 100644 docs/binance/binance-spot/testnet_websocket-api_authentication-requests.md create mode 100644 docs/binance/binance-spot/testnet_websocket-api_data-sources.md create mode 100644 docs/binance/binance-spot/testnet_websocket-api_event-format.md create mode 100644 docs/binance/binance-spot/testnet_websocket-api_general-api-information.md create mode 100644 docs/binance/binance-spot/testnet_websocket-api_general-requests.md create mode 100644 docs/binance/binance-spot/testnet_websocket-api_market-data-requests.md create mode 100644 docs/binance/binance-spot/testnet_websocket-api_rate-limits.md create mode 100644 docs/binance/binance-spot/testnet_websocket-api_request-format.md create mode 100644 docs/binance/binance-spot/testnet_websocket-api_request-security.md create mode 100644 docs/binance/binance-spot/testnet_websocket-api_response-format.md create mode 100644 docs/binance/binance-spot/testnet_websocket-api_session-authentication.md create mode 100644 docs/binance/binance-spot/testnet_websocket-api_trading-requests.md create mode 100644 docs/binance/binance-spot/testnet_websocket-api_user-data-stream-requests.md create mode 100644 docs/binance/binance-spot/user-data-stream.md create mode 100644 docs/binance/binance-spot/web-socket-api.md.error.txt create mode 100644 docs/binance/binance-spot/web-socket-streams.md create mode 100644 docs/binance/binance-spot/websocket-api_account-requests.md create mode 100644 docs/binance/binance-spot/websocket-api_authentication-requests.md create mode 100644 docs/binance/binance-spot/websocket-api_data-sources.md create mode 100644 docs/binance/binance-spot/websocket-api_event-format.md create mode 100644 docs/binance/binance-spot/websocket-api_general-api-information.md create mode 100644 docs/binance/binance-spot/websocket-api_general-requests.md create mode 100644 docs/binance/binance-spot/websocket-api_market-data-requests.md create mode 100644 docs/binance/binance-spot/websocket-api_rate-limits.md create mode 100644 docs/binance/binance-spot/websocket-api_request-format.md create mode 100644 docs/binance/binance-spot/websocket-api_request-security.md create mode 100644 docs/binance/binance-spot/websocket-api_response-format.md create mode 100644 docs/binance/binance-spot/websocket-api_session-authentication.md create mode 100644 docs/binance/binance-spot/websocket-api_trading-requests.md create mode 100644 docs/binance/binance-spot/websocket-api_user-data-stream-requests.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_Introduction.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_change-log.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_account_rest-api.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_account_rest-api_Account-Information.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_account_rest-api_Futures-Account-Balance.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_account_rest-api_Get-Current-Position-Mode.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_account_rest-api_Get-Download-Id-For-Futures-Order-History.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_account_rest-api_Get-Download-Id-For-Futures-Trade-History.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_account_rest-api_Get-Download-Id-For-Futures-Transaction-History.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_account_rest-api_Get-Future-Account-Transaction-History-List.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_account_rest-api_Get-Futures-Order-History-Download-Link-by-Id.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_account_rest-api_Get-Futures-Trade-Download-Link-by-Id.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_account_rest-api_Get-Futures-Transaction-History-Download-Link-by-Id.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_account_rest-api_Get-Income-History.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_account_rest-api_Notional-Bracket-for-Pair.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_account_rest-api_Notional-Bracket-for-Symbol.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_account_rest-api_User-Commission-Rate.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_account_websocket-api.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_account_websocket-api_Account-Information.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_common-definition.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_error-code.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_general-info.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_24hr-Ticker-Price-Change-Statistics.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Basis.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Check-Server-time.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Compressed-Aggregate-Trades-List.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Continuous-Contract-Kline-Candlestick-Data.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Delist-Schedule.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Exchange-Information.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Get-Funding-Info.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Get-Funding-Rate-History-of-Perpetual-Futures.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Index-Constituents.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Index-Price-Kline-Candlestick-Data.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Index-Price-and-Mark-Price.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Kline-Candlestick-Data.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Long-Short-Ratio.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Mark-Price-Kline-Candlestick-Data.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Old-Trades-Lookup.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Open-Interest-Statistics.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Open-Interest.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Order-Book.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Premium-Index-Kline-Data.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Recent-Trades-List.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Symbol-Order-Book-Ticker.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Symbol-Price-Ticker.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Taker-Buy-Sell-Volume.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Top-Long-Short-Account-Ratio.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Top-Trader-Long-Short-Ratio.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_portfolio-margin-endpoints.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api_Account-Trade-List.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api_All-Orders.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api_Auto-Cancel-All-Open-Orders.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api_Cancel-All-Open-Orders.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api_Cancel-Multiple-Orders.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api_Cancel-Order.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api_Change-Initial-Leverage.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api_Change-Margin-Type.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api_Change-Position-Mode.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api_Current-All-Open-Orders.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api_Get-Order-Modify-History.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api_Get-Position-Margin-Change-History.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api_Modify-Isolated-Position-Margin.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api_Modify-Multiple-Orders.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api_Modify-Order.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api_Place-Multiple-Orders.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api_Position-ADL-Quantile-Estimation.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api_Position-Information.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api_Query-Current-Open-Order.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api_Query-Order.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api_Users-Force-Orders.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_websocket-api.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_websocket-api_Cancel-Order.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_websocket-api_Modify-Order.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_websocket-api_Position-Information.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_websocket-api_Query-Order.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_user-data-streams.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_user-data-streams_Close-User-Data-Stream-Wsp.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_user-data-streams_Close-User-Data-Stream.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_user-data-streams_Event-Account-Configuration-Update.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_user-data-streams_Event-Balance-and-Position-Update.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_user-data-streams_Event-GRID-UPDATE.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_user-data-streams_Event-Margin-Call.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_user-data-streams_Event-Order-Update.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_user-data-streams_Event-STRATEGY-UPDATE.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_user-data-streams_Event-User-Data-Stream-Expired.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_user-data-streams_Keepalive-User-Data-Stream-Wsp.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_user-data-streams_Keepalive-User-Data-Stream.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_user-data-streams_Start-User-Data-Stream-Wsp.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_user-data-streams_Start-User-Data-Stream.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-api-general-info.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams_Aggregate-Trade-Streams.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams_All-Book-Tickers-Stream.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams_All-Market-Liquidation-Order-Streams.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams_All-Market-Mini-Tickers-Stream.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams_All-Market-Tickers-Streams.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams_Continuous-Contract-Kline-Candlestick-Streams.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams_Contract-Info-Stream.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams_Diff-Book-Depth-Streams.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams_How-to-manage-a-local-order-book-correctly.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams_Index-Kline-Candlestick-Streams.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams_Index-Price-Stream.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams_Individual-Symbol-Book-Ticker-Streams.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams_Individual-Symbol-Mini-Ticker-Stream.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams_Individual-Symbol-Ticker-Streams.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams_Kline-Candlestick-Streams.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams_Liquidation-Order-Streams.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams_Live-Subscribing-Unsubscribing-to-streams.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams_Mark-Price-Kline-Candlestick-Streams.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams_Mark-Price-Stream.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams_Mark-Price-of-All-Symbols-of-a-Pair.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams_Partial-Book-Depth-Streams.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_options-trading_account.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_options-trading_account_Account-Funding-Flow.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_options-trading_account_Funds-Transfer.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_options-trading_common-definition.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_options-trading_error-code.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_options-trading_general-info.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_options-trading_market-data.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_options-trading_market-data_24hr-Ticker-Price-Change-Statistics.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_options-trading_market-data_Exchange-Information.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_options-trading_market-data_Historical-Exercise-Records.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_options-trading_market-data_Kline-Candlestick-Data.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_options-trading_market-data_Open-Interest.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_options-trading_market-data_Option-Mark-Price.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_options-trading_market-data_Order-Book.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_options-trading_market-data_Recent-Block-Trade-List.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_options-trading_market-data_Recent-Trades-List.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_options-trading_market-data_Symbol-Price-Ticker.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_options-trading_market-data_Test-Connectivity.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_options-trading_market-maker-block-trade.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_options-trading_market-maker-block-trade_Accept-Block-Trade-Order.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_options-trading_market-maker-block-trade_Account-Block-Trade-List.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_options-trading_market-maker-block-trade_Cancel-Block-Trade-Order.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_options-trading_market-maker-block-trade_Extend-Block-Trade-Order.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_options-trading_market-maker-block-trade_Query-Block-Trade-Detail.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_options-trading_market-maker-block-trade_Query-Block-Trade-Order.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_options-trading_market-maker-endpoints.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_options-trading_market-maker-endpoints_Auto-Cancel-All-Open-Orders-Heartbeat.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_options-trading_market-maker-endpoints_Get-Auto-Cancel-All-Open-Orders-Config.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_options-trading_market-maker-endpoints_Reset-Market-Maker-Protection-Config.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_options-trading_market-maker-endpoints_Set-Auto-Cancel-All-Open-Orders-Config.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_options-trading_market-maker-endpoints_Set-Market-Maker-Protection-Config.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_options-trading_trade.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_options-trading_trade_Account-Trade-List.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_options-trading_trade_Cancel-All-Option-Orders-By-Underlying.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_options-trading_trade_Cancel-Multiple-Option-Orders.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_options-trading_trade_Cancel-Option-Order.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_options-trading_trade_Cancel-all-Option-orders-on-specific-symbol.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_options-trading_trade_Option-Position-Information.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_options-trading_trade_Place-Multiple-Orders.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_options-trading_trade_Query-Current-Open-Option-Orders.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_options-trading_trade_Query-Option-Order-History.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_options-trading_trade_Query-Single-Order.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_options-trading_trade_User-Commission.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_options-trading_trade_User-Exercise-Record.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_options-trading_user-data-streams.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_options-trading_user-data-streams_Close-User-Data-Stream.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_options-trading_user-data-streams_Event-Account-data.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_options-trading_user-data-streams_Event-Balance-and-Position-Update.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_options-trading_user-data-streams_Event-Greek-Update.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_options-trading_user-data-streams_Event-Order-update.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_options-trading_user-data-streams_Event-Risk-level-change.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_options-trading_user-data-streams_Event-User-Data-Stream-Expired.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_options-trading_user-data-streams_Keepalive-User-Data-Stream.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_options-trading_user-data-streams_Start-User-Data-Stream.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_options-trading_websocket-market-streams.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_options-trading_websocket-market-streams_24-hour-TICKER.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_options-trading_websocket-market-streams_Bookticker.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_options-trading_websocket-market-streams_Diff-Book-Depth-Streams.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_options-trading_websocket-market-streams_How-to-manage-a-local-order-book-correctly.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_options-trading_websocket-market-streams_Index-Price-Streams.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_options-trading_websocket-market-streams_Kline-Candlestick-Streams.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_options-trading_websocket-market-streams_Live-Subscribing-Unsubscribing-to-streams.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_options-trading_websocket-market-streams_Mark-Price.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_options-trading_websocket-market-streams_New-Symbol-Info.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_options-trading_websocket-market-streams_Open-Interest.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_options-trading_websocket-market-streams_Partial-Book-Depth-Streams.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_options-trading_websocket-market-streams_Trade-Streams.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_account.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_account_BNB-transfer.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_account_Change-Auto-repay-futures-Status.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_account_Classic-Portfolio-Margin-Bankruptcy-Loan-Repay.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_account_Fund-Auto-collection.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_account_Fund-Collection-by-Asset.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_account_Get-Auto-repay-futures-Status.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_account_Get-Classic-Portfolio-Margin-Account-Info-V2.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_account_Get-Classic-Portfolio-Margin-Balance-Info.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_account_Get-Delta-Mode-Status.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_account_Get-Transferable-Earn-Asset-Balance-Portfolio-Margin.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_account_Query-Classic-Portfolio-Margin-Bankruptcy-Loan-Amount.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_account_Query-Classic-Portfolio-Margin-Negative-Balance-Interest-History.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_account_Query-Portfolio-Margin-Pro-Bankruptcy-Loan-Repay-History.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_account_Repay-futures-Negative-Balance.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_account_Switch-Delta-Mode.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_account_Transfer-LDUSDT-Portfolio-Margin.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_error-code.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_general-info.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_market-data.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_market-data_Classic-Portfolio-Margin-Collateral-Rate.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_market-data_Get-Portfolio-Margin-Asset-Leverage.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_market-data_Portfolio-Margin-Pro-Tiered-Collateral-Rate.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_portfolio-margin-pro-user-data-stream.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_portfolio-margin-pro-user-data-stream_Event-riskLevelChange.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Account-Information.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_BNB-transfer.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_CM-Notional-and-Leverage-Brackets.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Change-Auto-repay-futures-Status.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Change-CM-Initial-Leverage.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Change-CM-Position-Mode.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Change-UM-Initial-Leverage.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Change-UM-Position-Mode.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Fund-Auto-collection.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Fund-Collection-by-Asset.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Get-Auto-repay-futures-Status.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Get-CM-Account-Detail.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Get-CM-Current-Position-Mode.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Get-CM-Income-History.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Get-Download-Id-For-UM-Futures-Order-History.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Get-Download-Id-For-UM-Futures-Trade-History.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Get-Download-Id-For-UM-Futures-Transaction-History.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Get-Margin-BorrowLoan-Interest-History.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Get-UM-Account-Detail-V2.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Get-UM-Account-Detail.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Get-UM-Current-Position-Mode.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Get-UM-Futures-Account-Config.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Get-UM-Futures-Order-Download-Link-by-Id.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Get-UM-Futures-Symbol-Config.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Get-UM-Futures-Trade-Download-Link-by-Id.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Get-UM-Futures-Transaction-Download-Link-by-Id.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Get-UM-Income-History.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Get-User-Commission-Rate-for-CM.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Get-User-Commission-Rate-for-UM.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Margin-Max-Borrow.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Portfolio-Margin-UM-Trading-Quantitative-Rules-Indicators.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Query-CM-Position-Information.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Query-Margin-Loan-Record.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Query-Margin-Max-Withdraw.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Query-Margin-repay-Record.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Query-Portfolio-Margin-Negative-Balance-Interest-History.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Query-UM-Position-Information.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Query-User-Negative-Balance-Auto-Exchange-Record.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Query-User-Rate-Limit.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Repay-futures-Negative-Balance.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_UM-Notional-and-Leverage-Brackets.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_common-definition.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_error-code.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_general-info.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_market-data.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_CM-Account-Trade-List.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_CM-Position-ADL-Quantile-Estimation.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Cancel-All-CM-Open-Conditional-Orders.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Cancel-All-CM-Open-Orders.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Cancel-All-UM-Open-Conditional-Orders.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Cancel-All-UM-Open-Orders.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Cancel-CM-Conditional-Order.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Cancel-CM-Order.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Cancel-Margin-Account-All-Open-Orders-on-a-Symbol.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Cancel-Margin-Account-OCO-Orders.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Cancel-Margin-Account-Order.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Cancel-UM-Conditional-Order.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Cancel-UM-Order.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Get-UM-Futures-BNB-Burn-Status.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Margin-Account-Borrow.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Margin-Account-New-OCO.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Margin-Account-Repay-Debt.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Margin-Account-Repay.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Margin-Account-Trade-List.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Modify-CM-Order.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Modify-UM-Order.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_New-CM-Conditional-Order.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_New-CM-Order.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_New-Margin-Order.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_New-UM-Conditional-Order.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-All-CM-Conditional-Orders.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-All-CM-Orders.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-All-Current-CM-Open-Conditional-Orders.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-All-Current-CM-Open-Orders.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-All-Current-UM-Open-Conditional-Orders.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-All-Current-UM-Open-Orders.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-All-Margin-Account-Orders.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-All-UM-Conditional-Orders.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-All-UM-Orders.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-CM-Conditional-Order-History.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-CM-Modify-Order-History.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-CM-Order.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-Current-CM-Open-Conditional-Order.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-Current-CM-Open-Order.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-Current-Margin-Open-Order.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-Current-UM-Open-Conditional-Order.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-Current-UM-Open-Order.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-Margin-Account-OCO.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-Margin-Account-Open-OCO.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-Margin-Account-Order.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-Margin-Account-all-OCO.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-UM-Conditional-Order-History.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-UM-Modify-Order-History.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-UM-Order.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-Users-CM-Force-Orders.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-Users-Margin-Force-Orders.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-Users-UM-Force-Orders.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Toggle-BNB-Burn-On-UM-Futures-Trade.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_UM-Account-Trade-List.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_UM-Position-ADL-Quantile-Estimation.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_user-data-streams.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_user-data-streams_Close-User-Data-Stream.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_user-data-streams_Event-Conditional-Order-Trade-Update.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_user-data-streams_Event-Futures-Account-Configuration-Update.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_user-data-streams_Event-Futures-Balance-and-Position-Update.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_user-data-streams_Event-Futures-Order-update.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_user-data-streams_Event-Liability-Update.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_user-data-streams_Event-Margin-Account-Update.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_user-data-streams_Event-Margin-Balance-Update.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_user-data-streams_Event-Margin-Order-Update.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_user-data-streams_Event-OpenOrderLoss-Update.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_user-data-streams_Event-User-Data-Stream-Expired.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_user-data-streams_Event-riskLevelChange.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_user-data-streams_Keepalive-User-Data-Stream.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_user-data-streams_Start-User-Data-Stream.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_quick-start.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_Account-Config.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_Account-Information-V2.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_Account-Information-V3.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_Futures-Account-Balance-V2.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_Futures-Account-Balance-V3.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_Futures-Trading-Quantitative-Rules-Indicators.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_Get-BNB-Burn-Status.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_Get-Current-Multi-Assets-Mode.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_Get-Current-Position-Mode.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_Get-Download-Id-For-Futures-Order-History.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_Get-Download-Id-For-Futures-Trade-History.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_Get-Download-Id-For-Futures-Transaction-History.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_Get-Future-Account-Transaction-History-List.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_Get-Futures-Order-History-Download-Link-by-Id.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_Get-Futures-Trade-Download-Link-by-Id.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_Get-Futures-Transaction-History-Download-Link-by-Id.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_Get-Income-History.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_Notional-and-Leverage-Brackets.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_Query-Rate-Limit.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_Symbol-Config.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_Toggle-BNB-Burn-On-Futures-Trade.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_User-Commission-Rate.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_websocket-api.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_websocket-api_Account-Information-V2.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_websocket-api_Account-Information.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_websocket-api_Futures-Account-Balance.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_common-definition.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_convert.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_convert_Accept-Quote.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_convert_Order-Status.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_convert_Send-quote-request.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_error-code.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_faq_stp-faq.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_general-info.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_24hr-Ticker-Price-Change-Statistics.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_ADL-Risk.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Basis.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Check-Server-Time.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Composite-Index-Symbol-Information.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Compressed-Aggregate-Trades-List.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Continuous-Contract-Kline-Candlestick-Data.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Delist-Schedule.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Delivery-Price.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Exchange-Information.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Get-Funding-Rate-History.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Get-Funding-Rate-Info.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Index-Constituents.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Index-Price-Kline-Candlestick-Data.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Insurance-Fund-Balance.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Kline-Candlestick-Data.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Long-Short-Ratio.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Mark-Price-Kline-Candlestick-Data.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Mark-Price.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Multi-Assets-Mode-Asset-Index.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Old-Trades-Lookup.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Open-Interest-Statistics.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Open-Interest.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Order-Book-RPI.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Order-Book.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Premium-Index-Kline-Data.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Recent-Trades-List.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Symbol-Order-Book-Ticker.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Symbol-Price-Ticker-v2.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Symbol-Price-Ticker.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Taker-BuySell-Volume.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Top-Long-Short-Account-Ratio.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Top-Trader-Long-Short-Ratio.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Trading-Schedule.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_websocket-api.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_websocket-api_Symbol-Order-Book-Ticker.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_websocket-api_Symbol-Price-Ticker.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_portfolio-margin-endpoints.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Account-Trade-List.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_All-Orders.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Auto-Cancel-All-Open-Orders.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Cancel-Algo-Order.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Cancel-All-Algo-Open-Orders.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Cancel-All-Open-Orders.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Cancel-Multiple-Orders.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Cancel-Order.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Change-Initial-Leverage.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Change-Margin-Type.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Change-Multi-Assets-Mode.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Change-Position-Mode.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Current-All-Algo-Open-Orders.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Current-All-Open-Orders.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Get-Order-Modify-History.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Get-Position-Margin-Change-History.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Modify-Isolated-Position-Margin.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Modify-Multiple-Orders.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Modify-Order.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_New-Algo-Order.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_New-Order-Test.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Place-Multiple-Orders.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Position-ADL-Quantile-Estimation.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Position-Information-V2.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Position-Information-V3.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Query-Algo-Order.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Query-All-Algo-Orders.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Query-Current-Open-Order.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Query-Order.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_TradFi-Perps.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Users-Force-Orders.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_websocket-api.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_websocket-api_Cancel-Algo-Order.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_websocket-api_Cancel-Order.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_websocket-api_Modify-Order.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_websocket-api_New-Algo-Order.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_websocket-api_Position-Info-V2.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_websocket-api_Position-Information.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_websocket-api_Query-Order.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_user-data-streams.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_user-data-streams_Close-User-Data-Stream-Wsp.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_user-data-streams_Close-User-Data-Stream.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_user-data-streams_Event-Account-Configuration-Update-previous-Leverage-Update.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_user-data-streams_Event-Algo-Order-Update.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_user-data-streams_Event-Balance-and-Position-Update.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_user-data-streams_Event-Conditional-Order-Trigger-Reject.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_user-data-streams_Event-GRID-UPDATE.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_user-data-streams_Event-Margin-Call.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_user-data-streams_Event-Order-Update.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_user-data-streams_Event-STRATEGY-UPDATE.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_user-data-streams_Event-Trade-Lite.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_user-data-streams_Event-User-Data-Stream-Expired.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_user-data-streams_Keepalive-User-Data-Stream-Wsp.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_user-data-streams_Keepalive-User-Data-Stream.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_user-data-streams_Start-User-Data-Stream-Wsp.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_user-data-streams_Start-User-Data-Stream.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-api-general-info.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_Aggregate-Trade-Streams.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_All-Book-Tickers-Stream.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_All-Market-Liquidation-Order-Streams.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_All-Market-Mini-Tickers-Stream.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_All-Market-Tickers-Streams.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_Composite-Index-Symbol-Information-Streams.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_Continuous-Contract-Kline-Candlestick-Streams.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_Contract-Info-Stream.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_Diff-Book-Depth-Streams-RPI.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_Diff-Book-Depth-Streams.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_How-to-manage-a-local-order-book-correctly.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_Individual-Symbol-Book-Ticker-Streams.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_Individual-Symbol-Mini-Ticker-Stream.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_Individual-Symbol-Ticker-Streams.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_Kline-Candlestick-Streams.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_Liquidation-Order-Streams.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_Live-Subscribing-Unsubscribing-to-streams.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_Mark-Price-Stream-for-All-market.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_Mark-Price-Stream.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_Multi-Assets-Mode-Asset-Index.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_Partial-Book-Depth-Streams.md create mode 100644 docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_Trading-Session-Stream.md create mode 100644 src/exchanges/binance/adapter.ts create mode 100644 src/exchanges/binance/gateway.ts create mode 100644 src/exchanges/binance/order.ts create mode 100644 tests/exchange-contract-suite.test.ts diff --git a/.env.example b/.env.example index 578f1d6..e2bbce5 100644 --- a/.env.example +++ b/.env.example @@ -2,12 +2,23 @@ LANG=zh # Exchange selection -EXCHANGE=aster # Pick aster (default) or standx/grvt/lighter/backpack/paradex/nado +EXCHANGE=aster # Pick aster (default) or binance/standx/grvt/lighter/backpack/paradex/nado # Aster API credentials ASTER_API_KEY= ASTER_API_SECRET= +# Binance API credentials (set when EXCHANGE=binance) +BINANCE_API_KEY= +BINANCE_API_SECRET= +BINANCE_SYMBOL=BTCUSDT # Trading symbol. Use BTCUSDT_PERP to force perpetual when ambiguous. +BINANCE_MARKET_TYPE=perp # perp | spot | auto +# BINANCE_SANDBOX=false +# BINANCE_SPOT_REST_URL=https://api.binance.com +# BINANCE_FUTURES_REST_URL=https://fapi.binance.com +# BINANCE_SPOT_WS_URL=wss://stream.binance.com:9443/ws +# BINANCE_FUTURES_WS_URL=wss://fstream.binance.com/ws + # StandX authentication (set when EXCHANGE=standx) STANDX_TOKEN= STANDX_SYMBOL=BTC-USD diff --git a/README.md b/README.md index 38984f2..58c1e91 100644 --- a/README.md +++ b/README.md @@ -86,7 +86,7 @@ curl -fsSL https://github.com/discountry/ritmex-bot/raw/refs/heads/main/setup.sh | 变量 | 说明 | | --- | --- | -| `EXCHANGE` | 选择交易所(`aster`/`standx`/`grvt`/`lighter`/`backpack`/`paradex`/`nado`) | +| `EXCHANGE` | 选择交易所(`aster`/`binance`/`standx`/`grvt`/`lighter`/`backpack`/`paradex`/`nado`) | | `TRADE_SYMBOL` | 交易对(默认 `BTCUSDT`) | | `TRADE_AMOUNT` | 单笔下单数量(标的资产计) | | `LOSS_LIMIT` | 单笔最大亏损触发的强平额度(USDT) | @@ -111,6 +111,38 @@ curl -fsSL https://github.com/discountry/ritmex-bot/raw/refs/heads/main/setup.sh 3. 根据交易对调整 `TRADE_SYMBOL`、`PRICE_TICK`、`QTY_STEP` 等精度参数。 4. 一键脚本会自动写入这些变量,手动部署时需自行维护。 +### Binance +1. 设置 `EXCHANGE=binance`。 +2. 填写 `BINANCE_API_KEY`、`BINANCE_API_SECRET`。 +3. 设置市场模式 `BINANCE_MARKET_TYPE`: + - `perp`:永续(默认) + - `spot`:现货 + - `auto`:按符号自动匹配(同名现货/永续并存时建议不要使用) +4. 设置交易符号 `BINANCE_SYMBOL`(或使用 `TRADE_SYMBOL`): + - 永续建议写 `BTCUSDT_PERP`(或直接 `BTCUSDT` + `BINANCE_MARKET_TYPE=perp`) + - 现货建议写 `BTCUSDT`(也支持 `BTCUSDT_SPOT`) +5. 需要做期现套利(Basis)时,建议显式拆分: + - `BASIS_FUTURES_SYMBOL=BTCUSDT_PERP` + - `BASIS_SPOT_SYMBOL=BTCUSDT` +6. 可选测试网/自定义端点: + - `BINANCE_SANDBOX=true` + - `BINANCE_SPOT_REST_URL` / `BINANCE_FUTURES_REST_URL` + - `BINANCE_SPOT_WS_URL` / `BINANCE_FUTURES_WS_URL` + +> Binance 适配器默认优先使用 WebSocket(盘口、ticker、kline、账户/订单用户流),仅在必要时使用 REST 补偿与兜底。 +> +> 若使用现货模式,部分“仅合约可用”的保护单能力会受交易所限制,策略会按交易所能力自动降级。 + +**示例(永续做市)** +```bash +EXCHANGE=binance BINANCE_MARKET_TYPE=perp BINANCE_SYMBOL=BTCUSDT_PERP bun run index.ts --strategy maker +``` + +**示例(现货网格)** +```bash +EXCHANGE=binance BINANCE_MARKET_TYPE=spot BINANCE_SYMBOL=BTCUSDT bun run index.ts --strategy grid +``` + ### StandX * [StandX 做市策略教程](docs/standx/maker-points-guide.md) diff --git a/README_en.md b/README_en.md index 461e5d1..ab46635 100644 --- a/README_en.md +++ b/README_en.md @@ -82,7 +82,7 @@ The script installs Bun, project dependencies, collects Aster API credentials, g | Variable | Purpose | | --- | --- | -| `EXCHANGE` | Choose the venue (`aster` / `standx` / `grvt` / `lighter` / `backpack` / `paradex` / `nado`) | +| `EXCHANGE` | Choose the venue (`aster` / `binance` / `standx` / `grvt` / `lighter` / `backpack` / `paradex` / `nado`) | | `TRADE_SYMBOL` | Contract symbol (defaults to `BTCUSDT`) | | `TRADE_AMOUNT` | Order size in base asset units | | `LOSS_LIMIT` | Max per-trade loss in USDT before forced close | @@ -108,6 +108,38 @@ The script installs Bun, project dependencies, collects Aster API credentials, g 3. Adjust `TRADE_SYMBOL`, `PRICE_TICK`, and `QTY_STEP` to match the requested market. 4. The bootstrap script auto-populates these variables; manual installs must maintain them. +### Binance +1. Set `EXCHANGE=binance`. +2. Provide `BINANCE_API_KEY` and `BINANCE_API_SECRET`. +3. Set market mode via `BINANCE_MARKET_TYPE`: + - `perp`: perpetual futures (default) + - `spot`: spot market + - `auto`: resolve by symbol (not recommended when both spot/perp share the same symbol) +4. Set `BINANCE_SYMBOL` (or fallback to `TRADE_SYMBOL`): + - Perp recommended: `BTCUSDT_PERP` (or `BTCUSDT` with `BINANCE_MARKET_TYPE=perp`) + - Spot recommended: `BTCUSDT` (also accepts `BTCUSDT_SPOT`) +5. For Basis arbitrage on Binance, explicitly split legs: + - `BASIS_FUTURES_SYMBOL=BTCUSDT_PERP` + - `BASIS_SPOT_SYMBOL=BTCUSDT` +6. Optional sandbox/custom endpoints: + - `BINANCE_SANDBOX=true` + - `BINANCE_SPOT_REST_URL` / `BINANCE_FUTURES_REST_URL` + - `BINANCE_SPOT_WS_URL` / `BINANCE_FUTURES_WS_URL` + +> The Binance adapter is WS-first by default (depth/ticker/kline/account/order streams), with REST used only for reconciliation and fallback. +> +> In spot mode, some derivatives-only protective order capabilities are exchange-limited, and the strategy will degrade gracefully based on venue capabilities. + +**Example (perp maker)** +```bash +EXCHANGE=binance BINANCE_MARKET_TYPE=perp BINANCE_SYMBOL=BTCUSDT_PERP bun run index.ts --strategy maker +``` + +**Example (spot grid)** +```bash +EXCHANGE=binance BINANCE_MARKET_TYPE=spot BINANCE_SYMBOL=BTCUSDT bun run index.ts --strategy grid +``` + ### StandX * [StandX Maker Points Strategy Guide](docs/standx/maker-points-guide.md) diff --git a/docs/binance/binance-spot/CHANGELOG.md b/docs/binance/binance-spot/CHANGELOG.md new file mode 100644 index 0000000..3e1604d --- /dev/null +++ b/docs/binance/binance-spot/CHANGELOG.md @@ -0,0 +1,2906 @@ +--- +title: "Changelog | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG" +fetched_at: "2026-02-26T10:38:06.450Z" +--- +# CHANGELOG for Binance's API + +**Last Updated: 2026-02-24** + +### 2026-02-24[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +- [ICEBERG\_PARTS](https://developers.binance.com/docs/binance-spot-api-docs/filters) will be increased to 100 for all symbols at **2026-03-12 07:00 UTC**. +- Following the announcement on [2025-12-02](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG), `!ticker@arr` will be retired on **2026-03-26**. + +--- + +### 2026-02-12[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +REST and WebSocket API: + +- Reminder that SBE 3:0 schema will be retired on 2026-02-19, [6 months after being deprecated](https://developers.binance.com/docs/binance-spot-api-docs/faqs/sbe_faq). +- The [SBE lifecycle for Production](https://github.com/binance/binance-spot-api-docs/blob/master/sbe/schemas/sbe_schema_lifecycle_prod.json) has been updated to reflect this change. + +--- + +### 2026-02-09[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +- Clarified exponent field requirements in [FIX SBE documentation](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +--- + +### 2026-02-02[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +- Documented that [FIX Drop Copy session](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) data is delayed by 1 second. This has been the delay since the inception of the FIX API. + +--- + +### 2026-01-29[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +- [Demo Mode](https://developers.binance.com/docs/binance-spot-api-docs/demo-mode/general-info) is now available. +- For information on when the Spot Demo Mode environment will be unavailable due to maintenance, please refer to the [Demo Mode Changelog](https://developers.binance.com/docs/binance-spot-api-docs/demo-mode/CHANGELOG) + +--- + +### 2026-01-27[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +**Notice: The following changes will occur at 2026-02-11 7:00 UTC**: + +- [ICEBERG\_PARTS](https://developers.binance.com/docs/binance-spot-api-docs/filters) will be increased to 50 for all symbols. + +--- + +### 2026-01-26[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +- Added undocumented `recvWindow` to `userDataStream.subscribe.signature`. + +--- + +### 2026-01-21[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +Following the announcement from [2025-10-24](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG), the following endpoints/methods will no longer be available starting from **2026-02-20,07:00 UTC** + +REST API + +- `POST /api/v3/userDataStream` +- `PUT /api/v3/userDataStream` +- `DELETE /api/v3/userDataStream` + +WebSocket API + +- `userDataStream.start` +- `userDataStream.ping` +- `userDataStream.stop` + +--- + +### 2025-12-18[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +- Updated [FIX SBE documentation](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) +- Clarified User Data Stream documentation regarding [`eventStreamTerminated`](https://developers.binance.com/docs/binance-spot-api-docs/user-data-stream). +- Assets `这是测试币` and `456` and symbol `这是测试币456` have been added to [SPOT Testnet](http://testnet.binance.vision/) for testing endpoints/methods with a Unicode symbol. See the [Testnet CHANGELOG](https://developers.binance.com/docs/binance-spot-api-docs/testnet) for more information. + +--- + +### 2025-12-17[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +#### Time-sensitive Notice[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +- **The following change to REST API will occur at approximately 2026-01-15 07:00 UTC:** + When calling endpoints that require signatures, percent-encode payloads before computing signatures. Requests that do not follow this order will be rejected with [`-1022 INVALID_SIGNATURE`](https://developers.binance.com/docs/binance-spot-api-docs/errors). Please review and update your signing logic accordingly. This has now been enabled on [SPOT Testnet](http://testnet.binance.vision/) + +#### REST API[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +- Updated documentation for REST API regarding [Signed Endpoints examples for placing an order](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/request-security). + +#### WebSocket API[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +- Updated documentation for WebSocket API regarding [SIGNED request security](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/request-security). + +--- + +### 2025-12-15[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +**Clarification Regarding UTF-8 Encoding:** + +- In [FIX](https://developers.binance.com/docs/binance-spot-api-docs/fix-api), [REST](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information), and [WebSocket APIs](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/general-api-information), if your request contains a symbol name containing non-ASCII characters, then the response may contain non-ASCII characters encoded in UTF-8. +- In REST and WebSocket APIs, some endpoints/methods may return asset and/or symbol names containing non-ASCII characters encoded in UTF-8 even if the request did not contain non-ASCII characters. +- In [WebSocket Streams](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams), if your request contains a symbol name containing non-ASCII characters, then the stream events may contain non-ASCII characters encoded in UTF-8. +- In WebSocket Streams, [All Market Mini Tickers Stream](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) and [All Market Rolling Window Statistics Streams](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) events may contain non-ASCII characters encoded in UTF-8. +- In [SBE Market Data Streams](https://developers.binance.com/docs/binance-spot-api-docs/sbe-market-data-streams), if your request contains a symbol name containing non-ASCII characters, then the stream events may contain non-ASCII characters encoded in UTF-8. +- [UserDataStream events](https://developers.binance.com/docs/binance-spot-api-docs/user-data-stream) may contain non-ASCII characters encoded in UTF-8 if you own or trade any assets or symbols whose names contain non-ASCII characters. +- For full compatibility with Binance APIs, please ensure your code is designed to handle UTF-8-encoded strings. + +--- + +### 2025-12-09[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +- [Schema for FIX SBE](https://github.com/binance/binance-spot-api-docs/blob/master/sbe/schemas/spot-fixsbe-1_0.xml) has been updated to use `smallGroupSize16Encoding` in `MarketDataSnapshot` and use `presence="optional"` for incremental book ticker/depth `MDEntrySize` fields. +- Updated documentation re: [FIX vs FIX SBE](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) +- Added documentation in REST, and WebSocket APIs stating: + **Please avoid SQL keywords in requests** as they may trigger a security block by a WAF (Web Application Firewall) rule. + See [https://www.binance.com/en/support/faq/detail/360004492232](https://www.binance.com/en/support/faq/detail/360004492232) for more details. + +--- + +### 2025-12-02[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +**Notice:** The changes in this section will be gradually rolled out, and will take approximately up to two weeks to complete. + +#### General Changes[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +- Parameter `symbol` and `symbols` can now support Unicode values encoded in UTF-8. +- Following the announcement from [2025-11-14](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG), all documentation related to `!ticker@arr` has been removed. + - The feature will remain available until a future retirement announcement is made. + - Please use `@ticker` or `!miniTicker@arr` instead. + +#### FIX API[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +- Unicode values encoded in UTF-8 can now be accepted in FIX messages. This is allowed for the following tags only: + - `Currency (15)` + - `MiscFeeCurr (138)` + - `Symbol (55)` + - `SecondarySymbol (25019)` + - `CounterSymbol (25028)` + - `SecurityDesc (107)` +- When Unicode is put in a tag value that is not one of the tags above, FIX API will now send back a `RefTagID (371)` tag in the Reject `<3>`, pointing to exactly which tag is not allowed to contain Unicode. +- NewOrderList `` accepts `TriggerPriceDirection (1109)` without `TriggerPrice (1102)`. + +#### WebSocket Streams[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +- WebSocket Market Streams supports URL-encoded urls. + + + + +**Notice: The following changes will occur at approximately 2025-12-18 7:00 UTC**: + +- [ICEBERG\_PARTS](https://developers.binance.com/docs/binance-spot-api-docs/filters) will be increased to 25 for all symbols. +- [FIX SBE support](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) becomes available. +- [One Pays the Other (OPO)](https://github.com/binance/binance-spot-api-docs/blob/master/faqs/opo.md) becomes available on all symbols. + - `opoAllowed` begins to appear in Exchange Information requests, indicating if One-Pays-the-Other (OPO) orders are supported on each symbol. + - REST API: `GET /api/v3/exchangeInfo` + - WebSocket API: `exchangeInfo` + - New requests for OPO: + - REST API: + - `POST /api/v3/orderList/opo` + - `POST /api/v3/orderList/opoco` + - WebSocket API + - `orderList.place.opo` + - `orderList.place.opoco` + - FIX API + - NewOrderList `` has field `OPO (25046)`. Please update to the latest QuickFIX Schema for OPO support. +- STP mode [`TRANSFER`](https://developers.binance.com/docs/binance-spot-api-docs/faqs/stp_faq) has been added. The exact date that STP `TRANSFER` will be enabled has not yet been determined. +- **SBE: A new schema 3:2 ([spot\_3\_2.xml](https://github.com/binance/binance-spot-api-docs/blob/master/sbe/schemas/spot_3_2.xml)) is available.** + - The current schema 3:1 ([spot\_3\_1.xml](https://github.com/binance/binance-spot-api-docs/blob/master/sbe/schemas/spot_3_1.xml)) is deprecated and will be retired in 6 months as per our schema deprecation policy. + - Changes in 3:2: + - New enum variant `TRANSFER` for `selfTradePreventionMode` and `allowedSelfTradePreventionModes`. + - All schemas below 3:1 are unable to represent any response that could contain the STP mode `TRANSFER` (e.g. Exchange Information, order placement, order cancellation, or querying the status of an order). + When a response cannot be represented in the requested schema, an error is returned. +- FIX API changes: + - `LastFragment (893)` becomes deprecated. + - This means that the MarketIncrementalRefresh `` messages will no longer be fragmented and may contain more than 10,000 entries. + - The documentation has been updated to reflect this change. + - ListStatus `` will no longer emit the optional `symbol` field. + - This applies to FIX Order Entry and FIX Drop Copy. + - The documentation has been updated to reflect this change. + +--- + +### 2025-11-14[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +- All Market Tickers Stream (`!ticker@arr`) has been deprecated; This means this will be removed both from the documentation and from our systems at a later date. More details to follow. +- Please use [`@ticker`](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) or [`!miniTicker@arr`](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) instead. + +--- + +### 2025-11-12[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +- The steps on [how to manage a local order book correctly](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) has been corrected. + +--- + +### 2025-11-11[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +#### SBE Market Data[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +- **At 2025-11-26 07:00 UTC, the update speed of `@depth` and `@depth20` streams will be changed to 50ms**. + - This change will apply automatically to all users of SBE Market Data and doesn't require any action. + - The total amount of data received per second will be increased (up to 2x). + - [SPOT Testnet](https://testnet.binance.vision/) will have these changes at **2025-11-11 07:00 UTC**. + - [SBE Market Data](https://developers.binance.com/docs/binance-spot-api-docs/sbe-market-data-streams) has been updated to reflect these changes. + +--- + +### 2025-11-10[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +- "Last Updated" dates will be removed from all documents except for CHANGELOG. +- Moving forward, CHANGELOG will be the source of reference for when changes were made to any document. + +--- + +### 2025-10-28[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +**Notice: The following changes will be deployed on 2025-10-28, starting at 04:00 UTC and may take several hours to complete:** + +- An optional parameter, `symbolStatus`, has been added to the following endpoints: + - **REST API** + - `GET /api/v3/depth` + - `GET /api/v3/ticker/price` + - `GET /api/v3/ticker/bookTicker` + - `GET /api/v3/ticker/24hr` + - `GET /api/v3/ticker/tradingDay` + - `GET /api/v3/ticker` + - **WebSocket API** + - `depth` + - `ticker.price` + - `ticker.book` + - `ticker.24hr` + - `ticker.tradingDay` + - `ticker` +- When the parameter `symbolStatus=` is provided, only symbols whose trading status matches the specified `STATUS` will be included in the response:\_ + - If a single symbol is specified using the `symbol=` parameter and its trading status does not match the given `STATUS`, the endpoint will return error code [`-1220 SYMBOL_DOES_NOT_MATCH_STATUS`](https://developers.binance.com/docs/binance-spot-api-docs/errors). + - If multiple symbols are specified using the `symbols=[...]` parameter, the response will be an array that excludes any symbols whose trading status does not match `STATUS`. If no symbols from the symbols parameter have a trading status that matches `STATUS`, the response is an empty array. + - For endpoints where the `symbol` and `symbols` parameters are optional, omitting these parameters is treated as if all symbols had been specified in the `symbols=[...]` parameter. See the previous line for the behavior of `symbolStatus=`. + +--- + +### 2025-10-24[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +#### SBE[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +- SBE: schema 3:1 ([spot\_3\_1.xml](https://github.com/binance/binance-spot-api-docs/blob/master/sbe/schemas/spot_3_1.xml)) has been updated to support [listenToken Subscription Methods](https://developers.binance.com/docs/margin_trading/trade-data-stream/Listen-Token-Websocket-API) for Margin Trading. + +#### REST and WebSocket API[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +Following the announcement from [2025-04-07](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG), all documentation related with `listenKey` for use on `wss://stream.binance.com` has been removed. + +**We remind you that you should instead get user data updates by subscribing to the [User Data Stream on the WebSocket API](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/user-data-stream-requests). This will offer better performance (lower latency).** + +Please refer to the list of requests and methods below for more information. + +The features will remain available until a future retirement announcement is made. + +- REST API + + - `POST /api/v3/userDataStream` + - `PUT /api/v3/userDataStream` + - `DELETE /api/v3/userDataStream` +- WebSocket API + + - `userDataStream.start` + - `userDataStream.ping` + - `userDataStream.stop` + +--- + +### 2025-10-21[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +REST and WebSocket API: + +- Reminder that SBE 2:1 schema will be retired on 2025-10-24, [6 months after being deprecated](https://developers.binance.com/docs/binance-spot-api-docs/faqs/sbe_faq). +- The [SBE lifecycle for Production](https://github.com/binance/binance-spot-api-docs/blob/master/sbe/schemas/sbe_schema_lifecycle_prod.json) has been updated to reflect this change. + +--- + +### 2025-10-08[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +#### FIX API[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +- Updated [QuickFIX Schema](https://github.com/binance/binance-spot-api-docs/blob/master/fix/schemas/spot-fix-md.xml) for FIX Market Data: + - Updated `RecvWindow(25000)` to reflect microsecond support announced on [2025-08-12](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG). + - Updated [InstrumentList ``](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) message: + - Added fields: `StartPriceRange`, `EndPriceRange`. + - Made the following fields optional: `MinTradeVol(562)`, `MaxTradeVol(1140)`, `MinQtyIncrement(25039)`, `MarketMinTradeVol(25040)`, `MarketMaxTradeVol(25041)`, `MarketMinQtyIncrement(25042)`, `MinPriceIncrement(969)`. + - **The changes to InstrumentList are breaking changes, and will roll out at around 2025-10-23 07:00 UTC. Please update to the new schema before then.** + - [SPOT Testnet](https://testnet.binance.vision/) has the breaking changes already enabled. + +--- + +### 2025-09-29[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +**Notice: The following changes will be deployed on 2025-09-29, starting at 10:00 UTC and may take several hours to complete.** + +- Added an endpoint to retrieve the list of filters relevant to an account on a given symbol. This is the only endpoint that shows if an account has `MAX_ASSET` filters applied to it. + - REST API: [`GET /api/v3/myFilters`](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints) + - WebSocket API: [`myFilters`](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests) +- Comments in **SBE: schema 3:1 ([spot\_3\_1.xml](https://github.com/binance/binance-spot-api-docs/blob/master/sbe/schemas/spot_3_1.xml))** have been added, modified, and removed. Although there is no need for users of `3:1` to update to this version of the file, we advise updating to maintain consistency. +- Added documentation for filter [`MAX_ASSET`](https://developers.binance.com/docs/binance-spot-api-docs/filters). + +--- + +### 2025-09-18[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +- Updated documentation for `recvWindow` to reflect microsecond support announced on [2025-08-12](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG). + - REST API: [Timing Security](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/request-security) + - WebSocket API: [Timing Security](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/request-security) + +--- + +### 2025-09-12[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +- The [QuickFix schema for FIX Order Entry](https://github.com/binance/binance-spot-api-docs/blob/master/fix/schemas/spot-fix-oe.xml) has been updated to support Pegged Orders. +- Updated FIX API Documentation for `RecvWindow` in + - [Message Components](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + - [Timing Security](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +--- + +### 2025-08-28[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +- Updated SBE FAQ section [regarding legacy support](https://developers.binance.com/docs/binance-spot-api-docs/faqs/sbe_faq) to include more details on schema compatibility and explain `NonRepresentable` and `NonRepresentableMessage`. + +--- + +### 2025-08-26[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +- Updated "Request Security" documentation for [REST API](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/request-security) and [WebSocket API](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/request-security) with no functional changes. + +--- + +### 2025-08-25[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +- **SBE: schema 3:1 ([spot\_3\_1.xml](https://github.com/binance/binance-spot-api-docs/blob/master/sbe/schemas/spot_3_1.xml))** will be updated on **2025-08-25 at 05:00 UTC** + - The following fields have been renamed because the [SbeTool](https://developers.binance.com/docs/binance-spot-api-docs/faqs/sbe_faq) code generator has been found to generate Java code that does not compile. + - Although only users impacted by this issue need to update the schema, we advise all users to upgrade to the latest version to maintain consistency. + - Message `MaxAssetFilter` + - field `limitExponent` renamed to `qtyExponent` + - field `limit` renamed to `maxQty` + +--- + +### 2025-08-19[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +- `userDataStream.subscribe` returns `subscriptionId` in the responses. + This was missed in the [previous](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) changelog entry. + +--- + +### 2025-08-12[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +**Notice:** The changes in this section will be gradually rolled out, and will take approximately up to two weeks to complete. + +#### General Changes[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +- New error codes `-1120` and `1211`. See [Errors](https://developers.binance.com/docs/binance-spot-api-docs/errors) for more information. +- The following requests have a new structure called `specialCommission`. See [Commission Rates](https://developers.binance.com/docs/binance-spot-api-docs/faqs/commission_faq). + - REST API + - `GET /api/v3/account/commission` + - `POST /api/v3/order/test` with `computeCommissionRates=true` + - `POST /api/v3/sor/order/test` with `computeCommissionRates=true` + - WebSocket API + - `account.commission` + - `order.test` with `computeCommissionRates=true` + - `sor.order.test` with `computeCommissionRates=true` +- **SBE: A new schema 3:1 ([spot\_3\_1.xml](https://github.com/binance/binance-spot-api-docs/blob/master/sbe/schemas/spot_3_1.xml)) is available.** + - The current schema 3:0 ([spot\_3\_0.xml](https://github.com/binance/binance-spot-api-docs/blob/master/sbe/schemas/spot_3_0.xml)) is deprecated and will retire in 6 months as per our schema deprecation policy. + - Changes in schema 3:1: + - `ExchangeInfoResponse`: new field `pegInstructionsAllowed` + - `ExecutionReportEvent`: new fields `pricePeg`, `pricePegOffsetLevel`, `peggedPrice` + - `UserDataStreamSubscribeResponse`: new field `subscriptionId` + - New field `subscriptionId` for all user data stream events. + - Field `apiKey` renamed to `loggedOnApiKey` for `WebSocketSessionLogonResponse`, `WebSocketSessionStatusResponse` and `WebSocketSessionLogoutResponse` + - `OrderTestWithCommissionsResponse`: 2 new fields `specialCommissionForOrderMaker` and `specialCommissionForOrderTaker` + - `AccountCommissionResponse`: 4 new fields `specialCommissionMaker`, `specialCommissionTaker`, `specialCommissionBuyer` and `specialCommissionSeller` + - Support for `EXCHANGE_MAX_NUM_ORDER_LISTS`, `MAX_NUM_ORDER_LISTS`, and `MAX_NUM_ORDER_AMENDS` filters. + - `ExecutionReportEvent`: fields `rejectReason` and `origClientOrderId` now show their default values in SBE format to match the JSON format. + - `NonRepresentableMessage`: New message added to represent a message that cannot be represented in this schema ID and version. Receipt of this message indicates that something should be available, but it is not representable using the SBE schema currently in use. +- Orders with cumulative quantity of 0 in the final state `EXPIRED_IN_MATCH` (i.e., the order expired due to STP) will be archived after 90 days. +- Query order lists requests will first query the data in the cache, and if it cannot be found, will query the database. + - REST API: `GET /api/v3/openOrderLists` + - WebSocket API: `openOrderLists.status` + +#### WebSocket API[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +- A single WebSocket connection can subscribe to multiple User Data Streams at once. + - Only one subscription per account is allowed on a single connection. +- Method `userDataStream.subscribe.signature` has been added that allows you to subscribe to the User Data Stream without needing to login first. + - This also doesn’t require an Ed25519 API Key, and can work with any [API Key type](https://developers.binance.com/docs/binance-spot-api-docs/faqs/api_key_types). + - For [SBE support](https://developers.binance.com/docs/binance-spot-api-docs/faqs/sbe_faq), you need to use at least schema 3:1. +- Method `session.subscriptions` has been added to list all active subscriptions for the current session. +- The meaning of the field `userDataStream` in the session requests has changed slightly. + - Previously, this returned `true` if you were subscribed to the user data stream of your logged-on account. + - Now returns `true` if you have at least one active user data stream subscription, otherwise `false`. +- `userDataStream.unsubscribe` supports closing multiple subscriptions. + - When called with no parameter, this will close all subscriptions. + - When called with `subscriptionId`, this will attempt to close the subscription matching that Id, if it exists. + - The authorization for this request has been changed to `NONE`. +- Field `subscriptionId` has been added to the User Data Stream events payload when listening through the [WebSocket API](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api.md). This will identify which subscription the event is coming from. + +#### FIX API[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +- When a client sends a reject message, the FIX API will no longer send the client back a Reject `<3>` message. +- Error messages are now clearer when a tag is invalid, missing a value, or when the field value is empty or malformed. + - ``` + { "code": -1169, "msg": "Invalid tag number." } + ``` + + - ``` + { "code": -1177, "msg": "Tag specified without a value." } + ``` + + - ``` + { "code": -1102, "msg": "Field value was empty or malformed." } + ``` + + +#### Future Changes[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +The following changes will be available on **2025-08-27 starting at 07:00 UTC**: + +- Exchange Information requests will emit a new field, `pegInstructionsAllowed`. +- Bug fix: The Matching Engine will no longer accept order lists that exceed the order count filter limits. Affected filters: + - `MAX_NUM_ORDERS` + - `MAX_ALGO_ORDERS` + - `MAX_ICEBERG_ORDERS` + - `EXCHANGE_MAX_NUM_ORDERS` + - `EXCHANGE_MAX_ALGO_ORDERS` + - `EXCHANGE_MAX_ICEBERG_ORDERS` + +The following changes will be available on **2025-08-28 starting at 07:00 UTC**: + +- The [pegged orders](https://developers.binance.com/docs/binance-spot-api-docs/faqs/pegged_orders) functionality will be available. + - `pegInstructionsAllowed` will be set to `true` for all symbols, enabling the use of pegged orders for all APIs. + - The following conditional fields `pegPriceType`, `pegOffSetType`, `pegOffsetValues`, and `peggedPrice` will appear in responses of the following requests if the order is a pegged order: + - REST API + - `GET /api/v3/order` + - `GET /api/v3/orderList` + - `GET /api/v3/openOrderList` + - `GET /api/v3/allOrders` + - `DELETE /api/v3/order` + - `DELETE /api/v3/orderList` + - `DELETE /api/v3/openOrders` + - `PUT /api/v3/order/amend/keepPriority` + - WebSocket API + - `order.status` + - `orderList.status` + - `allOrders` + - `order.cancel` + - `orderList.cancel` + - `openOrders.cancelAll` + - `order.amend.keepPriority` + - FIX API + - `OrdType(40)` supports new value `P(PEGGED)` + - Tags `PegOffsetValue(211)`, `PegPriceType(1094)`, `PegMoveType(835)`, and `PegOffsetType(836)` have been added to the following messages: + - NewOrderSingle `` + - NewOrderList `` + - OrderCancelRequestAndNewOrderSingle `` + - When placing an order, the `ExecutionReport` `<8>` message will echo back `PegInstructions`, with an extra optional field `PeggedPrice (839)`. + - New error messages for pegged orders are added. Please see the [Errors](https://developers.binance.com/docs/binance-spot-api-docs/errors) document for more information. +- Changes with `recvWindow` will be enabled. + - A third check is performed after your message leaves our message broker, just before it is sent to the Matching Engine. + - This does not cover potential delays inside the Matching Engine itself. + - `recvWindow` supports microseconds. + - The value is still specified in milliseconds, but it can now include a decimal component for higher precision. + - This means the parameter can now support up to **three decimal places** (e.g., 6000.346). + - APIs affected: + - FIX API + - REST API + - WebSocket API +- New [`MAX_NUM_ORDER_LISTS`](https://developers.binance.com/docs/binance-spot-api-docs/filters) filter will be enabled, limiting the number of order lists to 20 per symbol. +- New [`MAX_NUM_ORDER_AMENDS`](https://developers.binance.com/docs/binance-spot-api-docs/filters) filter will be enabled, limiting each order to a maximum of 10 amendments. + +--- + +### 2025-08-07[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +- Updated FIX API documentation + - [FIX Market Data limits](https://developers.binance.com/docs/binance-spot-api-docs/fix-api): The subscription limit has always been present but was undocumented. + - [On message processing order](https://developers.binance.com/docs/binance-spot-api-docs/fix-api): Reworded and reformatted. + +--- + +### 2025-07-03[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +- Beginning at **2025-07-08 07:00 UTC**, [WebSocket Streams](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) will be upgraded. +- During the upgrade, **existing and new connections may be disconnected in less than 24 hours**. +- The upgrade may take up to 2 hours; We apologize for the inconvenience. + +--- + +### 2025-06-04[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +REST and WebSocket API: + +- Reminder that SBE 2:0 schema will be retired on 2025-06-12, [6 months after being deprecated](https://developers.binance.com/docs/binance-spot-api-docs/faqs/sbe_faq). +- The [SBE lifecycle for Production](https://github.com/binance/binance-spot-api-docs/blob/master/sbe/schemas/sbe_schema_lifecycle_prod.json) has been updated to reflect this change. + +--- + +### 2025-05-28[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +- Documented API timeout value and error under General API Information for each API: + - [FIX](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + - [REST](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) + - [WebSocket](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/general-api-information) + +--- + +### 2025-05-22[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +**Notice: The following changes will happen at 2025-06-06 7:00 UTC.** + +- The previous behavior of `recvWindow` on FIX, REST, and WebSocket APIs will be augmented by an additional check. + - To review, the existing behavior is: + - If `timestamp` is greater than `serverTime` + 1 second at receipt of the request, the request is rejected. Rejection by this check increments message limits (FIX API) and IP limits (REST and WebSocket APIs), but not Unfilled Order Count (order placement endpoints of all APIs). + - If the difference between `timestamp` and `serverTime` at receipt of the request is greater than `recvWindow`, the request is rejected. Rejection by this check increments message limits (FIX API) and IP limits (REST and WebSocket APIs) but not Unfilled Order Count (order placement endpoints of all APIs). + - The additional check is: + - Just before a request is forwarded to the Matching Engine, if the difference between `timestamp` and the current `serverTime` is greater than `recvWindow`, the request is rejected. Rejection by this check increments message limits (FIX API), IP limits (REST and WebSocket APIs), and Unfilled Order Count (order placement endpoints of all APIs). + - The documentation for Timing security has been updated to reflect the additional check. + - [REST API](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/request-security) + - [WebSocket API](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/request-security) + - [FIX API](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) +- Fixed a bug in FIX Market Data message InstrumentList ``. Previously, the value of `NoRelatedSym(146)` could have been incorrect. + +--- + +### 2025-04-29[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +- Features that currently require an Ed25519 API key will soon be opened up to HMAC and RSA keys. + - For example, subscribing to User Data Stream in WebSocket API will be possible with any API key type before listenKeys are removed. + - Users are still encouraged to migrate to Ed25519 API keys as they are more secure and performant on Binance Spot Trading. + - More details to come. + +--- + +### 2025-04-25[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +- The following request weights have been increased from 1 to 4: + - REST API: `PUT /api/v3/order/amend/keepPriority` + - WebSocket API: `order.amend.keepPriority` + - The documentation for both REST and WebSocket API has been updated to reflect these changes. +- Clarified that `SEQNUM` in the FIX-API is a 32-bit unsigned integer that rolls over. This has been the `SEQNUM` data type since the inception of the FIX-API. + +--- + +### 2025-04-21[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +**Clarification on the release of [Order Amend Keep Priority](https://developers.binance.com/docs/binance-spot-api-docs/faqs/order_amend_keep_priority) and [STP Decrement](https://developers.binance.com/docs/binance-spot-api-docs/faqs/stp_faq):** + +- At **2025-05-07 07:00 UTC** + - Order Amend Keep Priority will be enabled on all symbols. + - STP Decrement will be allowed on all symbols. +- At **2025-04-24, 07:00 UTC**, the field `amendAllowed` will become visible on Exchange Information requests, but the feature will not be enabled yet. +- [SPOT Testnet](https://testnet.binance.vision/) has both features enabled/allowed on all symbols. + +--- + +### 2025-04-08[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +**Notice:** The changes in this section will be gradually rolled out, and will take a week to complete. + +- New Error code `-2039` where if querying an order with both `orderId` and `origClientOrderId` and no order is found with this combination. + - Affected requests: + - REST API: `GET /api/v3/order` + - WebSocket API: `order.status` +- The [Errors Documentation](https://developers.binance.com/docs/binance-spot-api-docs/errors) has also been updated with the new error messages for code `-1034` when the FIX connection rate limits have exceeded. (More details can be found in yesterday's [update](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG)) + +--- + +### 2025-04-07[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +#### General Changes[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +**Notice:** The changes in this section will be gradually rolled out, and will take a week to complete. + +- FIX Market Data connection limits were increased from 5 to 100 on January 16, 2025. This was not previously highlighted in changelog. +- New Error code `-2038` for order amend keep priority requests that fail. +- New messages for error code `-1034`. +- If the unfilled order count for `intervalNum:DAY` is exceeded, the unfilled order count for `intervalNum:SECOND` is no longer incremented. +- Previously, the request weight for myTrades was 20 regardless of the parameters provided. Now, if you provide `orderId`, the request weight is 5. + - REST API: `GET /api/v3/myTrades` + - WebSocket API: `myTrades` +- Change when querying and deleting orders: + - When neither `orderId` nor `origClientOrderId` are present, the request is now rejected with `-1102` instead of `-1128`. + - Affected requests: + - REST API: + - `GET /api/v3/order` + - `DELETE /api/v3/order` + - WebSocket API + - `order.status` + - `order.cancel` + - FIX API + - OrderCancelRequest `` + +#### FIX API[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +**Notice:** The following changes will occur during April 21, 2025. + +- FIX API verifies that `EncryptMethod(98)` is 0 at Logon ``. +- FIX Order Entry connection limits will be a maximum of 10 concurrent connections per account. +- The connection rate limits are now enforced. Note that these limits are checked independently for both the account and the IP address. + - FIX Order Entry: 15 connection attempts within 30 seconds + - FIX Drop Copy: 15 connection attempts within 30 seconds + - FIX Market Data: 300 connection attempts within 300 seconds +- News `` contains a countdown until disconnection in the Headline field. + - Following the completion of this update, when the server enters maintenance, a `News` message will be sent to clients **every 10 seconds for 10 minutes**. After this period, clients will be logged out and their sessions will be closed. +- OrderCancelRequest `` and OrderCancelRequestAndNewOrderSingle `` now allow both `orderId` and `clientOrderId`. +- The [QuickFix schema for FIX OE](https://github.com/binance/binance-spot-api-docs/blob/master/fix/schemas/spot-fix-oe.xml) is updated to support the Order Amend Keep Priority feature and new STP mode, `DECREMENT`. + +#### User Data Streams[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +- **Receiving user data streams on wss://stream.binance.com:9443 using a `listenKey` is now deprecated.** + - This feature will be removed from our systems at a later date. +- **Instead, you should get user data updates by subscribing to the [User Data Stream on the WebSocket API](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/user-data-stream-requests)**. + - This should offer slightly better performance **(lower latency)**. + - This requires the use of an Ed25519 API Key. +- In a future update, information about the base WebSocket endpoint for the User Data Streams will be removed. +- In a future update, the following requests will be removed from the documentation: + - `POST /api/v3/userDataStream` + - `PUT /api/v3/userDataStream` + - `DELETE /api/v3/userDataStream` + - `userDataStream.start` + - `userDataStream.ping` + - `userDataStream.stop` +- The [User Data Stream documentation](https://developers.binance.com/docs/binance-spot-api-docs/user-data-stream) will remain as reference for the payloads you can receive. + +#### Future Changes[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +The following changes will occur at **April 24, 2025, 07:00 UTC**: + +- [Order Amend Keep Priority](https://github.com/binance/binance-spot-api-docs/blob/master/faqs/order_amend_keep_priority.md) becomes available. (Note that the symbol has to have the feature enabled to be used.) + - **UPDATE 2025-04-21: The exact date "Order Amend Keep Priority" will be enabled has not yet been determined.** + - New field `amendAllowed` becomes visible in Exchange Information responses. + - REST API: `GET /api/v3/exchangeInfo` + - WebSocket API: `exchangeInfo` + - FIX API: New Order Entry Messages **OrderAmendKeepPriorityRequest** and **OrderAmendReject** + - REST API: `PUT /api/v3/order/amend/keepPriority` + - WebSocket API: `order.amend.keepPriority` +- STP mode `DECREMENT` becomes visible in Exchange Information if the symbol has it configured. + - **UPDATE 2025-04-21: The exact date `DECREMENT` STP will be enabled has not yet been determined.** + - Instead of expiring only the maker, only the taker, or unconditionally both orders, STP decrement decreases the available quantity of **both** orders and increases the `prevented quantity` of **both** orders by the amount of the prevented match. + - This expires the order with less available quantity as (`filled quantity` + `prevented quantity`) equals `order quantity`. Both orders expire if their available quantities are equal. It is called a "decrement" because it reduces available quantity. +- Behavior when querying and/or canceling with `orderId` and `origClientOrderId/cancelOrigClientOrderId`: + - The behavior when both parameters were provided was not consistent across all endpoints. + - Moving forward, when both parameters are provided, the order is first searched for using its `orderId`, and if found, `origClientOrderId`/`cancelOrigClientOrderId` is checked against that order. If both conditions pass, the request succeeds. If both conditions are not met the request is rejected. + - Affected requests: + - REST API: + - `GET /api/v3/order` + - `DELETE /api/v3/order` + - `POST /api/v3/order/cancelReplace` + - WebSocket API: + - `order.status` + - `order.cancel` + - `order.cancelReplace` + - FIX API + - OrderCancelRequest `` + - OrderCancelRequestAndNewOrderSingle `` +- Behavior when canceling with `listOrderId` and `listClientOrderId`: + - The behavior when both parameters were provided was not consistent across all endpoints. + - Moving forward, when both parameters are passed, the order list is first searched for using its `listOrderId`, and if found, `listClientOrderId` is checked against that order list. If both conditions are not met the request is rejected. + - Affected requests: + - REST API + - `DELETE /api/v3/orderList` + - WebSocket API + - `orderList.cancel` +- **SBE: A new schema 3:0 ([spot\_3\_0.xml](https://github.com/binance/binance-spot-api-docs/blob/master/sbe/schemas/spot_3_0.xml)) is now available.** + - The current schema 2:1 ([spot\_2\_1.xml](https://github.com/binance/binance-spot-api-docs/blob/master/sbe/schemas/spot_2_1.xml)) is now deprecated and will be retired in 6 months as per our schema deprecation policy. + - Note that trying to use schema 3:0 before it is released will result in an error. + - Changes in schema 3:0: + - Support for Order Amend Keep Priority: + - Added field `amendAllowed` to ExchangeInfoResponse. + - New Messages `OrderAmendmentsResponse` and `OrderAmendKeepPriorityResponse` + - All enums now have a `NON_REPRESENTABLE` variant. This will be used to encode new enum values in the future, which would be incompatible with 3:0. + - New enum variant `DECREMENT` for `selfTradePreventionMode` and `allowedSelfTradePreventionModes` + - `symbolStatus` enum values `AUCTION_MATCH`, `PRE_TRADING` and `POST_TRADING` have been removed. + - Fields `usedSor`, `orderCapacity`, `workingFloor`, `preventedQuantity`, and `matchType` are no longer optional. + - Field `orderCreationTime` in `ExecutionReportEvent` is now optional. + - When using deprecated schema 2:1 on the WebSocket API to listen to the User Data Stream: + - `ListStatusEvent` field `listStatusType` will be rendered as `ExecStarted` when it should have been `Updated`. Upgrade to schema 3:0 to get the correct value. + - `ExecutionReportEvent` field `selfTradePreventionMode` will be rendered as `None` when it should have been `Decrement`. This only happens when `executionType` is `TradePrevention`. + - `ExecutionReportEvent` field `orderCreationTime` will be rendered as -1 when it has no value. + - All schemas below 3:0 are unable to represent responses for Order Amend Keep Priority requests and any response that could contain the STP mode `DECREMENT` (e.g. Exchange Information, order placement, order cancelation, or querying the status of your order). When a response cannot be represented in the requested schema, an error is returned. + +--- + +### 2025-04-03[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +- Following SPOT Testnet's latest announcement, updating the URL in the WebSocket API to the latest URL for [SPOT Testnet](https://testnet.binance.vision/). + +--- + +### 2025-03-31[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +- Added a clarification on the performance of canceling an order. + +--- + +### 2025-03-10[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +- **Notice: The following changes will happen on 2025-03-13 09:00 UTC** + - FIX Drop Copy sessions will have a limit of **60 messages per minute**. + - FIX Market Data sessions will have a limit of **2000 messages per minute**. + - The FIX API documentation has been updated to reflect the upcoming changes. +- **SBE Market Data Streams will be available on March 18 2025, 07:00 UTC.** These streams offer a smaller payload and should offer better latency than the equivalent JSON streams for a subset of latency-sensitive market data streams. + - Streams available in SBE format: + - Real-time: trade stream + - Real-time: best bid/ask + - Every 100 ms: diff. depth + - Every 100 ms: partial book depth + - For more information please refer to the [SBE Market Data Streams](https://developers.binance.com/docs/binance-spot-api-docs/sbe-market-data-streams). + +--- + +### 2025-03-05[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +- **Notice: The following changes will happen on March 10, 2025 12:00 UTC.** + The following request weights will be increased from 2 to 4: + - REST API: `GET /api/v3/aggTrade` + - WebSocket API: `trades.aggregate` +- The documentation for both REST and WebSocket API has been updated to reflect the upcoming changes. + +--- + +### 2025-02-12[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +- **Notice: These changes will take effect on February 26, 2025 05:00 UTC.** Please ensure you have downloaded the latest schema before then. +- `AggressorSide (2446)` will be rendered in the [FIX Market Data Trade Stream](https://developers.binance.com/docs/binance-spot-api-docs/fix-api). The QuickFix schema [file](https://github.com/binance/binance-spot-api-docs/blob/master/fix/schemas/spot-fix-md.xml) has also been updated. + +--- + +### 2025-01-28[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +- **Notice: These changes will be gradually rolled out between February 3, 2025 and February 14, 2025.** **The following changes will apply to WebSocket Market Data Streams, User Data Streams, and the WebSocket API:** + - Our WebSocket services will send a ping frame **every 20 seconds** instead of 3 minutes. + - The allowed pong delay will be **every 1 minute** instead of 10 minutes. + - The documentation for these services have been updated to reflect the change. + +--- + +### 2025-01-09[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +- FIX Market Data will be available at **January 16, 05:00 UTC**. The FIX API documentation has been updated regarding this feature. +- Please refer to this [link](https://github.com/binance/binance-spot-api-docs/blob/master/fix/schemas/spot-fix-md.xml) for the QuickFIX Schema for FIX Market Data. + +--- + +### 2024-12-17[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +General Changes: + +The system now supports microseconds in all related time and/or timestamp fields. Microsecond support is **opt-in**, by default the requests and responses still use milliseconds. Examples in documentation are also using milliseconds for the foreseeable future. + +WebSocket Streams + +- A new optional parameter `timeUnit` can be used in the connection URL to select the time unit. + - For example: `/stream?streams=btcusdt@trade&timeUnit=millisecond` + - Supported values are: + - `MILLISECOND` + - `millisecond` + - `MICROSECOND` + - `microsecond` + - If the time unit is not selected, milliseconds will be used by default. + +REST API + +- A new optional header `X-MBX-TIME-UNIT` can be sent in the request to select the time unit. + - Supported values: + - `MILLISECOND` + - `millisecond` + - `MICROSECOND` + - `microsecond` + - The time unit affects timestamp fields in JSON responses (e.g., `time`, `transactTime`). + - SBE responses continue to be in microseconds regardless of time unit. + - If the time unit is not selected, milliseconds will be used by default. +- Timestamp parameters (e.g. `startTime`, `endTime`, `timestamp)` can now be passed in milliseconds or microseconds. + +WebSocket API + +- A new optional parameter `timeUnit` can be used in the connection URL to select the time unit. + - Supported values: + - `MILLISECOND` + - `millisecond` + - `MICROSECOND` + - `microsecond` + - The time unit affects timestamp fields in JSON responses (e.g., `time`, `transactTime`). + - SBE responses continue to be in microseconds regardless of time unit. + - If the time unit is not selected, milliseconds will be used by default. +- Timestamp parameters (e.g. `startTime`, `endTime`, `timestamp)` can now be passed in milliseconds or microseconds. + +User Data Streams + +- A new optional parameter `timeUnit` can be used in the connection URL to select the time unit. + - Supported values + - `MILLISECOND` + - `MICROSECOND`. + - `microsecond` + - `millisecond` + +--- + +### 2024-12-09[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +**Notice:** The changes below will be rolled out starting at **2024-12-12** and may take approximately a week to complete. + +General Changes + +- Timestamp parameters now reject values too far into the past or the future. To be specific, the parameter will be rejected if: + - `timestamp` before 2017-01-01 (less than 1483228800000) + - `timestamp` is more than 10 seconds after the current time (e.g., if current time is 1729745280000 then it is an error to use 1729745291000 or greater) +- If `startTime` and/or `endTime` values are outside of range, the values will be adjusted to fit the correct range. +- The field for quote order quantity (`origQuoteOrderQty`) has been added to responses that previously did not have it. Note that for order placement endpoints the field will only appear for requests with `newOrderRespType` set to `RESULT` or `FULL`. + - Please refer to the table below for affected requests with: `origQuoteOrderQty`: + +Service + +Request + +REST + +`POST /api/v3/order` + +`POST /api/v3/sor/order` + +`POST /api/v3/order/oco` + +`POST /api/v3/orderList/oco` + +`POST /api/v3/orderList/oto` + +`POST /api/v3/orderList/otoco` + +`DELETE /api/v3/order` + +`DELETE /api/v3/orderList` + +`POST /api/v3/order/cancelReplace` + +WebSocket API + +`order.place` + +`sor.order.place` + +`orderList.place` + +`orderList.place.oco` + +`orderList.place.oto` + +`orderList.place.otoco` + +`order.cancel` + +`orderList.cancel` + +`order.cancelReplace` + +SBE + +- A new schema 2:1 [spot\_2\_1.xml](https://github.com/binance/binance-spot-api-docs/blob/master/sbe/schemas/spot_2_1.xml) has been released. The current schema 2:0 [spot\_2\_0.xml](https://github.com/binance/binance-spot-api-docs/blob/master/sbe/schemas/spot_2_0.xml) will thus be deprecated, and retired from the API in 6 months as per our schema deprecation policy. +- Schema 2:1 is a backward compatible update of schema 2:0. You will always receive payloads in 2:1 format when you request either schema 2:0 or 2:1. +- Changes in SBE schema 2:1: + - New field `origQuoteOrderQty` in order placement/cancellation responses (Note: Decoders generated using the 2:0 schema will skip this field.): + - `NewOrderResultResponse` + - `NewOrderFullResponse` + - `CancelOrderResponse` + - `NewOrderListResultResponse` + - `NewOrderListFullResponse` + - `CancelOrderListResponse` + - WebSocket API only: New field `userDataStream` in session status responses: + - `WebSocketSessionLogonResponse` + - `WebSocketSessionStatusResponse` + - `WebSocketSessionLogoutResponse` + - WebSocket API only: New messages for User Data Stream support: + - `UserDataStreamSubscribeResponse` + - `UserDataStreamUnsubscribeResponse` + - `BalanceUpdateEvent` + - `EventStreamTerminatedEvent` + - `ExecutionReportEvent` + - `ExternalLockUpdateEvent` + - `ListStatusEvent` + - `OutboundAccountPositionEvent` + +WebSocket API + +- You can now subscribe to User Data Stream events through your WebSocket API connection. + - Note: This feature is only available for users of the Ed25519 API keys. + - Note: New SBE schema 2:1 is required for User Data Stream subscriptions in SBE format. +- New requests: + - `userDataStream.subscribe` + - `userDataStream.unsubscribe` +- Changes to `session.logon`, `session.status`, and `session.logout` + - Added a new field `userDataStream` indicating if the user data stream subscription is active. +- Fixed a bug where you wouldn't receive a new listenKey using `userDataStream.start` after `session.logon` + +User Data Stream + +- WebSocket API only: New event `eventStreamTerminated` is emitted when you either logout from your websocket session or you have unsubscribed from the user data stream. +- New event `externalLockUpdate` is sent when your spot wallet balance is locked/unlocked by an external system. + +FIX API + +- The [schema](https://github.com/binance/binance-spot-api-docs/blob/master/fix/schemas/spot-fix-oe.xml) has been updated with a new Administrative message News , which can be used for all FIX services. Receiving this message indicates that your connection is about to be closed. + +The following changes will occur **between 2024-12-16 to 2024-12-20**: + +- Fixed a bug that prevented orders from being placed when submitting OCOs on the `BUY` side without providing a `stopPrice`. +- `TAKE_PROFIT` and `TAKE_PROFIT_LIMIT` support has been added for OCOs. + - Previously OCOs could only be composed by the following order types: + - `LIMIT_MAKER` + `STOP_LOSS` + - `LIMIT_MAKER` + `STOP_LOSS_LIMIT` + - Now OCOs can be composed of the following order types: + - `LIMIT_MAKER` + `STOP_LOSS` + - `LIMIT_MAKER` + `STOP_LOSS_LIMIT` + - `TAKE_PROFIT` + `STOP_LOSS` + - `TAKE_PROFIT` + `STOP_LOSS_LIMIT` + - `TAKE_PROFIT_LIMIT` + `STOP_LOSS` + - `TAKE_PROFIT_LIMIT` + `STOP_LOSS_LIMIT` + - This is supported by the following requests: + - `POST /api/v3/orderList/oco` + - `POST /api/v3/orderList/otoco` + - `orderList.place.oco` + - `orderList.place.otoco` + - `NewOrderList` + - Error code -1167 will be obsolete after this update and will be removed from the documentation in a later update. + +--- + +### 2024-10-18[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +REST and WebSocket API: + +- Reminder that SBE 1:0 schema will be disabled on 2024-10-25, [6 months after being deprecated](https://developers.binance.com/docs/binance-spot-api-docs/faqs/sbe_faq), as per our SBE policy. +- The [SBE lifecycle for Prod](https://github.com/binance/binance-spot-api-docs/blob/master/sbe/schemas/sbe_schema_lifecycle_prod.json) has been updated to reflect this change. + +--- + +### 2024-10-17[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +Changes to Exchange Information (i.e. [`GET /api/v3/exchangeInfo`](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-endpoints) from REST and [`exchangeInfo`](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/general-requests) for WebSocket API). + +- A new optional parameter `showPermissionSets` can be used to hide the permissions from `permissionsSets`; This can be used for a reduced payload size. +- A new optional parameter `symbolStatus` can now be used to only show symbols with the specified status. (e.g. `TRADING`, `HALT`, `BREAK`) + +--- + +### 2024-08-26[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +- [Spot Unfilled Order Count Rules](https://developers.binance.com/docs/binance-spot-api-docs/faqs/order_count_decrement) have been updated to explain how to decrease your unfilled order count when placing orders. + +--- + +### 2024-08-16[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +**Notice:** The changes below are being rolled out gradually, and may take approximately a week to complete. + +General Changes: + +- New error messages have been added when quote quantity market orders (aka reverse market orders) are rejected in low-liquidity situations. + +--- + +### 2024-08-01[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +- [FIX API and Drop Copy Sessions](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) will be available on **August 8, 05:00 UTC**. + +--- + +### 2024-07-26[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +- [FIX API and Drop Copy Sessions](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) has been added to the documentation. +- The release date to the live exchange has not been determined. + +--- + +### 2024-07-22[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +General changes: + +- Fixed a bug where klines had incorrect timestamps. + - REST API: `GET /api/v3/klines` and `GET /api/v3/uiKlines` with `timeZone` parameter + - WebSocket API: `klines` and `uiKlines` with `timeZone` parameter + - WebSocket Streams: `@kline_@+08:00` streams + +--- + +### 2024-06-11[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +- On **June 11, 05:00 UTC**, One-Triggers-the-Other (OTO) orders and One-Triggers-a-One-Cancels-The-Other (OTOCO) orders will be enabled. (Note this may take a few hours to be rolled out to all servers.) + - New requests have been added: + - REST API: + - `POST /api/v3/orderList/oto` + - `POST /api/v3/orderList/otoco` + - WebSocket API: + - `orderList.place.oto` + - `orderList.place.otoco` +- On **June 18, 05:00 UTC**, Buyer order ID `b` and Seller order ID `a` will be removed from the Trade Streams (i.e. `@trade`). (Note that this may take a few hours to be rolled out to all servers.) + - [WebSocket Streams](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) has been updated regarding this change. + - To monitor if your order was part of a trade, please listen to the [User Data Streams](https://developers.binance.com/docs/binance-spot-api-docs/user-data-stream) + +--- + +### 2024-06-06[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +This will be available by **June 6, 11:59 UTC**. + +REST API + +- `orderRateLimitExceededMode` has been added to `POST /api/v3/order/cancelReplace`. + +WebSocket API + +- `orderRateLimitExceededMode` has been added to `order.cancelReplace`. + +--- + +### 2024-05-30[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +WebSocket Streams: + +- Kline/Candlestick streams can now support a UTC+8 timezone offset. (e.g. `btcusdt@kline_1d@+08:00`) + +--- + +### 2024-04-10[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +The following changes have been postponed to take effect on **April 25, 05:00 UTC** + +General changes: + +- Symbol permission information in Exchange Information responses has moved from field `permissions` to field `permissionSets`. +- Field `permissions` will be empty and will be removed in a future release. +- Previously, `"permissions":["SPOT","MARGIN"]` meant that you could place an order on the symbol if your account had `SPOT` or `MARGIN` permissions. The equivalent is `"permissionSets":[["SPOT","MARGIN"]]`. (Note the extra set of square brackets.) Each array of permissions inside the `permissionSets` array is called a "permission set". +- Symbol permissions can now be more complex. `"permissionSets":[["SPOT","MARGIN"],["TRD_GRP_004","TRD_GRP_005"]]` means that you may place an order on the symbol if your account has SPOT or MARGIN permissions **and** `TRD_GRP_004` or `TRD_GRP_005` permissions. There may be an arbitrary number of permission sets in a symbol's `permissionSets`. + +REST API + +- `otoAllowed` will now appear on `GET /api/v3/exchangeInfo`, that indicates if One-Triggers-the-Other (OTO) orders are supported on that symbol. + +WebSocket API + +- `otoAllowed` will now appear on `exchangeInfo`, that indicates if One-Triggers-the-Other (OTO) orders are supported on that symbol. + +SBE + +- A new schema 2:0 [spot\_2\_0.xml](https://github.com/binance/binance-spot-api-docs/blob/master/sbe/schemas/spot_2_0.xml) has been released. The current schema 1:0 [spot\_1\_0.xml](https://github.com/binance/binance-spot-api-docs/blob/becd4d44a09d94821d2dc761ba9197aae8b495c3/sbe/schemas/spot_1_0.xml) will thus be deprecated, and retired from the API in 6 months as per our schema deprecation policy. +- When using schema 1:0 on REST API or WebSocket API, group "permissions" in message "ExchangeInfoResponse" will always be empty. Upgrade to schema 2:0 to find permission information in group "permissionSets". See General changes above for more details. +- Deprecated OCO requests will still be supported by the latest schema. +- Note that trying to use schema 2:0 before it is actually released will result in an error. + +--- + +### 2024-04-02[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +**Notice:** The changes below are being rolled out gradually, and will take approximately a week to complete. + +General changes: + +- `GET /api/v3/account` has a new optional parameter `omitZeroBalances`, which if enabled hides all zero balances. +- `account.status` has a new optional parameter `omitZeroBalances` which if enabled hides all zero balances. +- **The weight of the following requests has been increased from 10 to 25 (This will take effect on April 4, 2024)**: + - `GET /api/v3/trades` + - `GET /api/v3/historicalTrades` + - `trades.recent` + - `trades.historical` + +User Data Stream: + +- New event `listenKeyExpired` that will be emitted in the streams if the `listenKey` expired. + +REST API + +- The `POST /api/v3/order/oco` endpoint is now deprecated on the REST API. You should use the new `POST /api/v3/orderList/oco` endpoint instead. Note that this new endpoint uses different parameters. + +WebSocket API + +- The `orderList.place` request is now deprecated on the WebSocket API. You should now use the new `orderList.place.oco` request instead. Note that this new request uses different parameters. + +**The following will take effect _approximately_ a week after the release date:** + +General changes: + +- Symbol permission information in Exchange Information responses has moved from field `permissions` to field `permissionSets`. +- Field `permissions` will be empty and will be removed in a future release. +- Previously, `"permissions":["SPOT","MARGIN"]` meant that you could place an order on the symbol if your account had `SPOT` or `MARGIN` permissions. The equivalent is `"permissionSets":[["SPOT","MARGIN"]]`. (Note the extra set of square brackets.) Each array of permissions inside the `permissionSets` array is called a "permission set". +- Symbol permissions can now be more complex. `"permissionSets":[["SPOT","MARGIN"],["TRD_GRP_004","TRD_GRP_005"]]` means that you may place an order on the symbol if your account has SPOT or MARGIN permissions **and** `TRD_GRP_004` or `TRD_GRP_005` permissions. There may be an arbitrary number of permission sets in a symbol's `permissionSets`. + +REST API + +- `otoAllowed` will now appear on `GET /api/v3/exchangeInfo`, that indicates if One-Triggers-the-Other (OTO) orders are supported on that symbol. + +WebSocket API + +- `otoAllowed` will now appear on `exchangeInfo`, that indicates if One-Triggers-the-Other (OTO) orders are supported on that symbol. + +SBE + +- A new schema 2:0 [spot\_2\_0.xml](https://github.com/binance/binance-spot-api-docs/blob/master/sbe/schemas/spot_2_0.xml) has been released. The current schema 1:0 [spot\_1\_0.xml](https://github.com/binance/binance-spot-api-docs/blob/becd4d44a09d94821d2dc761ba9197aae8b495c3/sbe/schemas/spot_1_0.xml) will thus be deprecated, and retired from the API in 6 months as per our schema deprecation policy. +- When using schema 1:0 on REST API or WebSocket API, group "permissions" in message "ExchangeInfoResponse" will always be empty. Upgrade to schema 2:0 to find permission information in group "permissionSets". See General changes above for more details. +- Deprecated OCO requests will still be supported by the latest schema. +- Note that trying to use schema 2:0 before it is actually released will result in an error. + +--- + +### 2024-02-28[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +**This will take effect on March 5, 2024.** + +Simple Binary Encoding (SBE) will be added to the live exchange, both for the Rest API and WebSocket API. + +For more information on SBE, please refer to the [FAQ](https://developers.binance.com/docs/binance-spot-api-docs/faqs/sbe_faq) + +--- + +### 2024-02-08[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +The SPOT WebSocket API can now support SBE on [SPOT Testnet](https://testnet.binance.vision/). + +The SBE schema has been updated with WebSocket API metadata without incrementing either `schemaId` or `version`. + +Users using SBE only on the REST API may continue to use the SBE schema with git commit hash [`128b94b2591944a536ae427626b795000100cf1d`](https://github.com/binance/binance-spot-api-docs/blob/128b94b2591944a536ae427626b795000100cf1d/sbe/schemas/spot_1_0.xml) or update to the newly-published SBE schema. + +Users who want to use SBE on the WebSocket API must use the [newly-published SBE schema](https://github.com/binance/binance-spot-api-docs/blob/becd4d44a09d94821d2dc761ba9197aae8b495c3/sbe/schemas/spot_1_0.xml). + +The [FAQ](https://developers.binance.com/docs/binance-spot-api-docs/faqs/sbe_faq) for SBE has been updated. + +--- + +### 2023-12-08[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +Simple Binary Encoding (SBE) has been added to [SPOT Testnet](https://testnet.binance.vision/). + +This will be added to the live exchange at a later date. + +For more information on what SBE is, please refer to the [FAQ](https://developers.binance.com/docs/binance-spot-api-docs/faqs/sbe_faq) + +--- + +### 2023-12-04[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +**Notice:** The changes below are being rolled out gradually, and will take approximately a week to complete. + +General Changes: + +- Error message `Precision is over the maximum defined for this asset.` has been changed to `Parameter '%s' has too much precision.` + - This error message is returned when a parameter has more precision than allowed: e.g. if `base asset` precision is 6 and `quantity=0.1234567` then this error message will appear. + - This affects all requests with the following parameters: + - `quantity` + - `quoteOrderQty` + - `icebergQty` + - `limitIcebergQty` + - `stopIcebergQty` + - `price` + - `stopPrice` + - `stopLimitPrice` +- Requests for open OCO now correctly return results in **ascending order**. This affects the following requests: + - REST API: `GET /api/v3/openOrderList` + - WebSocket API: `openOrderList.status` +- Requests for all OCO now correctly return results in **ascending order** when `startTime` or `fromId` are specified. This affects the following requests: + - REST API: `GET /api/v3/allOrderList` + - WebSocket API: `allOrderLists` +- Fixed a bug where order query requests would incorrectly return [`-2026 ORDER_ARCHIVED`](https://developers.binance.com/docs/binance-spot-api-docs/errors) error for newly placed orders. + - REST API: `GET /api/v3/order` + - WebSocket API: `order.status` + +REST API + +- New endpoint `GET /api/v3/account/commission` +- New endpoint `GET /api/v3/ticker/tradingDay` +- `GET /api/v3/avgPrice` response has a new field `closeTime`, indicating the last trade time. +- `GET /api/v3/klines` and `/api/v3/uiKlines` have a new optional parameter `timeZone`. +- `POST /api/v3/order/test` and `POST /api/v3/sor/order/test` have a new optional parameter `computeCommissionRates`. +- Changes regarding invalid endpoints being sent: + - Previously, if you query an non-existing endpoint (e.g. `curl -X GET "https://api.binance.com/api/v3/exchangie`) you would get a HTTP 404 code with the response `

404 Not found

` + - From now on the HTML response will only appear if the Accept request header has `text/html` for this situation. The HTTP code will remain the same. + +WebSocket API + +- New request `account.commission` +- New requests to allow session authentication: **(Note that these requests can only be used with Ed25519 keys.)** + - `session.logon` + - `session.logout` + - `session.status` +- New request `ticker.tradingDay` +- `avgPrice` response has a new field `closeTime`, indicating the last trade time. +- `klines` and `uiKlines` have a new optional parameter `timeZone`. +- `order.test` and `sor.order.test` have a new optional parameter `computeCommissionRates`. +- Fixed a bug where unsolicited pongs sent before the ping would cause disconnection. + +WebSocket Streams + +- New stream `@avgPrice` +- `id` now supports the same values as used for `id` in the WebSocket API: + - 64-bit signed integers (previously this was unsigned) + - Alphanumeric strings, max of 36 in length + - `null` +- Fixed a bug where unsolicited pongs sent before the ping would cause disconnection. + +User Data Streams + +- When an event of type `executionReport` has an execution type (`x`) of `TRADE_PREVENTION`, fields `l`, `L` and `Y` will now always be 0. New fields `pl`, `pL` and `pY` will describe the prevented execution quantity, prevented execution price, and prevented execution notional instead. These new fields show the values of what would `l`, `L` and `Y` have been if the taker order didn't have self-trade prevention enabled. + +**The following will take effect _approximately_ a week after the release date:** + +- Symbol Permissions will only affect order placement, not cancellation. + - `permissions` still apply to Cancel-Replace orders (i.e. The cancellation won't be allowed if your account does have the permission to place an order using this request.) + +--- + +### 2023-10-19[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +**Effective on 2023-10-19 00:00 UTC** + +- The request weights of the following requests have been increased: + +REST API + +WebSocket API + +Condition + +Previous Request Weight + +New Request Weight + +`GET /api/v3/trades` + +`trades.recent` + +N/A + +2 + +10 + +`GET /api/v3/depth` + +`depth` + +**Limit 1-100** + +2 + +5 + +**Limit 101-500** + +10 + +25 + +**Limit 501-1000** + +20 + +50 + +**Limit 1001-5000** + +100 + +250 + +--- + +### 2023-10-03[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +- **Order decrement feature went live at 06:15 UTC**. +- For more information on this feature, please refer to our [FAQ](https://developers.binance.com/docs/binance-spot-api-docs/faqs/order_count_decrement) + +--- + +### 2023-08-25[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +- For WebSocket API, removed `RAW REQUESTS` rate limit in `exchangeInfo`, replaced it with `CONNECTIONS` rate limit, which is the limit for new Websocket connections. + +**The following changes will be effective from 2023-08-25 at UTC 00:00.** + +- The `CONNECTIONS` rate limit for WebSocket API has been adjusted to 300 every 5 minutes. +- The `REQUEST_WEIGHT` rate limit for both REST and WebSocket API has been adjusted to 6,000 every minute. +- The `RAW_REQUESTS` rate limit for REST API has been adjusted to 61,000 every 5 minutes. +- Previously, connecting to WebSocket API used to cost 1 weight. **The cost is now 2**. +- The weights to the following requests for both REST API and WebSocket API have been adjusted. + +Please refer to the table for more details: + +Request + +Previous Request Weight + +New Request Weight + +`GET /api/v3/order` +`order.status` + +2 + +4 + +`GET /api/v3/orderList` +orderList.status + +2 + +4 + +`GET /api/v3/openOrders` +`openOrders.status` - **With `symbol`** + +3 + +6 + +`GET /api/v3/openOrders` +`openOrders.status` - **Without `symbol`** + +40 + +80 + +`GET /api/v3/openOrderList` +`openOrderLists.status` + +3 + +6 + +`GET /api/v3/allOrders` +`allOrders` + +10 + +20 + +`GET /api/v3/allOrderList` +`allOrderLists` + +10 + +20 + +`GET /api/v3/myTrades` +`myTrades` + +10 + +20 + +`GET /api/v3/myAllocations` +`myAllocations` + +10 + +20 + +`GET /api/v3/myPreventedMatches` +`myPreventedMatches` - **Using `preventedMatchId`** + +1 + +2 + +`GET /api/v3/myPreventedMatches` +`myPreventedMatches` - **Using `orderId`** + +10 + +20 + +`GET /api/v3/account` +`account.status` + +10 + +20 + +`GET /api/v3/rateLimit/order` +`account.rateLimits.orders` + +20 + +40 + +`GET /api/v3/exchangeInfo` +`exchangeInfo` + +10 + +20 + +`GET /api/v3/depth` +`depth` - **Limit 1-100** + +1 + +2 + +`GET /api/v3/depth` +`depth` - **Limit 101-500** + +5 + +10 + +`GET /api/v3/depth` +`depth` - **Limit 501-1000** + +10 + +20 + +`GET /api/v3/depth` +`depth` - **Limit 1001-5000** + +50 + +100 + +`GET /api/v3/aggTrades` +`trades.aggregate` + +1 + +2 + +`GET /api/v3/trades` +`trades.recent` + +1 + +2 + +`GET /api/v3/historicalTrades` +`trades.historical` + +5 + +10 + +`GET /api/v3/klines` +`klines` + +1 + +2 + +`GET /api/v3/uiKlines` +`uiKlines` + +1 + +2 + +`GET /api/v3/ticker/bookTicker` +`ticker.book` - **With `symbol`** + +1 + +2 + +`GET /api/v3/ticker/bookTicker` +`ticker.book` - **Without `symbol`** or **With `symbols`** + +2 + +4 + +`GET /api/v3/ticker/price` +`ticker.price` - **With `symbol`** + +1 + +2 + +`GET /api/v3/ticker/price` +`ticker.price` - **Without `symbol`** or **With `symbols`** + +2 + +4 + +`GET /api/v3/ticker/24hr` +`ticker.24hr` - **With `symbol`** or **With `symbols` using 1-20 symbols** + +1 + +2 + +`GET /api/v3/ticker/24hr` +`ticker.24hr` - **With `symbols using 21-100 symbols`** + +20 + +40 + +`GET /api/v3/ticker/24hr` +`ticker.24hr` - **Without `symbol` or `symbols using 101 or more symbols`** + +40 + +80 + +`GET /api/v3/avgPrice` +`avgPrice` + +1 + +2 + +`GET /api/v3/ticker` +`ticker` + +2 + +4 + +`GET /api/v3/ticker` +`ticker` - Maximum weight for this request + +100 + +200 + +`POST /api/v3/userDataStream` +`userDataStream.start` + +1 + +2 + +`PUT /api/v3/userDataStream` +`userDataStream.ping` + +1 + +2 + +`DELETE /api/v3/userDataStream` +`userDataStream.stop` + +1 + +2 + +--- + +### 2023-08-08[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +Smart Order Routing (SOR) has been added to the APIs. For more information please refer to our [FAQ](https://developers.binance.com/docs/binance-spot-api-docs/faqs/sor_faq). Please wait for future announcements on when the feature will be enabled. + +REST API + +- Changes to `GET /api/v3/exchangeInfo`: + - New field in response: `sors`, describing SORs enabled on the exchange. +- Changes to `GET /api/v3/myPreventedMatches` + - New field `makerSymbol` will appear in the response for all prevented matches. +- New endpoints for order placement using SOR: + - `POST /api/v3/sor/order` + - `POST /api/v3/sor/order/test` +- New endpoint `GET /api/v3/myAllocations` + +WEBSOCKET API + +- Changes to `exchangeInfo`: + - New field in response: `sors`, describing SORs enabled on the exchange. +- Changes to `myPreventedMatches`: + - New field `makerSymbol` will appear in the response for all prevented matches. +- New requests for order placement using SOR: + - `sor.order.place` + - `sor.order.test` +- New request `myAllocations` + +USER DATA STREAM + +- Changes to `executionReport`: + - These fields are only relevant for orders placed using SOR: + - New field `b` for `matchType` + - New field `a` for `allocId` + - New field `k` for `workingFloor` + - This field is only relevant for orders expiring due to STP: + - New field `Cs` for `counterSymbol` + +--- + +### 2023-07-18[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +- New API key type – Ed25519 – is now supported. (UI support will be released this week.) + - Ed25519 API keys are an alternative to RSA API keys, using asymmetric cryptography to authenticate your requests on the API. + - **We recommend switching to Ed25519** for improved performance and security. + For more information, please refer to the [API Key Types](https://developers.binance.com/docs/binance-spot-api-docs/faqs/api_key_types). +- Documentation has been updated with how to sign a payload with Ed25519 keys. + +--- + +### 2023-07-11[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +**Notice:** The change below are being rolled out, and will take approximately a week to complete. + +General Changes: + +- Changes to error messages: + - Previously, when duplicate symbols were passed to requests that do not allow it, the error would be "Mandatory parameter symbols was not sent, was empty/null, or malformed." + - Now, the error message is "Symbol is present multiple times in the list", with a new error code `-1151` + - This affects the following requests: + - `GET /api/v3/exchangeInfo` + - `GET /api/v3/ticker/24hr` + - `GET /api/v3/ticker/price` + - `GET/api/v3/ticker/bookTicker` + - `exchangeInfo` + - `ticker.24hr` + - `ticker.price` + - `ticker.book` +- Fixed a bug where some non-archived orders being queried would receive the error code that their order was archived. + +Rest API + +- Changes to `GET /api/v3/account`: + - New field `preventSor` will appear in the response. + - New field `uid` that shows the User Id/Account will appear in the response. +- Changes to `GET /api/v3/historicalTrades`: + - Changed security type from `MARKET_DATA` to `NONE`. + - This means that the `X-MBX-APIKEY` header is no longer necessary and is now ignored. + +Websocket API + +- Changes to `account.status`: + - New field `preventSor` will appear in the response. + - New field `uid` that shows the User Id/Account will appear in the response. +- Changes to `trades.historical`: + - Changed security type from `MARKET_DATA` to `NONE`. + - This means that the `apiKey` parameter is no longer necessary and is now ignored. + +**The following changes will take effect _approximately a week from the release date_:**: + +- Fixed multiple bugs with orders that use `type=MARKET` and `quoteOrderQty`, also known as “reverse market orders”: + - Reverse market orders are no longer partially filled, or filled for zero or negative quantity under extreme market conditions. + - `MARKET_LOT_SIZE` filter now correctly rejects reverse market orders that go over the symbol's `maxQty`. +- Fixed a bug where OCO orders using `trailingDelta` could have an incorrect `trailingTime` value after either leg of the OCO is touched. +- New field `transactTime` will appear in order cancellation responses. This affects the following requests: + - `DELETE /api/v3/order` + - `POST /api/v3/order/cancelReplace` + - `DELETE /api/v3/openOrders` + - `DELETE /api/v3/orderList` + - `order.cancel` + - `order.cancelReplace` + - `openOrders.cancelAll` + - `orderList.cancel` + +--- + +### 2023-06-06[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +- A new endpoint is now available for redundancy: **[https://api-gcp.binance.com/](https://api-gcp.binance.com/)** + - This is using the GCP (Google Cloud Platform) CDN and may have slower performance compared to `api1`\-`api4` endpoints. + +--- + +### 2023-05-26[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +**Notice:** The change below are being rolled out, and will take approximately a week to complete. + +- The following base endpoints may give better performance but have less stability than **[https://api.binance.com](https://api.binance.com/)**: + - **[https://api1.binance.com](https://api1.binance.com/)** + - **[https://api2.binance.com](https://api2.binance.com/)** + - **[https://api3.binance.com](https://api3.binance.com/)** + - **[https://api4.binance.com](https://api4.binance.com/)** + +--- + +### 2023-05-24[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +- **The previous market data URLs have been deprecated. Please update your code immediately to prevent interruption of our services.** + - API Market data from `data.binance.com` can now be accessed from `data-api.binance.vision`. + - Websocket Market Data from `data-stream.binance.com` can now be accessed from `data-stream.binance.vision`. + +--- + +### 2023-03-13[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +**Notice:** All changes are being rolled out gradually to all our servers, and may take a week to complete. + +GENERAL CHANGES + +- The error messages for certain issues have been improved for easier troubleshooting. + +Situation + +Old Error Message + +New Error Message + +An account cannot place or cancel an order, due to trading ability disabled. + +This action is disabled on this account. + +This account may not place or cancel orders. + +When the permissions configured on the symbol do not match the permissions on the account. + +This symbol is not permitted for this account. + +When the account tries to place an order on a symbol it has no permissions for. + +This symbol is restricted for this account. + +Placing an order when symbol is not TRADING. + +Unsupported order combination. + +This order type is not possible in this trading phase. + +Placing an order with timeinForce\=IOC or FOK on a trading phase that does not support it. + +Limit orders require GTC for this phase. + +- Fixed error message for querying archived orders: + + - Previously, if an archived order (i.e. order with status `CANCELED` or `EXPIRED` where `executedQty` == 0 that occurred more than 90 days in the past.) is queried, the error message would be: + + ``` + { "code": -2013, "msg": "Order does not exist."} + ``` + + - Now, the error message is: + + ``` + { "code": -2026, "msg": "Order was canceled or expired with no executed qty over 90 days ago and has been archived."} + ``` + +- Behavior for API requests with `startTime` and `endTime`: + - Previously some requests failed if the `startTime` == `endTime`. + - Now, all API requests that accept `startTime` and `endTime` allow the parameters to be equal. This applies to the following requests: + - Rest API + - `GET /api/v3/aggTrades` + - `GET /api/v3/klines` + - `GET /api/v3/allOrderList` + - `GET /api/v3/allOrders` + - `GET /api/v3/myTrades` + - Websocket API + - `trades.aggregate` + - `klines` + - `allOrderList` + - `allOrders` + - `myTrades` +- Users connected to the websocket API will now be disconnected if their IP is banned due to violation of the IP rate limits (status `418`). + +The following changes will take effect **approximately a week from the release date**, but the rest of the documentation has been updated to reflect the future changes: + +- Changes to Filter Evaluation: + - Previous behavior: `LOT_SIZE` and `MARKET_LOT_SIZE` required that (`quantity` - `minQty`) % `stepSize` == 0. + - New behavior: This has now been changed to (`quantity` % `stepSize`) == 0. +- Bug fix with reverse `MARKET` orders (i.e., `MARKET` using `quoteOrderQty`): + - Previous behavior: Reverse market orders would always have the status `FILLED` even if the order did not fully fill due to low liquidity. + - New behavior: If the reverse market order did not fully fill due to low liquidity the order status will be `EXPIRED`, and `FILLED` only if the order was completely filled. + +REST API + +- Changes to `DELETE /api/v3/order` and `POST /api/v3/order/cancelReplace`: + + - A new optional parameter `cancelRestrictions` that determines whether the cancel will succeed if the order status is `NEW` or `PARTIALLY_FILLED`. + - If the order cancellation fails due to `cancelRestrictions`, the error will be: + + ``` + { "code": -2011, "msg": "Order was not canceled due to cancel restrictions."} + ``` + + +WEBSOCKET API + +- Changes to `order.cancel` and `order.cancelReplace`: + + - A new optional parameter `cancelRestrictions` that determines whether the cancel will succeed if the order status is `NEW` or `PARTIALLY_FILLED`. + - If the order cancellation fails due to `cancelRestrictions`, the error will be: + + ``` + { "code": -2011, "msg": "Order was not canceled due to cancel restrictions."} + ``` + + +--- + +### 2023-02-17[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +**Changes to Websocket Limits** + +The WS-API and Websocket Stream now only allows 300 connections requests every 5 minutes. + +This limit is **per IP address**. + +Please be careful when trying to open multiple connections or reconnecting to the Websocket API. + +--- + +### 2023-01-26[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +As per the [announcement](https://www.binance.com/en/support/announcement/binance-spot-launches-self-trade-prevention-stp-function-on-api-312fd0112fb44635b397c116e56d8f84), Self Trade Prevention will be enabled at **2023-01-26 08:00 UTC**. + +Please refer to `GET /api/v3/exchangeInfo` from the Rest API or `exchangeInfo` from the Websocket API on the default and allowed modes. + +--- + +### 2023-01-23[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +New API cluster has been added. Note that all endpoints are functionally equal, but may vary in performance. + +- [https://api4.binance.com](https://api4.binance.com/) + +--- + +### 2023-01-19[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +**ACTUAL RELEASE DATE TBD** + +**New Feature**: Self-Trade Prevention (aka STP) will be added to the system at a later date. This will prevent orders from matching with orders from the same account, or accounts under the same `tradeGroupId`. + +Please refer to `GET /api/v3/exchangeInfo` from the Rest API or `exchangeInfo` from the Websocket API on the status. + +``` +{ "defaultSelfTradePreventionMode": "NONE", // If selfTradePreventionMode not provided, this will be the value passed to the engine "allowedSelfTradePreventionModes": [ // What the allowed modes of selfTradePrevention are "NONE", "EXPIRE_TAKER", "EXPIRE_BOTH", "EXPIRE_MAKER" ]} +``` + +Additional details on the functionality of STP is explained in the [STP FAQ](https://developers.binance.com/docs/binance-spot-api-docs/faqs/stp_faq) document. + +REST API + +- New order status: `EXPIRED_IN_MATCH` - This means that the order expired due to STP being triggered. +- New endpoint: + - `GET /api/v3/myPreventedMatches` - This queries the orders that expired due to STP being triggered. +- New optional parameter `selfTradePreventionMode` has been added to the following endpoints: + - `POST /api/v3/order` + - `POST /api/v3/order/oco` + - `POST /api/v3/cancelReplace` +- New responses that will appear for all order placement endpoints if there was a prevented match (i.e. if an order could have matched with an order of the same account, or the accounts are in the same `tradeGroupId`): + - `tradeGroupId` - This will only appear if account is configured to a `tradeGroupId` and if there was a prevented match. + - `preventedQuantity` - Only appears if there was a prevented match. + - An array `preventedMatches` with the following fields: + - `preventedMatchId` + - `makerOrderId` + - `price` + - `takerPreventedQuantity` - This will only appear if `selfTradePreventionMode` set is `EXPIRE_TAKER` or `EXPIRE_BOTH`. + - `makerPreventedQuantity` - This will only appear if `selfTradePreventionMode` set is `EXPIRE_MAKER` or `EXPIRE_BOTH`. +- New fields `preventedMatchId` and `preventedQuantity` that can appear in the order query endpoints if the order had expired due to an STP trigger: + - `GET /api/v3/order` + - `GET /api/v3/openOrders` + - `GET /api/v3/allOrders` + +WEBSOCKET API + +- New order status: `EXPIRED_IN_MATCH` - This means that the order expired due to STP being triggered. +- New optional parameter `selfTradePreventionMode` has been added to the following requests: + - `order.place` + - `orderList.place` + - `order.cancelReplace` +- New request: `myPreventedMatches` - This queries the orders that expired due to STP being triggered. +- New responses that will appear for all order placement endpoints if there was a prevented match (i.e. if an order could have matched with an order of the same account, or the accounts are in the same `tradeGroupId`): + - `tradeGroupId` - This will only appear if account is configured to a `tradeGroupId` and if there was a prevented match. + - `preventedQuantity` - Only appears if there was a prevented match. + - An array `preventedMatches` with the following fields: + - `preventedMatchId` + - `makerOrderId` + - `price` + - `takerPreventedQuantity` - This will only appear if `selfTradePreventionMode` set is `EXPIRE_TAKER` or `EXPIRE_BOTH`. + - `makerPreventedQuantity` - This will only appear if `selfTradePreventionMode` set is `EXPIRE_MAKER` or `EXPIRE_BOTH`. +- New fields `preventedMatchId` and `preventedQuantity` that can appear in the order query requests if the order had expired due to STP trigger: + - `order.status` + - `openOrders.status` + - `allOrders` + +USER DATA STREAM + +- New execution Type: `TRADE_PREVENTION` +- New fields for `executionReport` (These fields will only appear if the order has expired due to STP trigger) + - `u` - `tradeGroupId` + - `v` - `preventedMatchId` + - `U` - `counterOrderId` + - `A` - `preventedQuantity` + - `B` - `lastPreventedQuantity` + +--- + +### 2022-12-28[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +- SPOT WebSocket API documentation has been updated to show how to sign a request using an RSA key. + +--- + +### 2022-12-26[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +- Spot WebSocket API is now available on the live exchange. +- Spot Websocket API can be accessed through this URL: `wss://ws-api.binance.com/ws-api/v3` + +--- + +### 2022-12-15[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +- New RSA signature + - Documentation has been updated to show how to create RSA keys. + - For security reasons, we recommend to use RSA keys instead of HMAC keys when generating an API key. + - We accept `PKCS#8` (BEGIN PUBLIC KEY). + - More details on how to upload your RSA public key will be added at a later date. +- SPOT WebSocket API is now available on **SPOT Testnet**. + - WebSocket API allows placing orders, canceling orders, etc. through a WebSocket connection. + - WebSocket API is a **separate** service from WebSocket Market Data streams. I.e., placing orders and listening to market data requires two separate WebSocket connections. + - WebSocket API is subject to the same Filter and Rate Limit rules as REST API. + - WebSocket API and REST API are functionally equivalent: they provide the same features, accept the same parameters, return the same status and error codes. + +**WEBSOCKET API WILL BE AVAILABLE ON THE LIVE EXCHANGE AT A LATER DATE.** + +--- + +### 2022-12-13[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +REST API + +Some error messages on error code `-1003` have changed. + +- Previous error message: `Too much request weight used; current limit is %s request weight per %s %s. Please use the websocket for live updates to avoid polling the API.` has been updated to: + +``` +Too much request weight used; current limit is %s request weight per %s. Please use WebSocket Streams for live updates to avoid polling the API. +``` + +- Previous error message `Way too much request weight used; IP banned until %s. Please use the websocket for live updates to avoid bans.` has been updated to: + +``` +Way too much request weight used; IP banned until %s. Please use WebSocket Streams for live updates to avoid bans. +``` + +--- + +### 2022-12-05[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +**Notice:** These changes are being rolled out gradually to all our servers, and will take approximately a week to complete. + +WEBSOCKET + +- `!bookTicker` will be removed by **December 7, 2022**. Please use the Individual Book Ticker Streams instead (`@bookTicker`). + - Multiple `@bookTicker` streams can be subscribed to over one connection. (E.g. `wss://stream.binance.com:9443/stream?streams=btcusdt@bookTicker/bnbbtc@bookTicker`) + +REST API + +- New error code `-1135` + - This error code will occur if a parameter requiring a JSON object is invalid. +- New error code `-1108` + - This error will occur if a value to a parameter being sent was too large, potentially causing overflow. + - This error code can occur in the following endpoints: + - `POST /api/v3/order` + - `POST /api/v3/order/cancelReplace` + - `POST /api/v3/order/oco` +- Changes to `GET /api/v3/aggTrades` + - Previous behavior: `startTime` and `endTime` had to be used in combination and could only be an hour apart. + - New behavior: `startTime` and `endTime` can be used individually and the 1 hour limit has been removed. + - When using `startTime` only, this will return trades from that time, up to the `limit` provided. + - When using `endTime` only, this will return trades before that time, up to the `limit` provided. + - If `limit` not provided, regardless of used in combination or sent individually, the endpoint will use the default limit. +- Changes to `GET /api/v3/myTrades` + - Fixed a bug where `symbol` + `orderId` combination would return all trades even if the number of trades went beyond the `500` default limit. + + - Previous behavior: The API would send specific error messages depending on the combination of parameters sent. E.g: + + ``` + { "code": -1106, "msg": "Parameter X was sent when not required."} + ``` + + - New behavior: If the combinations of optional parameters to the endpoint were not supported, then the endpoint will respond with the generic error: + + ``` + { "code": -1128, "msg": "Combination of optional parameters invalid."} + ``` + + - Added a new combination of supported parameters: `symbol` + `orderId` + `fromId`. + + - The following combinations of parameters were previously supported but no longer accepted, as these combinations were only taking `fromId` into consideration, ignoring `startTime` and `endTime`: + + - `symbol` + `fromId` + `startTime` + - `symbol` + `fromId` + `endTime` + - `symbol` + `fromId` + `startTime` + `endTime` + - Thus, these are the supported combinations of parameters: + + - `symbol` + - `symbol` + `orderId` + - `symbol` + `startTime` + - `symbol` + `endTime` + - `symbol` + `fromId` + - `symbol` + `startTime` + `endTime` + - `symbol`\+ `orderId` + `fromId` + +**Note:** These new fields will appear approximately a week from the release date. + +- Changes to `GET /api/v3/exchangeInfo` + - New fields `defaultSelfTradePreventionMode` and `allowedSelfTradePreventionModes` +- Changes to the Order Placement Endpoints/Order Query/Order Cancellation Endpoints: + - New field `selfTradePreventionMode` will appear in the response. + - Affects the following endpoints: + - `POST /api/v3/order` + - `POST /api/v3/order/oco` + - `POST /api/v3/order/cancelReplace` + - `GET /api/v3/order` + - `DELETE /api/v3/order` + - `DELETE /api/v3/orderList` +- Changes to `GET /api/v3/account` + - New field `requireSelfTradePrevention` will appear in the response. +- New field `workingTime`, indicating when the order started working on the order book, will appear in the following endpoints: + - `POST /api/v3/order` + - `GET /api/v3/order` + - `POST /api/v3/order/cancelReplace` + - `POST /api/v3/order/oco` + - `GET /api/v3/order` + - `GET /api/v3/openOrders` + - `GET /api/v3/allOrders` +- Field `trailingTime`, indicating the time when the trailing order is active and tracking price changes, will appear for the following order types (`TAKE_PROFIT`, `TAKE_PROFIT_LIMIT`, `STOP_LOSS`, `STOP_LOSS_LIMIT` if `trailingDelta` parameter was provided) for the following endpoints: + - `POST /api/v3/order` + - `GET /api/v3/order` + - `GET /api/v3/openOrders` + - `GET /api/v3/allOrders` + - `POST /api/v3/order/cancelReplace` + - `DELETE /api/v3/order` +- Field `commissionRates` will appear in the `GET /api/v3/acccount` response + +USER DATA STREAM + +- eventType `executionReport` has new fields + - `V` - `selfTradePreventionMode` + - `D` - `trailing_time` (Appears if the trailing stop order is active) + - `W` - `workingTime` (Appears if `isWorking`\=`true`) + +--- + +### 2022-12-02[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +- Added a new market data base URL `https://data.binance.com`. +- Added a new WebSocket URL `wss://data-stream.binance.com`. + +--- + +### 2022-09-30[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +Scheduled changes to the removal of `!bookTicker` around November 2022. + +- The All Book Tickers stream (`!bookTicker`) is set to be removed in **November 2022**. +- More details of the actual removal date will be announced at a later time. +- Please use the Individual Book Ticker Streams instead. (`@bookTicker`). +- Multiple `@bookTicker` streams can be subscribed to over one connection. + - Example: wss://stream.binance.com:9443/stream?streams=btcusdt@bookTicker/bnbbtc@bookTicker + +--- + +### 2022-09-15[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +Note that these are rolling changes, so it may take a few days for it to rollout to all our servers. + +- Changes to `GET /api/v3/exchangeInfo` + - New optional parameter `permissions` added to display all symbols with the permissions matching the parameter provided. (eg.`SPOT`,`MARGIN`) + - If not provided, the default value will be `["SPOT","MARGIN","LEVERAGED"]`. + - This means the request `GET /api/v3/exchangeInfo` without any parameters will show all symbols that can be used for `SPOT`, `MARGIN`, and/or `LEVERAGED` trading. + - To search for symbols that can be traded on other permissions (e.g. `TRD_GRP_004`, etc), then this needs to be searched for explicitly. (e.g.`permissions`\=`TRD_GRP_004`) + - Cannot be combined with `symbol` or `symbols` + +--- + +### 2022-08-23[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +Note that these are rolling changes, so it may take a few days for it to rollout to all our servers. + +- Changes to `GET /api/v3/ticker` and `GET /api/v3/ticker/24hr` + - New optional parameter `type` added + - Supported values for parameter `type` are `FULL` and `MINI` + - `FULL` is the default value and the response that is currently being returned from the endpoint + - `MINI` omits the following fields from the response: `priceChangePercent`, `weightedAvgPrice`, `bidPrice`, `bidQty`, `askPrice`, `askQty`, and `lastQty` +- New error code `-1008` + - This is sent whenever the servers are overloaded with requests. +- New field `brokered` has been added to `GET /api/v3/account` +- New kline interval: `1s` +- New endpoint added: `GET /api/v3/uiKlines` + +--- + +### 2022-08-08[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +REST API + +- Changes to `POST /api/v3/order` and `POST /api/v3/order/cancelReplace` + - New optional fields `strategyId` and `strategyType` + - `strategyId` is a parameter used to identify an order as part of a strategy. + - `strategyType` is a parameter used to identify what strategy was running. (E.g. If all the orders are part of spot grid strategy, it can be set to `strategyType=1000000`) + - Note that the minimum value allowed for `strategyType` is `1000000`. +- Changes to `POST /api/v3/order/oco` + - New optional fields `limitStrategyId`, `limitStrategyType`, `stopStrategyId`, `stopStrategyType` + - These are the strategy metadata parameters for both legs of the OCO orders. + - `limitStrategyType` and `stopStrategyType` both cannot be less than `1000000`. +- Changes to `GET /api/v3/order`, `GET /api/v3/openOrders`, and `GET /api/v3/allOrders` + - New fields `strategyId` and `strategyType` will appear in the response JSON for orders that had these fields populated upon order placement. +- Changes to `DELETE /api/v3/order` and `DELETE /api/v3/openOrders` + - New fields `strategyId` and `strategyType` will appear in the response JSON for cancelled orders that had these fields populated upon order placement. + +USER DATA STREAM + +- New fields to eventType `executionReport` + - `j` for `strategyId` + - `J` for `strategyType` + - Note that these fields only appear if these were populated upon order placement. + +--- + +### 2022-06-20[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +Changes to `GET /api/v3/ticker` + +- Weight has been reduced from 5 to 2 per symbol, regardless of `windowSize`. +- The max number of symbols that can be processed in a request is 100. + + - If the number of `symbols` sent is more than 100, the error will be as follows: + + ``` + { "code": -1101, "msg": "Too many values sent for parameter 'symbols', maximum allowed up to 100."} + ``` + +- The max Weight for this endpoint will cap at 100. + - I.e. If the request has more than 50 symbols, the Weight will still be 100, regardless of `windowSize`. + +--- + +### 2022-06-15[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +**Note:** The update is being rolled out over the next few days, so these changes may not be visible right away. + +SPOT API + +- `GET /api/v3/ticker` added + - Rolling window price change statistics based on `windowSize` provided. + - Contrary to `GET /api/v3/ticker/24hr` the list of symbols cannot be omitted. + - If `windowSize` not specified, the value will default to `1d`. + - Response is similar to `GET /api/v3/ticker/24hr`, minus the following fields: `prevClosePrice`, `lastQty`, `bidPrice`, `bidQty`, `askPrice`, `askQty` +- `GET /api/v3/exchangeInfo` returns new field `cancelReplaceAllowed` in `symbols` list. +- `POST /api/v3/order/cancelReplace` added + - Cancels an existing order and places a new order on the same symbol. + - The filters are evaluated **before** the cancel order is placed. + - e.g. If the `MAX_NUM_ORDERS` filter is 10, and the total number of open orders on the account is also 10, when using `POST /api/v3/order/cancelReplace` both the cancel order placement and new order will fail because of the filter. + - The change is being rolled out in the next few days, thus this feature will be enabled once the upgrade is completed. +- New filter `NOTIONAL` has been added. + - Defines the allowed notional value (`price * quantity`) based on a configured `minNotional` and `maxNotional` +- New exchange filter `EXCHANGE_MAX_NUM_ICEBERG_ORDERS` has been added. + - Defines the limit of open iceberg orders on an account + +--- + +### 2022-05-23[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +- Changes to Order Book Depth Levels + + - Quantities in the Depth levels were returning negative values in situations where they were exceeding the max value, resulting in an overflow. + - Going forward depth levels will not overflow, but will be capped at the max value based on the precision of the base asset. This means that the depth level is at max value _or more_. + - E.g. If the precision is 8, then the max value for quantity will be at 92,233,720,368.54775807. + - When the fix has been applied, a change in the order book at the affected price level is required for the changes to be visible. +- What does this affect? + + - SPOT API + - `GET /api/v3/depth` + - Websocket Streams + - `@depth` + - `@depth@100ms` + - `@depth` + - `@depth@100ms` +- Updates to `MAX_POSITION` + + - If an order's `quantity` can cause the position to overflow, this will now fail the `MAX_POSITION` filter. + +--- + +### 2022-05-17[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +- Changes to GET `api/v3/aggTrades` + - When providing `startTime` and `endTime`, the oldest items are returned. +- Changed error messaging on `GET /api/v3/myTrades` where parameter `symbol` is not provided: + +``` +{ "code": -1102, "msg": "Mandatory parameter 'symbol' was not sent, was empty/null, or malformed."} +``` + +- The following endpoints now support multi-symbol querying using the parameter `symbols`. + - `GET /api/v3/ticker/24hr` + - `GET /api/v3/ticker/price` + - `GET /api/v3/ticker/bookTicker` +- In the above, the request weight will depend on the number of symbols provided in `symbols`. + Please refer to the table below: + +Endpoint + +Number of Symbols + +Weight + +`GET /api/v3/ticker/price` + +Any + +2 + +`GET /api/v3/ticker/bookTicker` + +Any + +2 + +`GET /api/v3/ticker/24hr` + +1-20 + +1 + +`GET /api/v3/ticker/24hr` + +21-100 + +20 + +`GET /api/v3/ticker/24hr` + +101 or more + +40 + +--- + +### 2022-04-13[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +REST API + +- Trailing Stops have been enabled. + - This is a type of algo order where the activation is based on a percentage of a price change in the market using the new parameter `trailingDelta`. + - This can only used with any of the following order types: `STOP_LOSS`, `STOP_LOSS_LIMIT`, `TAKE_PROFIT`, `TAKE_PROFIT_LIMIT`. + - The `trailingDelta` parameter will be done in Basis Points or BIPS. + - For example: a STOP\_LOSS SELL order with a `trailingDelta` of 100 will trigger after a price decrease of 1% from the highest price after the order is placed. (100 / 10,000 => 0.01 => 1%) + - When used in combination with OCO Orders, the `trailingDelta` will determine when the contingent leg of the OCO will trigger. + - When `trailingDelta` is used in combination with `stopPrice`, once the `stopPrice` condition is met, the trailing stop starts tracking the price change from the `stopPrice` based on the `trailingDelta` provided. + - When no `stopPrice` is sent, the trailing stop starts tracking the price changes from the last price based on the `trailingDelta` provided. +- Changes to POST `/api/v3/order` + - New optional field `trailingDelta` +- Changes to POST `/api/v3/order/test` + - New optional field `trailingDelta` +- Changes to POST `/api/v3/order/oco` + - New optional field `trailingDelta` +- A new filter `TRAILING_DELTA` has been added. + - This filter is defined by the minimum and maximum values for the `trailingDelta` value. + +USER DATA STREAM + +- New field in `executionReport` + - "d" for `trailingDelta` + +--- + +### 2022-04-12[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +**Note:** The changes are being rolled out during the next few days, so these will not appear right away. + +- Error message changed on `GET api/v3/allOrders` where `symbol` is not provided: + + ``` + { "code": -1102, "msg": "Mandatory parameter 'symbol' was not sent, was empty/null, or malformed."} + ``` + +- Fixed a typo with an error message when an account has disabled permissions (e.g. to withdraw, to trade, etc) + + ``` + "This action is disabled on this account." + ``` + +- During a market data audit, we detected some issues with the Spot aggregate trade data. + - Missing aggregate trades were recovered. + - Duplicated records were marked invalid with the following values: + - p = '0' // price + - q = '0' // qty + - f = -1 // first\_trade\_id + - l = -1 // last\_trade\_id + +--- + +### 2022-02-28[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +- New field `allowTrailingStop` has been added to `GET /api/v3/exchangeInfo` + +--- + +### 2022-02-24[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +- `(price-minPrice) % tickSize == 0` rule in `PRICE_FILTER` has been changed to `price % tickSize == 0`. +- A new filter `PERCENT_PRICE_BY_SIDE` has been added. +- Changes to GET `api/v3/depth` + - The `limit` value can be outside of the previous values (i.e. 5, 10, 20, 50, 100, 500, 1000,5000) and will return the correct limit. (i.e. if limit=3 then the response will be the top 3 bids and asks) + - The limit still cannot exceed 5000. If the limit provided is greater than 5000, then the response will be truncated to 5000. + - Due to the changes, these are the updated request weights based on the limit value provided: + +Limit + +Request Weight + +1-100 + +1 + +101-500 + +5 + +501-1000 + +10 + +1001-5000 + +50 + +- Changes to GET `api/v3/aggTrades` + - When providing `startTime` and `endTime`, the oldest items are returned. + +--- + +### 2021-12-29[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +- Removed out dated "Symbol Type" enum; added "Permissions" enum. + +### 2021-11-01[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +- `GET /api/v3/rateLimit/order` added + - The endpoint will display the user's current order count usage for all intervals. + - This endpoint will have a request weight of 20. + +### 2021-09-14[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +- Add a [YAML file](https://github.com/binance/binance-api-swagger) with OpenApi specification on the RESTful API. + +### 2021-08-12[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +- GET `api/v3/myTrades` has a new optional field `orderId` + +--- + +### 2021-05-12[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +- Added `Data Source` in the documentation to explain where each endpoint is retrieving its data. +- Added field `Data Source` to each API endpoint in the documentation +- GET `api/v3/exchangeInfo` now supports single or multi-symbol query + +--- + +### 2021-04-26[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +On **April 28, 2021 00:00 UTC** the weights to the following endpoints will be adjusted: + +- `GET /api/v3/order` weight increased to 2 +- `GET /api/v3/openOrders` weight increased to 3 +- `GET /api/v3/allOrders` weight increased to 10 +- `GET /api/v3/orderList` weight increased to 2 +- `GET /api/v3/openOrderList` weight increased to 3 +- `GET /api/v3/account` weight increased to 10 +- `GET /api/v3/myTrades` weight increased to 10 +- `GET /api/v3/exchangeInfo` weight increased to 10 + +--- + +### 2021-01-01[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +**USER DATA STREAM** + +- `outboundAccountInfo` has been removed. + +--- + +### 2020-11-27[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +New API clusters have been added in order to improve performance. + +Users can access any of the following API clusters, in addition to `api.binance.com` + +If there are any performance issues with accessing `api.binance.com` please try any of the following instead: + +- [https://api1.binance.com/api/v3/](https://api1.binance.com/api/v3)\* +- [https://api2.binance.com/api/v3/](https://api2.binance.com/api/v3)\* +- [https://api3.binance.com/api/v3/](https://api3.binance.com/api/v3)\* + +### 2020-09-09[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +USER DATA STREAM + +- `outboundAccountInfo` has been deprecated. +- `outboundAccountInfo` will be removed in the future. (Exact date unknown) **Please use `outboundAccountPosition` instead.** +- `outboundAccountInfo` will now only show the balance of non-zero assets and assets that have been reduced to 0. + +--- + +### 2020-05-01[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +- From 2020-05-01 UTC 00:00, all symbols will have a limit of 200 open orders using the [MAX\_NUM\_ORDERS](https://developers.binance.com/docs/binance-spot-api-docs/rest-api.md) filter. + - No existing orders will be removed or canceled. + - Accounts that have 200 or more open orders on a symbol will not be able to place new orders on that symbol until the open order count is below 200. + - OCO orders count as 2 open orders before the `LIMIT` order is touched or the `STOP_LOSS` (or `STOP_LOSS_LIMIT`) order is triggered; once this happens the other order is canceled and will no longer count as an open order. + +--- + +### 2020-04-25[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +REST API + +- New field `permissions` + - Defines the trading permissions that are allowed on accounts and symbols. + - `permissions` is an enum array; values: + - `SPOT` + - `MARGIN` + - `permissions` will replace `isSpotTradingAllowed` and `isMarginTradingAllowed` on `GET api/v3/exchangeInfo` in future API versions (v4+). + - For an account to trade on a symbol, the account and symbol must share at least 1 permission in common. +- Updates to `GET api/v3/exchangeInfo` + - New field `permissions` added. + - New field `quoteAssetPrecision` added; a duplicate of the `quotePrecision` field. `quotePrecision` will be removed in future API versions (v4+). +- Updates to `GET api/v3/account` + - New field `permissions` added. +- New endpoint `DELETE api/v3/openOrders` + - This will allow a user to cancel all open orders on a single symbol. + - This endpoint will cancel all open orders including OCO orders. +- Orders can be canceled via the API on symbols in the `BREAK` or `HALT` status. + +USER DATA STREAM + +- `OutboundAccountInfo` has new field `P` which shows the trading permissions of the account. + +--- + +### 2020-04-23[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +WEB SOCKET STREAM + +- WebSocket connections have a limit of 5 incoming messages per second. A message is considered: + - A PING frame + - A PONG frame + - A JSON control message (e.g. subscribe, unsubscribe) +- A connection that goes beyond the limit will be disconnected; IPs that are repeatedly disconnected may be banned. +- A single connection can listen to a maximum of 1024 streams. + +--- + +### 2020-03-24[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +- `MAX_POSITION` filter added. + - This filter defines the allowed maximum position an account can have on the base asset of a symbol. An account's position defined as the sum of the account's: + + - free balance of the base asset + - locked balance of the base asset + - sum of the qty of all open BUY orders + - `BUY` orders will be rejected if the account's position is greater than the maximum position allowed. + + +--- + +### 2019-11-22[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +- Quote Order Qty Market orders have been enabled on all symbols. + - Quote Order Qty `MARKET` orders allow a user to specify the total `quoteOrderQty` spent or received in the `MARKET` order. + - Quote Order Qty `MARKET` orders will not break `LOT_SIZE` filter rules; the order will execute a quantity that will have the notional value as close as possible to `quoteOrderQty`. + - Using `BNBBTC` as an example: + - On the `BUY` side, the order will buy as many BNB as `quoteOrderQty` BTC can. + - On the `SELL` side, the order will sell as much BNB as needed to receive `quoteOrderQty` BTC. + +--- + +### 2019-11-13[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +REST API + +- api/v3/exchangeInfo has new fields: + - `quoteOrderQtyMarketAllowed` + - `baseCommissionDecimalPlaces` + - `quoteCommissionDecimalPlaces` +- `MARKET` orders have a new optional field: `quoteOrderQty` used to specify the quote quantity to BUY or SELL. This cannot be used in combination with `quantity`. + - The exact timing that `quoteOrderQty` MARKET orders will be enabled is TBD. There will be a separate announcement and further details at that time. +- All order query endpoints will return a new field `origQuoteOrderQty` in the JSON payload. (e.g. GET api/v3/allOrders) +- Updated error messages for -1128 + + - Sending an `OCO` with a `stopLimitPrice` but without a `stopLimitTimeInForce` will return the error: + + ``` + { "code": -1128, "msg": "Combination of optional parameters invalid. Recommendation: 'stopLimitTimeInForce' should also be sent."} + ``` + +- Updated error messages for -1003 to specify the limit is referring to the request weight, not to the number of requests. + +**Deprecation of v1 endpoints**: + +By end of Q1 2020, the following endpoints will be removed from the API. The documentation has been updated to use the v3 versions of these endpoints. + +- GET api/v1/depth +- GET api/v1/historicalTrades +- GET api/v1/aggTrades +- GET api/v1/klines +- GET api/v1/ticker/24hr +- GET api/v1/ticker/price +- GET api/v1/exchangeInfo +- POST api/v1/userDataStream +- PUT api/v1/userDataStream +- GET api/v1/ping +- GET api/v1/time +- GET api/v1/ticker/bookTicker + +**These endpoints however, will NOT be migrated to v3. Please use the following endpoints instead moving forward.** + +Old V1 Endpoints + +New V3 Endpoints + +GET api/v1/ticker/allPrices + +GET api/v3/ticker/price + +GET api/v1/ticker/allBookTickers + +GET api/v3/ticker/bookTicker + +USER DATA STREAM + +- Changes to`executionReport` event + + - If the C field is empty, it will now properly return `null`, instead of `"null"`. + - New field Q which represents the `quoteOrderQty`. +- `balanceUpdate` event type added + + - This event occurs when funds are deposited or withdrawn from your account. + +WEB SOCKET STREAMS + +- WSS now supports live subscribing/unsubscribing to streams. + +--- + +### 2019-09-09[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +- New WebSocket streams for bookTickers added: `@bookTicker` and `!bookTicker`. See `web-socket-streams.md` for details. + +--- + +### 2019-09-03[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +- Faster order book data with 100ms updates: `@depth@100ms` and `@depth#@100ms` +- Added "Update Speed:" to `web-socket-streams.md` +- Removed deprecated v1 endpoints as per previous announcement: + - GET api/v1/order + - GET api/v1/openOrders + - POST api/v1/order + - DELETE api/v1/order + - GET api/v1/allOrders + - GET api/v1/account + - GET api/v1/myTrades + +--- + +### 2019-08-16 (Update 2)[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +- GET api/v1/depth `limit` of 10000 has been temporarily removed + +--- + +### 2019-08-16[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +- In Q4 2017, the following endpoints were deprecated and removed from the API documentation. They have been permanently removed from the API as of this version. We apologize for the omission from the original changelog: + + - GET api/v1/order + - GET api/v1/openOrders + - POST api/v1/order + - DELETE api/v1/order + - GET api/v1/allOrders + - GET api/v1/account + - GET api/v1/myTrades +- Streams, endpoints, parameters, payloads, etc. described in the documents in this repository are **considered official** and **supported**. The use of any other streams, endpoints, parameters, or payloads, etc. is **not supported; use them at your own risk and with no guarantees.** + + +--- + +### 2019-08-15[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +REST API + +- New order type: OCO ("One Cancels the Other") + + - An OCO has 2 orders: (also known as legs in financial terms) + + - `STOP_LOSS` or `STOP_LOSS_LIMIT` leg + - `LIMIT_MAKER` leg + - Price Restrictions: + + - `SELL Orders` : Limit Price > Last Price > Stop Price + - `BUY Orders` : Limit Price < Last Price < Stop Price + - As stated, the prices must "straddle" the last traded price on the symbol. EX: If the last price is 10: + - A SELL OCO must have the limit price greater than 10, and the stop price less than 10. + - A BUY OCO must have a limit price less than 10, and the stop price greater than 10. + - Quantity Restrictions: + + - Both legs must have the **same quantity**. + - `ICEBERG` quantities however, do not have to be the same. + - Execution Order: + + - If the `LIMIT_MAKER` is touched, the limit maker leg will be executed first BEFORE canceling the Stop Loss Leg. + - if the Market Price moves such that the `STOP_LOSS` or `STOP_LOSS_LIMIT` will trigger, the Limit Maker leg will be canceled BEFORE executing the `STOP_LOSS` Leg. + - Canceling an OCO + + - Canceling either order leg will cancel the entire OCO. + - The entire OCO can be canceled via the `orderListId` or the `listClientOrderId`. + - New Enums for OCO: + + 1. `ListStatusType` + - `RESPONSE` - used when ListStatus is responding to a failed action. (either order list placement or cancellation) + - `EXEC_STARTED` - used when an order list has been placed or there is an update to a list's status. + - `ALL_DONE` - used when an order list has finished executing and is no longer active. + 2. `ListOrderStatus` + - `EXECUTING` - used when an order list has been placed or there is an update to a list's status. + - `ALL_DONE` - used when an order list has finished executing and is no longer active. + - `REJECT` - used when ListStatus is responding to a failed action. (either order list placement or cancellation) + 3. `ContingencyType` + - `OCO` - specifies the type of order list. + - New Endpoints: + + - POST api/v3/order/oco + - DELETE api/v3/orderList + - GET api/v3/orderList +- `recvWindow` cannot exceed 60000. + +- New `intervalLetter` values for headers: + + - SECOND => S + - MINUTE => M + - HOUR => H + - DAY => D +- New Headers `X-MBX-USED-WEIGHT-(intervalNum)(intervalLetter)` will give your current used request weight for the (intervalNum)(intervalLetter) rate limiter. For example, if there is a one minute request rate weight limiter set, you will get a `X-MBX-USED-WEIGHT-1M` header in the response. The legacy header `X-MBX-USED-WEIGHT` will still be returned and will represent the current used weight for the one minute request rate weight limit. + +- New Header `X-MBX-ORDER-COUNT-(intervalNum)(intervalLetter)`that is updated on any valid order placement and tracks your current order count for the interval; rejected/unsuccessful orders are not guaranteed to have `X-MBX-ORDER-COUNT-**` headers in the response. + + - Eg. `X-MBX-ORDER-COUNT-1S` for "orders per 1 second" and `X-MBX-ORDER-COUNT-1D` for orders per "one day" +- GET api/v1/depth now supports `limit` 5000 and 10000; weights are 50 and 100 respectively. + +- GET api/v1/exchangeInfo has a new parameter `ocoAllowed`. + + +USER DATA STREAM + +- `executionReport` event now contains "g" which has the `orderListId`; it will be set to -1 for non-OCO orders. +- New Event Type `listStatus`; `listStatus` is sent on an update to any OCO order. +- New Event Type `outboundAccountPosition`; `outboundAccountPosition` is sent any time an account's balance changes and contains the assets that could have changed by the event that generated the balance change (a deposit, withdrawal, trade, order placement, or cancellation). + +NEW ERRORS + +- **\-1131 BAD\_RECV\_WINDOW** + - `recvWindow` must be less than 60000 +- **\-1099 Not found, authenticated, or authorized** + - This replaces error code -1999 + +NEW -2011 ERRORS + +- **OCO\_BAD\_ORDER\_PARAMS** + - A parameter for one of the orders is incorrect. +- **OCO\_BAD\_PRICES** + - The relationship of the prices for the orders is not correct. +- **UNSUPPORTED\_ORD\_OCO** + - OCO orders are not supported for this symbol. + +--- + +### 2019-03-12[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +REST API + +- X-MBX-USED-WEIGHT header added to Rest API responses. +- Retry-After header added to Rest API 418 and 429 responses. +- When canceling the Rest API can now return `errorCode` -1013 OR -2011 if the symbol's `status` isn't `TRADING`. +- `api/v1/depth` no longer has the ignored and empty `[]`. +- `api/v3/myTrades` now returns `quoteQty`; the price \* qty of for the trade. + +WEBSOCKET STREAMS + +- `@depth` and `@depthX` streams no longer have the ignored and empty `[]`. + +SYSTEM IMPROVEMENTS + +- Matching Engine stability/reliability improvements. +- Rest API performance improvements. + +--- + +### 2018-11-13[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +REST API + +- Can now cancel orders through the Rest API during a trading ban. +- New filters: `PERCENT_PRICE`, `MARKET_LOT_SIZE`, `MAX_NUM_ICEBERG_ORDERS`. +- Added `RAW_REQUESTS` rate limit. Limits based on the number of requests over X minutes regardless of weight. +- /api/v3/ticker/price increased to weight of 2 for a no symbol query. +- /api/v3/ticker/bookTicker increased weight of 2 for a no symbol query. +- DELETE /api/v3/order will now return an execution report of the final state of the order. +- `MIN_NOTIONAL` filter has two new parameters: `applyToMarket` (whether or not the filter is applied to MARKET orders) and `avgPriceMins` (the number of minutes over which the price averaged for the notional estimation). +- `intervalNum` added to /api/v1/exchangeInfo limits. `intervalNum` describes the amount of the interval. For example: `intervalNum` 5, with `interval` minute, means "every 5 minutes". + +#### Explanation for the average price calculation:[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +1. (qty \* price) of all trades / sum of qty of all trades over previous 5 minutes. + +2. If there is no trade in the last 5 minutes, it takes the first trade that happened outside of the 5min window. For example if the last trade was 20 minutes ago, that trade's price is the 5 min average. + +3. If there is no trade on the symbol, there is no average price and market orders cannot be placed. On a new symbol with `applyToMarket` enabled on the `MIN_NOTIONAL` filter, market orders cannot be placed until there is at least 1 trade. + +4. The current average price can be checked here: `https://api.binance.com/api/v3/avgPrice?symbol=` For example: [https://api.binance.com/api/v3/avgPrice?symbol=BNBUSDT](https://api.binance.com/api/v3/avgPrice?symbol=BNBUSDT) + + +USER DATA STREAM + +- `Last quote asset transacted quantity` (as variable `Y`) added to execution reports. Represents the `lastPrice` \* `lastQty` (`L` \* `l`). + +--- + +### 2018-07-18[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +REST API + +- New filter: `ICEBERG_PARTS` +- `POST api/v3/order` new defaults for `newOrderRespType`. `ACK`, `RESULT`, or `FULL`; `MARKET` and `LIMIT` order types default to `FULL`, all other orders default to `ACK`. +- POST api/v3/order `RESULT` and `FULL` responses now have `cummulativeQuoteQty` +- GET api/v3/openOrders with no symbol weight reduced to 40. +- GET api/v3/ticker/24hr with no symbol weight reduced to 40. +- Max amount of trades from GET /api/v1/trades increased to 1000. +- Max amount of trades from GET /api/v1/historicalTrades increased to 1000. +- Max amount of aggregate trades from GET /api/v1/aggTrades increased to 1000. +- Max amount of aggregate trades from GET /api/v1/klines increased to 1000. +- Rest API Order lookups now return `updateTime` which represents the last time the order was updated; `time` is the order creation time. +- Order lookup endpoints will now return `cummulativeQuoteQty`. If `cummulativeQuoteQty` is < 0, it means the data isn't available for this order at this time. +- `REQUESTS` rate limit type changed to `REQUEST_WEIGHT`. This limit was always logically request weight and the previous name for it caused confusion. + +USER DATA STREAM + +- `cummulativeQuoteQty` field added to order responses and execution reports (as variable `Z`). Represents the cummulative amount of the `quote` that has been spent (with a `BUY` order) or received (with a `SELL` order). Historical orders will have a value < 0 in this field indicating the data is not available at this time. `cummulativeQuoteQty` divided by `cummulativeQty` will give the average price for an order. +- `O` (order creation time) added to execution reports + +--- + +### 2018-01-23[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +- GET /api/v1/historicalTrades weight decreased to 5 +- GET /api/v1/aggTrades weight decreased to 1 +- GET /api/v1/klines weight decreased to 1 +- GET /api/v1/ticker/24hr all symbols weight decreased to number of trading symbols / 2 +- GET /api/v3/allOrders weight decreased to 5 +- GET /api/v3/myTrades weight decreased to 5 +- GET /api/v3/account weight decreased to 5 +- GET /api/v1/depth limit=500 weight decreased to 5 +- GET /api/v1/depth limit=1000 weight decreased to 10 +- \-1003 error message updated to direct users to websockets + +--- + +### 2018-01-20[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +- GET /api/v1/ticker/24hr single symbol weight decreased to 1 +- GET /api/v3/openOrders all symbols weight decreased to number of trading symbols / 2 +- GET /api/v3/allOrders weight decreased to 15 +- GET /api/v3/myTrades weight decreased to 15 +- GET /api/v3/order weight decreased to 1 +- myTrades will now return both sides of a self-trade/wash-trade + +--- + +### 2018-01-14[​](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) + +- GET /api/v1/aggTrades weight changed to 2 +- GET /api/v1/klines weight changed to 2 +- GET /api/v3/order weight changed to 2 +- GET /api/v3/allOrders weight changed to 20 +- GET /api/v3/account weight changed to 20 +- GET /api/v3/myTrades weight changed to 20 +- GET /api/v3/historicalTrades weight changed to 20 + +- [2026-02-24](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2026-02-12](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2026-02-09](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2026-02-02](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2026-01-29](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2026-01-27](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2026-01-26](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2026-01-21](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2025-12-18](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2025-12-17](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2025-12-15](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2025-12-09](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2025-12-02](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2025-11-14](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2025-11-12](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2025-11-11](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2025-11-10](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2025-10-28](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2025-10-24](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2025-10-21](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2025-10-08](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2025-09-29](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2025-09-18](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2025-09-12](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2025-08-28](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2025-08-26](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2025-08-25](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2025-08-19](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2025-08-12](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2025-08-07](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2025-07-03](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2025-06-04](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2025-05-28](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2025-05-22](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2025-04-29](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2025-04-25](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2025-04-21](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2025-04-08](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2025-04-07](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2025-04-03](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2025-03-31](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2025-03-10](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2025-03-05](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2025-02-12](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2025-01-28](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2025-01-09](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2024-12-17](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2024-12-09](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2024-10-18](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2024-10-17](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2024-08-26](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2024-08-16](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2024-08-01](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2024-07-26](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2024-07-22](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2024-06-11](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2024-06-06](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2024-05-30](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2024-04-10](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2024-04-02](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2024-02-28](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2024-02-08](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2023-12-08](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2023-12-04](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2023-10-19](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2023-10-03](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2023-08-25](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2023-08-08](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2023-07-18](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2023-07-11](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2023-06-06](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2023-05-26](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2023-05-24](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2023-03-13](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2023-02-17](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2023-01-26](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2023-01-23](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2023-01-19](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2022-12-28](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2022-12-26](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2022-12-15](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2022-12-13](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2022-12-05](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2022-12-02](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2022-09-30](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2022-09-15](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2022-08-23](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2022-08-08](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2022-06-20](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2022-06-15](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2022-05-23](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2022-05-17](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2022-04-13](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2022-04-12](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2022-02-28](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2022-02-24](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2021-12-29](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2021-11-01](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2021-09-14](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2021-08-12](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2021-05-12](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2021-04-26](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2021-01-01](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2020-11-27](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2020-09-09](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2020-05-01](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2020-04-25](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2020-04-23](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2020-03-24](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2019-11-22](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2019-11-13](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2019-09-09](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2019-09-03](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2019-08-16 (Update 2)](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2019-08-16](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2019-08-15](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2019-03-12](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2018-11-13](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2018-07-18](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2018-01-23](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2018-01-20](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) +- [2018-01-14](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) diff --git a/docs/binance/binance-spot/PROD-TERMS-OF-USE.md b/docs/binance/binance-spot/PROD-TERMS-OF-USE.md new file mode 100644 index 0000000..b29c1e5 --- /dev/null +++ b/docs/binance/binance-spot/PROD-TERMS-OF-USE.md @@ -0,0 +1,9 @@ +--- +title: "Terms of Use | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs/PROD-TERMS-OF-USE" +fetched_at: "2026-02-26T10:38:06.668Z" +--- +# SPOT Exchange Terms of Use + +Binance products and services are subject to the [Product Terms of Use](https://www.binance.com/en/terms). +Please read it carefully before proceeding. diff --git a/docs/binance/binance-spot/README.md b/docs/binance/binance-spot/README.md new file mode 100644 index 0000000..2d15d2f --- /dev/null +++ b/docs/binance/binance-spot/README.md @@ -0,0 +1,255 @@ +--- +title: "Readme | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs/README" +fetched_at: "2026-02-26T10:38:06.666Z" +--- +# Official Documentation for the Binance APIs and Streams. + +- Official Announcements regarding changes, downtime, etc. to the API and Streams will be reported here: **[https://t.me/binance\_api\_announcements](https://t.me/binance_api_announcements)** +- Streams, endpoints, parameters, payloads, etc. described in the documents in this repository are considered **official** and **supported**. +- The use of any other streams, endpoints, parameters, or payloads, etc. is **not supported**; **use them at your own risk and with no guarantees.** + +Name + +Description + +[enums.md](https://developers.binance.com/docs/binance-spot-api-docs/enums) + +Details on the enums used by REST and WebSocket API + +[errors.md](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +Error codes and messages of Spot API + +[filters.md](https://developers.binance.com/docs/binance-spot-api-docs/filters) + +Details on the filters used by Spot API + +[rest-api.md](https://developers.binance.com/docs/binance-spot-api-docs/rest-api) + +Spot REST API (`/api`) + +[web-socket-api.md](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api) + +Spot WebSocket API + +[fix-api.md](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +FIX API + +[web-socket-streams.md](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) + +Spot Market Data WebSocket streams + +[sbe-market-data-streams.md](https://developers.binance.com/docs/binance-spot-api-docs/sbe-market-data-streams) + +SBE Market Data Streams + +[user-data-stream.md](https://developers.binance.com/docs/binance-spot-api-docs/user-data-stream) + +Spot User Data WebSocket streams + +[sbe\_schemas](https://developers.binance.com/docs/binance-spot-api-docs/sbe/schemas) + +Spot Simple Binary Encoding (SBE) schemas + +[testnet](https://developers.binance.com/docs/binance-spot-api-docs/testnet) + +API docs for features available only on SPOT Testnet + +[demo-mode](https://developers.binance.com/docs/binance-spot-api-docs/demo-mode) + +Page regarding Demo Mode + +[Margin Trading](https://developers.binance.com/docs/margin_trading) + +Details on Margin Trading + +[Derivative UM Futures](https://developers.binance.com/docs/derivatives/usds-margined-futures/general-info) + +Details on Derivative UM Futures (`/fapi`) + +[Derivative CM Futures](https://developers.binance.com/docs/derivatives/coin-margined-futures/general-info) + +Details on Derivative CM Futures (`/dapi`) + +[Derivative Options](https://developers.binance.com/docs/derivatives/option/general-info) + +Details on Derivative European Options (`/eapi`) + +[Derivative Portfolio Margin](https://developers.binance.com/docs/derivatives/portfolio-margin/general-info) + +Details on Derivative Portfolio Margin (`/papi`) + +[Wallet](https://developers.binance.com/docs/wallet) + +Details on Wallet endpoints (`/sapi`) + +[Sub Account](https://developers.binance.com/docs/sub_account/general-info) + +Details on Sub-Account requests (`/sapi`) + +[Simple Earn](https://developers.binance.com/docs/simple_earn/general-info) + +Details on Simple Earn + +[Dual Investment](https://developers.binance.com/docs/dual_investment) + +Details on Dual Investment + +[Auto Invest](https://developers.binance.com/docs/auto_invest) + +Details on Auto Invest + +[Staking](https://developers.binance.com/docs/staking) + +Details on Staking + +[Mining](https://developers.binance.com/docs/mining) + +Details on Mining + +[Algo Trading](https://developers.binance.com/docs/algo) + +Details on Algo Trading + +[Copy Trading](https://developers.binance.com/docs/copy_trading) + +Details on Copy Trading + +[Portfolio Margin Pro](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/general-info) + +Details on Portfolio Margin Pro + +[Fiat](https://developers.binance.com/docs/fiat) + +Details on Fiat + +[C2C](https://developers.binance.com/docs/c2c) + +Details on C2C + +[VIP Loan](https://developers.binance.com/docs/vip_loan) + +Details on VIP Loan + +[Crypto Loan](https://developers.binance.com/docs/crypto_loan) + +Details on Crypto Loan + +[Pay](https://developers.binance.com/docs/binance-pay) + +Details on Binance Pay + +[Convert](https://developers.binance.com/docs/convert) + +Details on Convert API + +[Rebate](https://developers.binance.com/docs/rebate) + +Details on Spot Rebate + +[NFT](https://developers.binance.com/docs/nft) + +Details on NFT requests + +[Gift Card](https://developers.binance.com/docs/gift_card) + +Details on Gift Card API + +### FAQ[​](https://developers.binance.com/docs/binance-spot-api-docs/README) + +Name + +Description + +[api\_key\_types](https://developers.binance.com/docs/binance-spot-api-docs/faqs/api_key_types) + +API Key Types + +[spot\_glossary](https://developers.binance.com/docs/binance-spot-api-docs/faqs/spot_glossary) + +Definition of terms used in the API + +[commission\_faq](https://developers.binance.com/docs/binance-spot-api-docs/faqs/commission_faq) + +Explaining commission calculations on the API + +[trailing-stop-faq](https://developers.binance.com/docs/binance-spot-api-docs/faqs/trailing-stop-faq) + +Detailed Information on the behavior of Trailing Stops on the API + +[stp\_faq](https://developers.binance.com/docs/binance-spot-api-docs/faqs/stp_faq) + +Detailed Information on the behavior of Self Trade Prevention (aka STP) on the API + +[market\_orders\_faq](https://developers.binance.com/docs/binance-spot-api-docs/faqs/market_orders_faq.md) + +Detailed information on the behavior of Market Orders + +[market-data-only](https://developers.binance.com/docs/binance-spot-api-docs/faqs/market_data_only) + +Information on our market data only API and WebSocket streams. + +[sor\_faq](https://developers.binance.com/docs/binance-spot-api-docs/faqs/sor_faq) + +Smart Order Routing (SOR) + +[order\_count\_decrement](https://developers.binance.com/docs/binance-spot-api-docs/faqs/order_count_decrement) + +Updates to the Spot Order Count Limit Rules. + +[order\_amend\_keep\_priority](https://developers.binance.com/docs/binance-spot-api-docs/faqs/order_amend_keep_priority) + +Detailed Information on the behavior of Order Amend Keep Priority + +[pegged\_orders](https://developers.binance.com/docs/binance-spot-api-docs/faqs/pegged_orders) + +Detailed Information on Pegged Orders + +[sbe\_faq](https://developers.binance.com/docs/binance-spot-api-docs/faqs/sbe_faq) + +Information on the implementation of Simple Binary Encoding (SBE) on the API + +### Change log[​](https://developers.binance.com/docs/binance-spot-api-docs/README) + +Please refer to [CHANGELOG](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG) for latest changes on our APIs and Streamers. + +### Useful Resources[​](https://developers.binance.com/docs/binance-spot-api-docs/README) + +- [Postman Collections](https://github.com/binance/binance-api-postman) + - Postman collections are available, and they are recommended for new users seeking a quick and easy start with the API. +- Connectors + - The following are lightweight libraries that work as connectors to the Binance public API, written in different languages: + - [Python](https://github.com/binance/binance-connector-python) + - [Node.js](https://github.com/binance/binance-connector-node) + - [Ruby](https://github.com/binance/binance-connector-ruby) + - [DotNET C#](https://github.com/binance/binance-connector-dotnet) + - [Java](https://github.com/binance/binance-connector-java) + - [Rust](https://github.com/binance/binance-spot-connector-rust) + - [PHP](https://github.com/binance/binance-connector-php) + - [Go](https://github.com/binance/binance-connector-go) + - [TypeScript](https://github.com/binance/binance-connector-typescript) +- FIX Connector - This provides access to the exchange using the FIX protocol. + - [Python](https://github.com/binance/binance-fix-connector-python) +- [Swagger](https://github.com/binance/binance-api-swagger) + - A YAML file with OpenAPI specification for the RESTful API is available, along with a Swagger UI page for reference. +- [Spot Testnet](https://testnet.binance.vision/) + - Users can use the SPOT Testnet to practice SPOT trading. + - Currently, this is only available via the API. + - Only endpoints starting with `/api/*` are supported, `/sapi/*` is not supported. + +### Contact Us[​](https://developers.binance.com/docs/binance-spot-api-docs/README) + +- [Binance API Telegram Group](https://t.me/binance_api_english) + - For any questions regarding sudden drop in performance with the API and/or WebSockets. + - For any general questions about the API not covered in the documentation. +- [Binance Developers](https://dev.binance.vision/) + - For any questions/help regarding code implementation with API and/or WebSockets. +- [Binance Customer Support](https://www.binance.com/en/support-center) + - For cases such as missing funds, help with 2FA, etc. + +- [FAQ](https://developers.binance.com/docs/binance-spot-api-docs/README) +- [Change log](https://developers.binance.com/docs/binance-spot-api-docs/README) +- [Useful Resources](https://developers.binance.com/docs/binance-spot-api-docs/README) +- [Contact Us](https://developers.binance.com/docs/binance-spot-api-docs/README) diff --git a/docs/binance/binance-spot/demo-mode.md b/docs/binance/binance-spot/demo-mode.md new file mode 100644 index 0000000..d3a2bec --- /dev/null +++ b/docs/binance/binance-spot/demo-mode.md @@ -0,0 +1,16 @@ +--- +title: "Changelog | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs/demo-mode" +fetched_at: "2026-02-26T10:38:06.839Z" +--- +# CHANGELOG for Binance SPOT Demo Mode + +**Last Updated: 2026-01-29** + +### 2026-01-29[​](https://developers.binance.com/docs/binance-spot-api-docs/demo-mode) + +This changelog will announce any scheduled downtime for maintenance for the SPOT Demo Mode environment. + +For more information on how to use Demo Mode via API, please refer to the [General Info](https://developers.binance.com/docs/binance-spot-api-docs/demo-mode/general-info) page. + +- [2026-01-29](https://developers.binance.com/docs/binance-spot-api-docs/demo-mode) diff --git a/docs/binance/binance-spot/demo-mode_CHANGELOG.md b/docs/binance/binance-spot/demo-mode_CHANGELOG.md new file mode 100644 index 0000000..ffd9550 --- /dev/null +++ b/docs/binance/binance-spot/demo-mode_CHANGELOG.md @@ -0,0 +1,16 @@ +--- +title: "Changelog | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs/demo-mode/CHANGELOG" +fetched_at: "2026-02-26T10:38:06.898Z" +--- +# CHANGELOG for Binance SPOT Demo Mode + +**Last Updated: 2026-01-29** + +### 2026-01-29[​](https://developers.binance.com/docs/binance-spot-api-docs/demo-mode/CHANGELOG) + +This changelog will announce any scheduled downtime for maintenance for the SPOT Demo Mode environment. + +For more information on how to use Demo Mode via API, please refer to the [General Info](https://developers.binance.com/docs/binance-spot-api-docs/demo-mode/general-info) page. + +- [2026-01-29](https://developers.binance.com/docs/binance-spot-api-docs/demo-mode/CHANGELOG) diff --git a/docs/binance/binance-spot/demo-mode_DEMO-TERMS-OF-USE.md b/docs/binance/binance-spot/demo-mode_DEMO-TERMS-OF-USE.md new file mode 100644 index 0000000..d1b95db --- /dev/null +++ b/docs/binance/binance-spot/demo-mode_DEMO-TERMS-OF-USE.md @@ -0,0 +1,9 @@ +--- +title: "Demo Mode Terms of Use | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs/demo-mode/DEMO-TERMS-OF-USE" +fetched_at: "2026-02-26T10:38:06.921Z" +--- +# SPOT Demo Mode Terms of Use + +Binance products and services are subject to the [Product Terms of Use](https://www.binance.com/en/about-legal/terms-demo-trading). +Please read it carefully before proceeding. diff --git a/docs/binance/binance-spot/demo-mode_general-info.md b/docs/binance/binance-spot/demo-mode_general-info.md new file mode 100644 index 0000000..f3eadaf --- /dev/null +++ b/docs/binance/binance-spot/demo-mode_general-info.md @@ -0,0 +1,148 @@ +--- +title: "General Info | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs/demo-mode/general-info" +fetched_at: "2026-02-26T10:38:06.931Z" +--- +# Demo Mode for SPOT Trading + +This page explains how to use [Demo Mode Trading](https://www.binance.com/en/support/faq/detail/9be58f73e5e14338809e3b705b9687dd) via the API. + +## How can I trade on Demo Mode using the API?[​](https://developers.binance.com/docs/binance-spot-api-docs/demo-mode/general-info) + +1. After logging into your Binance account, click on Binance Demo Trading and then you can create an API key in the [API Key Management page](https://demo.binance.com/en/my/settings/api-management). +2. Follow the official documentation of the SPOT API, replacing the URLs of the endpoints/methods with the following values: + +Service + +Spot API URLs + +Demo Mode URLs + +REST API + +- https://api.binance.com/api +- https://api-gcp.binance.com/api +- https://api1.binance.com/api +- https://api2.binance.com/api +- https://api3.binance.com/api +- https://api4.binance.com/api + +- **https://demo-api.binance.com/api** + +WebSocket API + +- wss://ws-api.binance.com/ws-api/v3 +- wss://ws-api.binance.com:9443/ws-api/v3 + +- **wss://demo-ws-api.binance.com/ws-api/v3** + +WebSocket Market Streams + +- wss://stream.binance.com/ws +- wss://stream.binance.com:9443/ws + +- **wss://demo-stream.binance.com/ws** +- **wss://demo-stream.binance.com:9443/ws** + +- wss://stream.binance.com/stream +- wss://stream.binance.com:9443/stream + +- **wss://demo-stream.binance.com/stream** +- **wss://demo-stream.binance.com:9443/stream** + +WebSocket Market Streams (SBE) + +- wss://stream-sbe.binance.com/ws +- wss://stream-sbe.binance.com:9443/ws + +- **wss://demo-stream-sbe.binance.com/ws** +- **wss://demo-stream-sbe.binance.com:9443/ws** + +- wss://stream-sbe.binance.com/stream +- wss://stream-sbe.binance.com:9443/stream + +- **wss://demo-stream-sbe.binance.com/stream** +- **wss://demo-stream-sbe.binance.com:9443/stream** + +FIX +(Send FIX requests; receive FIX responses) + +- tcp+tls://fix-oe.binance.com:9000 + +- **tcp+tls://demo-fix-oe.binance.com:9000** + +- tcp+tls://fix-dc.binance.com:9000 + +- **tcp+tls://demo-fix-dc.binance.com:9000** + +- tcp+tls://fix-md.binance.com:9000 + +- **tcp+tls://demo-fix-md.binance.com:9000** + +FIX SBE +(Send FIX requests; receive FIX SBE responses) + +- tcp+tls://fix-oe.binance.com:9001 + +- **tcp+tls://demo-fix-oe.binance.com:9001** + +- tcp+tls://fix-dc.binance.com:9001 + +- **tcp+tls://demo-fix-dc.binance.com:9001** + +- tcp+tls://fix-md.binance.com:9001 + +- **tcp+tls://demo-fix-md.binance.com:9001** + +FIX SBE +(Send FIX SBE requests; receive FIX SBE responses) + +- tcp+tls://fix-oe.binance.com:9002 + +- **tcp+tls://demo-fix-oe.binance.com:9002** + +- tcp+tls://fix-dc.binance.com:9002 + +- **tcp+tls://demo-fix-dc.binance.com:9002** + +- tcp+tls://fix-md.binance.com:9002 + +- **tcp+tls://demo-fix-md.binance.com:9002** + +## What is the difference between SPOT Testnet and SPOT Demo Mode?[​](https://developers.binance.com/docs/binance-spot-api-docs/demo-mode/general-info) + +SPOT Testnet + +SPOT Demo Mode + +Balances are reset every month. + +You can reset your balance whenever you want via the UI. + +SPOT Testnet sometimes has new features before the live exchange. + +Demo Mode always has the same features as the live exchange. + +Testnet's prices and order books are independent from the live exchange. + +Demo Mode's prices and order books are similar to the live exchange. + +IP Limits, Unfilled Order Count, Exchange Filters are generally the same as the live exchange. + +IP Limits, Unfilled Order Count, Exchange Filters are exactly the same as the live exchange. + +**In summary**: + +- SPOT Testnet is useful to integrate with upcoming features not yet available on the live exchange. +- Demo Mode is useful to test against _realistic_ market data. + +> \[!WARNING\] Realistic market data is not equal to "real" market data. Do not assume trading strategies that work in Demo Mode will work in the live exchange. + +## What happens when Demo Mode is under maintenance?[​](https://developers.binance.com/docs/binance-spot-api-docs/demo-mode/general-info) + +- There will be an announcement on the [CHANGELOG](https://developers.binance.com/docs/binance-spot-api-docs/demo-mode/CHANGELOG) page prior to downtime. +- During maintenance, you will not be able to place or cancel orders. + +- [How can I trade on Demo Mode using the API?](https://developers.binance.com/docs/binance-spot-api-docs/demo-mode/general-info) +- [What is the difference between SPOT Testnet and SPOT Demo Mode?](https://developers.binance.com/docs/binance-spot-api-docs/demo-mode/general-info) +- [What happens when Demo Mode is under maintenance?](https://developers.binance.com/docs/binance-spot-api-docs/demo-mode/general-info) diff --git a/docs/binance/binance-spot/enums.md b/docs/binance/binance-spot/enums.md new file mode 100644 index 0000000..d8914cd --- /dev/null +++ b/docs/binance/binance-spot/enums.md @@ -0,0 +1,239 @@ +--- +title: "Enums | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs/enums" +fetched_at: "2026-02-26T10:38:07.237Z" +--- +# ENUM Definitions + +This will apply for both REST API and WebSocket API. + +## Symbol status (status)[​](https://developers.binance.com/docs/binance-spot-api-docs/enums) + +- `TRADING` +- `END_OF_DAY` +- `HALT` +- `BREAK` + +## Account and Symbol Permissions (permissions)[​](https://developers.binance.com/docs/binance-spot-api-docs/enums) + +- `SPOT` +- `MARGIN` +- `LEVERAGED` +- `TRD_GRP_002` +- `TRD_GRP_003` +- `TRD_GRP_004` +- `TRD_GRP_005` +- `TRD_GRP_006` +- `TRD_GRP_007` +- `TRD_GRP_008` +- `TRD_GRP_009` +- `TRD_GRP_010` +- `TRD_GRP_011` +- `TRD_GRP_012` +- `TRD_GRP_013` +- `TRD_GRP_014` +- `TRD_GRP_015` +- `TRD_GRP_016` +- `TRD_GRP_017` +- `TRD_GRP_018` +- `TRD_GRP_019` +- `TRD_GRP_020` +- `TRD_GRP_021` +- `TRD_GRP_022` +- `TRD_GRP_023` +- `TRD_GRP_024` +- `TRD_GRP_025` + +## Order status (status)[​](https://developers.binance.com/docs/binance-spot-api-docs/enums) + +Status + +Description + +`NEW` + +The order has been accepted by the engine. + +`PENDING_NEW` + +The order is in a pending phase until the working order of an order list has been fully filled. + +`PARTIALLY_FILLED` + +A part of the order has been filled. + +`FILLED` + +The order has been completed. + +`CANCELED` + +The order has been canceled by the user. + +`PENDING_CANCEL` + +Currently unused + +`REJECTED` + +The order was not accepted by the engine and not processed. + +`EXPIRED` + +The order was canceled according to the order type's rules (e.g. LIMIT FOK orders with no fill, LIMIT IOC or MARKET orders that partially fill) +or by the exchange, (e.g. orders canceled during liquidation, orders canceled during maintenance) + +`EXPIRED_IN_MATCH` + +The order was expired by the exchange due to STP. (e.g. an order with `EXPIRE_TAKER` will match with existing orders on the book with the same account or same `tradeGroupId`) + +## Order List Status (listStatusType)[​](https://developers.binance.com/docs/binance-spot-api-docs/enums) + +Status + +Description + +`RESPONSE` + +This is used when the ListStatus is responding to a failed action. (E.g. order list placement or cancellation) + +`EXEC_STARTED` + +The order list has been placed or there is an update to the order list status. + +`UPDATED` + +The clientOrderId of an order in the order list has been changed. + +`ALL_DONE` + +The order list has finished executing and thus is no longer active. + +## Order List Order Status (listOrderStatus)[​](https://developers.binance.com/docs/binance-spot-api-docs/enums) + +Status + +Description + +`EXECUTING` + +Either an order list has been placed or there is an update to the status of the list. + +`ALL_DONE` + +An order list has completed execution and thus no longer active. + +`REJECT` + +The List Status is responding to a failed action either during order placement or order canceled. + +## ContingencyType[​](https://developers.binance.com/docs/binance-spot-api-docs/enums) + +- `OCO` +- `OTO` + +## AllocationType[​](https://developers.binance.com/docs/binance-spot-api-docs/enums) + +- `SOR` + +## Order types (orderTypes, type)[​](https://developers.binance.com/docs/binance-spot-api-docs/enums) + +- `LIMIT` +- `MARKET` +- `STOP_LOSS` +- `STOP_LOSS_LIMIT` +- `TAKE_PROFIT` +- `TAKE_PROFIT_LIMIT` +- `LIMIT_MAKER` + +## Order Response Type (newOrderRespType)[​](https://developers.binance.com/docs/binance-spot-api-docs/enums) + +- `ACK` +- `RESULT` +- `FULL` + +## Working Floor[​](https://developers.binance.com/docs/binance-spot-api-docs/enums) + +- `EXCHANGE` +- `SOR` + +## Order side (side)[​](https://developers.binance.com/docs/binance-spot-api-docs/enums) + +- `BUY` +- `SELL` + +## Time in force (timeInForce)[​](https://developers.binance.com/docs/binance-spot-api-docs/enums) + +This sets how long an order will be active before expiration. + +Status + +Description + +`GTC` + +Good Til Canceled +An order will be on the book unless the order is canceled. + +`IOC` + +Immediate Or Cancel +An order will try to fill the order as much as it can before the order expires. + +`FOK` + +Fill or Kill +An order will expire if the full order cannot be filled upon execution. + +## Rate limiters (rateLimitType)[​](https://developers.binance.com/docs/binance-spot-api-docs/enums) + +- REQUEST\_WEIGHT + +``` +{ "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000} +``` + +- ORDERS + +``` +{ "rateLimitType": "ORDERS", "interval": "SECOND", "intervalNum": 1, "limit": 10} +``` + +- RAW\_REQUESTS + +``` +{ "rateLimitType": "RAW_REQUESTS", "interval": "MINUTE", "intervalNum": 5, "limit": 61000} +``` + +## Rate limit intervals (interval)[​](https://developers.binance.com/docs/binance-spot-api-docs/enums) + +- SECOND +- MINUTE +- DAY + +## STP Modes[​](https://developers.binance.com/docs/binance-spot-api-docs/enums) + +Read [Self Trade Prevention (STP) FAQ](https://developers.binance.com/docs/binance-spot-api-docs/faqs/stp_faq) to learn more. + +- `NONE` +- `EXPIRE_MAKER` +- `EXPIRE_TAKER` +- `EXPIRE_BOTH` +- `DECREMENT` +- `TRANSFER` + +- [Symbol status (status)](https://developers.binance.com/docs/binance-spot-api-docs/enums) +- [Account and Symbol Permissions (permissions)](https://developers.binance.com/docs/binance-spot-api-docs/enums) +- [Order status (status)](https://developers.binance.com/docs/binance-spot-api-docs/enums) +- [Order List Status (listStatusType)](https://developers.binance.com/docs/binance-spot-api-docs/enums) +- [Order List Order Status (listOrderStatus)](https://developers.binance.com/docs/binance-spot-api-docs/enums) +- [ContingencyType](https://developers.binance.com/docs/binance-spot-api-docs/enums) +- [AllocationType](https://developers.binance.com/docs/binance-spot-api-docs/enums) +- [Order types (orderTypes, type)](https://developers.binance.com/docs/binance-spot-api-docs/enums) +- [Order Response Type (newOrderRespType)](https://developers.binance.com/docs/binance-spot-api-docs/enums) +- [Working Floor](https://developers.binance.com/docs/binance-spot-api-docs/enums) +- [Order side (side)](https://developers.binance.com/docs/binance-spot-api-docs/enums) +- [Time in force (timeInForce)](https://developers.binance.com/docs/binance-spot-api-docs/enums) +- [Rate limiters (rateLimitType)](https://developers.binance.com/docs/binance-spot-api-docs/enums) +- [Rate limit intervals (interval)](https://developers.binance.com/docs/binance-spot-api-docs/enums) +- [STP Modes](https://developers.binance.com/docs/binance-spot-api-docs/enums) diff --git a/docs/binance/binance-spot/errors.md b/docs/binance/binance-spot/errors.md new file mode 100644 index 0000000..5cba0fd --- /dev/null +++ b/docs/binance/binance-spot/errors.md @@ -0,0 +1,832 @@ +--- +title: "Error | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs/errors" +fetched_at: "2026-02-26T10:38:07.185Z" +--- +# Error codes for Binance + +Errors consist of two parts: an error code and a message. Codes are universal, but messages can vary. Here is the error JSON payload: + +``` +{ "code": -1121, "msg": "Invalid symbol."} +``` + +## 10xx - General Server or Network issues[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +### \-1000 UNKNOWN[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- An unknown error occurred while processing the request. + +### \-1001 DISCONNECTED[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- Internal error; unable to process your request. Please try again. + +### \-1002 UNAUTHORIZED[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- You are not authorized to execute this request. + +### \-1003 TOO\_MANY\_REQUESTS[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- Too many requests queued. +- Too much request weight used; current limit is %s request weight per %s. Please use WebSocket Streams for live updates to avoid polling the API. +- Way too much request weight used; IP banned until %s. Please use WebSocket Streams for live updates to avoid bans. + +### \-1006 UNEXPECTED\_RESP[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- An unexpected response was received from the message bus. Execution status unknown. + +### \-1007 TIMEOUT[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- Timeout waiting for response from backend server. Send status unknown; execution status unknown. + +### \-1008 SERVER\_BUSY[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- Server is currently overloaded with other requests. Please try again in a few minutes. + +### \-1013 INVALID\_MESSAGE[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- The request is rejected by the API. (i.e. The request didn't reach the Matching Engine.) +- Potential error messages can be found in [Filter Failures](https://developers.binance.com/docs/binance-spot-api-docs/errors) or [Failures during order placement](https://developers.binance.com/docs/binance-spot-api-docs/errors). + +### \-1014 UNKNOWN\_ORDER\_COMPOSITION[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- Unsupported order combination. + +### \-1015 TOO\_MANY\_ORDERS[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- Too many new orders. +- Too many new orders; current limit is %s orders per %s. + +### \-1016 SERVICE\_SHUTTING\_DOWN[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- This service is no longer available. + +### \-1020 UNSUPPORTED\_OPERATION[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- This operation is not supported. + +### \-1021 INVALID\_TIMESTAMP[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- Timestamp for this request is outside of the recvWindow. +- Timestamp for this request was 1000ms ahead of the server's time. + +### \-1022 INVALID\_SIGNATURE[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- Signature for this request is not valid. + +### \-1033 COMP\_ID\_IN\_USE[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- `SenderCompId(49)` is currently in use. Concurrent use of the same SenderCompId within one account is not allowed. + +### \-1034 TOO\_MANY\_CONNECTIONS[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- Too many concurrent connections; current limit is '%s'. +- Too many connection attempts for account; current limit is %s per '%s'. +- Too many connection attempts from IP; current limit is %s per '%s'. + +### \-1035 LOGGED\_OUT[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- Please send [Logout`<5>`](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) message to close the session. + +## 11xx - Request issues[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +### \-1100 ILLEGAL\_CHARS[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- Illegal characters found in a parameter. +- Illegal characters found in parameter '%s'; legal range is '%s'. + +### \-1101 TOO\_MANY\_PARAMETERS[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- Too many parameters sent for this endpoint. +- Too many parameters; expected '%s' and received '%s'. +- Duplicate values for a parameter detected. + +### \-1102 MANDATORY\_PARAM\_EMPTY\_OR\_MALFORMED[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- A mandatory parameter was not sent, was empty/null, or malformed. +- Mandatory parameter '%s' was not sent, was empty/null, or malformed. +- Param '%s' or '%s' must be sent, but both were empty/null! +- Required tag '%s' missing. +- Field value was empty or malformed. +- '%s' contains unexpected value. Cannot be greater than %s. + +### \-1103 UNKNOWN\_PARAM[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- An unknown parameter was sent. +- Undefined Tag. + +### \-1104 UNREAD\_PARAMETERS[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- Not all sent parameters were read. +- Not all sent parameters were read; read '%s' parameter(s) but was sent '%s'. + +### \-1105 PARAM\_EMPTY[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- A parameter was empty. +- Parameter '%s' was empty. + +### \-1106 PARAM\_NOT\_REQUIRED[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- A parameter was sent when not required. +- Parameter '%s' sent when not required. +- A tag '%s' was sent when not required. + +### \-1108 PARAM\_OVERFLOW[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- Parameter '%s' overflowed. + +### \-1111 BAD\_PRECISION[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- Parameter '%s' has too much precision. + +### \-1112 NO\_DEPTH[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- No orders on book for symbol. + +### \-1114 TIF\_NOT\_REQUIRED[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- TimeInForce parameter sent when not required. + +### \-1115 INVALID\_TIF[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- Invalid timeInForce. + +### \-1116 INVALID\_ORDER\_TYPE[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- Invalid orderType. + +### \-1117 INVALID\_SIDE[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- Invalid side. + +### \-1118 EMPTY\_NEW\_CL\_ORD\_ID[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- New client order ID was empty. + +### \-1119 EMPTY\_ORG\_CL\_ORD\_ID[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- Original client order ID was empty. + +### \-1120 BAD\_INTERVAL[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- Invalid interval. + +### \-1121 BAD\_SYMBOL[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- Invalid symbol. + +### \-1122 INVALID\_SYMBOLSTATUS[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- Invalid symbolStatus. + +### \-1125 INVALID\_LISTEN\_KEY[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- This listenKey does not exist. + +### \-1127 MORE\_THAN\_XX\_HOURS[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- Lookup interval is too big. +- More than %s hours between startTime and endTime. + +### \-1128 OPTIONAL\_PARAMS\_BAD\_COMBO[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- Combination of optional parameters invalid. +- Combination of optional fields invalid. Recommendation: '%s' and '%s' must both be sent. +- Fields \[%s\] must be sent together or omitted entirely. +- Invalid `MDEntryType (269)` combination. BID and OFFER must be requested together. +- Conflicting fields: \['%s'...\] + +### \-1130 INVALID\_PARAMETER[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- Invalid data sent for a parameter. +- Data sent for parameter '%s' is not valid. + +### \-1134 BAD\_STRATEGY\_TYPE[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- `strategyType` was less than 1000000. +- `TargetStrategy (847)` was less than 1000000. + +### \-1135 INVALID\_JSON[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- Invalid JSON Request +- JSON sent for parameter '%s' is not valid + +### \-1139 INVALID\_TICKER\_TYPE[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- Invalid ticker type. + +### \-1145 INVALID\_CANCEL\_RESTRICTIONS[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- `cancelRestrictions` has to be either `ONLY_NEW` or `ONLY_PARTIALLY_FILLED`. + +### \-1151 DUPLICATE\_SYMBOLS[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- Symbol is present multiple times in the list. + +### \-1152 INVALID\_SBE\_HEADER[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- Invalid `X-MBX-SBE` header; expected `:`. +- Invalid SBE message header. + +### \-1153 UNSUPPORTED\_SCHEMA\_ID[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- Unsupported SBE schema ID or version specified in the `X-MBX-SBE` header. +- Invalid SBE schema ID or version specified. + +### \-1155 SBE\_DISABLED[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- SBE is not enabled. + +### \-1158 OCO\_ORDER\_TYPE\_REJECTED[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- Order type not supported in OCO. +- If the order type provided in the `aboveType` and/or `belowType` is not supported. + +### \-1160 OCO\_ICEBERGQTY\_TIMEINFORCE[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- Parameter '%s' is not supported if `aboveTimeInForce`/`belowTimeInForce` is not GTC. +- If the order type for the above or below leg is `STOP_LOSS_LIMIT`, and `icebergQty` is provided for that leg, the `timeInForce` has to be `GTC` else it will throw an error. +- `TimeInForce (59)` must be `GTC (1)` when `MaxFloor (111)` is used. + +### \-1161 DEPRECATED\_SCHEMA[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- Unable to encode the response in SBE schema 'x'. Please use schema 'y' or higher. + +### \-1165 BUY\_OCO\_LIMIT\_MUST\_BE\_BELOW[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- A limit order in a buy OCO must be below. + +### \-1166 SELL\_OCO\_LIMIT\_MUST\_BE\_ABOVE[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- A limit order in a sell OCO must be above. + +### \-1168 BOTH\_OCO\_ORDERS\_CANNOT\_BE\_LIMIT[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- At least one OCO order must be contingent. + +### \-1169 INVALID\_TAG\_NUMBER[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- Invalid tag number. + +### \-1170 TAG\_NOT\_DEFINED\_IN\_MESSAGE[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- Tag '%s' not defined for this message type. + +### \-1171 TAG\_APPEARS\_MORE\_THAN\_ONCE[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- Tag '%s' appears more than once. + +### \-1172 TAG\_OUT\_OF\_ORDER[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- Tag '%s' specified out of required order. + +### \-1173 GROUP\_FIELDS\_OUT\_OF\_ORDER[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- Repeating group '%s' fields out of order. + +### \-1174 INVALID\_COMPONENT[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- Component '%s' is incorrectly populated on '%s' order. Recommendation: '%s' + +### \-1175 RESET\_SEQ\_NUM\_SUPPORT[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- Continuation of sequence numbers to new session is currently unsupported. Sequence numbers must be reset for each new session. + +### \-1176 ALREADY\_LOGGED\_IN[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- [Logon`
`](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) should only be sent once. + +### \-1177 GARBLED\_MESSAGE[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- `CheckSum(10)` contains an incorrect value. +- `BeginString (8)` is not the first tag in a message. +- `MsgType (35)` is not the third tag in a message. +- `BodyLength (9)` does not contain the correct byte count. +- Only printable ASCII characters and SOH (Start of Header) are allowed. +- Tag specified without a value. +- Invalid encodingType. + +### \-1178 BAD\_SENDER\_COMPID[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- `SenderCompId(49)` contains an incorrect value. The SenderCompID value should not change throughout the lifetime of a session. + +### \-1179 BAD\_SEQ\_NUM[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- `MsgSeqNum(34)` contains an unexpected value. Expected: '%d'. + +### \-1180 EXPECTED\_LOGON[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- [Logon``](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) must be the first message in the session. + +### \-1181 TOO\_MANY\_MESSAGES[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- Too many messages; current limit is '%d' messages per '%s'. + +### \-1182 PARAMS\_BAD\_COMBO[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- Conflicting fields: \[%s\] + +### \-1183 NOT\_ALLOWED\_IN\_DROP\_COPY\_SESSIONS[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- Requested operation is not allowed in DropCopy sessions. + +### \-1184 DROP\_COPY\_SESSION\_NOT\_ALLOWED[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- DropCopy sessions are not supported on this server. Please reconnect to a drop copy server. + +### \-1185 DROP\_COPY\_SESSION\_REQUIRED[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- Only DropCopy sessions are supported on this server. Either reconnect to order entry server or send `DropCopyFlag (9406)` field. + +### \-1186 NOT\_ALLOWED\_IN\_ORDER\_ENTRY\_SESSIONS[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- Requested operation is not allowed in order entry sessions. + +### \-1187 NOT\_ALLOWED\_IN\_MARKET\_DATA\_SESSIONS[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- Requested operation is not allowed in market data sessions. + +### \-1188 INCORRECT\_NUM\_IN\_GROUP\_COUNT[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- Incorrect NumInGroup count for repeating group '%s'. + +### \-1189 DUPLICATE\_ENTRIES\_IN\_A\_GROUP[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- Group '%s' contains duplicate entries. + +### \-1190 INVALID\_REQUEST\_ID[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- `MDReqID (262)` contains a subscription request id that is already in use on this connection. +- `MDReqID (262)` contains an unsubscription request id that does not match any active subscription. + +### \-1191 TOO\_MANY\_SUBSCRIPTIONS[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- Too many subscriptions. Connection may create up to '%s' subscriptions at a time. +- Similar subscription is already active on this connection. Symbol='%s', active subscription id: '%s'. + +### \-1194 INVALID\_TIME\_UNIT[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- Invalid value for time unit; expected either MICROSECOND or MILLISECOND. + +### \-1196 BUY\_OCO\_STOP\_LOSS\_MUST\_BE\_ABOVE[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- A stop loss order in a buy OCO must be above. + +### \-1197 SELL\_OCO\_STOP\_LOSS\_MUST\_BE\_BELOW[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- A stop loss order in a sell OCO must be below. + +### \-1198 BUY\_OCO\_TAKE\_PROFIT\_MUST\_BE\_BELOW[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- A take profit order in a buy OCO must be below. + +### \-1199 SELL\_OCO\_TAKE\_PROFIT\_MUST\_BE\_ABOVE[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- A take profit order in a sell OCO must be above. + +### \-1210 INVALID\_PEG\_PRICE\_TYPE[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- Invalid pegPriceType. + +### \-1211 INVALID\_PEG\_OFFSET\_TYPE[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- Invalid pegOffsetType. + +### \-1220 SYMBOL\_DOES\_NOT\_MATCH\_STATUS[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- The symbol's status does not match the requested symbolStatus. + +### \-1221 INVALID\_SBE\_MESSAGE\_FIELD[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- Invalid/missing field(s) in SBE message. + +### \-1222 OPO\_WORKING\_MUST\_BE\_BUY[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- Working order in an OPO list must be a bid. + +### \-1223 OPO\_PENDING\_MUST\_BE\_SELL[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- Pending orders in an OPO list must be asks. + +### \-1224 WORKING\_PARAM\_REQUIRED[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- Working order must include the '{param}' tag. + +### \-1225 PENDING\_PARAM\_NOT\_REQUIRED[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- Pending orders should not include the '%s' tag. + +### \-2010 NEW\_ORDER\_REJECTED[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- NEW\_ORDER\_REJECTED + +### \-2011 CANCEL\_REJECTED[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- CANCEL\_REJECTED + +### \-2013 NO\_SUCH\_ORDER[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- Order does not exist. + +### \-2014 BAD\_API\_KEY\_FMT[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- API-key format invalid. + +### \-2015 REJECTED\_MBX\_KEY[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- Invalid API-key, IP, or permissions for action. + +### \-2016 NO\_TRADING\_WINDOW[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- No trading window could be found for the symbol. Try ticker/24hrs instead. + +### \-2026 ORDER\_ARCHIVED[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- Order was canceled or expired with no executed qty over 90 days ago and has been archived. + +### \-2035 SUBSCRIPTION\_ACTIVE[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- User Data Stream subscription already active. + +### \-2036 SUBSCRIPTION\_INACTIVE[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- User Data Stream subscription not active. + +### \-2039 CLIENT\_ORDER\_ID\_INVALID[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- Client order ID is not correct for this order ID. + +### \-2042 MAXIMUM\_SUBSCRIPTION\_IDS[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- Maximum subscription ID reached for this connection. + +## Messages for -1010 ERROR\_MSG\_RECEIVED, -2010 NEW\_ORDER\_REJECTED, -2011 CANCEL\_REJECTED, and -2038 ORDER\_AMEND\_REJECTED[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +This code is sent when an error has been returned by the matching engine. The following messages which will indicate the specific error: + +Error message + +Description + +"Unknown order sent." + +The order (by either `orderId`, `clOrdId`, `origClOrdId`) could not be found. + +"Duplicate order sent." + +The `clOrdId` is already in use. + +"Market is closed." + +The symbol is not trading. + +"Account has insufficient balance for requested action." + +Not enough funds to complete the action. + +"Market orders are not supported for this symbol." + +`MARKET` is not enabled on the symbol. + +"Iceberg orders are not supported for this symbol." + +`icebergQty` is not enabled on the symbol. + +"Stop loss orders are not supported for this symbol." + +`STOP_LOSS` is not enabled on the symbol. + +"Stop loss limit orders are not supported for this symbol." + +`STOP_LOSS_LIMIT` is not enabled on the symbol. + +"Take profit orders are not supported for this symbol." + +`TAKE_PROFIT` is not enabled on the symbol. + +"Take profit limit orders are not supported for this symbol." + +`TAKE_PROFIT_LIMIT` is not enabled on the symbol. + +"Order amend is not supported for this symbol." + +Order amend keep priority is not enabled on the symbol. + +"Price \* QTY is zero or less." + +`price` \* `quantity` is too low. + +"IcebergQty exceeds QTY." + +`icebergQty` must be less than the order quantity. + +"This action is disabled on this account." + +Contact customer support; some actions have been disabled on the account. + +"This account may not place or cancel orders." + +Contact customer support; the account has trading ability disabled. + +"Unsupported order combination" + +The `orderType`, `timeInForce`, `stopPrice`, and/or `icebergQty` combination isn't allowed. + +"Order would trigger immediately." + +The order's stop price is not valid when compared to the last traded price. + +"Cancel order is invalid. Check origClOrdId and orderId." + +No `origClOrdId` or `orderId` was sent in. + +"Order would immediately match and take." + +`LIMIT_MAKER` order type would immediately match and trade, and not be a pure maker order. + +"The relationship of the prices for the orders is not correct." + +The prices set in the `OCO` is breaking the Price restrictions. +For reference: +`BUY` : `LIMIT_MAKER` `price` < Last Traded Price < `stopPrice` +`SELL` : `LIMIT_MAKER` `price` > Last Traded Price > `stopPrice` + +"OCO orders are not supported for this symbol" + +`OCO` is not enabled on the symbol. + +"Quote order qty market orders are not support for this symbol." + +`MARKET` orders using the parameter `quoteOrderQty` are not enabled on the symbol. + +"Trailing stop orders are not supported for this symbol." + +Orders using `trailingDelta` are not enabled on the symbol. + +"Order cancel-replace is not supported for this symbol." + +`POST /api/v3/order/cancelReplace` (REST API) or `order.cancelReplace` (WebSocket API) is not enabled on the symbol. + +"This symbol is not permitted for this account." + +Account and symbol do not have the same permissions. (e.g. `SPOT`, `MARGIN`, etc) + +"This symbol is restricted for this account." + +Account is unable to trade on that symbol. (e.g. An `ISOLATED_MARGIN` account cannot place `SPOT` orders.) + +"Order was not canceled due to cancel restrictions." + +Either `cancelRestrictions` was set to `ONLY_NEW` but the order status was not `NEW` +or +`cancelRestrictions` was set to `ONLY_PARTIALLY_FILLED` but the order status was not `PARTIALLY_FILLED`. + +"Rest API trading is not enabled." / "WebSocket API trading is not enabled." + +Order is being placed or a server that is not configured to allow access to `TRADE` endpoints. + +"FIX API trading is not enabled. + +Order is placed on a FIX server that is not TRADE enabled. + +"Order book liquidity is less than `LOT_SIZE` filter minimum quantity." + +Quote quantity market orders cannot be placed when the order book liquidity is less than minimum quantity configured for the `LOT_SIZE` filter. + +"Order book liquidity is less than `MARKET_LOT_SIZE` filter minimum quantity." + +Quote quantity market orders cannot be placed when the order book liquidity is less than the minimum quantity for `MARKET_LOT_SIZE` filter. + +"Order book liquidity is less than symbol minimum quantity." + +Quote quantity market orders cannot be placed when there are no orders on the book. + +"Order amend (quantity increase) is not supported." + +`newQty` must be less than the order quantity. + +"The requested action would change no state; rejecting". + +The request sent would not have changed the status quo. + +(e.g. `newQty` cannot equal the order quantity.) + +"Pegged orders are not supported for this symbol." + +`pegInstructionsAllowed` has not been enabled. + +"This order type may not use pegged price." + +You are using parameter `pegPriceType` with an unsupported order type. (e.g. `MARKET`) + +"This price peg cannot be used with this order type." + +You are using `pegPriceType`\=`MARKET_PEG` for a `LIMIT_MAKER` order. + +"Order book liquidity is too low for this pegged order." + +The order book doesn’t have the best price level to peg the price to. + +OPO orders are not supported for this symbol. + +Order amend (pending OPO order) is not supported. + +You cannot amend the pending quantity of an OPO order + +## Errors regarding placing orders via cancelReplace[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +### \-2021 Order cancel-replace partially failed[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- This code is sent when either the cancellation of the order failed or the new order placement failed but not both. + +### \-2022 Order cancel-replace failed.[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +- This code is sent when both the cancellation of the order failed and the new order placement failed. + +## Filter failures[​](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +Error message + +Description + +"Filter failure: PRICE\_FILTER" + +`price` is too high, too low, and/or not following the tick size rule for the symbol. + +"Filter failure: PERCENT\_PRICE" + +`price` is X% too high or X% too low from the average weighted price over the last Y minutes. + +"Filter failure: LOT\_SIZE" + +`quantity` is too high, too low, and/or not following the step size rule for the symbol. + +"Filter failure: MIN\_NOTIONAL" + +`price` \* `quantity` is too low to be a valid order for the symbol. + +"Filter failure: NOTIONAL" + +`price` \* `quantity` is not within range of the `minNotional` and `maxNotional` + +"Filter failure: ICEBERG\_PARTS" + +`ICEBERG` order would break into too many parts; icebergQty is too small. + +"Filter failure: MARKET\_LOT\_SIZE" + +`MARKET` order's `quantity` is too high, too low, and/or not following the step size rule for the symbol. + +"Filter failure: MAX\_POSITION" + +The account's position has reached the maximum defined limit. +This is composed of the sum of the balance of the base asset, and the sum of the quantity of all open `BUY` orders. + +"Filter failure: MAX\_NUM\_ORDERS" + +Account has too many open orders on the symbol. + +"Filter failure: MAX\_NUM\_ALGO\_ORDERS" + +Account has too many open stop loss and/or take profit orders on the symbol. + +"Filter failure: MAX\_NUM\_ICEBERG\_ORDERS" + +Account has too many open iceberg orders on the symbol. + +"Filter failure: MAX\_NUM\_ORDER\_AMENDS" + +Account has made too many amendments to a single order on the symbol. + +"Filter failure: MAX\_NUM\_ORDER\_LISTS" + +Account has too many open order lists on the symbol. + +"Filter failure: TRAILING\_DELTA" + +`trailingDelta` is not within the defined range of the filter for that order type. + +"Filter failure: EXCHANGE\_MAX\_NUM\_ORDERS" + +Account has too many open orders on the exchange. + +"Filter failure: EXCHANGE\_MAX\_NUM\_ALGO\_ORDERS" + +Account has too many open stop loss and/or take profit orders on the exchange. + +"Filter failure: EXCHANGE\_MAX\_NUM\_ICEBERG\_ORDERS" + +Account has too many open iceberg orders on the exchange. + +"Filter failure: EXCHANGE\_MAX\_NUM\_ORDER\_LISTS" + +Account has too many open order lists on the exchange. + +- [10xx - General Server or Network issues](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1000 UNKNOWN](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1001 DISCONNECTED](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1002 UNAUTHORIZED](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1003 TOO\_MANY\_REQUESTS](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1006 UNEXPECTED\_RESP](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1007 TIMEOUT](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1008 SERVER\_BUSY](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1013 INVALID\_MESSAGE](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1014 UNKNOWN\_ORDER\_COMPOSITION](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1015 TOO\_MANY\_ORDERS](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1016 SERVICE\_SHUTTING\_DOWN](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1020 UNSUPPORTED\_OPERATION](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1021 INVALID\_TIMESTAMP](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1022 INVALID\_SIGNATURE](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1033 COMP\_ID\_IN\_USE](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1034 TOO\_MANY\_CONNECTIONS](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1035 LOGGED\_OUT](https://developers.binance.com/docs/binance-spot-api-docs/errors) +- [11xx - Request issues](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1100 ILLEGAL\_CHARS](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1101 TOO\_MANY\_PARAMETERS](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1102 MANDATORY\_PARAM\_EMPTY\_OR\_MALFORMED](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1103 UNKNOWN\_PARAM](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1104 UNREAD\_PARAMETERS](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1105 PARAM\_EMPTY](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1106 PARAM\_NOT\_REQUIRED](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1108 PARAM\_OVERFLOW](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1111 BAD\_PRECISION](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1112 NO\_DEPTH](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1114 TIF\_NOT\_REQUIRED](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1115 INVALID\_TIF](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1116 INVALID\_ORDER\_TYPE](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1117 INVALID\_SIDE](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1118 EMPTY\_NEW\_CL\_ORD\_ID](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1119 EMPTY\_ORG\_CL\_ORD\_ID](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1120 BAD\_INTERVAL](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1121 BAD\_SYMBOL](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1122 INVALID\_SYMBOLSTATUS](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1125 INVALID\_LISTEN\_KEY](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1127 MORE\_THAN\_XX\_HOURS](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1128 OPTIONAL\_PARAMS\_BAD\_COMBO](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1130 INVALID\_PARAMETER](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1134 BAD\_STRATEGY\_TYPE](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1135 INVALID\_JSON](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1139 INVALID\_TICKER\_TYPE](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1145 INVALID\_CANCEL\_RESTRICTIONS](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1151 DUPLICATE\_SYMBOLS](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1152 INVALID\_SBE\_HEADER](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1153 UNSUPPORTED\_SCHEMA\_ID](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1155 SBE\_DISABLED](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1158 OCO\_ORDER\_TYPE\_REJECTED](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1160 OCO\_ICEBERGQTY\_TIMEINFORCE](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1161 DEPRECATED\_SCHEMA](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1165 BUY\_OCO\_LIMIT\_MUST\_BE\_BELOW](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1166 SELL\_OCO\_LIMIT\_MUST\_BE\_ABOVE](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1168 BOTH\_OCO\_ORDERS\_CANNOT\_BE\_LIMIT](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1169 INVALID\_TAG\_NUMBER](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1170 TAG\_NOT\_DEFINED\_IN\_MESSAGE](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1171 TAG\_APPEARS\_MORE\_THAN\_ONCE](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1172 TAG\_OUT\_OF\_ORDER](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1173 GROUP\_FIELDS\_OUT\_OF\_ORDER](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1174 INVALID\_COMPONENT](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1175 RESET\_SEQ\_NUM\_SUPPORT](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1176 ALREADY\_LOGGED\_IN](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1177 GARBLED\_MESSAGE](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1178 BAD\_SENDER\_COMPID](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1179 BAD\_SEQ\_NUM](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1180 EXPECTED\_LOGON](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1181 TOO\_MANY\_MESSAGES](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1182 PARAMS\_BAD\_COMBO](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1183 NOT\_ALLOWED\_IN\_DROP\_COPY\_SESSIONS](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1184 DROP\_COPY\_SESSION\_NOT\_ALLOWED](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1185 DROP\_COPY\_SESSION\_REQUIRED](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1186 NOT\_ALLOWED\_IN\_ORDER\_ENTRY\_SESSIONS](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1187 NOT\_ALLOWED\_IN\_MARKET\_DATA\_SESSIONS](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1188 INCORRECT\_NUM\_IN\_GROUP\_COUNT](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1189 DUPLICATE\_ENTRIES\_IN\_A\_GROUP](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1190 INVALID\_REQUEST\_ID](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1191 TOO\_MANY\_SUBSCRIPTIONS](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1194 INVALID\_TIME\_UNIT](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1196 BUY\_OCO\_STOP\_LOSS\_MUST\_BE\_ABOVE](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1197 SELL\_OCO\_STOP\_LOSS\_MUST\_BE\_BELOW](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1198 BUY\_OCO\_TAKE\_PROFIT\_MUST\_BE\_BELOW](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1199 SELL\_OCO\_TAKE\_PROFIT\_MUST\_BE\_ABOVE](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1210 INVALID\_PEG\_PRICE\_TYPE](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1211 INVALID\_PEG\_OFFSET\_TYPE](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1220 SYMBOL\_DOES\_NOT\_MATCH\_STATUS](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1221 INVALID\_SBE\_MESSAGE\_FIELD](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1222 OPO\_WORKING\_MUST\_BE\_BUY](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1223 OPO\_PENDING\_MUST\_BE\_SELL](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1224 WORKING\_PARAM\_REQUIRED](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-1225 PENDING\_PARAM\_NOT\_REQUIRED](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-2010 NEW\_ORDER\_REJECTED](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-2011 CANCEL\_REJECTED](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-2013 NO\_SUCH\_ORDER](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-2014 BAD\_API\_KEY\_FMT](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-2015 REJECTED\_MBX\_KEY](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-2016 NO\_TRADING\_WINDOW](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-2026 ORDER\_ARCHIVED](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-2035 SUBSCRIPTION\_ACTIVE](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-2036 SUBSCRIPTION\_INACTIVE](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-2039 CLIENT\_ORDER\_ID\_INVALID](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-2042 MAXIMUM\_SUBSCRIPTION\_IDS](https://developers.binance.com/docs/binance-spot-api-docs/errors) +- [Messages for -1010 ERROR\_MSG\_RECEIVED, -2010 NEW\_ORDER\_REJECTED, -2011 CANCEL\_REJECTED, and -2038 ORDER\_AMEND\_REJECTED](https://developers.binance.com/docs/binance-spot-api-docs/errors) +- [Errors regarding placing orders via cancelReplace](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-2021 Order cancel-replace partially failed](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - [\-2022 Order cancel-replace failed.](https://developers.binance.com/docs/binance-spot-api-docs/errors) +- [Filter failures](https://developers.binance.com/docs/binance-spot-api-docs/errors) diff --git a/docs/binance/binance-spot/faqs_api_key_types.md b/docs/binance/binance-spot/faqs_api_key_types.md new file mode 100644 index 0000000..a3fc395 --- /dev/null +++ b/docs/binance/binance-spot/faqs_api_key_types.md @@ -0,0 +1,87 @@ +--- +title: "API Key Types | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs/faqs/api_key_types" +fetched_at: "2026-02-26T10:38:07.187Z" +--- +# API Key Types + +Binance APIs require an API key to access authenticated endpoints for trading, account history, etc. + +We support several types of API keys: + +- Ed25519 (recommended) +- HMAC +- RSA + +This document provides an overview of supported API keys. + +**We recommend to use Ed25519 API keys** as it should provide the best performance and security out of all supported key types. + +Read [REST API](https://developers.binance.com/docs/binance-spot-api-docs/rest-api.md) or [WebSocket API](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/request-security) documentation to learn how to use different API keys. + +### Ed25519[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/api_key_types) + +Ed25519 keys use asymmetric cryptography. You share your public key with Binance and use the private key to sign API requests. Binance API uses the public key to verify your signature. + +Ed25519 keys provide security comparable to 3072-bit RSA keys, but with considerably smaller key, smaller signature size, and faster signature computation. + +**We recommend to use Ed25519 API keys.** + +Sample Ed25519 key: + +``` +-----BEGIN PUBLIC KEY-----MCowBQYDK2VwAyEAgmDRTtj2FA+wzJUIlAL9ly1eovjLBu7uXUFR+jFULmg=-----END PUBLIC KEY----- +``` + +Sample Ed25519 signature: + +``` +E7luAubOlcRxL10iQszvNCff+xJjwJrfajEHj1hOncmsgaSB4NE+A/BbQhCWwit/usNJ32/LeTwDYPoA7Qz4BA== +``` + +### HMAC[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/api_key_types) + +HMAC keys use symmetric cryptography. Binance generates and shares with you a secret key which you use to sign API requests. Binance API uses the same shared secret key to verify your signature. + +HMAC signatures are quick to compute and compact. +However, the shared secret must be shared between multiple parties which is less secure than asymmetric cryptography used by Ed25519 or RSA keys. + +**HMAC keys are deprecated.** We recommend to migrate to asymmetric API keys, such as Ed25519 or RSA. + +Sample HMAC key: + +``` +Fhs4lGae2qAi6VNjbJjebUAwXrIChb7mlf372UOICMwdKaNdNBGKtfdeUff2TTTT +``` + +Sample HMAC signature: + +``` +7f3fc79c57d7a70d2b644ad4589672f4a5d55a62af2a336a0af7d4896f8d48b8 +``` + +### RSA[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/api_key_types) + +RSA keys use asymmetric cryptography. +You share your public key with Binance and use the private key to sign API requests. +Binance API uses the public key to verify your signature. + +We support 2048 and 4096 bit RSA keys. + +While RSA keys are more secure than HMAC keys, RSA signatures are much larger than HMAC and Ed25519 which can lead to a degradation to performance. + +Sample RSA key (2048 bits): + +``` +-----BEGIN PUBLIC KEY-----MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyfKiFXpcOhF5rX1XxePNakwN7Etwtn3v05cZNY+ftDHbVZHs/kY6Ruj5lhxVFAq5dv7Ba9/4jPijXuMuIc6Y8nUlqtrrxC8DEOAczw9SKATDYZN9nbLfYlbBFfHzRQUXdAtYCPI6XtxmJBS7aOBb4nZe1SVm+bhLrp0YQnx2P0s+37qkGeVn09m6w9MnWxjgCkkYFPWQkXIu5qOnwx6pNfqDmFD7d7dUc/6PZQ1bKFALu/UETsobmBk82ShbrBhlc0JXuhf9qBR7QASjHjFQ2N+VF2PfH8dm5prZIpz/MFKPkBW4Yuss0OXiD+jQt1J2JUKspLqsIqoXjHQQGjL73wIDAQAB-----END PUBLIC KEY----- +``` + +Sample RSA signature (2048 bits): + +``` +wS6q6h77AvH1TqwInoTDdWIIubRCiUP4RLG++GI24twL3BMtX0EEV+YT1eH8Hb8bLe0Rb9OhOHbt1CC3aurzoCTgZvhNek47mg+Bpu8fwQ7eRkXEiWBx5C8BNN73JwnnkZw4UzYvqiwAs162jToV8AL0eN043KJ3MEKCy3C6nyeYOFSg+1Cp637KtAZk3z7aHknSu7/PXSPuwMIpBgFctf8YKGZFAVRbgwlcgUDhXyaGts6OFePGy0jkZKJHawb/w5hoatatsfVmVC4hZ8fsfystQ9k5DNjTm7ROApWaXy9BsfAYcj13O424mqlpkKG4EGnIjOIWB/pRDDQEm2O/xg== +``` + +- [Ed25519](https://developers.binance.com/docs/binance-spot-api-docs/faqs/api_key_types) +- [HMAC](https://developers.binance.com/docs/binance-spot-api-docs/faqs/api_key_types) +- [RSA](https://developers.binance.com/docs/binance-spot-api-docs/faqs/api_key_types) diff --git a/docs/binance/binance-spot/faqs_commission_faq.md b/docs/binance/binance-spot/faqs_commission_faq.md new file mode 100644 index 0000000..bbfb50b --- /dev/null +++ b/docs/binance/binance-spot/faqs_commission_faq.md @@ -0,0 +1,137 @@ +--- +title: "Commission FAQ | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs/faqs/commission_faq" +fetched_at: "2026-02-26T10:38:07.334Z" +--- +# Commission Rates + +**Disclaimer:** + +- The commissions and prices used here are fictional, and do not imply anything about the actual setup on the live exchange. +- This applies only for the SPOT Exchange. + +### What are Commission Rates?[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/commission_faq) + +These are the rates that determine the commission to be paid on trades when your order fills for any amount. + +### What are the different types of rates?[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/commission_faq) + +There are 3 types: + +- `standardCommission` - Standard commission rates on trades from the order. +- `taxCommission` - Tax commission rates on trades from the order. +- `specialCommission` - Extra commission that will be added in specific circumstances. + +Standard commission rate may be reduced, depending on promotions for specific trading pairs, applicable discounts, etc. + +### How do I know what the commission rates are?[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/commission_faq) + +You can find them using the following requests: + +REST API: `GET /api/v3/account/commission` + +WebSocket API: `account.commission` + +You can also find out the commission rates to a trade from an order using the test order requests with `computeCommissionRates`. + +### What is the difference between the response sending a test order with `computeCommissionRates` vs the response from querying commission rates?[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/commission_faq) + +A test order with `computeCommissionRates` returns detailed commission rates for that specific order: + +``` +{ "standardCommissionForOrder": { "maker": "0.00000050", "taker": "0.00000060" }, "specialCommissionForOrder": { "maker": "0.05000000", "taker": "0.06000000" }, "taxCommissionForOrder": { "maker": "0.00000228", "taker": "0.00000230" }, "discount": { "enabledForAccount": true, "enabledForSymbol": true, "discountAsset": "BNB", "discount": "0.25000000" }} +``` + +Note: It does not show buyer/seller commissions separately, as these are already taken into account based on the order side. + +In contrast, querying commission rates returns your current commission rates for the symbol on your account. + +``` +{ "symbol": "BTCUSDT", "standardCommission": { "maker": "0.00000040", "taker": "0.00000050", "buyer": "0.00000010", "seller": "0.00000010" }, "specialCommission": { "maker": "0.04000000", "taker": "0.05000000", "buyer": "0.01000000", "seller": "0.01000000" }, "taxCommission": { "maker": "0.00000128", "taker": "0.00000130", "buyer": "0.00000100", "seller": "0.00000100" }, "discount": { "enabledForAccount": true, "enabledForSymbol": true, "discountAsset": "BNB", "discount": "0.25000000" }} +``` + +### How is the commission calculated?[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/commission_faq) + +Using an example commission configuration: + +``` +{ "symbol": "BTCUSDT", "standardCommission": { "maker": "0.00000010", "taker": "0.00000020", "buyer": "0.00000030", "seller": "0.00000040" }, "specialCommission": { "maker": "0.01000000", "taker": "0.02000000", "buyer": "0.03000000", "seller": "0.04000000" }, "taxCommission": { "maker": "0.00000112", "taker": "0.00000114", "buyer": "0.00000118", "seller": "0.00000116" }, "discount": { "enabledForAccount": true, "enabledForSymbol": true, "discountAsset": "BNB", "discount": "0.25000000" }} +``` + +If you placed an order with the following parameters which took immediately and fully filled in a single trade: + +Parameter + +Value + +symbol + +BTCUSDT + +price + +35,000 + +quantity + +0.49975 + +side + +SELL + +type + +MARKET + +Since you sold BTC for USDT, the commission will be paid either in USDT or BNB. + +When standard commission is calculated, the received amount is multiplied with the sum of the rates. + +Since this order is on the `SELL` side, the received amount is the notional value. (For orders on the `BUY` side, the received amount would be `quantity`.) The order type was `MARKET`, making this the taker order for the trade. + +``` +Standard Commission = Notional value * (taker + seller) = (35000 * 0.49975) * (0.00000020 + 0.00000040) = 17491.25000000 * 0.00000060 = 0.01049475 USDT +``` + +Tax commission (if applicable) is calculated similarly: + +``` +Tax commission = Notional value * (taker + seller) = (35000 * 0.49975) * (0.00000114 + 0.00000116) = 17491.25000000 * 0.00000230 = 0.04022988 USDT +``` + +Special commission (if applicable) is calculated as: + +``` +Special commission = Notional value * (taker + seller) = (35000 * 0.49975) * (0.02000000 + 0.04000000) = 17491.25000000 * 0.06000030 = 1049.47500000 USDT +``` + +If not paying in BNB, the total commission are summed up and deducted from your received amount of `USDT`. + +Since `enabledforAccount` and `enabledForSymbol` under `discount` is set to `true`, this means the commission will be paid in BNB assuming you have a sufficient balance. + +If paying with BNB, then the standard commission will be reduced based on the `discount`. + +First the standard commission and tax commission will be converted into BNB based on the exchange rate. For this example, assume that 1 BNB = 260 USDT. + +``` +Standard commission (Discounted and in BNB) = (Standard commission * BNB exchange rate) * discount = (0.01049475 * 1/260) * 0.25 = 0.000040364 * 0.25 = 0.000010091 +``` + +Note that the discount **does not apply to tax commissions or special commissions**. + +``` +Tax Commission (in BNB) = Tax commission * BNB exchange rate = 0.04022988 * (1/260) = 0.00015473Special Commission (in BNB) = Special commission * BNB exchange rate = 1049.47500000 * (1/260) = 4.036442308 +``` + +``` +Total Commission (in BNB) = Standard commission (Discounted) + Tax commission (in BNB) + Special commission (in BNB) = 0.000010091 + 0.00015473 + 4.036442308 = 4.036607129 +``` + +If you do not have enough BNB to pay the discounted commission, the full commission will be taken out of your received amount of USDT instead. + +- [What are Commission Rates?](https://developers.binance.com/docs/binance-spot-api-docs/faqs/commission_faq) +- [What are the different types of rates?](https://developers.binance.com/docs/binance-spot-api-docs/faqs/commission_faq) +- [How do I know what the commission rates are?](https://developers.binance.com/docs/binance-spot-api-docs/faqs/commission_faq) +- [What is the difference between the response sending a test order with `computeCommissionRates` vs the response from querying commission rates?](https://developers.binance.com/docs/binance-spot-api-docs/faqs/commission_faq) +- [How is the commission calculated?](https://developers.binance.com/docs/binance-spot-api-docs/faqs/commission_faq) diff --git a/docs/binance/binance-spot/faqs_market_data_only.md b/docs/binance/binance-spot/faqs_market_data_only.md new file mode 100644 index 0000000..978dedb --- /dev/null +++ b/docs/binance/binance-spot/faqs_market_data_only.md @@ -0,0 +1,47 @@ +--- +title: "Market Data Only | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs/faqs/market_data_only" +fetched_at: "2026-02-26T10:38:07.444Z" +--- +# Market Data Only URLs + +These URLs do not require any authentication (i.e. The API key is not necessary) and serve only public market data. + +### RESTful API[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/market_data_only) + +On the RESTful API, these are the endpoints you can request on `data-api.binance.vision`: + +- [GET /api/v3/aggTrades](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints) +- [GET /api/v3/avgPrice](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints) +- [GET /api/v3/depth](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints) +- [GET /api/v3/exchangeInfo](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-endpoints) +- [GET /api/v3/klines](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints) +- [GET /api/v3/ping](https://developers.binance.com/docs/binance-spot-api-docs/rest-api.md) +- [GET /api/v3/ticker](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints) +- [GET /api/v3/ticker/24hr](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints) +- [GET /api/v3/ticker/bookTicker](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints) +- [GET /api/v3/ticker/price](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints) +- [GET /api/v3/time](https://developers.binance.com/docs/binance-spot-api-docs/rest-api.md) +- [GET /api/v3/trades](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints) +- [GET /api/v3/uiKlines](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints) + +Sample request: + +``` +curl -sX GET "https://data-api.binance.vision/api/v3/exchangeInfo?symbol=BTCUSDT" +``` + +### Websocket Streams[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/market_data_only) + +Public market data can also be retrieved through the websocket market data using the URL `data-stream.binance.vision`. The streams available through this domain are the same that can be found in the [Websocket Market Streams](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) documentation. + +Note that User Data Streams **cannot** be accessed through this URL. + +Sample request: + +``` +wss://data-stream.binance.vision:443/ws/btcusdt@kline_1m +``` + +- [RESTful API](https://developers.binance.com/docs/binance-spot-api-docs/faqs/market_data_only) +- [Websocket Streams](https://developers.binance.com/docs/binance-spot-api-docs/faqs/market_data_only) diff --git a/docs/binance/binance-spot/faqs_opo.md b/docs/binance/binance-spot/faqs_opo.md new file mode 100644 index 0000000..bdfabca --- /dev/null +++ b/docs/binance/binance-spot/faqs_opo.md @@ -0,0 +1,64 @@ +--- +title: "OPO | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs/faqs/opo" +fetched_at: "2026-02-26T10:38:07.501Z" +--- +# One Pays the Other (OPO) + +## What is One Pays the Other?[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/opo) + +This is a special behavior of OTO and OTOCO where the received amount from the working order is used for the quantity of the pending order(s). Thus the only balance requirement on order placement is that of the working order. + +The received funds from the working order are _locked_ for use by the pending order(s) and not available for trading or withdrawal. If the order list is canceled before the pending order is placed on the Matching Engine then these locked funds are unlocked. + +OPO is almost identical to `OTO`, with the exception of the absence of the `quantity` of the pending order(s). + +## How can I use this?[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/opo) + +Please refer to the following table: + +API + +Request + +REST API + +`POST /api/v3/orderList/opo` +`POST /api/v3/orderList/opoco` + +WebSocket API + +`orderList.place.opo` +`orderList.place.opoco` + +FIX API + +NewOrderList `` where OPO `(25046)`\=`true` + +## What is the difference with this order list from other order lists?[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/opo) + +- The pending order(s) are placed into the Matching Engine without quantity; the quantity will be based on the received quantity from the working order once it fully fills. +- The received quantity will have commission deducted as appropriate. The commission is taken from the available funds instead (i.e. `free` balances) if the received asset is not BNB and there are enough available funds. +- The quantity of the pending order(s) are evaluated (e.g. filters) after the working order fully fills. +- If a symbol has `LOT_SIZE` and/or `MARKET_LOT_SIZE` filters configured, the quantity of the pending order(s) are adjusted to meet them. Any of the locked quantity not used in the pending order(s) will be unlocked and returned to the `free` balances. +- A pending OPO order's quantity may not be amended until the working order has been fully filled. +- Only working orders on the `BUY` side and pending order(s) on the `SELL` side are accepted. + +## Which symbols allow OPO orders?[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/opo) + +Order + +Reqired in Exchange Information + +OPO + +`otoAllowed` and `opoAllowed` + +OPOCO + +`otoAllowed`, `opoAllowed`, and `ocoAllowed` + +- [What is One Pays the Other?](https://developers.binance.com/docs/binance-spot-api-docs/faqs/opo) +- [How can I use this?](https://developers.binance.com/docs/binance-spot-api-docs/faqs/opo) +- [What is the difference with this order list from other order lists?](https://developers.binance.com/docs/binance-spot-api-docs/faqs/opo) +- [Which symbols allow OPO orders?](https://developers.binance.com/docs/binance-spot-api-docs/faqs/opo) diff --git a/docs/binance/binance-spot/faqs_order_amend_keep_priority.md b/docs/binance/binance-spot/faqs_order_amend_keep_priority.md new file mode 100644 index 0000000..3e1be48 --- /dev/null +++ b/docs/binance/binance-spot/faqs_order_amend_keep_priority.md @@ -0,0 +1,286 @@ +--- +title: "Order Amend Keep Priority | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs/faqs/order_amend_keep_priority" +fetched_at: "2026-02-26T10:38:07.700Z" +--- +# Order Amend Keep Priority + +**Disclaimer**: + +- The symbols and values used here are fictional and do not imply anything about the actual setup on the live exchange. +- For simplicity, the examples in this document do not include commission. + +## What is Order Amend Keep Priority?[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/order_amend_keep_priority) + +Order Amend Keep Priority request is used to modify (amend) an existing order **without losing order book priority**. + +The following order modifications are allowed: + +- reduce the quantity of the order + +## How can I amend the quantity of my order?[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/order_amend_keep_priority) + +Use the following requests: + +API + +Request + +REST API + +`PUT /api/v3/order/amend/keepPriority` + +WebSocket API + +`order.amend.keepPriority` + +FIX API + +OrderAmendKeepPriorityRequest `` + +## What is the difference between "Cancel an Existing Order and Send a New Order" (cancel-replace) and "Order Amend Keep Priority"?[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/order_amend_keep_priority) + +**Cancel an Existing Order and Send a New Order** request cancels the old order and places a new order. +Time priority is lost. The new order executes after existing orders at the same price. + +**Order Amend Keep Priority** request modifies an existing order in-place. +The amended order keeps its time priority among existing orders at the same price. + +For example, consider the following order book: + +User + +Order ID + +Side + +Order price + +quantity + +User A + +10 + +BUY + +87,000 + +1.00 + +⭐️ YOU + +15 + +BUY + +87,000 + +5.50 + +User B + +20 + +BUY + +87,000 + +4.00 + +User C + +21 + +BUY + +86,999 + +2.00 + +Your order 15 is the second one in the queue based on price and time. + +You want to reduce the quantity from 5.50 down to 5.00. + +If you use **cancel-replace** to cancel `orderId=15` and place a new order with `qty=5.00`, the order book will look like this: + +User + +Order ID + +Side + +Order price + +quantity + +User A + +10 + +BUY + +87,000 + +1.00 + +⭐️ YOU + +11 + +BUY + +87,000 + +5.50 + +User B + +20 + +BUY + +87,000 + +4.00 + +⭐️ YOU + +(new) 22 + +BUY + +87,000 + +5.00 + +User C + +21 + +BUY + +86,999 + +2.00 + +Note that the new order gets a new order ID and you lose time priority: order 22 will trade after the order 20. + +If instead you use **Order Amend Keep Priority** to reduce the quantity of `orderId=15` down to `qty=5.00`, the order book will look like this: + +User + +Order ID + +Side + +Order price + +quantity + +User A + +10 + +BUY + +87,000 + +1.00 + +⭐️ YOU + +15 + +BUY + +87,000 + +(amended) **5.00** + +User B + +20 + +BUY + +87,000 + +4.00 + +User C + +21 + +BUY + +86,999 + +2.00 + +Note that the order ID stays the same and the order keeps its priority in the queue. Only the quantity of the order changes. + +## Does Order Amend Keep Priority affect unfilled order count (rate limits)?[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/order_amend_keep_priority) + +Currently, Order Amend Keep Priority requests charge 0 for unfilled order count. + +## How do I know if my order has been amended?[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/order_amend_keep_priority) + +If the order was amended successfully, the API response contains your order with the updated quantity. + +On User Data Stream, you will receive an `"executionReport"` event with execution type `"x": "REPLACED"`. + +If the amended order belongs to an order list and the client order ID has changed, you will also receive a "listStatus" event with list status type `"l": "UPDATED"`. + +You can also use the following requests to query order modification history: + +API + +Request + +REST API + +`GET /api/v3/order/amendments` + +WebSocket API + +`order.amendments` + +## What happens if my amend request does not succeed?[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/order_amend_keep_priority) + +If the request fails for any reason (e.g. fails the filters, permissions, account restrictions, etc), then the order amend request is rejected and the order remains unchanged. + +## Is it possible to reuse the current clientOrderId for my amended order?[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/order_amend_keep_priority) + +Yes. + +By default, amended orders get a random new client order ID, but you can pass the current client order ID in the `newClientOrderId` parameter if you wish to keep it. + +## Can Iceberg Orders be amended?[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/order_amend_keep_priority) + +Yes. + +Note that an iceberg order's visible quantity will only change if `newQty` is below the pre-amended visible quantity. + +## Can Order lists be amended?[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/order_amend_keep_priority) + +Orders in an order list can be amended. + +Note that OCO order pairs must have the same quantity, since only one of the orders can ever be executed. This means that amending either order affects both orders. + +For OTO orders, the working and pending orders can be amended individually. + +## Which symbols allow Order Amend Keep Priority?[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/order_amend_keep_priority) + +This information is available in Exchange Information. Symbols that allow Order Amend Keep Priority requests have `amendAllowed` set to `true`. + +- [What is Order Amend Keep Priority?](https://developers.binance.com/docs/binance-spot-api-docs/faqs/order_amend_keep_priority) +- [How can I amend the quantity of my order?](https://developers.binance.com/docs/binance-spot-api-docs/faqs/order_amend_keep_priority) +- [What is the difference between "Cancel an Existing Order and Send a New Order" (cancel-replace) and "Order Amend Keep Priority"?](https://developers.binance.com/docs/binance-spot-api-docs/faqs/order_amend_keep_priority) +- [Does Order Amend Keep Priority affect unfilled order count (rate limits)?](https://developers.binance.com/docs/binance-spot-api-docs/faqs/order_amend_keep_priority) +- [How do I know if my order has been amended?](https://developers.binance.com/docs/binance-spot-api-docs/faqs/order_amend_keep_priority) +- [What happens if my amend request does not succeed?](https://developers.binance.com/docs/binance-spot-api-docs/faqs/order_amend_keep_priority) +- [Is it possible to reuse the current clientOrderId for my amended order?](https://developers.binance.com/docs/binance-spot-api-docs/faqs/order_amend_keep_priority) +- [Can Iceberg Orders be amended?](https://developers.binance.com/docs/binance-spot-api-docs/faqs/order_amend_keep_priority) +- [Can Order lists be amended?](https://developers.binance.com/docs/binance-spot-api-docs/faqs/order_amend_keep_priority) +- [Which symbols allow Order Amend Keep Priority?](https://developers.binance.com/docs/binance-spot-api-docs/faqs/order_amend_keep_priority) diff --git a/docs/binance/binance-spot/faqs_order_count_decrement.md b/docs/binance/binance-spot/faqs_order_count_decrement.md new file mode 100644 index 0000000..69bd562 --- /dev/null +++ b/docs/binance/binance-spot/faqs_order_count_decrement.md @@ -0,0 +1,391 @@ +--- +title: "Order Count Decrement | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs/faqs/order_count_decrement" +fetched_at: "2026-02-26T10:38:07.751Z" +--- +# Spot Unfilled Order Count Rules + +To ensure a fair and orderly Spot market, we limit the rate at which new orders may be placed. + +The rate limit applies to the number of new, _unfilled_ orders placed within a time interval. That is, orders which are partially or fully filled do not count against the rate limit. + +> \[!NOTE\] Unfilled order rate limit rewards efficient traders. +> +> **So long as your orders trade, you can keep trading.** +> +> More information: [How do filled orders affect the rate limit?](https://developers.binance.com/docs/binance-spot-api-docs/faqs/order_count_decrement) + +### What are the current rate limits?[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/order_count_decrement) + +You can query current rate limits using the "exchange information" request. + +The `"rateLimitType": "ORDERS"` indicates the current unfilled order rate limit. + +Please refer to the API documentation: + +API + +Request + +FIX API + +[LimitQuery``](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +REST API + +[`GET /api/v3/exchangeInfo`](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-endpoints) + +WebSocket API + +[`exchangeInfo`](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/general-requests) + +> \[!IMPORTANT\] Order placement requests are also affected by the general request rate limits on REST and WebSocket API and the message limits on FIX API. +> +> If you send too many requests at a high rate, you will be blocked by the API. + +### How does the unfilled `ORDERS` rate limit work?[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/order_count_decrement) + +Every successful request to place an order adds to the unfilled order count for the current time interval. If too many unfilled orders accumulate during the interval, subsequent requests will be rejected. + +For example, if the unfilled order rate limit is 100 per 10 seconds: + +``` +{ "rateLimitType": "ORDERS", "interval": "SECOND", "intervalNum": 10, "limit": 100} +``` + +then you can place at most 100 new orders between 12:34:00 and 12:34:10, then 100 more from 12:34:10 to 12:34:20, and so on. + +> \[!TIP\] If the newly placed orders receive fills, your unfilled order count decreases and you may place more orders during the time interval. +> +> More information: [How do filled orders affect the rate limit?](https://developers.binance.com/docs/binance-spot-api-docs/faqs/order_count_decrement) + +When an order is rejected by the system due to the unfilled order rate limit, the HTTP status code is set to `429 Too Many Requests` and the error code is `-1015 "Too many new orders"`. + +If you encounter these errors, please stop sending orders until the affected rate limit interval expires. + +Please refer to the API documentation: + +API + +Documentation + +FIX API + +[Unfilled Order Count](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +REST API + +[Unfilled Order Count](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/limits) + +WebSocket API + +[Unfilled Order Count](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/rate-limits) + +### Is the unfilled order count tracked by IP address?[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/order_count_decrement) + +Unfilled order count is tracked **by (sub)account**. + +Unfilled order count is shared across all IP addresses, all API keys, and all APIs. + +### How do filled orders affect the unfilled order count?[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/order_count_decrement) + +When an order is filled for the first time (partially or fully), your unfilled order count is decremented by one order for all intervals of the `ORDERS` rate limit. Effectively, orders that trade do not count towards the rate limit, allowing efficient traders to keep placing new orders. + +Certain orders provide additional incentive: + +- **Orders that do not fill immediately (that is, first fill in the maker phase).** +- Orders that fill large quantities. + +In these cases the unfilled order count may be decremented by more than one order for each order that starts trading. + +**Notes:** + +- **The examples only give a general idea of the behavior.** The 10-second interval is used for simplicity. The actual configuration on the live exchange may be different. +- There is a short delay between the order being filled and the unfilled order count update. Please be careful when your unfilled order count is close to the limit. +- Please refer to [How does unfilled `ORDERS` rate limit work?](https://developers.binance.com/docs/binance-spot-api-docs/faqs/order_count_decrement) to see how you can monitor the unfilled order count depending on the API. + +**Example 1** — taker: + +Time + +Action + +Unfilled order count + +00:00:00 + +0 + +00:00:01 + +Place LIMIT order A + +1 — new order (+1) + +00:00:02 + +Place LIMIT order B + +2 — new order (+1) + +(order B partially filled) + +1 — first fill as taker (−1) + +00:00:03 + +Place LIMIT order C + +2 — new order (+1) + +00:00:04 + +(order B partially filled) + +2 + +00:00:04 + +(order B filled) + +2 + +00:00:05 + +Place MARKET order D + +3 — new order (+1) + +(order D fully filled) + +2 — first fill as taker (−1) + +Note how for every taker order that immediately trades, the unfilled order count is decremented later, allowing you to keep placing orders. + +**Example 2** — maker: + +Time + +Action + +Unfilled order count + +00:00:00 + +0 + +00:00:01 + +Place LIMIT order A + +1 — new order (+1) + +00:00:01 + +Place LIMIT order B + +2 — new order (+1) + +00:00:02 + +Place LIMIT order C + +3 — new order (+1) + +00:00:02 + +Place LIMIT order D + +4 — new order (+1) + +00:00:02 + +Place LIMIT order E + +5 — new order (+1) + +00:00:03 + +(order A partially filled) + +0 — first fill as maker (−5) + +00:00:04 + +Place LIMIT order F + +1 — new order (+1) + +00:00:04 + +Place LIMIT order G + +2 — new order (+1) + +00:00:05 + +(order A partially filled) + +2 + +00:00:05 + +(order A filled) + +2 + +00:00:05 + +(order B partially filled) + +0 — first fill as maker (−5) + +00:00:06 + +Place LIMIT order H + +1 — new order (+1) + +Note how for every maker order that is filled later, the unfilled order count is decremented by a higher amount, allowing you to place more orders. + +### How do canceled or expired orders affect the unfilled order count?[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/order_count_decrement) + +Canceling an order does not change the unfilled order count. + +Expired orders also do not change the unfilled order count. + +**Example:** + +Time + +Action + +Unfilled order count + +00:00:00 + +0 + +00:00:01 + +Place LIMIT order A + +1 — new order (+1) + +00:00:02 + +Cancel order A + +1 + +00:00:02 + +Place LIMIT order B + +2 — new order (+1) + +00:00:03 + +Place LIMIT FOK order C + +3 — new order (+1) + +(order C is fully filled) + +2 — fill (−1) + +00:00:05 + +Place LIMIT order D + +3 — new order (+1) + +00:00:06 + +Place LIMIT FOK order E + +4 — new order (+1) + +(order E expires with no fill) + +4 + +00:00:07 + +Cancel order D + +4 + +00:00:07 + +Place LIMIT order F + +5 — new order (+1) + +### Which time zone does `"interval":"DAY"` use?[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/order_count_decrement) + +UTC + +### What happens if I placed an order yesterday but it is filled the next day?[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/order_count_decrement) + +New order fills decrease your _current_ unfilled order count regardless of when the orders were placed. + +**Example:** + +Time + +Action + +Unfilled order count + +2024-01-01 09:00 + +Place 5 orders: 1..5 + +5 + +2024-01-02 00:00 + +(rate limit interval reset) + +0 + +2024-01-02 09:00 + +Place 10 orders: 6..15 + +10 + +2024-01-02 12:00 + +(orders 1..5 are filled) + +5 + +2024-01-02 13:00 + +(orders 6..10 are filled) + +0 + +2024-01-02 14:00 + +Place 2 orders: 16, 17 + +2 + +2024-01-02 15:00 + +(orders 11..15 are filled) + +0 + +**Note:** You do not get credit for order fills. That is, once the unfilled order count is down to zero, additional fills will not decrease it further. New orders will increase the count as usual. + +- [What are the current rate limits?](https://developers.binance.com/docs/binance-spot-api-docs/faqs/order_count_decrement) +- [How does the unfilled `ORDERS` rate limit work?](https://developers.binance.com/docs/binance-spot-api-docs/faqs/order_count_decrement) +- [Is the unfilled order count tracked by IP address?](https://developers.binance.com/docs/binance-spot-api-docs/faqs/order_count_decrement) +- [How do filled orders affect the unfilled order count?](https://developers.binance.com/docs/binance-spot-api-docs/faqs/order_count_decrement) +- [How do canceled or expired orders affect the unfilled order count?](https://developers.binance.com/docs/binance-spot-api-docs/faqs/order_count_decrement) +- [Which time zone does `"interval":"DAY"` use?](https://developers.binance.com/docs/binance-spot-api-docs/faqs/order_count_decrement) +- [What happens if I placed an order yesterday but it is filled the next day?](https://developers.binance.com/docs/binance-spot-api-docs/faqs/order_count_decrement) diff --git a/docs/binance/binance-spot/faqs_pegged_orders.md b/docs/binance/binance-spot/faqs_pegged_orders.md new file mode 100644 index 0000000..d932687 --- /dev/null +++ b/docs/binance/binance-spot/faqs_pegged_orders.md @@ -0,0 +1,150 @@ +--- +title: "Pegged Orders | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs/faqs/pegged_orders" +fetched_at: "2026-02-26T10:38:07.900Z" +--- +# Pegged orders + +**Disclaimer**: + +- This explanation only applies to the SPOT Exchange. +- The symbols and values used here are fictional and do not imply anything about the actual setup on the live exchange. +- For simplicity, the examples in this document do not include commission. + +## What are pegged orders?[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/pegged_orders) + +Pegged orders are essentially **limit orders** with the price derived from the order book. + +For example, instead of using a specific price (e.g. SELL 1 BTC for at least 100,000 USDC) you can send orders like “SELL 1 BTC at the best asking price” to queue your order after the orders on the book at the highest price, or “BUY 1 BTC for 100,000 USDT or best offer, IOC” to cherry-pick the sellers at the lowest price, and only that price. + +Pegged orders offer a way for market makers to match the best price with minimal latency, while retail users can get quick fills at the best price with minimal slippage. + +Pegged orders are also known as “best bid-offer” or BBO orders. + +## How can I send a pegged order?[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/pegged_orders) + +Please refer to the following table: + +API + +Request + +Parameters + +REST API + +`POST /api/v3/order` + +`pegPriceType`: + +- `PRIMARY` — best price on the same side of the order book +- `MARKET` — best price on the opposite side of the order book + +`pegOffsetType` and `pegOffsetValue PRICE_LEVEL` — offset by existing price levels, deeper into the order book + +For order lists: (Please see the API documentation for more details.) + +- OCO are using `above*` and `below*` prefixes. +- OTO are using `working*` and `pending*` prefixes. +- OTOCO are using `working*`, `pendingAbove*`, and `pendingBelow*` prefixes. + +`POST /api/v3/orderList/*` + +`POST /api/v3/cancelReplace` + +WebSocket API + +`order.place` + +`orderList.place.*` + +`order.cancelReplace` + +FIX API + +NewOrderSingle `` + +`OrdType=PEGGED`, `` component block, `PeggedPrice` field. + +NewOrderList `` + +OrderCancelRequestAndNewOrderSingle `` + +Currently, [Smart Order Routing (SOR)](https://developers.binance.com/docs/binance-spot-api-docs/faqs/sor_faq) does not support pegged orders. + +This sample REST API response shows that for pegged orders, `peggedPrice` reflects the selected price, while `price` is the original order price (zero if not set). + +``` +{ "symbol": "BTCUSDT", "orderId": 18, "orderListId": -1, "clientOrderId": "q1fKs4Y7wgE61WSFMYRFKo", "transactTime": 1750313780050, "price": "0.00000000", "pegPriceType": "PRIMARY_PEG", "peggedPrice": "0.04000000", "origQty": "1.00000000", "executedQty": "0.00000000", "origQuoteOrderQty": "0.00000000", "cummulativeQuoteQty": "0.00000000", "status": "NEW", "timeInForce": "GTC", "type": "LIMIT", "side": "BUY", "workingTime": 1750313780050, "fills": [], "selfTradePreventionMode": "NONE"} +``` + +## What order types support pegged orders?[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/pegged_orders) + +All order types, with the exception of `MARKET` orders, are supported by this feature. + +Since both `STOP_LOSS` and `TAKE_PROFIT` orders place a `MARKET` order once the stop condition is met, these order types cannot be pegged. + +### Limit orders[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/pegged_orders) + +Pegged limit orders immediately enter the market at the current best price: + +- `LIMIT` + - With `pegPriceType=PRIMARY_PEG` only `timeInForce=GTC` is allowed. +- `LIMIT_MAKER` + - Only `pegPriceType=PRIMARY_PEG` is allowed. + +### Stop-limit orders[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/pegged_orders) + +Pegged stop-limit orders enter the market at the best price when price movement triggers the stop order (via stop price or trailing stop): + +- `STOP_LOSS_LIMIT` +- `TAKE_PROFIT_LIMIT` + +That is, stop orders use the best price at the time when they are triggered, which is different from the price when the stop order is placed. Only the limit price can be pegged, not the stop price. + +### OCO[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/pegged_orders) + +OCO order lists may use peg instructions. + +- Any order in OCO can be pegged: both above and below orders, or only one of them. +- Pegged orders enter at the best price when they are placed on the book: + - `LIMIT_MAKER` order enters immediately at the current best price + - `STOP_LOSS_LIMIT` and `TAKE_PROFIT_LIMIT` enter at the best price when they are triggered +- `STOP_LOSS` and `TAKE_PROFIT` orders cannot be pegged. + +### OTO and OTOCO[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/pegged_orders) + +OTO order lists may use peg instructions as well. + +- Any order in OTO can be pegged: both working and pending orders, or only one of them. +- Pegged working order enters immediately at the current best price. +- Pegged pending limit order enters at the best price after the working order has been filled. +- Pegged pending stop-limit order enters at the best price when it is triggered. + +OTOCO order lists may contain pegged orders as well, similar to OTO and OCO. + +## Which symbols allow pegged orders?[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/pegged_orders) + +Please refer to Exchange Information requests and look for the field `pegInstructionsAllowed`. If set to true, pegged orders can be used with the symbol. + +## Which Filters are applicable to pegged orders?[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/pegged_orders) + +Pegged orders are required to pass all applicable filters with the selected price: + +- `PRICE_FILTER` +- `PERCENT_PRICE` and `PERCENT_PRICE_BY_SIDE` +- `NOTIONAL` and `MIN_NOTIONAL` (considering the `quantity`) + +If a pegged order specifies `price`, it must pass validation at both `price` and `peggedPrice`. + +Contingent pegged orders as well as pegged pending orders of OTO order lists are (re)validated at the trigger time and may be rejected later. + +- [What are pegged orders?](https://developers.binance.com/docs/binance-spot-api-docs/faqs/pegged_orders) +- [How can I send a pegged order?](https://developers.binance.com/docs/binance-spot-api-docs/faqs/pegged_orders) +- [What order types support pegged orders?](https://developers.binance.com/docs/binance-spot-api-docs/faqs/pegged_orders) + - [Limit orders](https://developers.binance.com/docs/binance-spot-api-docs/faqs/pegged_orders) + - [Stop-limit orders](https://developers.binance.com/docs/binance-spot-api-docs/faqs/pegged_orders) + - [OCO](https://developers.binance.com/docs/binance-spot-api-docs/faqs/pegged_orders) + - [OTO and OTOCO](https://developers.binance.com/docs/binance-spot-api-docs/faqs/pegged_orders) +- [Which symbols allow pegged orders?](https://developers.binance.com/docs/binance-spot-api-docs/faqs/pegged_orders) +- [Which Filters are applicable to pegged orders?](https://developers.binance.com/docs/binance-spot-api-docs/faqs/pegged_orders) diff --git a/docs/binance/binance-spot/faqs_sbe_faq.md b/docs/binance/binance-spot/faqs_sbe_faq.md new file mode 100644 index 0000000..cd9272a --- /dev/null +++ b/docs/binance/binance-spot/faqs_sbe_faq.md @@ -0,0 +1,158 @@ +--- +title: "SBE FAQ | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs/faqs/sbe_faq" +fetched_at: "2026-02-26T10:38:07.910Z" +--- +# Simple Binary Encoding (SBE) FAQ + +The goal of this document is to explain: + +- How to receive SBE responses in the SPOT API. +- How to decode SBE responses. + +SBE is a serialization format used for low-latency. + +This implementation is based on the FIX SBE specification. + +- [GitHub repository](https://github.com/FIXTradingCommunity/fix-simple-binary-encoding) +- [HTML document](https://www.fixtrading.org/standards/sbe-online) + +### How to get an SBE response[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/sbe_faq) + +#### REST API[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/sbe_faq) + +- The `Accept` header must include `application/sbe`. +- Provide the schema ID and version in the `X-MBX-SBE` header as `:`. + +Sample request (REST): + +``` +curl -sX GET -H "Accept: application/sbe" -H "X-MBX-SBE: 1:0" 'https://api.binance.com/api/v3/exchangeInfo?symbol=BTCUSDT' +``` + +**Notes:** + +- If you provide only `application/sbe` in the Accept header: + - If SBE is not enabled in the exchange, you will receive an HTTP **406 Not Acceptable**. + - If the `:` provided in the `X-MBX-SBE` header is malformed or invalid, the response will be an SBE-encoded error. + - If the `X-MBX-SBE` header is missing, the response will be an SBE-encoded error. +- If you provide both `application/sbe` and `application/json` in the Accept header: + - If SBE is not enabled in the exchange, the response will fall back to JSON. + - If the `:` provided in the `X-MBX-SBE` header is malformed or invalid, the response will fall back to JSON. + - If the `X-MBX-SBE` header is missing, the response will fall back to JSON. + +#### WebSocket API[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/sbe_faq) + +- In the connection URL, add `responseFormat=sbe`. +- Provide the schema ID and version in the parameters `sbeSchemaId=` and `sbeSchemaVersion=` respectively. + +Sample request (WebSocket): + +``` +id=$(date +%s%3N)method="exchangeInfo"params='{"symbol":"BTCUSDT"}'request=$( jq -n \ --arg id "$id" \ --arg method "$method" \ --argjson params "$params" \ '{id: $id, method: $method, params: $params}' )response=$(echo $request | websocat -n1 'wss://ws-api.binance.com:443/ws-api/v3?responseFormat=sbe&sbeSchemaId=1&sbeSchemaVersion=0') +``` + +**Notes:** + +- If you provide only `responseFormat=sbe` in the connection URL: + - If SBE is not enabled in the exchange, the response will be HTTP 400. + - If the `sbeSchemaId=` or `sbeSchemaVersion=` are malformed or invalid, the response will be HTTP 400. +- If you provide both `responseFormat=sbe` and `responseFormat=json`, the response will be HTTP 400. +- All error responses during the HTTP handshake are encoded as JSON with the `Content-Type` header set to `application/json;charset=UTF-8`. +- Once a WebSocket session has been successfully established with SBE enabled, all method responses within that session are encoded in SBE, even in the event SBE becomes disabled. + - This means that if SBE is disabled while your WebSocket connection is active, you will receive an SBE-encoded "SBE is not enabled" error in response to any subsequent request. +- As of writing, we do not recommend using `websocat` to send any request as we have observed issues in how it decodes binary frames. The sample above is only used for reference to show the URL to get an SBE response. + +#### FIX API[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/sbe_faq) + +See FIX API's [SBE section](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) for detailed information. + +Please continue reading below also. + +### Supported APIs[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/sbe_faq) + +REST API, WebSocket API and FIX API for SPOT support SBE. + +### SBE Schema[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/sbe_faq) + +- The schema to use both for the live exchange and SPOT Testnet will be saved in this repository [here](https://github.com/binance/binance-spot-api-docs/tree/master/sbe/schemas). +- Any updates to the schema will be noted in the [CHANGELOG](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG). + +### Regarding Legacy support[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/sbe_faq) + +- SBE schemas are versioned via two XML attributes, `id` and `version`. + - `id` is incremented when a breaking change is introduced. When this occurs, `version` is reset to 0. + - `version` is incremented when a non-breaking change is introduced. When this occurs, `id` is not modified. +- When a new schema is live the old schema becomes deprecated. **Deprecation occurs even when the new schema only introduces non-breaking changes.** +- A deprecated schema will be supported **for at least 6 months after deprecation**. + For example given this hypothetical timeline: + - January 3024: Schema id 1 version 0 is released. This is the first version so this is usable once SBE is enabled in the exchange. + - March 3024: Schema id 1 version 1 is released. This schema introduces a non-breaking change. + - Schema id 1 version 0 is deprecated, but can still be used for at least another 6 months. + - August 3024: Schema id 2 version 0 is released. This schema introduces a breaking change. + - Schema id 1 version 0 is deprecated, but can still be used for at least another 1 month. + - Schema id 1 version 1 is deprecated, but can still be used for at least another 6 months. + - September 3024: 6 months have passed since the release of Schema id 1 version 1. + - Schema id 1 version 0 is retired. + - February 3025: Schema id 2 version 1 is released. This schema introduces a non-breaking change. + - Schema id 1 version 1 is retired. + - Schema id 2 version 0 is deprecated, but can still be used for at least another 6 months. +- For REST API requests specifying a deprecated `:` in their `X-MBX-SBE` header: + - the HTTP responses will contain a `X-MBX-SBE-DEPRECATED` header + - the SBE responses will be encoded in the highest compatible schema + - For example, as of 2025-08-27, requests for `X-MBX-SBE: 3:0` will receive responses encoded in schema `3:1`. An SBE decoder for schema `3:0` is expected to decode schema `3:1` gracefully as detailed in the [FIX SBE Specification](https://www.fixtrading.org/standards/sbe-online). +- For WebSocket API connections specifying a deprecated `sbeSchemaId` and `sbeSchemaVersion` in their connection URL: + - the field `sbeSchemaIdVersionDeprecated` will be set to `true` in all `WebSocketResponse` SBE messages + - all SBE responses will be encoded in the highest compatible schema + - For example, as of 2025-08-27, requests for `sbeSchemaId=3&sbeSchemaVersion=0` will receive responses encoded in schema `3:1`. An SBE decoder for schema `3:0` is expected to decode schema `3:1` gracefully as detailed in the [FIX SBE Specification](https://www.fixtrading.org/standards/sbe-online). +- For FIX API, when an SBE request message header specifies a deprecated `schemaId` and `version`: + - the field `sbeSchemaIdVersionDeprecated` will be set to `true` in the `LogonAck` message + - all SBE response messages will be encoded using the highest schema version for the provided `schemaId` +- Requests specifying a retired schemaId/version will fail with HTTP 400 (REST & WebSocket) or reject message (FIX API) . +- In SBE Schema [3:0](https://github.com/binance/binance-spot-api-docs/blob/master/sbe/schemas/spot_3_0.xml), a `validValue` named `NonRepresentable` was added to each `enum`. Receipt of this value indicates that additional data is available when using the latest schema. +- In SBE Schema [3:1](https://github.com/binance/binance-spot-api-docs/blob/master/sbe/schemas/spot_3_1.xml), a message named `NonRepresentableMessage` was added. Receipt of this message indicates that additional data is available when using the latest schema. This message may be received as a top-level message or embedded in a `data` field when the `data` field's `type` is `messageData`, `messageData8`, `messageData16`, `optionalMessageData`, or `optionalMessageData16`. +- JSON file regarding the schema life-cycle with the dates of the latest, deprecated, and retired schemas for both the live exchange and SPOT Testnet will be saved in this repository [here](https://github.com/binance/binance-spot-api-docs/tree/master/sbe/schemas). + Below is an example JSON based on the hypothetical timeline above: + +``` +{ "environment": "PROD", "latestSchema": { "id": 2, "version": 1, "releaseDate": "3025-02-01" }, "deprecatedSchemas": [ { "id": 2, "version": 0, "releaseDate": "3024-08-01", "deprecatedDate": "3025-02-01" } ], "retiredSchemas": [ { "id": 1, "version": 1, "releaseDate": "3024-03-01", "deprecatedDate": "3024-08-01", "retiredDate": "3025-02-01" }, { "id": 1, "version": 0, "releaseDate": "3024-01-01", "deprecatedDate": "3024-03-01", "retiredDate": "3024-09-01" } ]} +``` + +### Generate SBE decoders:[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/sbe_faq) + +1. Download the schema: + - REST/WebSocket API: + - [`spot_prod_latest.xml`](https://github.com/binance/binance-spot-api-docs/blob/master/sbe/schemas/spot_prod_latest.xml) for the live exchange. + - [`spot_testnet_latest.xml`](https://github.com/binance/binance-spot-api-docs/blob/master/sbe/schemas/spot_testnet_latest.xml) for [SPOT Testnet](https://testnet.binance.vision/). + - FIX API: + - [`spot_fix_prod_latest.xml`](https://github.com/binance/binance-spot-api-docs/blob/master/sbe/schemas/spot_fix_prod_latest.xml) for the live exchange. + - [`spot_fix_testnet_latest.xml`](https://github.com/binance/binance-spot-api-docs/blob/master/sbe/schemas/spot_fix_testnet_latest.xml) for [SPOT Testnet](https://testnet.binance.vision/). +2. Clone and build [`simple-binary-encoding`](https://github.com/real-logic/simple-binary-encoding): + +``` + $ git clone https://github.com/real-logic/simple-binary-encoding.git $ cd simple-binary-encoding $ ./gradlew +``` + +3. Run the SbeTool code generator. (Here are samples for [Java](https://github.com/binance/binance-sbe-java-sample-app), [C++](https://github.com/binance/binance-sbe-cpp-sample-app) and [Rust](https://github.com/binance/binance-sbe-rust-sample-app) decoding the payload from Exchange Information.) + +#### Decimal field encoding[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/sbe_faq) + +Unlike the FIX SBE specification, decimal fields have their mantissa and exponent fields encoded separately as primitive fields in order to minimize payload size and the number of encoded fields within messages. + +#### Timestamp field encoding[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/sbe_faq) + +Timestamps in SBE responses are in microseconds. This differs from JSON responses, which contain millisecond timestamps by default. + +#### Custom field attributes in the schema file[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/sbe_faq) + +A few field attributes prefixed with `mbx:` were added to the schema file for documentation purposes: + +- `mbx:exponent`: Points to the exponent field corresponding to the mantissa field +- `mbx:jsonPath`: Contains the name of the equivalent field in the JSON response +- `mbx:jsonValue`: Contains the name of the equivalent ENUM value in the JSON response + +- [How to get an SBE response](https://developers.binance.com/docs/binance-spot-api-docs/faqs/sbe_faq) +- [Supported APIs](https://developers.binance.com/docs/binance-spot-api-docs/faqs/sbe_faq) +- [SBE Schema](https://developers.binance.com/docs/binance-spot-api-docs/faqs/sbe_faq) +- [Regarding Legacy support](https://developers.binance.com/docs/binance-spot-api-docs/faqs/sbe_faq) +- [Generate SBE decoders:](https://developers.binance.com/docs/binance-spot-api-docs/faqs/sbe_faq) diff --git a/docs/binance/binance-spot/faqs_sor_faq.md b/docs/binance/binance-spot/faqs_sor_faq.md new file mode 100644 index 0000000..bc91821 --- /dev/null +++ b/docs/binance/binance-spot/faqs_sor_faq.md @@ -0,0 +1,165 @@ +--- +title: "SOR FAQ | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs/faqs/sor_faq" +fetched_at: "2026-02-26T10:38:08.116Z" +--- +# Smart Order Routing (SOR) + +**Disclaimer:** + +- The symbols and values used here are fictional, and do not imply anything about the actual setup on the live exchange. +- For simplicity, the examples in this document do not include commission. + +### What is Smart Order Routing (SOR)?[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/sor_faq) + +**Smart Order Routing (SOR)** allows you to potentially get better liquidity by filling an order with liquidity from other order books with the same base asset and interchangeable quote assets. **Interchangeable quote assets** are quote assets with fixed 1 to 1 exchange rate, such as stablecoins pegged to the same fiat currency. + +Note that even though the quote assets are interchangeable, when selling the base asset you will always receive the quote asset of the symbol in your order. + +When you place an order using SOR, it goes through the eligible order books, looks for best price levels for each order book in that SOR configuration, and takes from those books if possible. + +**Note:** If the order using SOR cannot fully fill based on the eligible order books' liquidity, `LIMIT IOC` or `MARKET` orders will immediately expire, while `LIMIT GTC` orders will place the remaining quantity on the order book you originally submitted the order to. + +**Example 1** + +Let's consider a SOR configuration containing the symbols `BTCUSDT`, `BTCUSDC` and `BTCUSDP`, and the following `ASK` (`SELL` side) order books for those symbols: + +``` +BTCUSDT quantity 3 price 30,800BTCUSDT quantity 3 price 30,500BTCUSDC quantity 1 price 30,000BTCUSDC quantity 1 price 28,000BTCUSDP quantity 1 price 35,000BTCUSDP quantity 1 price 29,000 +``` + +If you send a `LIMIT GTC BUY` order for `BTCUSDT` with `quantity=0.5` and `price=31000`, you would match with the best SELL price on the BTCUSDT book at 30,500. You would spend 15,250 USDT and receive 0.5 BTC. + +If you send a `LIMIT GTC BUY` order _using SOR_ for `BTCUSDT` with `quantity=0.5` and `price=31000`, you would match with the best SELL price across _all symbols in the SOR_, which is BTCUSDC at price 28,000. You would spend 14,000 USDT (_not_ USDC!) and receive 0.5 BTC. + +``` +{ "symbol": "BTCUSDT", "orderId": 2, "orderListId": -1, "clientOrderId": "sBI1KM6nNtOfj5tccZSKly", "transactTime": 1689149087774, "price": "31000.00000000", "origQty": "0.50000000", "executedQty": "0.50000000", "cummulativeQuoteQty": "14000.00000000", "status": "FILLED", "timeInForce": "GTC", "type": "LIMIT", "side": "BUY", "workingTime": 1689149087774, "fills": [ { "matchType": "ONE_PARTY_TRADE_REPORT", "price": "28000.00000000", "qty": "0.50000000", "commission": "0.00000000", "commissionAsset": "BTC", "tradeId": -1, "allocId": 0 } ], "workingFloor": "SOR", "selfTradePreventionMode": "NONE", "usedSor": true} +``` + +**Example 2** + +Using the same order book as Example 1: + +``` +BTCUSDT quantity 3 price 30,800BTCUSDT quantity 3 price 30,500BTCUSDC quantity 1 price 30,000BTCUSDC quantity 1 price 28,000BTCUSDP quantity 1 price 35,000BTCUSDP quantity 1 price 29,000 +``` + +If you send a `LIMIT GTC BUY` order for `BTCUSDT` with `quantity=5` and `price=31000`, you would: + +- match with the 3 BTCUSDT at 30,500, and buy 3 BTC for 91,500 USDT +- then match with the 3 BTCUSDT at 30,800, and buy 2 BTC for 61,600 USDT + +In total, you spend 153,100 USDT and receive 5 BTC. + +If you send the same `LIMIT GTC BUY` order _using SOR_ for `BTCUSDT` with `quantity=5` and `price=31000`, you would: + +- match with 1 BTCUSDC at 28,000, and buy 1 BTC for 28,000 USDT +- match with 1 BTCUSDP at 29,000, and buy 1 BTC for 29,000 USDT +- match with 1 BTCUSDC at 30,000, and buy 1 BTC for 30,000 USDT +- match with 3 BTCUSDT at 30,500, and buy 2 BTC for 61,000 USDT + +In total, you spend 148,000 USDT and receive 5 BTC. + +``` +{ "symbol": "BTCUSDT", "orderId": 2, "orderListId": -1, "clientOrderId": "tHonoNjWfOSaKiTygN3bfY", "transactTime": 1689146154686, "price": "31000.00000000", "origQty": "5.00000000", "executedQty": "5.00000000", "cummulativeQuoteQty": "148000.00000000", "status": "FILLED", "timeInForce": "GTC", "type": "LIMIT", "side": "BUY", "workingTime": 1689146154686, "fills": [ { "matchType": "ONE_PARTY_TRADE_REPORT", "price": "28000.00000000", "qty": "1.00000000", "commission": "0.00000000", "commissionAsset": "BTC", "tradeId": -1, "allocId": 0 }, { "matchType": "ONE_PARTY_TRADE_REPORT", "price": "29000.00000000", "qty": "1.00000000", "commission": "0.00000000", "commissionAsset": "BTC", "tradeId": -1, "allocId": 1 }, { "matchType": "ONE_PARTY_TRADE_REPORT", "price": "30000.00000000", "qty": "1.00000000", "commission": "0.00000000", "commissionAsset": "BTC", "tradeId": -1, "allocId": 2 }, { "matchType": "ONE_PARTY_TRADE_REPORT", "price": "30500.00000000", "qty": "2.00000000", "commission": "0.00000000", "commissionAsset": "BTC", "tradeId": -1, "allocId": 3 } ], "workingFloor": "SOR", "selfTradePreventionMode": "NONE", "usedSor": true} +``` + +**Example 3** + +Using the same order book as Example 1 and 2: + +``` +BTCUSDT quantity 3 price 30,800BTCUSDT quantity 3 price 30,500BTCUSDC quantity 1 price 30,000BTCUSDC quantity 1 price 28,000BTCUSDP quantity 1 price 35,000BTCUSDP quantity 1 price 29,000 +``` + +If you send a `MARKET BUY` order for `BTCUSDT` _using SOR_ with `quantity=11`, there is only 10 BTC in total available across all eligible order books. Once all the order books in SOR configuration have been exhausted, the remaining quantity of 1 expires. + +``` +{ "symbol": "BTCUSDT", "orderId": 2, "orderListId": -1, "clientOrderId": "jdFYWTNyzplbNvVJEzQa0o", "transactTime": 1689149513461, "price": "0.00000000", "origQty": "11.00000000", "executedQty": "10.00000000", "cummulativeQuoteQty": "305900.00000000", "status": "EXPIRED", "timeInForce": "GTC", "type": "MARKET", "side": "BUY", "workingTime": 1689149513461, "fills": [ { "matchType": "ONE_PARTY_TRADE_REPORT", "price": "28000.00000000", "qty": "1.00000000", "commission": "0.00000000", "commissionAsset": "BTC", "tradeId": -1, "allocId": 0 }, { "matchType": "ONE_PARTY_TRADE_REPORT", "price": "29000.00000000", "qty": "1.00000000", "commission": "0.00000000", "commissionAsset": "BTC", "tradeId": -1, "allocId": 1 }, { "matchType": "ONE_PARTY_TRADE_REPORT", "price": "30000.00000000", "qty": "1.00000000", "commission": "0.00000000", "commissionAsset": "BTC", "tradeId": -1, "allocId": 2 }, { "matchType": "ONE_PARTY_TRADE_REPORT", "price": "30500.00000000", "qty": "3.00000000", "commission": "0.00000000", "commissionAsset": "BTC", "tradeId": -1, "allocId": 3 }, { "matchType": "ONE_PARTY_TRADE_REPORT", "price": "30800.00000000", "qty": "3.00000000", "commission": "0.00000000", "commissionAsset": "BTC", "tradeId": -1, "allocId": 4 }, { "matchType": "ONE_PARTY_TRADE_REPORT", "price": "35000.00000000", "qty": "1.00000000", "commission": "0.00000000", "commissionAsset": "BTC", "tradeId": -1, "allocId": 5 } ], "workingFloor": "SOR", "selfTradePreventionMode": "NONE", "usedSor": true} +``` + +**Example 4** + +Let's consider a SOR configuration containing the symbols `BTCUSDT`, `BTCUSDC` and `BTCUSDP` and the following `BID` (`BUY` side) order book for those symbols: + +``` +BTCUSDT quantity 5 price 29,500BTCUSDC quantity 5 price 35,000BTCUSDC quantity 5 price 30,000BTCUSDP quantity 5 price 28,000 +``` + +If you send a `LIMIT GTC SELL` order for `BTCUSDT` with `price=29000` and `quantity=10`, you would sell 5 BTC and receive 147,500 USDT. Since there is no better price available on the BTCUSDT book, the remaining (unfilled) quantity of the order will rest there at the price of 29,000. + +If you send a `LIMIT GTC SELL` order _using SOR_ for `BTCUSDT`, you would: + +- match with 5 BTCUSDC at 35,000 and sell 5 BTC for 175,000 USDT +- match with 5 BTCUSDC at 30,000 and sell 5 BTC for 150,000 USDT + +In total, you sell 10 BTC and receive 325,000 USDT. + +``` +{ "symbol": "BTCUSDT", "orderId": 1, "orderListId": -1, "clientOrderId": "W1iXSng1fS77dvanQJDGA5", "transactTime": 1689147920113, "price": "29000.00000000", "origQty": "10.00000000", "executedQty": "10.00000000", "cummulativeQuoteQty": "325000.00000000", "status": "FILLED", "timeInForce": "GTC", "type": "LIMIT", "side": "SELL", "workingTime": 1689147920113, "fills": [ { "matchType": "ONE_PARTY_TRADE_REPORT", "price": "35000.00000000", "qty": "5.00000000", "commission": "0.00000000", "commissionAsset": "USDT", "tradeId": -1, "allocId": 0 }, { "matchType": "ONE_PARTY_TRADE_REPORT", "price": "30000.00000000", "qty": "5.00000000", "commission": "0.00000000", "commissionAsset": "USDT", "tradeId": -1, "allocId": 1 } ], "workingFloor": "SOR", "selfTradePreventionMode": "NONE", "usedSor": true} +``` + +**Summary: The goal of SOR is to potentially access better liquidity across order books with interchangeable quote assets. Better liquidity access can fill orders more fully and at better prices during an order's taker phase.** + +### What symbols support SOR?[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/sor_faq) + +You can find the current SOR configuration in Exchange Information (`GET /api/v3/exchangeInfo` for Rest, and `exchangeInfo` on Websocket API). + +``` +{ "sors": [ { "baseAsset": "BTC", "symbols": ["BTCUSDT", "BTCUSDC", "BTCUSDP"] } ]} +``` + +The `sors` field is optional. It is omitted in responses if SOR is not available. + +### How do I place an order using SOR?[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/sor_faq) + +On the Rest API, the request is `POST /api/v3/sor/order`. + +On the WebSocket API, the request is `sor.order.place`. + +### In the API response, there's a field called `workingFloor`. What does that field mean?[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/sor_faq) + +This is a term used to determine where the order's last activity occurred (filling, expiring, or being placed as new, etc.). + +If the `workingFloor` is `SOR`, this means your order interacted with other eligible order books in the SOR configuration. + +If the `workingFloor` is `EXCHANGE`, this means your order interacted on the order book that you sent that order to. + +### In the API response, `fills` contain fields `matchType` and `allocId`. What do they mean?[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/sor_faq) + +`matchType` field indicates a non-standard order fill. + +When your order is filled by SOR, you will see `matchType: ONE_PARTY_TRADE_REPORT`, indicating that you did not trade directly on the exchange (`tradeId: -1`). Instead your order is filled by _allocations_. + +`allocId` field identifies the allocation so that you can query it later. + +### What are allocations?[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/sor_faq) + +**An allocation** is a transfer of an asset from the exchange to your account. For example, when SOR takes liquidity from eligible order books, your order is filled by allocations. In this case you don't trade directly, but rather receive allocations from SOR corresponding to the trades made by SOR on your behalf. + +``` +[ { "symbol": "BTCUSDT", // Symbol the order was submitted to "allocationId": 0, "allocationType": "SOR", "orderId": 2, "orderListId": -1, "price": "30000.00000000", // Price of the fill "qty": "5.00000000", // Quantity of the fill "quoteQty": "150000.00000000", "commission": "0.00000000", "commissionAsset": "BTC", "time": 1688379272280, // Time the allocation occurred "isBuyer": true, "isMaker": false, "isAllocator": false }] +``` + +### How do I query orders that used SOR?[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/sor_faq) + +You can find them the same way you query any other order. The main difference is that in the response for an order that used SOR there are two extra fields: `usedSor` and `workingFloor`. + +### How do I get details of my fills for orders that used SOR?[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/sor_faq) + +When SOR orders trade against order books other than the symbol submitted with the order, the order is filled with an **allocation** and not a trade. Orders placed with SOR can potentially have both allocations and trades. + +In the API response, you can review the `fills` fields. Allocations have an `allocId` and `"matchType": "ONE_PARTY_TRADE_REPORT"`, while trades will have a non-negative `tradeId`. + +Allocations can be queried using `GET /api/v3/myAllocations` (Rest API) or `myAllocations` (WebSocket API). + +Trades can be queried using `GET /api/v3/myTrades` (Rest API) or `myTrades` (WebSocket API). + +- [What is Smart Order Routing (SOR)?](https://developers.binance.com/docs/binance-spot-api-docs/faqs/sor_faq) +- [What symbols support SOR?](https://developers.binance.com/docs/binance-spot-api-docs/faqs/sor_faq) +- [How do I place an order using SOR?](https://developers.binance.com/docs/binance-spot-api-docs/faqs/sor_faq) +- [In the API response, there's a field called `workingFloor`. What does that field mean?](https://developers.binance.com/docs/binance-spot-api-docs/faqs/sor_faq) +- [In the API response, `fills` contain fields `matchType` and `allocId`. What do they mean?](https://developers.binance.com/docs/binance-spot-api-docs/faqs/sor_faq) +- [What are allocations?](https://developers.binance.com/docs/binance-spot-api-docs/faqs/sor_faq) +- [How do I query orders that used SOR?](https://developers.binance.com/docs/binance-spot-api-docs/faqs/sor_faq) +- [How do I get details of my fills for orders that used SOR?](https://developers.binance.com/docs/binance-spot-api-docs/faqs/sor_faq) diff --git a/docs/binance/binance-spot/faqs_spot_glossary.md b/docs/binance/binance-spot/faqs_spot_glossary.md new file mode 100644 index 0000000..efd840b --- /dev/null +++ b/docs/binance/binance-spot/faqs_spot_glossary.md @@ -0,0 +1,608 @@ +--- +title: "Spot Glossary | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs/faqs/spot_glossary" +fetched_at: "2026-02-26T10:38:08.010Z" +--- +# SPOT API Glossary + +**Disclaimer:** This glossary refers only to the SPOT API Implementation. The definition for these terms may differ with regards to Futures, Options, and other APIs by Binance. + +### A[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/spot_glossary) + +`ACK` + +- `newOrderRespType` enum. Stands for a type of order response in JSON where only the following fields are emitted: `symbol`, `orderId`, `orderListId`, `clientOrderId`, and `transactTime`. + +`aggTrade`/Aggregate trade + +- Aggregation of one or more individual trades from the same taker order that got filled at the same time and price. + +allocation + +- Transfer of asset from the exchange to your account (e.g., when an order is filled by SOR instead of trading directly). + +`allocationId` + +- Unique identifier of an allocation on a symbol. + +`allocationType` + +- See [AllocationType](https://developers.binance.com/docs/binance-spot-api-docs/enums) + +`askPrice` + +- In ticker responses: the lowest price on the `SELL` side. + +`askQty` + +- In ticker responses: total quantity offered at the lowest price on the `SELL` side. + +`asks` + +- Orders on the `SELL` side. + +`avgPrice` + +- Represents the volume-weighted average price for a set interval of minutes. + +--- + +### B[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/spot_glossary) + +`baseAsset` + +- The first asset in the symbol (e.g. `BTC` is the `base asset` of symbol `BTCUSDT`), which represents the asset being bought and sold (the `quantity`). + +`baseAssetPrecision` + +- A field found in Exchange Information that shows the number of decimals allowed on the `baseAsset`. + +`baseCommissionPrecision` + +- A field found in Exchange Information that represents the number of decimals base asset commission will be calculated to. + +`bidPrice` + +- In ticker responses: the highest price on the `BUY` side. + +`bidQty` + +- In ticker responses: total quantity offered at the highest price on the `BUY` side. + +`bids` + +- Orders on the `BUY` side. + +`BREAK` + +- Symbol's trading status that represents the symbol is not available for trading, which can happen during expected downtime. Market data is not generated during `BREAK`. + +`BUY` + +- An enum in the `side` parameter when a user wants to purchase an asset (e.g. `BTC`). + +--- + +### C[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/spot_glossary) + +`CANCELED` + +- Order `status` indicating the order has been canceled by the user. + +`cancelReplaceMode` + +- Parameter used in Cancel Replace orders that define whether the New Order Placement should proceed if the Cancel Request fails. + +`clientOrderId` + +- A field, which can be set by the user, in the JSON response for order placement requests to identify the newly placed order. + +`commission` + +- The fee that was paid on a trade. + +`commissionAsset` + +- The asset the commission fees were deducted from. + +Counter Order Id + +- A field in User Data Stream execution reports that indicates the counterparty order in a prevented match. + +Counter Symbol + +- A field in User Data Stream execution reports that indicates the symbol of the counterparty order in a prevented match. + +`cummulativeQuoteQty` + +- The accumulation of the `price` \* `qty` for each fill of an order. + +--- + +### D[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/spot_glossary) + +Data Source + +- Specifies where the endpoint or request is retrieving their data. + +--- + +### E[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/spot_glossary) + +`executedQty` + +- The field that shows how much of the quantity was filled in an order. + +`EXPIRED` + +- Order `status` indicating the order was canceled according to the order type's rules or by the exchange. + +`EXPIRED_IN_MATCH` + +- Order `status` indicating the order was canceled by the exchange due to STP. (e.g. an order with `EXPIRE_TAKER` will match with existing orders on the book with the same account or same `tradeGroupId`) + +--- + +### F[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/spot_glossary) + +`filters` + +- Defines the trading rules on the exchange. + +`FOK`/ Fill or Kill + +- `timeInForce` enum where the order will not fill and expire if the order cannot be fully filled. + +`free` + +- The amount of an asset in a user's balances that can be used to trade or withdraw. + +`FULL` + +- `newOrderRespType` enum. Stands for a type of order response in JSON, where all the order information is emitted, including orders `fills` field. + +--- + +### G[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/spot_glossary) + +`GTC`/ Good Til Canceled + +- `timeInForce` enum where the order will remain active until it is canceled or fully filled. + +--- + +### H[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/spot_glossary) + +`HALT` + +- Symbol's trading status that represents the symbol is not available for trading, which can happen during emergency downtime. Market data is still generated during `HALT`. + +--- + +### I[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/spot_glossary) + +`intervalNum` + +- Describes the amount of time in the interval (e.g. if `interval` is `SECOND` and `intervalNum` is 5, then this will be interpreted as every 5 seconds). + +`IOC` / Immediate or Canceled + +- `timeInForce` enum where the order tries to fill as much as possible, and the remaining unfilled quantity will expire. + +`isBestMatch` + +- Field in the Response JSON that determines if the price of the trade was the best available on the exchange. + +`isBuyerMaker` + +- Field in the Response JSON that indicates if the Buy side (the Buyer) was also the market maker (the Maker). + +`isWorking` + +- Field in the JSON that shows if the order has started working on the order book. + +--- + +### K[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/spot_glossary) + +`kline` + +- Identifies the open, close, high, low price, trading volume, and other market data, of a symbol at a specified time for a specific duration. Also known as a Candlestick. + +--- + +### L[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/spot_glossary) + +Last Prevented Quantity + +- Order quantity that expired due to STP. + +`lastPrice` + +- Price of the latest trade. + +`lastQty` + +- Total quantity traded at the `lastPrice`. + +`LIMIT` + +- a `type` of order where the execution price will be no worse than the order's set price. The execution price is limited to be the set price or better. + +`LIMIT_MAKER` + +- A `type` of order where the order can only be a maker order (i.e. The order cannot immediately match and take). + +`limitClientOrderId` + +- A parameter used in placing OCO orders that identifies the `LIMIT_MAKER` pair of the OCO Order. + +`listClientOrderId` + +- A parameter used in placing OCO Orders that identifies the pair of orders. + +`locked` + +- The amount of an asset in a user's balances that are currently locked in open orders and other services by the platform. + +--- + +### M[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/spot_glossary) + +`MARKET` + +- A `type` of order where the user buys or sells an asset at the best available prices and liquidity until the order is fully filled or the order book's liquidity is exhausted. + +Matching Engine + +- This can either refer to a Data Source in the documentation which means the response is coming from the engine. +- Or this is referred to as the system that handles all the requests and matches orders. + +Match Type + +- Field in the order response or execution report indicating if the order was filled by the [SOR](https://developers.binance.com/docs/binance-spot-api-docs/faqs/sor_faq) + +Memory + +- Data Source where the response is coming from the API's internal memory or cache. + +--- + +### N[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/spot_glossary) + +`NEW` + +- Order `status` where a order has been successfully sent to the Matching Engine. + +`newClientOrderId` + +- Parameter used in the SPOT API to assign the `clientOrderId` for the order being placed or the cancel message. + +Notional value + +- The `price` \* `qty` value. + +--- + +### O[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/spot_glossary) + +`OCO` + +- One-Cancels-the-Other type of order that is composed by a pair of orders (e.g. `STOP_LOSS` or `STOP_LOSS_LIMIT` paired with a `LIMIT_MAKER` order) with the condition that if one of the orders execute, the other is automatically expired. + +`OPO` + +- [One-Pays-The-Other](https://github.com/binance/binance-spot-api-docs/blob/master/faqs/opo.md), a special subset of OTO. +- When the working order fully fills, the accumulated received quantity is used for the quantity of the pending order. + +`OPOCO` + +- [One-Pays-The-Other](https://github.com/binance/binance-spot-api-docs/blob/master/faqs/opo.md), a special subset of OTOCO. +- When the working order fully fills, the accumulated received quantity is used for the quantity of the pending OCO pair. + +Order Amend Keep Priority + +- See [Order Amend Keep Priority](https://developers.binance.com/docs/binance-spot-api-docs/faqs/order_amend_keep_priority) + +Order Book + +- List of the open bids and asks for a symbol. + +Order List + +- Multiple orders grouped together as a unit. See `OCO` and/or `OTO` + +`orderId` + +- A field in the order response that uniquely identifies the order on a symbol. + +`origQty` + +- The original `quantity` that was sent during order placement. + +`origClientOrderId` + +- Field used when canceling or querying an order by providing the `clientOrderId`. + +`OTO` + +- One-Triggers-the-Other type of order that has a working order and a pending order. +- When the working order fully fills, the pending order is automatically placed. + +`OTOCO` + +- One-Triggers-a-One-Cancels-the-Other order has a working order, and an OCO pair for the pending orders. +- When the working order fully fills, the pending OCO pair is automatically placed. + +--- + +### P[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/spot_glossary) + +`PARTIALLY_FILLED` + +- Order `status` indicating that part of the order has been partially filled. + +Pending order + +- An order in an order list that is only placed on the order book when the corresponding working order is fully filled. +- A single order list can contain either a single pending order, or 2 pending orders forming an OCO. +- In the single order case, almost any order type is supported, with the exception of `MARKET` orders using `quoteOrderQty`. + +`PENDING_NEW` + +- Order `status` indicating that the pending orders of an order list have been accepted by the engine, but are not yet placed on the order book. + +Prevented execution price + +- A field in User Data Stream execution reports showing the price of a prevented self-trade. See [STP](https://developers.binance.com/docs/binance-spot-api-docs/faqs/stp_faq). + +Prevented execution quantity + +- A field in the User Data Stream showing the quantity of a prevented self-trade. See [STP](https://developers.binance.com/docs/binance-spot-api-docs/faqs/stp_faq). + +Prevented execution quote quantity + +- A field in the User data Stream showing the quote quantity of the prevented self-trade. See [STP](https://developers.binance.com/docs/binance-spot-api-docs/faqs/stp_faq). + +`preventedQuantity` + +- Order quantity expired due to STP events. + +Prevented Match + +- When order(s) expire due to the STP, a "prevented match" records the event. + +`preventedMatchId` + +- When used in combination with `symbol`, can be used to query a prevented match of the expired order. + +--- + +### Q[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/spot_glossary) + +`quantity` + +- Parameter used to specify the amount of the `base asset` to buy or sell. + +`quoteAsset` + +- The second asset in the symbol (e.g. `USDT` is the `quote asset` of symbol `BTCUSDT`) which represents the asset being used to quote prices (the `price`). + +`quoteAssetPrecision` + +- A field found in Exchange Information that shows the number of decimals allowed on the `quoteAsset`. + +`quoteCommissionPrecision` + +- A field found in Exchange Information that represents the number of decimals quote asset commission will be calculated to. + +`quoteOrderQty` + +- `MARKET` order parameter that specifies the amount of the quote asset one wants to spend/receive in a "Reverse MARKET order". + +`quoteQty` + +- `price` \* `qty`; the notional value. + +--- + +### R[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/spot_glossary) + +`recvWindow` + +- Parameter in the APIs that can be used to specify the number of milliseconds after the `timestamp` the request is valid for. + +`RESULT` + +- `newOrderRespType` enum. Stands for a type of order response in JSON, where all the order information is emitted, except order's `fills` field. + +Reverse `MARKET` order + +- A `MARKET` order that is specified using the `quoteOrderQty` instead of the `quantity`. + +--- + +### S[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/spot_glossary) + +Self Trade Prevention (STP) + +- Self Trade Prevention is a feature that prevents orders of users, or the user's `tradeGroupId` from matching against their own. Read [STP FAQ](https://developers.binance.com/docs/binance-spot-api-docs/faqs/stp_faq) to learn more. + +`selfTradePreventionMode` + +- A parameter used to specify what the system will do if an order could cause a self-trade. + +`SELL` + +- An enum in the `side` used when a user wants to sell an asset (e.g. BTC). + +Smart Order Routing (SOR) + +- Smart Order Routing uses interchangeable quote assets to improve liquidity. Read [SOR FAQ](https://developers.binance.com/docs/binance-spot-api-docs/faqs/sor_faq) to learn more. + +`specialCommissionForOrder`/`specialCommission` + +- See [Commission FAQ](https://developers.binance.com/docs/binance-spot-api-docs/faqs/commission_faq) + +`SPOT` + +- This is to distinguish a type of trading, where the purchase and delivery of a asset is made immediately. + +`standardCommissionForOrder`/`standardCommission` + +- See [Commission FAQ](https://developers.binance.com/docs/binance-spot-api-docs/faqs/commission_faq) + +`stopClientOrderId` + +- A parameter used in placing OCO orders that identifies the `STOP_LOSS` or `STOP_LOSS_LIMIT` pair of the OCO Order. + +`stopPrice` + +- The price used in algorithmic orders (e.g. `STOP_LOSS`, `TAKE_PROFIT`) that determines when an order will be triggered to be placed on the order book. +- The price used in trailing algorithmic orders (e.g. `STOP_LOSS`, `TAKE_PROFIT`) to determine when trailing price tracking begins. + +`STOP_LOSS` + +- A `type` of algorithmic order where once the market price hits the `stopPrice`, a `MARKET` order is placed on the order book. + +`STOP_LOSS_LIMIT` + +- A `type` of algorithmic order where once the market price hits the `stopPrice`, a `LIMIT` order is placed on the order book. + +`strategyId` + +- Arbitrary numeric value identifying the order within an order strategy. + +`strategyType` + +- Arbitrary numeric value identifying the order strategy. + +`symbol` + +- A trading pair, composed of a `base asset` and a `quote asset`. (e.g. BTCUSDT and BNBBTC) + +--- + +### T[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/spot_glossary) + +`TAKE_PROFIT` + +- A `type` of algorithmic order where once the market price hits the `stopPrice`, a `MARKET` order is placed on the order book. + +`TAKE_PROFIT_LIMIT` + +- A `type` of algorithmic order where once the market price hits the `stopPrice`, a `LIMIT` order is placed on the order book. + +`taxCommissionForOrder`/`taxCommission` + +- See [Commission FAQ](https://developers.binance.com/docs/binance-spot-api-docs/faqs/commission_faq) + +`ticker` + +- Reports the price change, and other maker data, of a symbol within a certain rolling interval. + +`time` + +- For trade/allocation queries: the time when trades/allocations were executed. +- For order queries: the time when orders were created. + +`timeInForce` + +- Determines the taker behavior of an order, if an order can be a maker order, and how long the order will stay on the order book before it expires. +- Supported enums are `GTC`, `IOC`, and `FOK`. + +`tradeGroupId` + +- Group of accounts that belong to the same "trade group". + +`TRADING` + +- Trading status where orders can be placed. + +`trailingDelta` + +- Trailing Stop Order parameter that specifies the delta price change required before order activation. + +`trailingTime` + +- The time when the trailing order is now active and tracking price changes. + +`transactTime` + +- The time when the order was updated: placed, filled, or canceled. This field (as well as all timestamp related fields) will be in milliseconds by default in JSON responses. + +--- + +### U[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/spot_glossary) + +`uiKlines` + +- Modified candlestick data that is optimized for presentation of candlestick charts. + +`updateTime` + +- Last update to the order. This field (as well as all timestamp related fields) will be in milliseconds by default in JSON responses. + +User Data Stream + +- WebSocket stream used to get real-time information of a user's account. (e.g. Changes to Balances, Order Updates, etc.) Read [User Data Streams](https://developers.binance.com/docs/binance-spot-api-docs/user-data-stream) to learn more. + +`usedSor` + +- Indicates if the order was placed through [SOR](https://developers.binance.com/docs/binance-spot-api-docs/faqs/sor_faq). + +--- + +### W[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/spot_glossary) + +`weightedAveragePrice` + +- The volume weighted average price in the last x minutes. + +`workingFloor` + +- A field that determines whether the order is being filled by the SOR or by the order book the order was submitted to. + +Working order + +- An order in an order list that is immediately placed on the order book, and will trigger the placement of one or multiple pending order(s) when it becomes fully filled. +- An order in an order list that always consists of a single `LIMIT` or `LIMIT_MAKER` order. + +`workingTime` + +- The time when the order started working on the order book. + +--- + +### X[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/spot_glossary) + +`X-MBX-ORDER-COUNT-XX` + +- Response header that is emitted when a user places an order, indicating the current order count for the interval XX for that account. + +`X-MBX-USED-WEIGHT-XX` + +- Response header that is emitted when a user sends any request to the API, indicating the current used request weight for the XX interval by the user's IP. + +- [A](https://developers.binance.com/docs/binance-spot-api-docs/faqs/spot_glossary) +- [B](https://developers.binance.com/docs/binance-spot-api-docs/faqs/spot_glossary) +- [C](https://developers.binance.com/docs/binance-spot-api-docs/faqs/spot_glossary) +- [D](https://developers.binance.com/docs/binance-spot-api-docs/faqs/spot_glossary) +- [E](https://developers.binance.com/docs/binance-spot-api-docs/faqs/spot_glossary) +- [F](https://developers.binance.com/docs/binance-spot-api-docs/faqs/spot_glossary) +- [G](https://developers.binance.com/docs/binance-spot-api-docs/faqs/spot_glossary) +- [H](https://developers.binance.com/docs/binance-spot-api-docs/faqs/spot_glossary) +- [I](https://developers.binance.com/docs/binance-spot-api-docs/faqs/spot_glossary) +- [K](https://developers.binance.com/docs/binance-spot-api-docs/faqs/spot_glossary) +- [L](https://developers.binance.com/docs/binance-spot-api-docs/faqs/spot_glossary) +- [M](https://developers.binance.com/docs/binance-spot-api-docs/faqs/spot_glossary) +- [N](https://developers.binance.com/docs/binance-spot-api-docs/faqs/spot_glossary) +- [O](https://developers.binance.com/docs/binance-spot-api-docs/faqs/spot_glossary) +- [P](https://developers.binance.com/docs/binance-spot-api-docs/faqs/spot_glossary) +- [Q](https://developers.binance.com/docs/binance-spot-api-docs/faqs/spot_glossary) +- [R](https://developers.binance.com/docs/binance-spot-api-docs/faqs/spot_glossary) +- [S](https://developers.binance.com/docs/binance-spot-api-docs/faqs/spot_glossary) +- [T](https://developers.binance.com/docs/binance-spot-api-docs/faqs/spot_glossary) +- [U](https://developers.binance.com/docs/binance-spot-api-docs/faqs/spot_glossary) +- [W](https://developers.binance.com/docs/binance-spot-api-docs/faqs/spot_glossary) +- [X](https://developers.binance.com/docs/binance-spot-api-docs/faqs/spot_glossary) diff --git a/docs/binance/binance-spot/faqs_stp_faq.md b/docs/binance/binance-spot/faqs_stp_faq.md new file mode 100644 index 0000000..e774156 --- /dev/null +++ b/docs/binance/binance-spot/faqs_stp_faq.md @@ -0,0 +1,369 @@ +--- +title: "STP FAQ | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs/faqs/stp_faq" +fetched_at: "2026-02-26T10:38:08.165Z" +--- +# Self Trade Prevention (STP) FAQ + +**Disclaimer:** + +- The commissions and prices used here are fictional and do not imply anything about the actual setup on the live exchange. + +### What is Self Trade Prevention?[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/stp_faq) + +Self Trade Prevention (or STP) prevents orders of users, or the user's `tradeGroupId` to match against their own. + +### What defines a self-trade?[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/stp_faq) + +A self-trade can occur in either scenario: + +- The order traded against the same account. +- The order traded against an account with the same `tradeGroupId`. + +### What happens when STP is triggered?[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/stp_faq) + +There are five possible modes for what the system does when an order would create a self-trade. + +`NONE` - This mode exempts the order from self-trade prevention. Accounts or Trade group IDs will not be compared, no orders will be expired, and the trade will occur. + +`EXPIRE_TAKER` - This mode prevents a trade by immediately expiring the taker order's remaining quantity. + +`EXPIRE_MAKER` - This mode prevents a trade by immediately expiring the potential maker order's remaining quantity. + +`EXPIRE_BOTH` - This mode prevents a trade by immediately expiring both the taker and the potential maker orders' remaining quantities. + +`DECREMENT` - This mode increases the `prevented quantity` of _both_ orders by the amount of the prevented match. The smaller of the two orders will expire, or both if they have the same quantity. + +`TRANSFER` - If orders are from the same account, then the behavior is the same as `DECREMENT`. If orders are from different accounts with the same `tradeGroupId`, then in addition to the behavior of `DECREMENT`, the `last prevented quantity` and its notional are transferred between the two accounts. + +STP behavior is typically determined by the STP mode of the **taker order** only. The exception is that for STP `TRANSFER` to occur, both the maker and taker orders must specify STP mode `TRANSFER`. If the taker order specifies STP mode `TRANSFER`, but the maker order specifies a different STP mode, then the STP behavior is `DECREMENT`. + +In summary: + +Taker Order STP Mode + +Maker Order STP Mode + +Effective STP Mode + +`TRANSFER` + +`TRANSFER` + +`TRANSFER` + +`TRANSFER` + +`EXPIRE_MAKER`, `EXPIRE_TAKER`, `EXPIRE_BOTH`, `NONE`, `DECREMENT` + +`DECREMENT` + +`EXPIRE_MAKER`, `EXPIRE_TAKER`, `EXPIRE_BOTH`, `NONE`, `DECREMENT` + +ANY STP MODE + +STP mode of the Taker Order + +### What is a Trade Group Id?[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/stp_faq) + +Different accounts with the same `tradeGroupId` are considered part of the same "trade group". Orders submitted by members of a trade group are eligible for STP according to the taker-order's STP mode. + +A user can confirm if their accounts are under the same `tradeGroupId` from the API either from `GET /api/v3/account` (REST API) or `account.status` (WebSocket API) for each account. + +The field is also present in the response for `GET /api/v3/preventedMatches` (REST API) or `myPreventedMatches` (WebSocket API). + +If the value is `-1`, then the `tradeGroupId` has not been set for that account, so the STP may only take place between orders of the same account. + +### What is a Prevented Match?[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/stp_faq) + +When a self-trade is prevented, a prevented match is created. The orders in the prevented match have their prevented quantities increased and one or more orders expire. + +This is not to be confused with a trade, as no orders will match. + +This is a record of what orders could have self-traded. + +This can be queried through the endpoint `GET /api/v3/preventedMatches` on the REST API or `myPreventedMatches` on the WebSocket API. + +This is a sample of the output request for reference: + +``` +[ { "symbol": "BTCDUSDT", // Symbol of the orders "preventedMatchId": 8, // Identifies the prevented match of the expired order(s) for the symbol. "takerOrderId": 12, // Order Id of the Taker Order "makerOrderId": 10, // Order Id of the Maker Order "tradeGroupId": 1, // Identifies the Trade Group Id. (If the account is not part of a trade group, this will be -1.) "selfTradePreventionMode": "EXPIRE_BOTH", // STP mode that expired the order(s). "price": "50.00000000", // Price at which the match occurred. "takerPreventedQuantity": "1.00000000", // Taker's remaining quantity before the STP. Only appears if the STP mode is EXPIRE_TAKER, EXPIRE_BOTH or DECREMENT. "makerPreventedQuantity": "10.00000000", // Maker's remaining quantity before the STP. Only appears if the STP mode is EXPIRE_MAKER, EXPIRE_BOTH, or DECREMENT. "transactTime": 1663190634060 // Time the order(s) expired due to STP. }] +``` + +### What is "prevented quantity?"[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/stp_faq) + +STP events expire quantity from open orders. The STP modes `EXPIRE_TAKER`, `EXPIRE_MAKER`, and `EXPIRE_BOTH` expire all remaining quantity on the affected orders, resulting in the entire open order being expired. + +Prevented quantity is the amount of quantity that is expired due to STP events for a particular order. User stream execution reports for orders involved in STP may have these fields: + +``` +{ "A": "3.000000", // Prevented Quantity "B": "3.000000" // Last Prevented Quantity} +``` + +`B` is present for execution type `TRADE_PREVENTION`, and is the quantity expired due to that individual STP event. + +`A` is the cumulative quantity expired due to STP over the lifetime of the order. For `EXPIRE_TAKER`, `EXPIRE_MAKER`, and `EXPIRE_BOTH` modes this will always be the same value as `B`. + +API responses for orders which expired due to STP will also have a `preventedQuantity` field, indicating the cumulative quantity expired due to STP over the lifetime of the order. + +While an order is open, the following equation holds true: + +``` +original order quantity - executed quantity - prevented quantity = quantity available for further execution +``` + +When an order's available quantity goes to zero, the order will be removed from the order book and the status will be one of `EXPIRED_IN_MATCH`, `FILLED`, or `EXPIRED`. + +### How do I know which symbol uses STP?[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/stp_faq) + +Symbols may be configured to allow different sets of STP modes and take different default STP modes. + +`defaultSelfTradePreventionMode` - Orders will use this STP mode if the user does not provide one on order placement. + +`allowedSelfTradePreventionModes` - Defines the allowed set of STP modes for order placement on that symbol. + +For example, if a symbol has the following configuration: + +``` +{ "defaultSelfTradePreventionMode": "NONE", "allowedSelfTradePreventionModes": ["NONE", "EXPIRE_TAKER", "EXPIRE_BOTH"]} +``` + +Then that means if a user sends an order with no `selfTradePreventionMode` provided, then the order sent will have the value of `NONE`. + +If a user wants to explicitly specify the mode they can pass the enum `NONE`, `EXPIRE_TAKER`, or `EXPIRE_BOTH`. + +If a user tries to specify `EXPIRE_MAKER` for orders on this symbol, they will receive an error: + +``` +{ "code": -1013, "msg": "This symbol does not allow the specified self-trade prevention mode."} +``` + +### How do I know if an order expired due to STP?[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/stp_faq) + +The order will have the status `EXPIRED_IN_MATCH`. + +### STP Examples[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/stp_faq) + +For all these cases, assume that all orders for these examples are made on the same account. + +**Scenario A- A user sends a new order with selfTradePreventionMode:`NONE` that will match with another order of theirs that is already on the book.** + +``` +Maker Order: symbol=BTCUSDT side=BUY type=LIMIT quantity=1 price=1 selfTradePreventionMode=NONETaker Order: symbol=BTCUSDT side=SELL type=LIMIT quantity=1 price=1 selfTradePreventionMode=NONE +``` + +**Result**: No STP is triggered and the orders will match. + +Order Status of the Maker Order + +``` +{ "symbol": "BTCUSDT", "orderId": 2, "orderListId": -1, "clientOrderId": "FaDk4LPRxastaICEFE9YTf", "price": "1.000000", "origQty": "1.000000", "executedQty": "1.000000", "cummulativeQuoteQty": "1.000000", "status": "FILLED", "timeInForce": "GTC", "type": "LIMIT", "side": "BUY", "stopPrice": "0.000000", "icebergQty": "0.000000", "time": 1670217090310, "updateTime": 1670217090330, "isWorking": true, "workingTime": 1670217090310, "origQuoteOrderQty": "0.000000", "selfTradePreventionMode": "NONE"} +``` + +Order Status of the Taker Order + +``` +{ "symbol": "BTCUSDT", "orderId": 3, "orderListId": -1, "clientOrderId": "Ay48Vtpghnsvy6w8RPQEde", "transactTime": 1670207731263, "price": "1.000000", "origQty": "1.000000", "executedQty": "1.000000", "cummulativeQuoteQty": "1.000000", "status": "FILLED", "timeInForce": "GTC", "type": "LIMIT", "side": "SELL", "workingTime": 1670207731263, "fills": [ { "price": "1.000000", "qty": "1.000000", "commission": "0.000000", "commissionAsset": "USDT", "tradeId": 1 } ], "selfTradePreventionMode": "NONE"} +``` + +**Scenario B- A user sends an order with `EXPIRE_MAKER` that would match with their orders that are already on the book.** + +``` +Maker Order 1: symbol=BTCUSDT side=BUY type=LIMIT quantity=1.2 price=1.2 selfTradePreventionMode=NONEMaker Order 2: symbol=BTCUSDT side=BUY type=LIMIT quantity=1.3 price=1.1 selfTradePreventionMode=NONEMaker Order 3: symbol=BTCUSDT side=BUY type=LIMIT quantity=8.1 price=1 selfTradePreventionMode=NONETaker Order 1: symbol=BTCUSDT side=SELL type=LIMIT quantity=3 price=1 selfTradePreventionMode=EXPIRE_MAKER +``` + +**Result**: The orders that were on the book will expire due to STP, and the taker order will go on the book. + +Maker Order 1 + +``` +{ "symbol": "BTCUSDT", "orderId": 2, "orderListId": -1, "clientOrderId": "wpNzhSclc16pV8g5THIOR3", "price": "1.200000", "origQty": "1.200000", "executedQty": "0.000000", "cummulativeQuoteQty": "0.000000", "status": "EXPIRED_IN_MATCH", "timeInForce": "GTC", "type": "LIMIT", "side": "BUY", "stopPrice": "0.000000", "icebergQty": "0.000000", "time": 1670217957437, "updateTime": 1670217957498, "isWorking": true, "workingTime": 1670217957437, "origQuoteOrderQty": "0.000000", "selfTradePreventionMode": "NONE", "preventedMatchId": 0, "preventedQuantity": "1.200000"} +``` + +Maker Order 2 + +``` +{ "symbol": "BTCUSDT", "orderId": 3, "orderListId": -1, "clientOrderId": "ZT9emqia99V7x8B6FW0pFF", "price": "1.100000", "origQty": "1.300000", "executedQty": "0.000000", "cummulativeQuoteQty": "0.000000", "status": "EXPIRED_IN_MATCH", "timeInForce": "GTC", "type": "LIMIT", "side": "BUY", "stopPrice": "0.000000", "icebergQty": "0.000000", "time": 1670217957458, "updateTime": 1670217957498, "isWorking": true, "workingTime": 1670217957458, "origQuoteOrderQty": "0.000000", "selfTradePreventionMode": "NONE", "preventedMatchId": 1, "preventedQuantity": "1.300000"} +``` + +Maker Order 3 + +``` +{ "symbol": "BTCUSDT", "orderId": 4, "orderListId": -1, "clientOrderId": "8QZ3taGcU4gND59TxHAcR0", "price": "1.000000", "origQty": "8.100000", "executedQty": "0.000000", "cummulativeQuoteQty": "0.000000", "status": "EXPIRED_IN_MATCH", "timeInForce": "GTC", "type": "LIMIT", "side": "BUY", "stopPrice": "0.000000", "icebergQty": "0.000000", "time": 1670217957478, "updateTime": 1670217957498, "isWorking": true, "workingTime": 1670217957478, "origQuoteOrderQty": "0.000000", "selfTradePreventionMode": "NONE", "preventedMatchId": 2, "preventedQuantity": "8.100000"} +``` + +Output of the Taker Order + +``` +{ "symbol": "BTCUSDT", "orderId": 5, "orderListId": -1, "clientOrderId": "WRzbhp257NhZsIJW4y2Nri", "transactTime": 1670217957498, "price": "1.000000", "origQty": "3.000000", "executedQty": "0.000000", "cummulativeQuoteQty": "0.000000", "status": "NEW", "timeInForce": "GTC", "type": "LIMIT", "side": "SELL", "workingTime": 1670217957498, "fills": [], "preventedMatches": [ { "preventedMatchId": 0, "makerOrderId": 2, "price": "1.200000", "makerPreventedQuantity": "1.200000" }, { "preventedMatchId": 1, "makerOrderId": 3, "price": "1.100000", "makerPreventedQuantity": "1.300000" }, { "preventedMatchId": 2, "makerOrderId": 4, "price": "1.000000", "makerPreventedQuantity": "8.100000" } ], "selfTradePreventionMode": "EXPIRE_MAKER"} +``` + +**Scenario C - A user sends an order with `EXPIRE_TAKER` that would match with their orders already on the book.** + +``` +Maker Order 1: symbol=BTCUSDT side=BUY type=LIMIT quantity=1.2 price=1.2 selfTradePreventionMode=NONEMaker Order 2: symbol=BTCUSDT side=BUY type=LIMIT quantity=1.3 price=1.1 selfTradePreventionMode=NONEMaker Order 3: symbol=BTCUSDT side=BUY type=LIMIT quantity=8.1 price=1 selfTradePreventionMode=NONETaker Order 1: symbol=BTCUSDT side=SELL type=LIMIT quantity=3 price=1 selfTradePreventionMode=EXPIRE_TAKER +``` + +**Result**: The orders already on the book will remain, while the taker order will expire. + +Maker Order 1 + +``` +{ "symbol": "BTCUSDT", "orderId": 2, "orderListId": -1, "clientOrderId": "NpwW2t0L4AGQnCDeNjHIga", "price": "1.200000", "origQty": "1.200000", "executedQty": "0.000000", "cummulativeQuoteQty": "0.000000", "status": "NEW", "timeInForce": "GTC", "type": "LIMIT", "side": "BUY", "stopPrice": "0.000000", "icebergQty": "0.000000", "time": 1670219811986, "updateTime": 1670219811986, "isWorking": true, "workingTime": 1670219811986, "origQuoteOrderQty": "0.000000", "selfTradePreventionMode": "NONE"} +``` + +Maker Order 2 + +``` +{ "symbol": "BTCUSDT", "orderId": 3, "orderListId": -1, "clientOrderId": "TSAmJqGWk4YTB2yA9p04UO", "price": "1.100000", "origQty": "1.300000", "executedQty": "0.000000", "cummulativeQuoteQty": "0.000000", "status": "NEW", "timeInForce": "GTC", "type": "LIMIT", "side": "BUY", "stopPrice": "0.000000", "icebergQty": "0.000000", "time": 1670219812007, "updateTime": 1670219812007, "isWorking": true, "workingTime": 1670219812007, "origQuoteOrderQty": "0.000000", "selfTradePreventionMode": "NONE"} +``` + +Maker Order 3 + +``` +{ "symbol": "BTCUSDT", "orderId": 4, "orderListId": -1, "clientOrderId": "L6FmpCJJP6q4hCNv4MuZDG", "price": "1.000000", "origQty": "8.100000", "executedQty": "0.000000", "cummulativeQuoteQty": "0.000000", "status": "NEW", "timeInForce": "GTC", "type": "LIMIT", "side": "BUY", "stopPrice": "0.000000", "icebergQty": "0.000000", "time": 1670219812026, "updateTime": 1670219812026, "isWorking": true, "workingTime": 1670219812026, "origQuoteOrderQty": "0.000000", "selfTradePreventionMode": "NONE"} +``` + +Output of the Taker order + +``` +{ "symbol": "BTCUSDT", "orderId": 5, "orderListId": -1, "clientOrderId": "kocvDAi4GNN2y1l1Ojg1Ri", "price": "1.000000", "origQty": "3.000000", "executedQty": "0.000000", "cummulativeQuoteQty": "0.000000", "status": "EXPIRED_IN_MATCH", "timeInForce": "GTC", "type": "LIMIT", "side": "SELL", "stopPrice": "0.000000", "icebergQty": "0.000000", "time": 1670219812046, "updateTime": 1670219812046, "isWorking": true, "workingTime": 1670219812046, "origQuoteOrderQty": "0.000000", "selfTradePreventionMode": "EXPIRE_TAKER", "preventedMatchId": 0, "preventedQuantity": "3.000000"} +``` + +**Scenario D- A user has an order on the book, and then sends an order with `EXPIRE_BOTH` that would match with the existing order.** + +``` +Maker Order: symbol=BTCUSDT side=BUY type=LIMIT quantity=1 price=1 selfTradePreventionMode=NONETaker Order: symbol=BTCUSDT side=SELL type=LIMIT quantity=3 price=1 selfTradePreventionMode=EXPIRE_BOTH +``` + +**Result:** Both orders will expire. + +Maker Order + +``` +{ "symbol": "BTCUSDT", "orderId": 2, "orderListId": -1, "clientOrderId": "2JPC8xjpLq6Q0665uYWAcs", "price": "1.000000", "origQty": "1.000000", "executedQty": "0.000000", "cummulativeQuoteQty": "0.000000", "status": "EXPIRED_IN_MATCH", "timeInForce": "GTC", "type": "LIMIT", "side": "BUY", "stopPrice": "0.000000", "icebergQty": "0.000000", "time": 1673842412831, "updateTime": 1673842413170, "isWorking": true, "workingTime": 1673842412831, "origQuoteOrderQty": "0.000000", "selfTradePreventionMode": "NONE", "preventedMatchId": 0, "preventedQuantity": "1.000000"} +``` + +Taker Order + +``` +{ "symbol": "BTCUSDT", "orderId": 5, "orderListId": -1, "clientOrderId": "qMaz8yrOXk2iUIz74cFkiZ", "transactTime": 1673842413170, "price": "1.000000", "origQty": "3.000000", "executedQty": "0.000000", "cummulativeQuoteQty": "0.000000", "status": "EXPIRED_IN_MATCH", "timeInForce": "GTC", "type": "LIMIT", "side": "SELL", "workingTime": 1673842413170, "fills": [], "preventedMatches": [ { "preventedMatchId": 0, "makerOrderId": 2, "price": "1.000000", "takerPreventedQuantity": "3.000000", "makerPreventedQuantity": "1.000000" } ], "selfTradePreventionMode": "EXPIRE_BOTH", "tradeGroupId": 1, "preventedQuantity": "3.000000"} +``` + +**Scenario E - A user has an order on the book with `EXPIRE_MAKER`, and then sends a new order with `EXPIRE_TAKER` which would match with the existing order.** + +``` +Maker Order: symbol=BTCUSDT side=BUY type=LIMIT quantity=1 price=1 selfTradePreventionMode=EXPIRE_MAKERTaker Order: symbol=BTCUSDT side=SELL type=LIMIT quantity=1 price=1 selfTradePreventionMode=EXPIRE_TAKER +``` + +**Result**: The taker order's STP mode will be used, so the taker order will be expired. + +Maker Order + +``` +{ "symbol": "BTCUSDT", "orderId": 0, "orderListId": -1, "clientOrderId": "jFUap8iFwwgqIpOfAL60GS", "price": "1.000000", "origQty": "1.000000", "executedQty": "0.000000", "cummulativeQuoteQty": "0.000000", "status": "NEW", "timeInForce": "GTC", "type": "LIMIT", "side": "BUY", "stopPrice": "0.000000", "icebergQty": "0.000000", "time": 1670220769261, "updateTime": 1670220769261, "isWorking": true, "workingTime": 1670220769261, "origQuoteOrderQty": "0.000000", "selfTradePreventionMode": "EXPIRE_MAKER"} +``` + +Taker Order + +``` +{ "symbol": "BTCUSDT", "orderId": 1, "orderListId": -1, "clientOrderId": "zxrvnNNm1RXC3rkPLUPrc1", "transactTime": 1670220800315, "price": "1.000000", "origQty": "1.000000", "executedQty": "0.000000", "cummulativeQuoteQty": "0.000000", "status": "EXPIRED_IN_MATCH", "timeInForce": "GTC", "type": "LIMIT", "side": "SELL", "workingTime": 1670220800315, "fills": [], "preventedMatches": [ { "preventedMatchId": 0, "makerOrderId": 0, "price": "1.000000", "takerPreventedQuantity": "1.000000" } ], "selfTradePreventionMode": "EXPIRE_TAKER", "preventedQuantity": "1.000000"} +``` + +**Scenario F - A user sends a market order with `EXPIRE_MAKER` which would match with an existing order.** + +``` +Maker Order: symbol=BTCUSDT side=BUY type=LIMIT quantity=1 price=1 selfTradePreventionMode=NONETaker Order: symbol=BTCUSDT side=SELL type=MARKET quantity=1 selfTradePreventionMode=EXPIRE_MAKER +``` + +**Result**: The existing order expires with the status `EXPIRED_IN_MATCH`, due to STP. The new order also expires but with status `EXPIRED`, due to low liquidity on the order book. + +Maker Order + +``` +{ "symbol": "BTCUSDT", "orderId": 2, "orderListId": -1, "clientOrderId": "7sgrQQInL69XDMQpiqMaG2", "price": "1.000000", "origQty": "1.000000", "executedQty": "0.000000", "cummulativeQuoteQty": "0.000000", "status": "EXPIRED_IN_MATCH", "timeInForce": "GTC", "type": "LIMIT", "side": "BUY", "stopPrice": "0.000000", "icebergQty": "0.000000", "time": 1670222557456, "updateTime": 1670222557478, "isWorking": true, "workingTime": 1670222557456, "origQuoteOrderQty": "0.000000", "selfTradePreventionMode": "NONE", "preventedMatchId": 0, "preventedQuantity": "1.000000"} +``` + +Taker Order + +``` +{ "symbol": "BTCUSDT", "orderId": 3, "orderListId": -1, "clientOrderId": "zqhsgGDEcdhxy2oza2Ljxd", "transactTime": 1670222557478, "price": "0.000000", "origQty": "1.000000", "executedQty": "0.000000", "cummulativeQuoteQty": "0.000000", "status": "EXPIRED", "timeInForce": "GTC", "type": "MARKET", "side": "SELL", "workingTime": 1670222557478, "fills": [], "preventedMatches": [ { "preventedMatchId": 0, "makerOrderId": 2, "price": "1.000000", "makerPreventedQuantity": "1.000000" } ], "selfTradePreventionMode": "EXPIRE_MAKER"} +``` + +**Scenario G- A user sends a limit order with `DECREMENT` which would match with an existing order.** + +``` +Maker Order: symbol=BTCUSDT side=BUY type=LIMIT quantity=6 price=2 selfTradePreventionMode=NONETaker Order: symbol=BTCUSDT side=SELL type=LIMIT quantity=2 price=2 selfTradePreventionMode=DECREMENT +``` + +**Result**: Both orders have a preventedQuantity of 2. Since this is the taker order’s full quantity, it expires due to STP. + +Maker Order + +``` +{ "symbol": "BTCUSDT", "orderId": 23, "orderListId": -1, "clientOrderId": "Kxb4RpsBhfQrkK2r2YO2Z9", "price": "2.00000000", "origQty": "6.00000000", "executedQty": "0.00000000", "cummulativeQuoteQty": "0.00000000", "status": "NEW", "timeInForce": "GTC", "type": "LIMIT", "side": "BUY", "stopPrice": "0.00000000", "icebergQty": "0.00000000", "time": 1741682807892, "updateTime": 1741682816376, "isWorking": true, "workingTime": 1741682807892, "origQuoteOrderQty": "0.00000000", "selfTradePreventionMode": "DECREMENT", "preventedMatchId": 4, "preventedQuantity": "2.00000000"} +``` + +Taker Order + +``` +{ "symbol": "BTCUSDT", "orderId": 24, "orderListId": -1, "clientOrderId": "dwf3qOzD7GM9ysDn9XG9AS", "price": "2.00000000", "origQty": "2.00000000", "executedQty": "0.00000000", "cummulativeQuoteQty": "0.00000000", "status": "EXPIRED_IN_MATCH", "timeInForce": "GTC", "type": "LIMIT", "side": "SELL", "stopPrice": "0.00000000", "icebergQty": "0.00000000", "time": 1741682816376, "updateTime": 1741682816376, "isWorking": true, "workingTime": 1741682816376, "origQuoteOrderQty": "0.00000000", "selfTradePreventionMode": "DECREMENT", "preventedMatchId": 4, "preventedQuantity": "2.00000000"} +``` + +**Scenario H- A user sends a limit order with `TRANSFER` which would match with an existing order under the same tradeGroupId.** + +Balances before order placement + +Maker's Balances + +``` +{ "balances": [ { "asset": "BTC", "free": "20000.00000000", "locked": "0.00000000" }, { "asset": "USDT", "free": "20000.00000000", "locked": "0.00000000" } ]} +``` + +Taker's Balances + +``` +{ "balances": [ { "asset": "BTC", "free": "20000.00000000", "locked": "0.00000000" }, { "asset": "USDT", "free": "20000.00000000", "locked": "0.00000000" } ]} +``` + +``` +Maker Order: symbol=BTCUSDT side=BUY type=LIMIT quantity=0.6 price=0.2 selfTradePreventionMode=TRANSFER tradeGroupId=1Taker Order: symbol=BTCUSDT side=SELL type=LIMIT quantity=0.2 price=0.2 selfTradePreventionMode=TRANSFER tradeGroupId=1 +``` + +**Result:** Both orders have a preventedQuantity of 0.2. Since this is the taker’s full quantity, it expires due to STP. + +Maker Order + +``` +{ "symbol": "BTCUSDT", "orderId": 12, "orderListId": -1, "clientOrderId": "zEyu9HGqiT5YUaXXhKr1MR", "price": "0.20000000", "origQty": "0.60000000", "executedQty": "0.00000000", "cummulativeQuoteQty": "0.00000000", "status": "NEW", "timeInForce": "GTC", "type": "LIMIT", "side": "BUY", "stopPrice": "0.00000000", "icebergQty": "0.00000000", "time": 1762852466582, "updateTime": 1762852522145, "isWorking": true, "workingTime": 1762852466582, "origQuoteOrderQty": "0.00000000", "selfTradePreventionMode": "TRANSFER", "preventedMatchId": 3, "preventedQuantity": "0.20000000"} +``` + +Taker Order + +``` +{ "symbol": "BTCUSDT", "orderId": 13, "orderListId": -1, "clientOrderId": "6T06cph3Et2yFNnGpHdejh", "transactTime": 1762852522145, "price": "0.20000000", "origQty": "0.20000000", "executedQty": "0.00000000", "origQuoteOrderQty": "0.00000000", "cummulativeQuoteQty": "0.00000000", "status": "EXPIRED_IN_MATCH", "timeInForce": "GTC", "type": "LIMIT", "side": "SELL", "workingTime": 1762852522145, "fills": [], "preventedMatches": [ { "preventedMatchId": 3, "makerSymbol": "BTCUSDT", "makerOrderId": 12, "price": "0.20000000", "takerPreventedQuantity": "0.20000000", "makerPreventedQuantity": "0.20000000" } ], "selfTradePreventionMode": "TRANSFER", "tradeGroupId": 1, "preventedQuantity": "0.20000000"} +``` + +Balances after self-trade prevention: + +Maker Balances + +``` +{ "balances": [ { "asset": "BTC", "free": "20000.20000000", "locked": "0.00000000" }, { "asset": "USDT", "free": "19999.88000000", "locked": "0.08000000" } ]} +``` + +Taker's Balances + +``` +{ "balances": [ { "asset": "BTC", "free": "19999.80000000", "locked": "0.00000000" }, { "asset": "USDT", "free": "20000.04000000", "locked": "0.00000000" } ]} +``` + +- [What is Self Trade Prevention?](https://developers.binance.com/docs/binance-spot-api-docs/faqs/stp_faq) +- [What defines a self-trade?](https://developers.binance.com/docs/binance-spot-api-docs/faqs/stp_faq) +- [What happens when STP is triggered?](https://developers.binance.com/docs/binance-spot-api-docs/faqs/stp_faq) +- [What is a Trade Group Id?](https://developers.binance.com/docs/binance-spot-api-docs/faqs/stp_faq) +- [What is a Prevented Match?](https://developers.binance.com/docs/binance-spot-api-docs/faqs/stp_faq) +- [What is "prevented quantity?"](https://developers.binance.com/docs/binance-spot-api-docs/faqs/stp_faq) +- [How do I know which symbol uses STP?](https://developers.binance.com/docs/binance-spot-api-docs/faqs/stp_faq) +- [How do I know if an order expired due to STP?](https://developers.binance.com/docs/binance-spot-api-docs/faqs/stp_faq) +- [STP Examples](https://developers.binance.com/docs/binance-spot-api-docs/faqs/stp_faq) diff --git a/docs/binance/binance-spot/faqs_trailing-stop-faq.md b/docs/binance/binance-spot/faqs_trailing-stop-faq.md new file mode 100644 index 0000000..5db2502 --- /dev/null +++ b/docs/binance/binance-spot/faqs_trailing-stop-faq.md @@ -0,0 +1,275 @@ +--- +title: "Trailing Stop FAQ | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs/faqs/trailing-stop-faq" +fetched_at: "2026-02-26T10:38:08.171Z" +--- +# Spot Trailing Stop order FAQ + +### What is a trailing stop order?[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/trailing-stop-faq) + +Trailing stop is a type of contingent order with a dynamic trigger price influenced by price changes in the market. For the SPOT API, the change required to trigger order entry is specified in the `trailingDelta` parameter, and is defined in BIPS. + +Intuitively, trailing stop orders allow unlimited price movement in a direction that is beneficial for the order, and limited movement in a detrimental direction. + +Buy orders: _low_ prices are good. Unlimited price _decreases_ are allowed but the order will trigger after a price _increase_ of the supplied delta, relative to the _lowest_ trade price since submission. + +Sell orders: _high_ prices are good. Unlimited price _increases_ are allowed but the order will trigger after a price _decrease_ of the supplied delta, relative to the _highest_ trade price since submission. + +### What are BIPs?[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/trailing-stop-faq) + +Basis Points, also known as BIP or BIPS, are used to indicate a percentage change. + +BIPS conversion reference: + +BIPS + +Percentage + +Multiplier + +1 + +0.01% + +0.0001 + +10 + +0.1% + +0.001 + +100 + +1% + +0.01 + +1000 + +10% + +0.1 + +For example, a `STOP_LOSS` `SELL` order with a `trailingDelta` of 100 is a trailing stop order which will be triggered after a price decrease of 1% from the highest price after placing the order. + +### What order types can be trailing stop orders?[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/trailing-stop-faq) + +Trailing stop orders are supported for contingent orders such as `STOP_LOSS`, `STOP_LOSS_LIMIT`, `TAKE_PROFIT`, and `TAKE_PROFIT_LIMIT`. + +OCO orders also support trailing stop orders in the contingent leg. In this scenario if the trailing stop condition is triggered, the limit leg of the OCO order will be canceled. + +### How do I place a trailing stop order?[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/trailing-stop-faq) + +Trailing stop orders are entered the same way as regular `STOP_LOSS`, `STOP_LOSS_LIMIT`, `TAKE_PROFIT`, or `TAKE_PROFIT_LIMIT` orders, but with an additional `trailingDelta` parameter. This parameter must be within the range of the `TRAILING_DELTA` filter for that symbol. + +Unlike regular contingent orders, the `stopPrice` parameter is optional for trailing stop orders. If it is provided then the order will only start tracking price changes after the `stopPrice` condition is met. If the `stopPrice` parameter is omitted then the order starts tracking price changes from the next trade. + +### What kind of price changes will trigger my trailing stop order?[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/trailing-stop-faq) + +Trailing order type + +Side + +Stop price condition + +Market price movement required to trigger + +`TAKE_PROFIT` + +SELL + +market price >= stop price + +_decrease_ from maximum + +`TAKE_PROFIT_LIMIT` + +SELL + +market price >= stop price + +_decrease_ from maximum + +`STOP_LOSS` + +SELL + +market price <= stop price + +_decrease_ from maximum + +`STOP_LOSS_LIMIT` + +SELL + +market price <= stop price + +_decrease_ from maximum + +`STOP_LOSS` + +BUY + +market price >= stop price + +_increase_ from minimum + +`STOP_LOSS_LIMIT` + +BUY + +market price >= stop price + +_increase_ from minimum + +`TAKE_PROFIT` + +BUY + +market price <= stop price + +_increase_ from minimum + +`TAKE_PROFIT_LIMIT` + +BUY + +market price <= stop price + +_increase_ from minimum + +### How do I pass the `TRAILING_DELTA` filter?[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/trailing-stop-faq) + +For `STOP_LOSS` `BUY`, `STOP_LOSS_LIMIT` `BUY`, `TAKE_PROFIT` `SELL`, and `TAKE_PROFIT_LIMIT` `SELL` orders: + +- `trailingDelta` >= `minTrailingAboveDelta` +- `trailingDelta` <= `maxTrailingAboveDelta` + +For `STOP_LOSS` `SELL`, `STOP_LOSS_LIMIT` `SELL`, `TAKE_PROFIT` `BUY`, and `TAKE_PROFIT_LIMIT` `BUY` orders: + +- `trailingDelta` >= `minTrailingBelowDelta` +- `trailingDelta` <= `maxTrailingBelowDelta` + +### Trailing Stop Order Scenarios[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/trailing-stop-faq) + +#### Scenario A - Trailing Stop Loss Limit Buy Order[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/trailing-stop-faq) + +At `12:01:00` there is a trade at a price of 40,000 and a `STOP_LOSS_LIMIT` order is placed on the `BUY` side of the exchange. The order has of a `stopPrice` of 44,000, a `trailingDelta` of 500 (5%), and a limit `price` of 45,000. + +Between `12:01:00` and `12:02:00` a series of linear trades lead to a decrease in last price, ending at 37,000. This is a price decrease of 7.5% or 750 BIPS, well exceeding the order's `trailingDelta`. However since the order has not started price tracking, the price movement is ignored and the order remains contingent. + +Between `12:02:00` and `12:03:00` a series of linear trades lead to an increase in last price. When a trade is equal to, or surpasses, the `stopPrice` the order starts tracking price changes immediately; the first trade that meets this condition sets the "lowest price". In this case, the lowest price is 44,000 and if there is a 500 BIPS increase from 44,000 then the order will trigger. The series of linear trades continue to increase the last price, ending at 45,000. + +Between `12:03:00` and `12:04:00` a series of linear trades lead to an increase in last price, ending at 46,000. This is an increase of ~454 BIPS from the order's previously noted lowest price, but it's not large enough to trigger the order. + +Between `12:04:00` and `12:05:00` a series of linear trades lead to a decrease in last price, ending at 42,000. This is a decrease from the order's previously noted lowest price. If there is a 500 BIPS increase from 42,000 then the order will trigger. + +Between `12:05:00` and `12:05:30` a series of linear trades lead to an increase in last price to 44,100. This trade is equal to, or surpasses, the order's requirement of 500 BIPS, as `44,100 = 42,000 * 1.05`. This causes the order to trigger and start working against the order book at its limit price of 45,000. + +![image](https://user-images.githubusercontent.com/17701918/167370103-ab3b4c05-1e13-4a25-b99a-42f9e4d6adc8.png) + +#### Scenario B - Trailing Stop Loss Limit Sell Order[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/trailing-stop-faq) + +At `12:01:00` there is a trade at a price of 40,000 and a `STOP_LOSS_LIMIT` order is placed on the `SELL` side of the exchange. The order has of a `stopPrice` of 39,000, a `trailingDelta` of 1000 (10%), and a limit `price` of 38,000. + +Between `12:01:00` and `12:02:00` a series of linear trades lead to an increase in last price, ending at 41,500. + +Between `12:02:00` and `12:03:00` a series of linear trades lead to a decrease in last price. When a trade is equal to, or surpasses, the `stopPrice` the order starts tracking price changes immediately; the first trade that meets this condition sets the "highest price". In this case, the highest price is 39,000 and if there is a 1000 BIPS decrease from 39,000 then the order will trigger. + +Between `12:03:00` and `12:04:00` a series of linear trades lead to a decrease in last price, ending at 37,000. This is a decrease of ~512 BIPS from the order's previously noted highest price, but it's not large enough to trigger the order. + +Between `12:04:00` and `12:05:00` a series of linear trades lead to an increase in last price, ending at 41,000. This is an increase from the order's previously noted highest price. If there is a 1000 BIPS decrease from 41,000 then the order will trigger. + +Between `12:05:00` and `12:05:30` a series of linear trades lead to a decrease in last price to 36,900. This trade is equal to, or surpasses, the order's requirement of 1000 BIPS, as `36,900 = 41,000 * 0.90`. This causes the order to trigger and start working against the order book at its limit price of 38,000. + +![image](https://user-images.githubusercontent.com/17701918/167370383-eb813cc1-d9b8-4a94-896c-a1a29551e09d.png) + +#### Scenario C - Trailing Take Profit Limit Buy Order[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/trailing-stop-faq) + +At `12:01:00` there is a trade at a price of 40,000 and a `TAKE_PROFIT_LIMIT` order is placed on the `BUY` side of the exchange. The order has of a `stopPrice` of 38,000, a `trailingDelta` of 850 (8.5%), and a limit `price` of 38,500. + +Between `12:01:00` and `12:02:00` a series of linear trades lead to an increase in last price, ending at 42,000. + +Between `12:02:00` and `12:03:00` a series of linear trades lead to a decrease in last price. When a trade is equal to, or surpasses, the `stopPrice` the order starts tracking price changes immediately; the first trade that meets this condition sets the "lowest price". In this case, the lowest price is 38,000 and if there is a 850 BIPS increase from 38,000 then the order will trigger. + +The series of linear trades continues to decrease the last price, ending at 37,000. If there is a 850 BIPS increase from 37,000 then the order will trigger. + +Between `12:03:00` and `12:04:00` a series of linear trades lead to an increase in last price, ending at 39,000. This is an increase of ~540 BIPS from the order's previously noted lowest price, but it's not large enough to trigger the order. + +Between `12:04:00` and `12:05:00` a series of linear trades lead to a decrease in last price, ending at 38,000. It does not surpass the order's previously noted lowest price, resulting in no change to the order's trigger price. + +Between `12:05:00` and `12:05:30` a series of linear trades lead to an increase in last price to 40,145. This trade is equal to, or surpasses, the order's requirement of 850 BIPS, as `40,145 = 37,000 * 1.085`. This causes the order to trigger and start working against the order book at its limit price of 38,500. + +![image](https://user-images.githubusercontent.com/17701918/167370339-f1b83c76-790b-4108-8c9a-db2d89a4850f.png) + +#### Scenario D - Trailing Take Profit Limit Sell Order[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/trailing-stop-faq) + +At `12:01:00` there is a trade at a price of 40,000 and a `TAKE_PROFIT_LIMIT` order is placed on the `SELL` side of the exchange. The order has of a `stopPrice` of 42,000, a `trailingDelta` of 750 (7.5%), and a limit `price` of 41,000. + +Between `12:01:00` and `12:02:00` a series of linear trades lead to an increase in last price, ending at 41,500. + +Between `12:02:00` and `12:03:00` a series of linear trades lead to a decrease in last price, ending at 39,000. + +Between `12:03:00` and `12:04:00` a series of linear trades lead to an increase in last price. When a trade is equal to, or surpasses, the `stopPrice` the order starts tracking price changes immediately; the first trade that meets this condition sets the "highest price". In this case, the highest price is 42,000 and if there is a 750 BIPS decrease from 42,000 then the order will trigger. + +The series of linear trades continues to increase the last price, ending at 45,000. If there is a 750 BIPS decrease from 45,000 then the order will trigger. + +Between `12:04:00` and `12:05:00` a series of linear trades lead to a decrease in last price, ending at 44,000. This is a decrease of ~222 BIPS from the order's previously noted highest price, but it's not large enough to trigger the order. + +Between `12:05:00` and `12:06:00` a series of linear trades lead to an increase in last price, ending at 46,500. This is an increase from the order's previously noted highest price. If there is a 750 BIPS decrease from 46,500 then the order will trigger. + +Between `12:06:00` and `12:06:50` a series of linear trades lead to a decrease in last price to 43,012.5. This trade is equal to, or surpasses, the order's requirement of 750 BIPS, as `43,012.5 = 46,500 * 0.925`. This causes the order to trigger and start working against the order book at its limit price of 41,000. + +![image](https://user-images.githubusercontent.com/17701918/167370298-172b227a-198d-46ee-a385-5cc267dc253b.png) + +#### Scenario E - Trailing Stop Order Without A Stop Price[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/trailing-stop-faq) + +At `12:01:00` there is a trade at a price of 40,000 and a `STOP_LOSS_LIMIT` order is placed on the `SELL` side of the exchange. The order has a `trailingDelta` of 700 (7%), a limit `price` of 39,000 and no `stopPrice`. The order starts tracking price changes once placed. If there is a 700 BIPS decrease from 40,000 then the order will trigger. + +Between `12:01:00` and `12:02:00` a series of linear trades lead to an increase in last price, ending at 42,000. This is an increase from the order's previously noted highest price. If there is a 700 BIPS decrease from 42,000 then the order will trigger. + +Between `12:02:00` and `12:03:00` a series of linear trades lead to a decrease in last price, ending at 39,500. This is a decrease of ~595 BIPS from the order's previously noted highest price, but it's not large enough to trigger the order. + +Between `12:03:00` and `12:04:00` a series of linear trades lead to an increase in last price, ending at 45,500. This is an increase from the order's previously noted highest price. If there is a 700 BIPS decrease from 45,500 then the order will trigger. + +Between `12:04:00` and `12:04:45` a series of linear trades lead to a decrease in last price to 42,315. This trade is equal to, or surpasses, the order's requirement of 700 BIPS, as `42,315 = 45,500 * 0.93`. This causes the order to trigger and start working against the order book at its limit price of 39,000. + +![image](https://user-images.githubusercontent.com/17701918/167370616-17d3295a-3e7c-4314-aa13-ad44e685a311.png) + +### Trailing Stop Order Examples[​](https://developers.binance.com/docs/binance-spot-api-docs/faqs/trailing-stop-faq) + +Assuming a last price of 40,000. + +Placing a trailing stop `STOP_LOSS_LIMIT BUY` order, with a price of 42,000.0 and a trailing stop of 5%. + +``` +# Excluding stop pricePOST 'https://api.binance.com/api/v3/order?symbol=BTCUSDT&side=BUY&type=STOP_LOSS_LIMIT&timeInForce=GTC&quantity=0.01&price=42000&trailingDelta=500×tamp=&signature='# Including stop price of 43,000POST 'https://api.binance.com/api/v3/order?symbol=BTCUSDT&side=BUY&type=STOP_LOSS_LIMIT&timeInForce=GTC&quantity=0.01&price=42000&stopPrice=43000&trailingDelta=500×tamp=&signature=' +``` + +Placing a trailing stop `STOP_LOSS_LIMIT SELL` order, with a price of 37,500.0 and a trailing stop of 2.5%. + +``` +# Excluding stop pricePOST 'https://api.binance.com/api/v3/order?symbol=BTCUSDT&side=SELL&type=STOP_LOSS_LIMIT&timeInForce=GTC&quantity=0.01&price=37500&trailingDelta=250×tamp=&signature='# Including stop price of 39,000POST 'https://api.binance.com/api/v3/order?symbol=BTCUSDT&side=SELL&type=STOP_LOSS_LIMIT&timeInForce=GTC&quantity=0.01&price=37500&stopPrice=39000&trailingDelta=250×tamp=&signature=' +``` + +Placing a trailing stop `TAKE_PROFIT_LIMIT BUY` order, with a price of 38,000.0 and a trailing stop of 5%. + +``` +# Excluding stop pricePOST 'https://api.binance.com/api/v3/order?symbol=BTCUSDT&side=BUY&type=TAKE_PROFIT_LIMIT&timeInForce=GTC&quantity=0.01&price=38000&trailingDelta=500×tamp=&signature='# Including stop price of 36,000POST 'https://api.binance.com/api/v3/order?symbol=BTCUSDT&side=BUY&type=TAKE_PROFIT_LIMIT&timeInForce=GTC&quantity=0.01&price=38000&stopPrice=36000&trailingDelta=500×tamp=&signature=' +``` + +Placing a trailing stop `TAKE_PROFIT_LIMIT SELL` order, with a price of 41,500.0 and a trailing stop of 1.75%. + +``` +# Excluding stop pricePOST 'https://api.binance.com/api/v3/order?symbol=BTCUSDT&side=SELL&type=TAKE_PROFIT_LIMIT&timeInForce=GTC&quantity=0.01&price=41500&trailingDelta=175×tamp=&signature='# Including stop price of 42,500POST 'https://api.binance.com/api/v3/order?symbol=BTCUSDT&side=SELL&type=TAKE_PROFIT_LIMIT&timeInForce=GTC&quantity=0.01&price=41500&stopPrice=42500&trailingDelta=175×tamp=&signature=' +``` + +- [What is a trailing stop order?](https://developers.binance.com/docs/binance-spot-api-docs/faqs/trailing-stop-faq) +- [What are BIPs?](https://developers.binance.com/docs/binance-spot-api-docs/faqs/trailing-stop-faq) +- [What order types can be trailing stop orders?](https://developers.binance.com/docs/binance-spot-api-docs/faqs/trailing-stop-faq) +- [How do I place a trailing stop order?](https://developers.binance.com/docs/binance-spot-api-docs/faqs/trailing-stop-faq) +- [What kind of price changes will trigger my trailing stop order?](https://developers.binance.com/docs/binance-spot-api-docs/faqs/trailing-stop-faq) +- [How do I pass the `TRAILING_DELTA` filter?](https://developers.binance.com/docs/binance-spot-api-docs/faqs/trailing-stop-faq) +- [Trailing Stop Order Scenarios](https://developers.binance.com/docs/binance-spot-api-docs/faqs/trailing-stop-faq) +- [Trailing Stop Order Examples](https://developers.binance.com/docs/binance-spot-api-docs/faqs/trailing-stop-faq) diff --git a/docs/binance/binance-spot/filters.md b/docs/binance/binance-spot/filters.md new file mode 100644 index 0000000..857738b --- /dev/null +++ b/docs/binance/binance-spot/filters.md @@ -0,0 +1,324 @@ +--- +title: "Filters | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs/filters" +fetched_at: "2026-02-26T10:38:08.277Z" +--- +# Filters + +Filters define trading rules on a symbol or an exchange. Filters come in three forms: `symbol filters`, `exchange filters` and `asset filters`. + +## Symbol filters[​](https://developers.binance.com/docs/binance-spot-api-docs/filters) + +### PRICE\_FILTER[​](https://developers.binance.com/docs/binance-spot-api-docs/filters) + +The `PRICE_FILTER` defines the `price` rules for a symbol. There are 3 parts: + +- `minPrice` defines the minimum `price`/`stopPrice` allowed; disabled on `minPrice` == 0. +- `maxPrice` defines the maximum `price`/`stopPrice` allowed; disabled on `maxPrice` == 0. +- `tickSize` defines the intervals that a `price`/`stopPrice` can be increased/decreased by; disabled on `tickSize` == 0. + +Any of the above variables can be set to 0, which disables that rule in the `price filter`. In order to pass the `price filter`, the following must be true for `price`/`stopPrice` of the enabled rules: + +- `price` >= `minPrice` +- `price` <= `maxPrice` +- `price` % `tickSize` == 0 + +**/exchangeInfo format:** + +``` +{ "filterType": "PRICE_FILTER", "minPrice": "0.00000100", "maxPrice": "100000.00000000", "tickSize": "0.00000100"} +``` + +### PERCENT\_PRICE[​](https://developers.binance.com/docs/binance-spot-api-docs/filters) + +The `PERCENT_PRICE` filter defines the valid range for the price based on the average of the previous trades. `avgPriceMins` is the number of minutes the average price is calculated over. 0 means the last price is used. + +In order to pass the `percent price`, the following must be true for `price`: + +- `price` <= `weightedAveragePrice` \* `multiplierUp` +- `price` >= `weightedAveragePrice` \* `multiplierDown` + +**/exchangeInfo format:** + +``` +{ "filterType": "PERCENT_PRICE", "multiplierUp": "1.3000", "multiplierDown": "0.7000", "avgPriceMins": 5} +``` + +### PERCENT\_PRICE\_BY\_SIDE[​](https://developers.binance.com/docs/binance-spot-api-docs/filters) + +The `PERCENT_PRICE_BY_SIDE` filter defines the valid range for the price based on the average of the previous trades. +`avgPriceMins` is the number of minutes the average price is calculated over. 0 means the last price is used. +There is a different range depending on whether the order is placed on the `BUY` side or the `SELL` side. + +Buy orders will succeed on this filter if: + +- `Order price` <= `weightedAveragePrice` \* `bidMultiplierUp` +- `Order price` >= `weightedAveragePrice` \* `bidMultiplierDown` + +Sell orders will succeed on this filter if: + +- `Order Price` <= `weightedAveragePrice` \* `askMultiplierUp` +- `Order Price` >= `weightedAveragePrice` \* `askMultiplierDown` + +**/exchangeInfo format:** + +``` +{ "filterType": "PERCENT_PRICE_BY_SIDE", "bidMultiplierUp": "1.2", "bidMultiplierDown": "0.2", "askMultiplierUp": "5", "askMultiplierDown": "0.8", "avgPriceMins": 1} +``` + +### LOT\_SIZE[​](https://developers.binance.com/docs/binance-spot-api-docs/filters) + +The `LOT_SIZE` filter defines the `quantity` (aka "lots" in auction terms) rules for a symbol. There are 3 parts: + +- `minQty` defines the minimum `quantity`/`icebergQty` allowed. +- `maxQty` defines the maximum `quantity`/`icebergQty` allowed. +- `stepSize` defines the intervals that a `quantity`/`icebergQty` can be increased/decreased by. + +In order to pass the `lot size`, the following must be true for `quantity`/`icebergQty`: + +- `quantity` >= `minQty` +- `quantity` <= `maxQty` +- `quantity` % `stepSize` == 0 + +**/exchangeInfo format:** + +``` +{ "filterType": "LOT_SIZE", "minQty": "0.00100000", "maxQty": "100000.00000000", "stepSize": "0.00100000"} +``` + +### MIN\_NOTIONAL[​](https://developers.binance.com/docs/binance-spot-api-docs/filters) + +The `MIN_NOTIONAL` filter defines the minimum notional value allowed for an order on a symbol. An order's notional value is the `price` \* `quantity`. `applyToMarket` determines whether or not the `MIN_NOTIONAL` filter will also be applied to `MARKET` orders. Since `MARKET` orders have no price, the average price is used over the last `avgPriceMins` minutes. `avgPriceMins` is the number of minutes the average price is calculated over. 0 means the last price is used. + +**/exchangeInfo format:** + +``` +{ "filterType": "MIN_NOTIONAL", "minNotional": "0.00100000", "applyToMarket": true, "avgPriceMins": 5} +``` + +### NOTIONAL[​](https://developers.binance.com/docs/binance-spot-api-docs/filters) + +The `NOTIONAL` filter defines the acceptable notional range allowed for an order on a symbol. + +`applyMinToMarket` determines whether the `minNotional` will be applied to `MARKET` orders. +`applyMaxToMarket` determines whether the `maxNotional` will be applied to `MARKET` orders. + +In order to pass this filter, the notional (`price * quantity`) has to pass the following conditions: + +- `price * quantity` <= `maxNotional` +- `price * quantity` >= `minNotional` + +For `MARKET` orders, the average price used over the last `avgPriceMins` minutes will be used for calculation. +If the `avgPriceMins` is 0, then the last price will be used. + +**/exchangeInfo format:** + +``` +{ "filterType": "NOTIONAL", "minNotional": "10.00000000", "applyMinToMarket": false, "maxNotional": "10000.00000000", "applyMaxToMarket": false, "avgPriceMins": 5} +``` + +### ICEBERG\_PARTS[​](https://developers.binance.com/docs/binance-spot-api-docs/filters) + +The `ICEBERG_PARTS` filter defines the maximum parts an iceberg order can have. The number of `ICEBERG_PARTS` is defined as `CEIL(qty / icebergQty)`. + +**/exchangeInfo format:** + +``` +{ "filterType": "ICEBERG_PARTS", "limit": 10} +``` + +### MARKET\_LOT\_SIZE[​](https://developers.binance.com/docs/binance-spot-api-docs/filters) + +The `MARKET_LOT_SIZE` filter defines the `quantity` (aka "lots" in auction terms) rules for `MARKET` orders on a symbol. There are 3 parts: + +- `minQty` defines the minimum `quantity` allowed. +- `maxQty` defines the maximum `quantity` allowed. +- `stepSize` defines the intervals that a `quantity` can be increased/decreased by. + +In order to pass the `market lot size`, the following must be true for `quantity`: + +- `quantity` >= `minQty` +- `quantity` <= `maxQty` +- `quantity` % `stepSize` == 0 + +**/exchangeInfo format:** + +``` +{ "filterType": "MARKET_LOT_SIZE", "minQty": "0.00100000", "maxQty": "100000.00000000", "stepSize": "0.00100000"} +``` + +### MAX\_NUM\_ORDERS[​](https://developers.binance.com/docs/binance-spot-api-docs/filters) + +The `MAX_NUM_ORDERS` filter defines the maximum number of orders an account is allowed to have open on a symbol. Note that both "algo" orders and normal orders are counted for this filter. + +**/exchangeInfo format:** + +``` +{ "filterType": "MAX_NUM_ORDERS", "maxNumOrders": 25} +``` + +### MAX\_NUM\_ALGO\_ORDERS[​](https://developers.binance.com/docs/binance-spot-api-docs/filters) + +The `MAX_NUM_ALGO_ORDERS` filter defines the maximum number of "algo" orders an account is allowed to have open on a symbol. "Algo" orders are `STOP_LOSS`, `STOP_LOSS_LIMIT`, `TAKE_PROFIT`, and `TAKE_PROFIT_LIMIT` orders. + +**/exchangeInfo format:** + +``` +{ "filterType": "MAX_NUM_ALGO_ORDERS", "maxNumAlgoOrders": 5} +``` + +### MAX\_NUM\_ICEBERG\_ORDERS[​](https://developers.binance.com/docs/binance-spot-api-docs/filters) + +The `MAX_NUM_ICEBERG_ORDERS` filter defines the maximum number of `ICEBERG` orders an account is allowed to have open on a symbol. An `ICEBERG` order is any order where the `icebergQty` is > 0. + +**/exchangeInfo format:** + +``` +{ "filterType": "MAX_NUM_ICEBERG_ORDERS", "maxNumIcebergOrders": 5} +``` + +### MAX\_POSITION[​](https://developers.binance.com/docs/binance-spot-api-docs/filters) + +The `MAX_POSITION` filter defines the allowed maximum position an account can have on the base asset of a symbol. An account's position defined as the sum of the account's: + +1. free balance of the base asset +2. locked balance of the base asset +3. sum of the qty of all open BUY orders + +`BUY` orders will be rejected if the account's position is greater than the maximum position allowed. + +If an order's `quantity` can cause the position to overflow, this will also fail the `MAX_POSITION` filter. + +**/exchangeInfo format:** + +``` +{ "filterType": "MAX_POSITION", "maxPosition": "10.00000000"} +``` + +### TRAILING\_DELTA[​](https://developers.binance.com/docs/binance-spot-api-docs/filters) + +The `TRAILING_DELTA` filter defines the minimum and maximum value for the parameter [`trailingDelta`](https://developers.binance.com/docs/binance-spot-api-docs/faqs/trailing-stop-faq). + +In order for a trailing stop order to pass this filter, the following must be true: + +For `STOP_LOSS BUY`, `STOP_LOSS_LIMIT_BUY`,`TAKE_PROFIT SELL` and `TAKE_PROFIT_LIMIT SELL` orders: + +- `trailingDelta` >= `minTrailingAboveDelta` +- `trailingDelta` <= `maxTrailingAboveDelta` + +For `STOP_LOSS SELL`, `STOP_LOSS_LIMIT SELL`, `TAKE_PROFIT BUY`, and `TAKE_PROFIT_LIMIT BUY` orders: + +- `trailingDelta` >= `minTrailingBelowDelta` +- `trailingDelta` <= `maxTrailingBelowDelta` + +**/exchangeInfo format:** + +``` +{ "filterType": "TRAILING_DELTA", "minTrailingAboveDelta": 10, "maxTrailingAboveDelta": 2000, "minTrailingBelowDelta": 10, "maxTrailingBelowDelta": 2000} +``` + +### MAX\_NUM\_ORDER\_AMENDS[​](https://developers.binance.com/docs/binance-spot-api-docs/filters) + +The `MAX_NUM_ORDER_AMENDS` filter defines the maximum number of times an order can be amended on the given symbol. + +If there are too many order amendments made on a single order, you will receive the `-2038` error code. + +**/exchangeInfo format:** + +``` +{ "filterType": "MAX_NUM_ORDER_AMENDS", "maxNumOrderAmends": 10} +``` + +### MAX\_NUM\_ORDER\_LISTS[​](https://developers.binance.com/docs/binance-spot-api-docs/filters) + +The `MAX_NUM_ORDER_LISTS` filter defines the maximum number of open order lists an account can have on a symbol. Note that OTOCOs count as one order list. + +**/exchangeInfo format:** + +``` +{ "filterType": "MAX_NUM_ORDER_LISTS", "maxNumOrderLists": 20} +``` + +## Exchange Filters[​](https://developers.binance.com/docs/binance-spot-api-docs/filters) + +### EXCHANGE\_MAX\_NUM\_ORDERS[​](https://developers.binance.com/docs/binance-spot-api-docs/filters) + +The `EXCHANGE_MAX_NUM_ORDERS` filter defines the maximum number of orders an account is allowed to have open on the exchange. Note that both "algo" orders and normal orders are counted for this filter. + +**/exchangeInfo format:** + +``` +{ "filterType": "EXCHANGE_MAX_NUM_ORDERS", "maxNumOrders": 1000} +``` + +### EXCHANGE\_MAX\_NUM\_ALGO\_ORDERS[​](https://developers.binance.com/docs/binance-spot-api-docs/filters) + +The `EXCHANGE_MAX_NUM_ALGO_ORDERS` filter defines the maximum number of "algo" orders an account is allowed to have open on the exchange. "Algo" orders are `STOP_LOSS`, `STOP_LOSS_LIMIT`, `TAKE_PROFIT`, and `TAKE_PROFIT_LIMIT` orders. + +**/exchangeInfo format:** + +``` +{ "filterType": "EXCHANGE_MAX_NUM_ALGO_ORDERS", "maxNumAlgoOrders": 200} +``` + +### EXCHANGE\_MAX\_NUM\_ICEBERG\_ORDERS[​](https://developers.binance.com/docs/binance-spot-api-docs/filters) + +The `EXCHANGE_MAX_NUM_ICEBERG_ORDERS` filter defines the maximum number of iceberg orders an account is allowed to have open on the exchange. + +**/exchangeInfo format:** + +``` +{ "filterType": "EXCHANGE_MAX_NUM_ICEBERG_ORDERS", "maxNumIcebergOrders": 10000} +``` + +### EXCHANGE\_MAX\_NUM\_ORDER\_LISTS[​](https://developers.binance.com/docs/binance-spot-api-docs/filters) + +The `EXCHANGE_MAX_NUM_ORDERS` filter defines the maximum number of order lists an account is allowed to have open on the exchange. Note that OTOCOs count as one order list. + +**/exchangeInfo format:** + +``` +{ "filterType": "EXCHANGE_MAX_NUM_ORDER_LISTS", "maxNumOrderLists": 20} +``` + +## Asset Filters[​](https://developers.binance.com/docs/binance-spot-api-docs/filters) + +### MAX\_ASSET[​](https://developers.binance.com/docs/binance-spot-api-docs/filters) + +The `MAX_ASSET` filter defines the maximum quantity of an asset that an account is allowed to transact in a single order. + +- When the asset is a symbol's base asset, the limit applies to the order's quantity. +- When the asset is a symbol's quote asset, the limit applies to the order's notional value. +- For example, a MAX\_ASSET filter for USDC applies to all symbols that have USDC as either a base or quote asset, such as: + - USDCBNB + - BNBUSDC + +**/myFilters format:** + +``` +{ "filterType": "MAX_ASSET", "asset": "USDC", "limit": "42.00000000"} +``` + +- [Symbol filters](https://developers.binance.com/docs/binance-spot-api-docs/filters) + - [PRICE\_FILTER](https://developers.binance.com/docs/binance-spot-api-docs/filters) + - [PERCENT\_PRICE](https://developers.binance.com/docs/binance-spot-api-docs/filters) + - [PERCENT\_PRICE\_BY\_SIDE](https://developers.binance.com/docs/binance-spot-api-docs/filters) + - [LOT\_SIZE](https://developers.binance.com/docs/binance-spot-api-docs/filters) + - [MIN\_NOTIONAL](https://developers.binance.com/docs/binance-spot-api-docs/filters) + - [NOTIONAL](https://developers.binance.com/docs/binance-spot-api-docs/filters) + - [ICEBERG\_PARTS](https://developers.binance.com/docs/binance-spot-api-docs/filters) + - [MARKET\_LOT\_SIZE](https://developers.binance.com/docs/binance-spot-api-docs/filters) + - [MAX\_NUM\_ORDERS](https://developers.binance.com/docs/binance-spot-api-docs/filters) + - [MAX\_NUM\_ALGO\_ORDERS](https://developers.binance.com/docs/binance-spot-api-docs/filters) + - [MAX\_NUM\_ICEBERG\_ORDERS](https://developers.binance.com/docs/binance-spot-api-docs/filters) + - [MAX\_POSITION](https://developers.binance.com/docs/binance-spot-api-docs/filters) + - [TRAILING\_DELTA](https://developers.binance.com/docs/binance-spot-api-docs/filters) + - [MAX\_NUM\_ORDER\_AMENDS](https://developers.binance.com/docs/binance-spot-api-docs/filters) + - [MAX\_NUM\_ORDER\_LISTS](https://developers.binance.com/docs/binance-spot-api-docs/filters) +- [Exchange Filters](https://developers.binance.com/docs/binance-spot-api-docs/filters) + - [EXCHANGE\_MAX\_NUM\_ORDERS](https://developers.binance.com/docs/binance-spot-api-docs/filters) + - [EXCHANGE\_MAX\_NUM\_ALGO\_ORDERS](https://developers.binance.com/docs/binance-spot-api-docs/filters) + - [EXCHANGE\_MAX\_NUM\_ICEBERG\_ORDERS](https://developers.binance.com/docs/binance-spot-api-docs/filters) + - [EXCHANGE\_MAX\_NUM\_ORDER\_LISTS](https://developers.binance.com/docs/binance-spot-api-docs/filters) +- [Asset Filters](https://developers.binance.com/docs/binance-spot-api-docs/filters) + - [MAX\_ASSET](https://developers.binance.com/docs/binance-spot-api-docs/filters) diff --git a/docs/binance/binance-spot/fix-api.md b/docs/binance/binance-spot/fix-api.md new file mode 100644 index 0000000..dac8a1e --- /dev/null +++ b/docs/binance/binance-spot/fix-api.md @@ -0,0 +1,5585 @@ +--- +title: "FIX API | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs/fix-api" +fetched_at: "2026-02-26T10:38:08.649Z" +--- +# FIX API + +> \[!NOTE\] This API can only be used with the SPOT Exchange. + +## General API Information[​](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +- FIX connections require TLS encryption. Please either use native TCP+TLS connection or set up a local proxy such as [stunnel](https://www.stunnel.org/) to handle TLS encryption. +- APIs have a timeout of 10 seconds when processing a request. If a response from the Matching Engine takes longer than this, the API responds with "Timeout waiting for response from backend server. Send status unknown; execution status unknown." [(-1007 TIMEOUT)](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - This does not always mean that the request failed in the Matching Engine. + - If the status of the request has not appeared in [User Data Stream](https://developers.binance.com/docs/binance-spot-api-docs/user-data-stream), please perform an API query for its status. +- If your request contains a symbol name containing non-ASCII characters, then the response may contain non-ASCII characters encoded in UTF-8. + +**FIX sessions only support Ed25519 keys.** + +Please refer to [this tutorial](https://www.binance.com/en/support/faq/how-to-generate-an-ed25519-key-pair-to-send-api-requests-on-binance-6b9a63f1e3384cf48a2eedb82767a69a) on how to set up an Ed25519 key pair. + +### FIX API Order Entry sessions[​](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +- Endpoint is: `tcp+tls://fix-oe.binance.com:9000` +- Supports placing orders, canceling orders, and querying current limit usage. +- Supports receiving all of the account's [ExecutionReport`<8>`](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) and [List Status``](https://developers.binance.com/docs/binance-spot-api-docs/fix-api). +- Only API keys with `FIX_API` are allowed to connect. +- QuickFIX Schema can be found [here](https://github.com/binance/binance-spot-api-docs/blob/master/fix/schemas/spot-fix-oe.xml). + +### FIX API Drop Copy sessions[​](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +- Endpoint is: `tcp+tls://fix-dc.binance.com:9000` +- Supports receiving all of the account's [ExecutionReport`<8>`](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) and [List Status``](https://developers.binance.com/docs/binance-spot-api-docs/fix-api). +- Only API keys with `FIX_API` or `FIX_API_READ_ONLY` are allowed to connect. +- QuickFIX Schema can be found [here](https://github.com/binance/binance-spot-api-docs/blob/master/fix/schemas/spot-fix-oe.xml). +- Data in Drop Copy sessions is delayed by 1 second. + +### FIX API Market Data sessions[​](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +- Endpoint is: `tcp+tls://fix-md.binance.com:9000` +- Supports market data streams and active instruments queries. +- Does not support placing or canceling orders. +- Only API keys with `FIX_API` or `FIX_API_READ_ONLY` are allowed to connect. +- QuickFIX Schema can be found [here](https://github.com/binance/binance-spot-api-docs/blob/master/fix/schemas/spot-fix-md.xml). + +### FIX Connection Lifecycle[​](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +- All FIX API sessions will remain open for as long as possible, on a best-effort basis. +- There is no minimum connection time guarantee; a server can enter maintenance at any time. + - When a server enters maintenance, a [News ``](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) message will be sent to clients **every 10 seconds for 10 minutes**, prompting clients to reconnect. Upon receiving this message, a client is expected to establish a new session and close the old one. If the client does not close the old session within the time frame, the server will proceed to log it out and close the session. +- After connecting, the client must send a Logon `` request. For more information please refer to [How to sign a Logon request](https://developers.binance.com/docs/binance-spot-api-docs/fix-api). +- The client should send a Logout `<5>` message to close the session before disconnecting. Failure to send the logout message will result in the session’s `SenderCompID (49)` being unusable for new session establishment for a duration of 2x the `HeartInt (108)` interval. +- The system allows negotiation of the `HeartInt (108)` value during the logon process. Accepted values range between 5 and 60 seconds. + - If the server has not sent any messages within a `HeartInt (108)` interval, a [HeartBeat `<0>`](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) will be sent. + - If the server has not received any messages within a `HeartInt (108)` interval, a [TestRequest `<1>`](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) will be sent. If the server does not receive a HeartBeat `<0>` containing the expected `TestReqID (112)` from the client within `HeartInt (108)` seconds, the server will send a Logout `<5>` message and close the connection. + - If the client has not received any messages within a `HeartInt (108)` interval, the client is responsible for sending a TestRequest `<1>` to ensure the connection is healthy. Upon receiving such a TestRequest `<1>`, the server will respond with a Heartbeat `<0>` containing the expected `TestReqID (112)`. If the client does not receive the server’s response within a `HeartInt (108)` interval, the client should close the session and connection and establish new ones. + +### API Key Permissions[​](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +To access the FIX API order entry sessions, your API key must be configured with the `FIX_API` permission. + +To access the FIX Drop Copy sessions, your API key must be configured with either `FIX_API_READ_ONLY` or `FIX_API` permission. + +To access the FIX Market Data sessions, your API key must be configured with either `FIX_API` or `FIX_API_READ_ONLY` permission. + +**FIX sessions only support Ed25519 keys.** + +Please refer to [this tutorial](https://www.binance.com/en/support/faq/how-to-generate-an-ed25519-key-pair-to-send-api-requests-on-binance-6b9a63f1e3384cf48a2eedb82767a69a) on how to set up an Ed25519 key pair. + +### On message processing order[​](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +The `MessageHandling (25035)` field required in the initial [Logon``](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) message controls whether messages from the client may be reordered before they are processed by the Matching Engine. + +Mode + +Description + +`UNORDERED(1)` + +Messages from the client are allowed to be sent to the matching engine in any order. + +`SEQUENTIAL(2)` + +Messages from the client are always sent to the matching engine in `MsgSeqNum (34)` order. + +In all modes, the client's `MsgSeqNum (34)` must increase monotonically, with each subsequent message having a sequence number that is exactly 1 greater than the previous message. + +> \[!TIP\] `UNORDERED(1)` should offer better performance when there are multiple messages in flight from the client to the server. + +### Response Mode[​](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +By default, all concurrent order entry sessions receive all of the account's successful [ExecutionReport`<8>`](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) and [ListStatus``](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) messages, including those in response to orders placed from other FIX sessions and via non-FIX APIs. + +Use the `ResponseMode (25036)` field in the initial [Logon``](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) message to change this behavior. + +- `EVERYTHING(1)`: The default mode. +- `ONLY_ACKS(2)`: Receive only ACK messages whether operation succeeded or failed. Disables ExecutionReport push. + +### Timing Security[​](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +- All requests require a `SendingTime(52)` field which should be the current timestamp. +- An additional optional field, `RecvWindow(25000)`, specifies for how long the request stays valid in milliseconds. + - `RecvWindow(25000)` supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + - If `RecvWindow(25000)` is not specified, it defaults to 5000 milliseconds only for the Logon`` request. For other requests if unset, the RecvWindow check is not executed. + - Maximum `RecvWindow(25000)` is 60000 milliseconds. +- Request processing logic is as follows: + +``` +serverTime = getCurrentTime()if (SendingTime < (serverTime + 1 second) && (serverTime - SendingTime) <= RecvWindow) { // begin processing request serverTime = getCurrentTime() if (serverTime - SendingTime) <= RecvWindow { // forward request to Matching Engine } else { // reject request } // finish processing request} else { // reject request} +``` + +### How to sign Logon `` request[​](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +The [Logon``](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) message authenticates your connection to the FIX API. This must be the first message sent by the client. + +- The `Username (553)` field is required to contain the API key. +- The `RawData (96)` field is required to contain a valid signature made with the API key. + +The signature payload is a text string constructed by concatenating the values of the following fields in this exact order, separated by the SOH character: + +1. `MsgType (35)` +2. `SenderCompId (49)` +3. `TargetCompId (56)` +4. `MsgSeqNum (34)` +5. `SendingTime (52)` + +Sign the payload using your private key. Encode the signature with **base64**. The resulting text string is the value of the `RawData (96)` field. + +Here is a sample Python code implementing the signature algorithm: + +``` +import base64from cryptography.hazmat.primitives.asymmetric.ed25519 import Ed25519PrivateKeyfrom cryptography.hazmat.primitives.serialization import load_pem_private_keydef logon_raw_data(private_key: Ed25519PrivateKey, sender_comp_id: str, target_comp_id: str, msg_seq_num: str, sending_time: str): """ Computes the value of RawData (96) field in Logon message. """ payload = chr(1).join([ 'A', sender_comp_id, target_comp_id, msg_seq_num, sending_time, ]) signature = private_key.sign(payload.encode('ASCII')) return base64.b64encode(signature).decode('ASCII')with open('private_key.pem', 'rb') as f: private_key = load_pem_private_key(data=f.read(), password=None)raw_data = logon_raw_data(private_key, sender_comp_id='5JQmUOsm', target_comp_id='SPOT', msg_seq_num='1', sending_time='20240612-08:52:21.613') +``` + +The values presented below can be used to validate the correctness of the signature computation implementation: + +Field + +Value + +MsgType (35) + +`A` + +SenderCompID (49) + +`EXAMPLE` + +TargetCompID (56) + +`SPOT` + +MsgSeqNum (34) + +`1` + +SendingTime (52) + +`20240627-11:17:25.223` + +The Ed25519 private key used in the example computation is shown below: + +> \[!CAUTION\] The following secret key is provided solely for illustrative purposes. Do not use this key in any real-world application as it is not secure and may compromise your cryptographic implementation. Always generate your own unique and secure keys for actual use. + +``` +-----BEGIN PRIVATE KEY-----MC4CAQAwBQYDK2VwBCIEIIJEYWtGBrhACmb9Dvy+qa8WEf0lQOl1s4CLIAB9m89u-----END PRIVATE KEY----- +``` + +Computed signature: + +``` +4MHXelVVcpkdwuLbl6n73HQUXUf1dse2PCgT1DYqW9w8AVZ1RACFGM+5UdlGPrQHrgtS3CvsRURC1oj73j8gCA== +``` + +Resulting Logon `` message: + +``` +8=FIX.4.4|9=247|35=A|34=1|49=EXAMPLE|52=20240627-11:17:25.223|56=SPOT|95=88|96=4MHXelVVcpkdwuLbl6n73HQUXUf1dse2PCgT1DYqW9w8AVZ1RACFGM+5UdlGPrQHrgtS3CvsRURC1oj73j8gCA==|98=0|108=30|141=Y|553=sBRXrJx2DsOraMXOaUovEhgVRcjOvCtQwnWj8VxkOh1xqboS02SPGfKi2h8spZJb|25035=2|10=227| +``` + +## Limits[​](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +### Message Limits[​](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +- Each connection has a limit on **how many messages can be sent to the exchange**. +- The message limit **does not count the messages sent in response to the client**. +- Breaching the message limit results in immediate [Logout `<5>`](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) and disconnection. +- To understand current limits and usage, please send a [LimitQuery``](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) message. A [LimitResponse``](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) message will be sent in response, containing information about Order Rate Limits and Message Limits. +- FIX Order entry sessions have a limit of 10,000 messages every 10 seconds. +- FIX Drop Copy sessions have a limit of 60 messages every 60 seconds. +- FIX Market Data sessions have a limit of 2000 messages every 60 seconds. + +### Connection Limits[​](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +- Each Account has a limit on how many TCP connections can be established at the same time. +- The limit is reduced when the TCP connection is closed. If the reduction of connections is not immediate, please wait up to twice the value of `HeartBtInt (108)` for the change to take effect. For example, if the current value of `HeartBtInt` is 5, please wait up to 10 seconds. +- Upon breaching the limit a [Reject `<3>`](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) will be sent containing information about the connection limit breach and the current limit. +- FIX Order Entry limits: + - 15 connection attempts within 30 seconds + - Maximum of 10 concurrent TCP connections per account +- FIX Drop Copy limits: + - 15 connection attempts within 30 seconds + - Maximum of 10 concurrent TCP connections per account +- FIX Market Data limits + - 300 connection attempts within 300 seconds + - Maximum of 100 concurrent TCP connections per account + - A single connection can listen to a maximum of 1000 streams. + +### Unfilled Order Count[​](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +- To understand how many orders you have placed within a certain time interval, please send a [LimitQuery``](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) message. A [LimitResponse``](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) message will be sent in response, containing information about Unfilled Order Count and Message Limits. +- **Please note that if your orders are consistently filled by trades, you can continuously place orders on the API**. For more information, please see [Spot Unfilled Order Count Rules](https://developers.binance.com/docs/binance-spot-api-docs/faqs/order_count_decrement). +- If you exceed the unfilled order count your message will be rejected, and information will be transferred back to you in a reject message specific to that endpoint. +- **The number of unfilled orders is tracked for each account.** + +## Error Handling[​](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +Client messages that contain syntax errors, missing required fields, or refer to unknown symbols will be rejected by the server with a [Reject `<3>`](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) message. + +If a valid message cannot be processed and is rejected, an appropriate reject response will be sent. Please refer to the individual message documentation for possible responses. + +Please refer to the `Text (58)` and `ErrorCode (25016)` fields in responses for the reject reason. + +The list of error codes can be found on the [Error codes](https://developers.binance.com/docs/binance-spot-api-docs/errors) page. + +## Types[​](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +Only printable ASCII characters and SOH are supported. + +Type + +Description + +`BOOLEAN` + +Enum: `Y` or `N`. + +`CHAR` + +Single character. + +`INT` + +Signed 64-bit integer. + +`LENGTH` + +Unsigned 64-bit integer. + +`NUMINGROUP` + +Unsigned 64-bit integer. + +`PRICE` + +Fixed-point number. Precision depends on the symbol definition. + +`QTY` + +Fixed-point number. Precision depends on the symbol definition. + +`SEQNUM` + +Unsigned 32-bit integer. Rolls over to 0 after reaching its maximum value of 4,294,967,295. + +`STRING` + +Sequence of printable ASCII characters. + +`UTCTIMESTAMP` + +String representing datetime in UTC. + +Supported `UTCTIMESTAMP` formats: + +- `20011217-09:30:47` - seconds +- `20011217-09:30:47.123` - milliseconds +- `20011217-09:30:47.123456` - microseconds (always used in messages from the exchange) + +Client order ID fields must conform to the regex `^[a-zA-Z0-9-_]{1,36}$`: + +- `ClOrdID (11)` +- `OrigClOrdID (41)` +- `MDReqID (262)` +- `ClListID (25014)` +- `OrigClListID (25015)` +- `CancelClOrdID (25034)` + +## Message Components[​](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +> \[!NOTE\] In example messages, the `|` character is used to represent SOH character: + +``` +8=FIX.4.4|9=113|35=A|34=1|49=SPOT|52=20240612-08:52:21.636837|56=5JQmUOsm|98=0|108=30|25037=4392a152-3481-4499-921a-6d42c50702e2|10=051| +``` + +### Header[​](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +Appears at the start of every message. + +Tag + +Name + +Type + +Required + +Description + +8 + +BeginString + +STRING + +Y + +Always `FIX.4.4`. + +Must be the first field the message. + +9 + +BodyLength + +LENGTH + +Y + +Message length in bytes. + +Must be the second field in the message. + +35 + +MsgType + +STRING + +Y + +Must be the third field in the message. + +Possible values: + +`0` - [HEARTBEAT](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +`1` - [TEST\_REQUEST](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +`3` - [REJECT](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +`5` - [LOGOUT](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +`8` - [EXECUTION\_REPORT](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +`9` - [ORDER\_CANCEL\_REJECT](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +`A` - [LOGON](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +`D` - [NEW\_ORDER\_SINGLE](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +`E` - [NEW\_ORDER\_LIST](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +`F` - [ORDER\_CANCEL\_REQUEST](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +`N` - [LIST\_STATUS](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +`q` - [ORDER\_MASS\_CANCEL\_REQUEST](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +`r` - [ORDER\_MASS\_CANCEL\_REPORT](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +`XCN` - [ORDER\_CANCEL\_REQUEST\_AND\_NEW\_ORDER\_SINGLE](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +`XLQ` - [LIMIT\_QUERY](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +`XLR` - [LIMIT\_RESPONSE](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +`B` - [NEWS](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +`x`\- [INSTRUMENT\_LIST\_REQUEST](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +`y` - [INSTRUMENT\_LIST](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +`V` - [MARKET\_DATA\_REQUEST](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +`Y` - [MARKET\_DATA\_REQUEST\_REJECT](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +`W` - [MARKET\_DATA\_SNAPSHOT](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +`X` - [MARKET\_DATA\_INCREMENTAL\_REFRESH](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +`XAK` - [ORDER\_AMEND\_KEEP\_PRIORITY\_REQUEST](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +`XAR` - [ORDER\_AMEND\_REJECT](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +49 + +SenderCompID + +STRING + +Y + +Must be unique across an account's active sessions. + +Must obey regex: `^[a-zA-Z0-9-_]{1,8}$` + +56 + +TargetCompID + +STRING + +Y + +A string identifying this TCP connection. + +On messages from client required to be set to `SPOT`. + +Must be unique across TCP connections. + +Must conform to the regex: `^[a-zA-Z0-9-_]{1,8}$` + +34 + +MsgSeqNum + +SEQNUM + +Y + +Integer message sequence number. + +Values that will cause a gap will be rejected. + +52 + +SendingTime + +UTCTIMESTAMP + +Y + +Time of message transmission (always expressed in UTC). + +25000 + +RecvWindow + +FLOAT + +N + +Number of milliseconds after `SendingTime (52)` the request is valid for. + +Defaults to `5000` milliseconds in [Logon``](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) and has a max value of `60000` milliseconds. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +### Trailer[​](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +Appears at the end of every message. + +Tag + +Name + +Type + +Required + +Description + +10 + +CheckSum + +STRING + +Y + +Always three-character numeric string, calculated by summing the ASCII values of each preceding character in the message, including start-of-header (SOH) characters. + +The resultant sum is divided by 256, with the remainder forming the CheckSum value. + +To maintain a fixed length, the CheckSum field is right-justified and zero-padded as needed. + +## Administrative Messages[​](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +### Heartbeat `<0>`[​](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +Sent by the server if there is no outgoing traffic during the heartbeat interval (`HeartBtInt (108)` in [Logon``](https://developers.binance.com/docs/binance-spot-api-docs/fix-api)). + +Sent by the client to indicate that the session is healthy. + +Sent by the client or the server in response to a [TestRequest`<1>`](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) message. + +Tag + +Name + +Type + +Required + +Description + +112 + +TestReqID + +STRING + +N + +When Heartbeat`<35>` is sent in response to TestRequest`<1>`, must mirror the value in TestRequest`<1>`. + +### TestRequest `<1>`[​](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +Sent by the server if there is no incoming traffic during the heartbeat interval (`HeartBtInt (108)` in [Logon``](https://developers.binance.com/docs/binance-spot-api-docs/fix-api)). + +Sent by the client to request a [Heartbeat`<0>`](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) response. + +> \[!NOTE\] If the client does not respond to TestRequest`<1>` with Heartbeat`<0>` with a correct `TestReqID (112)` within timeout, the connection will be dropped. + +Tag + +Name + +Type + +Required + +Description + +112 + +TestReqID + +STRING + +Y + +Arbitrary string that must be included in the Heartbeat`<0>` response. + +### Reject `<3>`[​](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +Sent by the server in response to an invalid message that cannot be processed. + +Sent by the server if a new connection cannot be accepted. Please refer to [Connection Limits](https://developers.binance.com/docs/binance-spot-api-docs/fix-api). + +Please refer to the `Text (58)` and `ErrorCode (25016)` fields for the reject reason. + +Tag + +Name + +Type + +Required + +Description + +45 + +RefSeqNum + +INT + +N + +The `MsgSeqNum (34)` of the rejected message that caused issuance of this Reject`<3>`. + +371 + +RefTagID + +INT + +N + +When present, identifies the field that directly caused the issuance of this Reject`<3>` message. + +372 + +RefMsgType + +STRING + +N + +The `MsgType (35)` of the rejected message that caused issuance of this Reject`<3>`. + +373 + +SessionRejectReason + +INT + +N + +A reason for the reject, can be one of the values below. + +Usually accompanied by additional Text description + +Possible values: + +`0`\- INVALID\_TAG\_NUMBER + +`1` - REQUIRED\_TAG\_MISSING + +`2` - TAG\_NOT\_DEFINED\_FOR\_THIS\_MESSAGE\_TYPE + +`3` - UNDEFINED\_TAG + +`5` - VALUE\_IS\_INCORRECT + +`6` - INCORRECT\_DATA\_FORMAT\_FOR\_VALUE + +`8` - SIGNATURE\_PROBLEM + +`10` - SENDINGTIME\_ACCURACY\_PROBLEM + +`12` - XML\_VALIDATION\_ERROR + +`13` - TAG\_APPEARS\_MORE\_THAN\_ONCE + +`14` - TAG\_SPECIFIED\_OUT\_OF\_REQUIRED\_ORDER + +`15` - REPEATING\_GROUP\_FIELDS\_OUT\_OF\_ORDER + +`16` - INCORRECT\_NUMINGROUP\_COUNT\_FOR\_REPEATING\_GROUP + +`99` - OTHER + +25016 + +ErrorCode + +INT + +N + +API error code (see [Error Codes](https://developers.binance.com/docs/binance-spot-api-docs/errors)). + +58 + +Text + +STRING + +N + +Human-readable error message. + +### Logon ``[​](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +Sent by the client to authenticate the connection. Logon`` must be the first message sent by the client. + +Sent by the server in response to a successful logon. + +> \[!NOTE\] Logon`` can only be sent once for the entirety of the session. + +#### Logon Request[​](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +Tag + +Name + +Type + +Required + +Description + +98 + +EncryptMethod + +INT + +Y + +Required to be `0`. + +108 + +HeartBtInt + +INT + +Y + +Required to be within range \[5, 60\]. Heartbeat interval in seconds. + +95 + +RawDataLength + +LENGTH + +Y + +Length of the `RawData (96)` field that comes strictly after this field. + +96 + +RawData + +DATA + +Y + +Signature. [How to sign Logon`` request](https://developers.binance.com/docs/binance-spot-api-docs/fix-api). + +141 + +ResetSeqNumFlag + +BOOLEAN + +Y + +Required to be `Y`. + +553 + +Username + +STRING + +Y + +API key. **Only Ed25519 API keys are supported.** + +25035 + +MessageHandling + +INT + +Y + +Possible values: + +`1` - UNORDERED + +`2` - SEQUENTIAL + +Please refer to [On message order processing](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) for more information. + +25036 + +ResponseMode + +INT + +N + +Please refer to [Response Mode](https://developers.binance.com/docs/binance-spot-api-docs/fix-api). + +9406 + +DropCopyFlag + +BOOLEAN + +N + +Must be set to 'Y' when logging into Drop Copy sessions. + +**Sample message:** + +``` +8=FIX.4.4|9=248|35=A|34=1|49=5JQmUOsm|52=20240612-08:52:21.613|56=SPOT|95=88|96=KhJLbZqADWknfTAcp0ZjyNz36Kxa4ffvpNf9nTIc+K5l35h+vA1vzDRvLAEQckyl6VDOwJ53NOBnmmRYxQvQBQ==|98=0|108=30|141=Y|553=W5rcOD30c0gT4jHK8oX5d5NbzWoa0k4SFVoTHIFNJVZ3NuRpYb6ZyJznj8THyx5d|25035=1|10=000| +``` + +#### Logon Response[​](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +Tag + +Name + +Type + +Required + +Description + +98 + +EncryptMethod + +INT + +Y + +Always `0`. + +108 + +HeartBtInt + +INT + +Y + +Mirrors value from the Logon request. + +25037 + +UUID + +STRING + +Y + +UUID of the FIX API serving the requests. + +**Sample message:** + +``` +8=FIX.4.4|9=113|35=A|34=1|49=SPOT|52=20240612-08:52:21.636837|56=5JQmUOsm|98=0|108=30|25037=4392a152-3481-4499-921a-6d42c50702e2|10=051| +``` + +### Logout `<5>`[​](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +Sent to initiate the process of closing the connection, and also when responding to Logout. + +Tag + +Name + +Type + +Required + +Description + +58 + +Text + +STRING + +N + +**Sample messages:** + +Logout Request + +``` +8=FIX.4.4|9=55|35=5|34=3|49=GhQHzrLR|52=20240611-09:44:25.543|56=SPOT|10=249| +``` + +Logout Response + +``` +8=FIX.4.4|9=84|35=5|34=4|49=SPOT|52=20240611-09:44:25.544001|56=GhQHzrLR|58=Logout acknowledgment.|10=212| +``` + +### News ``[​](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +When the server enters maintenance, a `News` message will be sent to clients **every 10 seconds for 10 minutes**. After this period, clients will be logged out and their sessions will be closed. + +Upon receiving this message, clients are expected to establish a new session and close the old one. + +The countdown message sent will be: + +``` +You'll be disconnected in %d seconds. Please reconnect. +``` + +When there are 10 seconds remaining, the following message will be sent: + +``` +Your connection is about to be closed. Please reconnect. +``` + +If the client does not close the old session within 10 seconds of receiving the above message, the server will log it out and close the session. + +Tag + +Name + +Type + +Required + +Description + +148 + +Headline + +STRING + +Y + +**Sample message:** + +``` +8=FIX.4.4|9=0000113|35=B|49=SPOT|56=OE|34=4|52=20240924-21:07:35.773537|148=Your connection is about to be closed. Please reconnect.|10=165| +``` + +### Resend Request `<2>`[​](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +Resend requests are currently not supported. + +## Application Messages[​](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +### Order Entry Messages[​](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +> \[!NOTE\] The messages below can only be used for the FIX Order Entry and FIX Drop Copy Sessions. + +#### NewOrderSingle ``[​](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +Sent by the client to submit a new order for execution. + +This adds 1 order to the `EXCHANGE_MAX_ORDERS` filter and the `MAX_NUM_ORDERS` filter. + +**Unfilled Order Count:** 1 + +Please refer to [Supported Order Types](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) for supported field combinations. + +> \[!NOTE\] Many fields become required based on the order type. Please refer to [Supported Order Types](https://developers.binance.com/docs/binance-spot-api-docs/fix-api). + +Tag + +Name + +Type + +Required + +Description + +11 + +ClOrdID + +STRING + +Y + +`ClOrdID` to be assigned to the order. + +38 + +OrderQty + +QTY + +N + +Quantity of the order + +40 + +OrdType + +CHAR + +Y + +See the [table](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) to understand supported order types and the required fields to use them. + +Possible values: + +`1` - MARKET + +`2` - LIMIT + +`3` - STOP + +`4` - STOP\_LIMIT + +`P`\- PEGGED + +18 + +ExecInst + +CHAR + +N + +Possible values: + +`6` - PARTICIPATE\_DONT\_INITIATE + +44 + +Price + +PRICE + +N + +Price of the order + +54 + +Side + +CHAR + +Y + +Side of the order. + +Possible values: + +`1` - BUY + +`2` - SELL + +55 + +Symbol + +STRING + +Y + +Symbol to place the order on. + +59 + +TimeInForce + +CHAR + +N + +Possible values: + +`1` - GOOD\_TILL\_CANCEL + +`3` - IMMEDIATE\_OR\_CANCEL + +`4` - FILL\_OR\_KILL + +111 + +MaxFloor + +QTY + +N + +Used for iceberg orders, this specifies the visible quantity of the order on the book. + +152 + +CashOrderQty + +QTY + +N + +Quantity of the order specified in the quote asset units, for reverse market orders. + +847 + +TargetStrategy + +INT + +N + +The value cannot be less than `1000000`. + +7940 + +StrategyID + +INT + +N + +25001 + +SelfTradePreventionMode + +CHAR + +N + +Possible values: + +`1` - NONE + +`2` - EXPIRE\_TAKER + +`3` - EXPIRE\_MAKER + +`4` - EXPIRE\_BOTH + +`5` - DECREMENT +`6` - TRANSFER + +211 + +PegOffsetValue + +FLOAT + +N + +Amount added to the peg in the context of the PegOffsetType + +1094 + +PegPriceType + +CHAR + +N + +Defines the type of peg +Possible values: +`4` - MARKET\_PEG +`5` - PRIMARY\_PEG + +835 + +PegMoveType + +CHAR + +N + +Describes whether peg is fixed or floats. Required for Pegged Orders and must be set to `1` (FIXED) + +836 + +PegOffsetType + +CHAR + +N + +Type of price peg offset. +Possible values: + +`3` - PRICE\_TIER + +1100 + +TriggerType + +CHAR + +N + +Possible values: `4` - PRICE\_MOVEMENT + +1101 + +TriggerAction + +CHAR + +N + +Possible values: + +`1` - ACTIVATE + +1102 + +TriggerPrice + +PRICE + +N + +Activation price for contingent orders. See [table](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +1107 + +TriggerPriceType + +CHAR + +N + +Possible values: + +`2` - LAST\_TRADE + +1109 + +TriggerPriceDirection + +CHAR + +N + +Used to differentiate between StopLoss and TakeProfit orders. See [table](https://developers.binance.com/docs/binance-spot-api-docs/fix-api). + +Possible values: + +`U` - TRIGGER\_IF\_THE\_PRICE\_OF\_THE\_SPECIFIED\_TYPE\_GOES\_UP\_TO\_OR\_THROUGH\_THE\_SPECIFIED\_TRIGGER\_PRICE + +`D` - TRIGGER\_IF\_THE\_PRICE\_OF\_THE\_SPECIFIED\_TYPE\_GOES\_DOWN\_TO\_OR\_THROUGH\_THE\_SPECIFIED\_TRIGGER\_PRICE + +25009 + +TriggerTrailingDeltaBips + +INT + +N + +Provide to create trailing orders. + +25032 + +SOR + +BOOLEAN + +N + +Whether to activate SOR for this order. + +**Sample message:** + +``` +8=FIX.4.4|9=114|35=D|34=2|49=qNXO12fH|52=20240611-09:01:46.228|56=SPOT|11=1718096506197867067|38=5|40=2|44=10|54=1|55=LTCBNB|59=4|10=016| +``` + +**Response:** + +- [ExecutionReport`<8>`](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) with `ExecType (150)` value `NEW (0)` if the order was accepted. +- [ExecutionReport`<8>`](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) with `ExecType (150)` value `REJECTED (8)` if the order was rejected. +- [Reject`<3>`](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) if the message is rejected. + +##### Supported Order Types[​](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +Order name + +Binance OrderType + +Side + +required field values + +required fields with user values + +Market order + +`MARKET` + +BUY or SELL + +`40=1|` + +Limit order + +`LIMIT` + +BUY or SELL + +`40=2|` + +Limit maker order + +`LIMIT_MAKER` + +BUY or SELL + +`40=2|18=6|` + +Buy stop loss order + +`STOP_LOSS` + +BUY + +`40=3|1100=4|1101=1|1107=2|1109=U|` + +1102 + +Buy trailing stop loss order + +`STOP_LOSS` + +BUY + +`40=3|1100=4|1101=1|1107=2|1109=U|` + +1102,25009 + +Buy stop loss limit order + +`STOP_LOSS_LIMIT` + +BUY + +`40=4|1100=4|1101=1|1107=2|1109=U|` + +1102 + +Buy trailing stop loss limit order + +`STOP_LOSS_LIMIT` + +BUY + +`40=4|1100=4|1101=1|1107=2|1109=U|` + +1102,25009 + +Sell stop loss order + +`STOP_LOSS` + +SELL + +`40=3|1100=4|1101=1|1107=2|1109=D|` + +1102 + +Sell trailing stop loss order + +`STOP_LOSS` + +SELL + +`40=3|1100=4|1101=1|1107=2|1109=D|` + +1102,25009 + +Sell stop loss limit order + +`STOP_LOSS_LIMIT` + +SELL + +`40=4|1100=4|1101=1|1107=2|1109=D|` + +1102 + +Sell trailing stop loss limit order + +`STOP_LOSS_LIMIT` + +SELL + +`40=4|1100=4|1101=1|1107=2|1109=D|` + +1102,25009 + +Buy take profit order + +`TAKE_PROFIT` + +BUY + +`40=3|1100=4|1101=1|1107=2|1109=D|` + +1102 + +Buy trailing take profit order + +`TAKE_PROFIT` + +BUY + +`40=3|1100=4|1101=1|1107=2|1109=D|` + +1102,25009 + +Buy trailing take profit order + +`TAKE_PROFIT` + +BUY + +`40=3|1100=4|1101=1|1107=2|` + +25009 + +Buy take profit order + +`TAKE_PROFIT_LIMIT` + +BUY + +`40=4|1100=4|1101=1|1107=2|1109=D|` + +1102 + +Buy trailing take profit limit order + +`TAKE_PROFIT_LIMIT` + +BUY + +`40=4|1100=4|1101=1|1107=2|1109=D|` + +1102,25009 + +Buy trailing take profit limit order + +`TAKE_PROFIT_LIMIT` + +BUY + +`40=4|1100=4|1101=1|1107=2|` + +25009 + +Sell take profit order + +`TAKE_PROFIT` + +SELL + +`40=3|1100=4|1101=1|1107=2|1109=U|` + +1102 + +Sell trailing take profit order + +`TAKE_PROFIT` + +SELL + +`40=3|1100=4|1101=1|1107=2|1109=U|` + +1102,25009 + +Sell trailing take profit order + +`TAKE_PROFIT` + +SELL + +`40=3|1100=4|1101=1|1107=2|` + +25009 + +Sell take profit limit order + +`TAKE_PROFIT_LIMIT` + +SELL + +`40=4|1100=4|1101=1|1107=2|1109=U|` + +1102 + +Sell trailing take profit limit order + +`TAKE_PROFIT_LIMIT` + +SELL + +`40=4|1100=4|1101=1|1107=2|1109=U|` + +1102,25009 + +Sell trailing take profit limit order + +`TAKE_PROFIT_LIMIT` + +SELL + +`40=4|1100=4|1101=1|1107=2|` + +25009 + +Required fields based on Binance OrderType: + +Binance OrderType + +Additional mandatory parameters + +Additional Information + +`LIMIT` + +38, 44, 59 + +`MARKET` + +38 OR 152 + +`MARKET` orders using the `OrderQty (38)` field specifies the amount of the `base asset` the user wants to buy or sell at the market price. +E.g. `MARKET` order on BTCUSDT will specify how much BTC the user is buying or selling. + +`MARKET` orders using `quoteOrderQty` specifies the amount the user wants to spend (when buying) or receive (when selling) the `quote` asset; the correct `quantity` will be determined based on the market liquidity and `quoteOrderQty`. +E.g. Using the symbol BTCUSDT: +`BUY` side, the order will buy as many BTC as `quoteOrderQty` USDT can. +`SELL` side, the order will sell as much BTC needed to receive `CashOrderQty (152)` USDT. + +`STOP_LOSS` + +38, 1102 or 25009 + +This will execute a `MARKET` order when the conditions are met. (e.g. `TriggerPrice (1102)` is met or `TriggerTrailingDeltaBips (25009)` is activated) + +`STOP_LOSS_LIMIT` + +38, 44, 59, 1102 or 25009 + +`TAKE_PROFIT` + +38, 1102 or 25009 + +This will execute a `MARKET` order when the conditions are met. (e.g. `TriggerPrice (1102)` is met or `TriggerTrailingDeltaBips (25009)` is activated) + +`TAKE_PROFIT_LIMIT` + +38, 44, 59, 1102 or 25009 + +`LIMIT_MAKER` + +38, 44 + +This is a `LIMIT` order that will be rejected if the order immediately matches and trades as a taker. +This is also known as a POST-ONLY order. + +#### ExecutionReport `<8>`[​](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +Sent by the server whenever an order state changes. + +> \[!NOTE\] +> +> - By default, ExecutionReport`<8>` is sent for all orders of an account, including those submitted in different connections. Please see [Response Mode](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) for other behavior options. +> - FIX API should give better performance for ExecutionReport`<8>` push. + +Tag + +Name + +Type + +Required + +Description + +17 + +ExecID + +STRING + +N + +Omitted on rejected orders. + +11 + +ClOrdID + +STRING + +N + +`ClOrdID` of the list as assigned on the request. + +41 + +OrigClOrdID + +STRING + +N + +Original `ClOrdID` of the order. + +37 + +OrderID + +INT + +N + +Assigned by exchange. + +38 + +OrderQty + +QTY + +N + +Quantity of the order. + +40 + +OrdType + +CHAR + +Y + +Possible values: + +`1` - MARKET + +`2` - LIMIT + +`3` - STOP\_LOSS + +`4` - STOP\_LIMIT + +`P` - PEGGED + +54 + +Side + +CHAR + +Y + +Possible values: + +`1` - BUY + +`2` - SELL + +55 + +Symbol + +STRING + +Y + +Symbol of the order. + +18 + +ExecInst + +CHAR + +N + +Possible values: + +`6` - PARTICIPATE\_DONT\_INITIATE + +44 + +Price + +PRICE + +N + +Price of the order. + +59 + +TimeInForce + +CHAR + +N + +Possible values: + +`1` - GOOD\_TILL\_CANCEL + +`3` - IMMEDIATE\_OR\_CANCEL + +`4` - FILL\_OR\_KILL + +60 + +TransactTime + +UTCTIMESTAMP + +N + +Timestamp when this event occurred. + +25018 + +OrderCreationTime + +INT + +N + +111 + +MaxFloor + +QTY + +N + +Appears on iceberg orders. + +66 + +ListID + +STRING + +N + +Appears on list orders. + +152 + +CashOrderQty + +QTY + +N + +OrderQty specified in the quote asset units. + +847 + +TargetStrategy + +INT + +N + +`TargetStrategy (847)` from the order placement request. + +7940 + +StrategyID + +INT + +N + +`StrategyID (7940)` from the order placement request. + +25001 + +SelfTradePreventionMode + +CHAR + +N + +Possible values: + +`1` - NONE + +`2` - EXPIRE\_TAKER + +`3` - EXPIRE\_MAKER + +`4` - EXPIRE\_BOTH + +`5` - DECREMENT +`6` - TRANSFER + +150 + +ExecType + +CHAR + +Y + +**Note:** Field `PreventedMatchID(25024)` will be present if order has expired due to `SelfTradePreventionMode(25013)` + +Possible values: + +`0` - NEW + +`4` - CANCELED + +`5` - REPLACED + +`8` - REJECTED + +`F` - TRADE + +`C` - EXPIRED + +14 + +CumQty + +QTY + +Y + +Total number of base asset traded on this order. + +151 + +LeavesQty + +QTY + +N + +Quantity remaining for further execution. + +25017 + +CumQuoteQty + +QTY + +N + +Total number of quote asset traded on this order. + +1057 + +AggressorIndicator + +BOOLEAN + +N + +Appears on trade execution reports. + +Indicates whether the order was a taker in the trade. + +1003 + +TradeID + +STRING + +N + +Appears on trade execution reports. + +31 + +LastPx + +PRICE + +N + +The price of the last execution. + +32 + +LastQty + +QTY + +Y + +The quantity of the last execution. + +39 + +OrdStatus + +CHAR + +Y + +Possible values: + +`0` - NEW + +`1` - PARTIALLY\_FILLED + +`2` - FILLED + +`4` - CANCELED `6` - PENDING\_CANCEL + +`8` - REJECTED + +`A` - PENDING\_NEW + +`C` - EXPIRED + +Note that FIX does not support `EXPIRED_IN_MATCH` status, and get converted to `EXPIRED` in FIX. + +70 + +AllocID + +INT + +N + +Allocation ID as assigned by the exchange. + +574 + +MatchType + +INT + +N + +Possible values: + +`1` - ONE\_PARTY\_TRADE\_REPORT + +`4` - AUTO\_MATCH + +25021 + +WorkingFloor + +INT + +N + +Appears for orders that potentially have allocations. + +25022 + +TrailingTime + +UTCTIMESTAMP + +N + +Appears only for trailing stop orders. + +636 + +WorkingIndicator + +BOOLEAN + +N + +Set to `Y` when this order enters order book. + +25023 + +WorkingTime + +UTCTIMESTAMP + +N + +When this order appeared on the order book. + +25024 + +PreventedMatchID + +INT + +N + +Appears only for orders that expired due to STP. + +25025 + +PreventedExecutionPrice + +PRICE + +N + +Appears only for orders that expired due to STP. + +25026 + +PreventedExecutionQty + +QTY + +N + +Appears only for orders that expired due to STP. + +25027 + +TradeGroupID + +INT + +N + +Appears only for orders that expired due to STP. + +25028 + +CounterSymbol + +STRING + +N + +Appears only for orders that expired due to STP. + +25029 + +CounterOrderID + +INT + +N + +Appears only for orders that expired due to STP. + +25030 + +PreventedQty + +QTY + +N + +Appears only for orders that expired due to STP. + +25031 + +LastPreventedQty + +QTY + +N + +Appears only for orders that expired due to STP. + +25032 + +SOR + +BOOLEAN + +N + +Appears for orders that used SOR. + +25016 + +ErrorCode + +INT + +N + +API error code (see [Error Codes](https://developers.binance.com/docs/binance-spot-api-docs/errors)). + +58 + +Text + +STRING + +N + +Human-readable error message. + +136 + +NoMiscFees + +NUMINGROUP + +N + +Number of repeating groups of miscellaneous fees. + +\=>137 + +MiscFeeAmt + +QTY + +Y + +Amount of fees denominated in `MiscFeeCurr(138)` asset + +\=>138 + +MiscFeeCurr + +STRING + +Y + +Currency of miscellaneous fee. + +\=>139 + +MiscFeeType + +INT + +Y + +Possible values: + +`4` - EXCHANGE\_FEES + +1100 + +TriggerType + +CHAR + +N + +Possible values: + +`4` - PRICE\_MOVEMENT + +1101 + +TriggerAction + +CHAR + +N + +Possible values: + +`1` - ACTIVATE + +1102 + +TriggerPrice + +PRICE + +N + +Activation price for contingent orders. See [table](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +1107 + +TriggerPriceType + +CHAR + +N + +Possible values: + +`2` - LAST\_TRADE + +1109 + +TriggerPriceDirection + +CHAR + +N + +Used to differentiate between StopLoss and TakeProfit orders. See [table](https://developers.binance.com/docs/binance-spot-api-docs/fix-api). + +Possible values: + +`U` - TRIGGER\_IF\_THE\_PRICE\_OF\_THE\_SPECIFIED\_TYPE\_GOES\_UP\_TO\_OR\_THROUGH\_THE\_SPECIFIED\_TRIGGER\_PRICE + +`D` - TRIGGER\_IF\_THE\_PRICE\_OF\_THE\_SPECIFIED\_TYPE\_GOES\_DOWN\_TO\_OR\_THROUGH\_THE\_SPECIFIED\_TRIGGER\_PRICE + +25009 + +TriggerTrailingDeltaBips + +INT + +N + +Appears only for trailing stop orders. + +211 + +PegOffsetValue + +FLOAT + +N + +Amount added to the peg in the context of the PegOffsetType + +1094 + +PegPriceType + +CHAR + +N + +Defines the type of peg +Possible values: +`4` - MARKET\_PEG +`5` - PRIMARY\_PEG + +835 + +PegMoveType + +CHAR + +N + +Describes whether peg is fixed or floats. Required for Pegged Orders and must be set to `1` (FIXED) + +836 + +PegOffsetType + +CHAR + +N + +Type of price peg offset. +Possible values: + +`3` - PRICE\_TIER + +839 + +PeggedPrice + +PRICE + +N + +Current price the order is pegged at + +**Sample message:** + +``` +8=FIX.4.4|9=330|35=8|34=2|49=SPOT|52=20240611-09:01:46.228950|56=qNXO12fH|11=1718096506197867067|14=0.00000000|17=144|32=0.00000000|37=76|38=5.00000000|39=0|40=2|44=10.00000000|54=1|55=LTCBNB|59=4|60=20240611-09:01:46.228000|150=0|151=5.00000000|636=Y|1057=Y|25001=1|25017=0.00000000|25018=20240611-09:01:46.228000|25023=20240611-09:01:46.228000|10=095| +``` + +#### OrderCancelRequest ``[​](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +Sent by the client to cancel an order or an order list. + +- To cancel an order either `OrderID (11)` or `OrigClOrdID (41)` are required. + - If both `OrderID (37)` and `OrigClOrdID (41)` are provided, the `OrderID` is searched first, then the `OrigClOrdID` from that result is checked against that order. If both conditions are not met the request will be rejected. +- To cancel an order list either `ListID (66)` or `OrigClListID (25015)` are required. + - If both `ListID (66)` and `OrigClListID (25015)` are provided, the `ListID` is searched first, then the `OrigClListID` from that result is checked against that order. If both conditions are not met the request will be rejected. + +If the canceled order is part of an order list, the entire list will be canceled. + +**Note:** + +- The performance for canceling an order (single cancel or as part of a cancel-replace) is always better when only `orderId` is sent. Sending `origClientOrderId` or both `orderId` + `origClientOrderId` will be slower. + +Tag + +Name + +Type + +Required + +Description + +11 + +ClOrdID + +STRING + +Y + +`ClOrdID` of this request. + +41 + +OrigClOrdID + +STRING + +N + +`ClOrdID (11)` of the order to cancel. + +37 + +OrderID + +INT + +N + +`OrderID (37)` of the order to cancel. + +25015 + +OrigClListID + +STRING + +N + +`ClListID (25014)` of the order list to cancel. + +66 + +ListID + +STRING + +N + +`ListID (66)` of the order list to cancel. + +55 + +Symbol + +STRING + +Y + +Symbol on which to cancel order. + +25002 + +CancelRestrictions + +INT + +N + +Restrictions on the cancel. Possible values: + +`1` - ONLY\_NEW + +`2` - ONLY\_PARTIALLY\_FILLED + +**Sample message:** + +``` +8=FIX.4.4|9=93|35=F|34=2|49=ieBwvCKy|52=20240613-01:11:13.784|56=SPOT|11=1718241073695674483|37=2|55=LTCBNB|10=210| +``` + +**Response:** + +- [ExecutionReport`<8>`](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) with `ExecType (150)` value `CANCELED (4)` for each canceled order. +- [ListStatus``](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) if orders in an order list were canceled. +- [OrderCancelReject`<9>`](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) if cancellation was rejected. +- [Reject`<3>`](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) if the message is rejected. + +#### OrderCancelReject `<9>`[​](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +Sent by the server when [OrderCancelRequest``](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) has failed. + +Tag + +Name + +Type + +Required + +Description + +11 + +ClOrdID + +STRING + +Y + +`ClOrdID (11)` of the cancel request. + +41 + +OrigClOrdID + +STRING + +N + +`OrigClOrdID (41)` from the cancel request. + +37 + +OrderID + +INT + +N + +`OrderID (37)` from the cancel request. + +25015 + +OrigClListID + +STRING + +N + +`OrigClListID (25015)` from the cancel request. + +66 + +ListID + +STRING + +N + +`ListID (66)` from the cancel request. + +55 + +Symbol + +STRING + +Y + +`Symbol (55)` from the cancel request. + +25002 + +CancelRestrictions + +INT + +N + +`CancelRestrictions (25002)` from the cancel request. + +434 + +CxlRejResponseTo + +CHAR + +Y + +Type of request that this OrderCancelReject`<9>` is in response to. + +Possible values: + +`1` - ORDER\_CANCEL\_REQUEST + +25016 + +ErrorCode + +INT + +Y + +API error code (see [Error Codes](https://developers.binance.com/docs/binance-spot-api-docs/errors)). + +58 + +Text + +STRING + +Y + +Human-readable error message. + +**Sample message:** + +``` +8=FIX.4.4|9=137|35=9|34=2|49=SPOT|52=20240613-01:12:41.320869|56=OlZb8ht8|11=1718241161272843932|37=2|55=LTCBNB|58=Unknown order sent.|434=1|25016=-1013|10=087| +``` + +#### OrderCancelRequestAndNewOrderSingle ``[​](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +Sent by the client to cancel an order and submit a new one for execution. + +- To cancel an order either `OrderID (11)` or `OrigClOrdId (41)` are required. +- If both `OrderID (37)` and `OrigClOrdID (41)` are provided, the `OrderID` is searched first, then the `OrigClOrdID` from that result is checked against that order. If both conditions are not met the request will be rejected. + +Filters and Order Count are evaluated before the processing of the cancellation and order placement occurs. + +A new order that was not attempted (i.e. when `newOrderResult: NOT_ATTEMPTED`), will still increase the unfilled order count by 1. + +**Unfilled Order Count:** 1 + +Please refer to [Supported Order Types](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) for supported field combinations when describing the new order. + +> \[!NOTE\] Cancel is always processed first. Then immediately after that the new order is submitted. + +Tag + +Name + +Type + +Required + +Description + +25033 + +OrderCancelRequestAndNewOrderSingleMode + +INT + +Y + +What action should be taken if cancel fails. + +Possible values: + +`1` - STOP\_ON\_FAILURE + +`2` - ALLOW\_FAILURE + +25038 + +OrderRateLimitExceededMode + +INT + +N + +What should be done to the cancellation request if you exceed the unfilled order rate limit. + +Possible values: `1` - DO\_NOTHING + +`2` - CANCEL\_ONLY + +37 + +OrderID + +INT + +N + +`OrderID` of the order to cancel. + +25034 + +CancelClOrdID + +STRING + +N + +`ClOrdID` of the cancel. + +41 + +OrigClOrdID + +STRING + +N + +`ClOrdID` of the order to cancel. + +11 + +ClOrdID + +STRING + +Y + +`ClOrdID` to be assigned to the new order. + +25002 + +CancelRestrictions + +INT + +N + +Restrictions on the cancel. Possible values: + +`1` - ONLY\_NEW + +`2` - ONLY\_PARTIALLY\_FILLED + +38 + +OrderQty + +QTY + +N + +Quantity of the new order + +40 + +OrdType + +CHAR + +Y + +See the [table](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) to understand supported order types and the required fields to use them. + +Possible values: + +`1` - MARKET + +`2` - LIMIT + +`3` - STOP + +`4` - STOP\_LIMIT + +`P` - PEGGED + +18 + +ExecInst + +CHAR + +N + +Possible values: + +`6` - PARTICIPATE\_DONT\_INITIATE + +44 + +Price + +PRICE + +N + +Price of the new order + +54 + +Side + +CHAR + +Y + +Side of the order. + +Possible values: + +`1` - BUY + +`2` - SELL + +55 + +Symbol + +STRING + +Y + +Symbol to cancel and place the order on. + +59 + +TimeInForce + +CHAR + +N + +Possible values: + +`1` - GOOD\_TILL\_CANCEL + +`3` - IMMEDIATE\_OR\_CANCEL + +`4` - FILL\_OR\_KILL + +111 + +MaxFloor + +QTY + +N + +Used for iceberg orders, this specifies the visible quantity of the order on the book. + +152 + +CashOrderQty + +QTY + +N + +Quantity of the order specified in the quote asset units, for reverse market orders. + +847 + +TargetStrategy + +INT + +N + +The value cannot be less than `1000000`. + +7940 + +StrategyID + +INT + +N + +25001 + +SelfTradePreventionMode + +CHAR + +N + +Possible values: + +`1` - NONE + +`2` - EXPIRE\_TAKER + +`3` - EXPIRE\_MAKER + +`4` - EXPIRE\_BOTH + +`5` - DECREMENT +`6` - TRANSFER + +211 + +PegOffsetValue + +FLOAT + +N + +Amount added to the peg in the context of the PegOffsetType + +1094 + +PegPriceType + +CHAR + +N + +Defines the type of peg +Possible values: +`4` - MARKET\_PEG +`5` - PRIMARY\_PEG + +835 + +PegMoveType + +CHAR + +N + +Describes whether peg is fixed or floats. Required for Pegged Orders and must be set to `1` (FIXED) + +836 + +PegOffsetType + +CHAR + +N + +Type of price peg offset. +Possible values: + +`3` - PRICE\_TIER + +1100 + +TriggerType + +CHAR + +N + +Possible values: `4` - PRICE\_MOVEMENT + +1101 + +TriggerAction + +CHAR + +N + +Possible values: + +`1` - ACTIVATE + +1102 + +TriggerPrice + +PRICE + +N + +Activation price for contingent orders. See [table](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +1107 + +TriggerPriceType + +CHAR + +N + +Possible values: + +`2` - LAST\_TRADE + +1109 + +TriggerPriceDirection + +CHAR + +N + +Used to differentiate between StopLoss and TakeProfit orders. See [table](https://developers.binance.com/docs/binance-spot-api-docs/fix-api). + +Possible values: + +`U` - TRIGGER\_IF\_THE\_PRICE\_OF\_THE\_SPECIFIED\_TYPE\_GOES\_UP\_TO\_OR\_THROUGH\_THE\_SPECIFIED\_TRIGGER\_PRICE + +`D` - TRIGGER\_IF\_THE\_PRICE\_OF\_THE\_SPECIFIED\_TYPE\_GOES\_DOWN\_TO\_OR\_THROUGH\_THE\_SPECIFIED\_TRIGGER\_PRICE + +25009 + +TriggerTrailingDeltaBips + +INT + +N + +Provide to create trailing orders. + +**Sample message:** + +``` +8=FIX.4.4|9=160|35=XCN|34=2|49=JS8iiXK6|52=20240613-02:31:53.753|56=SPOT|11=1718245913721036458|37=8|38=5|40=2|44=4|54=1|55=LTCBNB|59=1|111=1|25033=1|25034=1718245913721036819|10=229| +``` + +**Response:** + +- [ExecutionReport`<8>`](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) with `ExecType (150)` value `CANCELED (4)` for the canceled order. +- [ExecutionReport`<8>`](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) with `ExecType (150)` value `NEW (0)` for the new order. +- [ExecutionReport`<8>`](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) with `ExecType (150)` value `REJECTED (8)` if the new order was rejected. +- [OrderCancelReject`<9>`](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) if the cancellation was rejected. +- [Reject`<3>`](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) if the message is rejected. + +#### OrderMassCancelRequest ``[​](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +Sent by the client to cancel all open orders on a symbol. + +> \[!NOTE\] All orders of the account will be canceled, including those placed in different connections. + +Tag + +Name + +Type + +Required + +Description + +11 + +ClOrdID + +STRING + +Y + +`ClOrdId` of this mass cancel request. + +55 + +Symbol + +STRING + +Y + +Symbol on which to cancel orders. + +530 + +MassCancelRequestType + +CHAR + +Y + +Possible values: + +`1` - CANCEL\_SYMBOL\_ORDERS + +**Sample message:** + +``` +8=FIX.4.4|9=95|35=q|34=2|49=dpYPesqv|52=20240613-01:24:36.948|56=SPOT|11=1718241876901971671|55=BTCUSDT|530=1|10=243| +``` + +**Responses:** + +- [ExecutionReport`<8>`](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) with `ExecType (150)` value `CANCELED (4)` for the every order canceled. +- [OrderMassCancelReport``](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) with `MassCancelResponse (531)` field indicating whether the message is accepted or rejected. +- [Reject`<3>`](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) if the message is rejected. + +#### OrderMassCancelReport ``[​](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +Sent by the server in response to [OrderMassCancelRequest``](https://developers.binance.com/docs/binance-spot-api-docs/fix-api). + +Tag + +Name + +Type + +Required + +Description + +55 + +Symbol + +STRING + +Y + +`Symbol (55)` from the cancel request. + +11 + +ClOrdID + +STRING + +Y + +`ClOrdID (11)` of the cancel request. + +530 + +MassCancelRequestType + +CHAR + +Y + +`MassCancelRequestType (530)` from the cancel request. + +531 + +MassCancelResponse + +CHAR + +Y + +Possible values: + +`0` - CANCEL\_REQUEST\_REJECTED + +`1` - CANCEL\_SYMBOL\_ORDERS + +532 + +MassCancelRejectReason + +INT + +N + +Possible values: + +`99` - OTHER + +533 + +TotalAffectedOrders + +INT + +N + +How many orders were canceled. + +25016 + +ErrorCode + +INT + +N + +API error code (see [Error Codes](https://developers.binance.com/docs/binance-spot-api-docs/errors)). + +58 + +Text + +STRING + +N + +Human-readable error message. + +**Sample message:** + +``` +8=FIX.4.4|9=109|35=r|34=2|49=SPOT|52=20240613-01:24:36.949763|56=dpYPesqv|11=1718241876901971671|55=LTCBNB|530=1|531=1|533=5|10=083| +``` + +#### NewOrderList ``[​](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +Sent by the client to submit a list of orders for execution. + +- OCOs or OTOs add **2 orders** to the `EXCHANGE_MAX_ORDERS` filter and the `MAX_NUM_ORDERS` filter. +- OTOCOs add **3 orders** to the `EXCHANGE_MAX_NUM_ORDERS` filter and `MAX_NUM_ORDERS` filter. + +**Unfilled Order Count:** + +- OCO: 2 +- OTO: 2 +- OTOCO: 3 + +Orders in an order list are contingent on one another. Please refer to [Supported Order List Types](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) for supported order types and triggering instructions. + +Tag + +Name + +Type + +Required + +Description + +25014 + +ClListID + +STRING + +Y + +`ClListID` to be assigned to the order list. + +1385 + +ContingencyType + +INT + +N + +Possible values: + +`1` - ONE\_CANCELS\_THE\_OTHER + +`2` - ONE\_TRIGGERS\_THE\_OTHER + +25046 + +OPO + +BOOLEAN + +N + +Sets this order list as an [OPO](https://developers.binance.com/docs/binance-spot-api-docs/faqs/opo) when set to `true`. + +73 + +NoOrders + +NUMINGROUP + +N + +The length of the array for Orders. Only 2 or 3 are allowed. + +\=>11 + +ClOrdID + +STRING + +Y + +`ClOrdID` to be assigned to the order + +\=>38 + +OrderQty + +QTY + +N + +Quantity of the order + +\=>40 + +OrdType + +CHAR + +Y + +See the [table](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) to understand supported order types and the required fields to use them. + +Possible values: + +`1` - MARKET + +`2` - LIMIT + +`3` - STOP + +`4` - STOP\_LIMIT + +`P` - PEGGED + +\=>18 + +ExecInst + +CHAR + +N + +Possible values: + +`6` - PARTICIPATE\_DONT\_INITIATE + +\=>44 + +Price + +PRICE + +N + +Price of the order + +\=>54 + +Side + +CHAR + +Y + +Side of the order. Possible values: + +`1` - BUY + +`2` - SELL + +\=>55 + +Symbol + +STRING + +Y + +Symbol to place the order on. + +\=>59 + +TimeInForce + +CHAR + +N + +Possible values: + +`1` - GOOD\_TILL\_CANCEL + +`3` - IMMEDIATE\_OR\_CANCEL + +`4` - FILL\_OR\_KILL + +\=>111 + +MaxFloor + +QTY + +N + +Used for iceberg orders, this specifies the visible quantity of the order on the book. + +\=>152 + +CashOrderQty + +QTY + +N + +Quantity of the order specified in the quote asset units, for reverse market orders. + +\=>847 + +TargetStrategy + +INT + +N + +The value cannot be less than `1000000`. + +\=>7940 + +StrategyID + +INT + +N + +\=>25001 + +SelfTradePreventionMode + +CHAR + +N + +Possible values: + +`1` - NONE + +`2` - EXPIRE\_TAKER + +`3` - EXPIRE\_MAKER + +`4` - EXPIRE\_BOTH + +`5` - DECREMENT +`6` - TRANSFER + +\=>211 + +PegOffsetValue + +FLOAT + +N + +Amount added to the peg in the context of the PegOffsetType + +\=>1094 + +PegPriceType + +CHAR + +N + +Defines the type of peg +Possible values: +`4` - MARKET\_PEG +`5` - PRIMARY\_PEG + +\=>835 + +PegMoveType + +CHAR + +N + +Describes whether peg is fixed or floats. Required for Pegged Orders and must be set to `1` (FIXED) + +\=>836 + +PegOffsetType + +CHAR + +N + +Type of price peg offset. +Possible values: + +`3` - PRICE\_TIER + +\=>1100 + +TriggerType + +CHAR + +N + +Possible values: + +`4` - PRICE\_MOVEMENT + +\=>1101 + +TriggerAction + +CHAR + +N + +Possible values: + +`1` - ACTIVATE + +\=>1102 + +TriggerPrice + +PRICE + +N + +Activation price for contingent orders. See [table](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +\=>1107 + +TriggerPriceType + +CHAR + +N + +Possible values: + +`2` - LAST\_TRADE + +\=>1109 + +TriggerPriceDirection + +CHAR + +N + +Used to differentiate between StopLoss and TakeProfit orders. See [table](https://developers.binance.com/docs/binance-spot-api-docs/fix-api). + +Possible values: + +`U` - TRIGGER\_IF\_THE\_PRICE\_OF\_THE\_SPECIFIED\_TYPE\_GOES\_UP\_TO\_OR\_THROUGH\_THE\_SPECIFIED\_TRIGGER\_PRICE + +`D` - TRIGGER\_IF\_THE\_PRICE\_OF\_THE\_SPECIFIED\_TYPE\_GOES\_DOWN\_TO\_OR\_THROUGH\_THE\_SPECIFIED\_TRIGGER\_PRICE + +\=>25009 + +TriggerTrailingDeltaBips + +INT + +N + +Provide to create trailing orders. + +\=>25010 + +NoListTriggeringInstructions + +NUMINGROUP + +N + +The length of the array for ListTriggeringInstructions. + +\==>25011 + +ListTriggerType + +CHAR + +N + +What needs to happen to the order pointed to by ListTriggerTriggerIndex in order for the action to take place. + +Possible values: + +`1` - ACTIVATED + +`2` - PARTIALLY\_FILLED + +`3` - FILLED + +\==>25012 + +ListTriggerTriggerIndex + +INT + +N + +Index of the trigger order: 0-indexed. + +\==>25013 + +ListTriggerAction + +CHAR + +N + +Action to take place on this order after the ListTriggerType has been fulfilled. + +Possible values: + +`1` - RELEASE + +`2` - CANCEL + +**Sample message:** + +``` +8=FIX.4.4|9=236|35=E|34=2|49=Eg13pOvN|52=20240607-02:19:07.836|56=SPOT|73=2|11=w1717726747805308656|55=LTCBNB|54=2|38=1|40=2|44=0.25|59=1|11=p1717726747805308656|55=LTCBNB|54=2|38=1|40=1|25010=1|25011=3|25012=0|25013=1|1385=2|25014=1717726747805308656|10=171| +``` + +#### Supported Order List Types[​](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +> \[!NOTE\] Orders must be specified in the sequence indicated in the _Order Names_ column in the table below. + +Order list name + +Contingency Type (1385) + +Order names + +Order sides + +Allowed Binance order types + +List Triggering Instructions + +OCO + +`1` + +1\. below order + + + +2\. above order + +1\. below order=`SELL` + + + +2\. above order=`SELL` + +1\. below order=`STOP_LOSS` or `STOP_LOSS_LIMIT` + + + +2\. above order=`LIMIT_MAKER` + +1\. below order: + +`25010=1|25011=2|25012=1|25013=2|` + + + +2\. above order: + +`25010=1|25011=1|25012=0|25013=2|` + +OCO + +`1` + +1\. below order + + + +2\. above order + +1\. below order=`BUY` + + + +2\. above order=`BUY` + +1\. below order=`LIMIT_MAKER` + + + +2\. above order=`STOP_LOSS` or `STOP_LOSS_LIMIT` + +1\. below order: + +`25010=1|25011=1|25012=1|25013=2|` + + + +2\. above order: + +`25010=1|25011=2|25012=0|25013=2|` + +OCO + +`1` + +1\. below order + + + +2\. above order + +1\. below order=`SELL` + + + +2\. above order=`SELL` + +1\. below order=`STOP_LOSS` or `STOP_LOSS_LIMIT` + + + +2\. above order= `TAKE_PROFIT` + +1\. below order: + +`25010=1|25011=1|25012=1|25013=2|` + + + +2\. above order: + +`25010=1|25011=1|25012=0|25013=2|` + +OCO + +`1` + +1\. below order + + + +2\. above order + +1\. below order=`BUY` + + + +2\. above order=`BUY` + +1\. below order=`TAKE_PROFIT` + + + +2\. above order = `STOP_LOSS` or `STOP_LOSS_LIMIT` + +1\. below order: + +`25010=1|25011=1|25012=1|25013=2|` + + + +2\. above order: + +`25010=1|25011=1|25012=0|25013=2|` + +OTO + +`2` + +1\. working order + + + +2\. pending order + +1\. working order=`SELL` or `BUY` + + + +2\. pending order=`SELL` or `BUY` + +1\. working order=`LIMIT` or `LIMIT_MAKER` + + + +2\. pending order=ANY + +1\. working order: + +NONE + + + +2\. pending order: + +`25010=1|25011=3|25012=0|25013=1|` + +OTOCO + +`2` + +1\. working order + + + +2\. pending below order + + + +3\. pending above order + +1\. working order=`SELL` or `BUY` + + + +2\. pending below order=`SELL` + + + +3\. pending above order=`SELL` + +1\. working order=`LIMIT` or `LIMIT_MAKER` + + + +2\. pending below order=`STOP_LOSS` or `STOP_LOSS_LIMIT` + + + +3\. pending above order=`LIMIT_MAKER` + +1\. working order: + +NONE + + + +2\. pending below order: + +`25010=2|25011=3|25012=0|25013=2|25011=2|25012=2|25013=2|` + + + +3\. pending above order: + +`25010=2|25011=3|25012=0|25013=2|25011=1|25012=1|25013=2|` + +OTOCO + +`2` + +1\. working order + + + +2\. pending below order + + + +3\. pending above order + +1\. working order=`SELL` or `BUY` + + + +2\. pending below order=`BUY` + + + +3\. pending above order=`BUY` + +1\. working order=`LIMIT` or `LIMIT_MAKER` + + + +2\. pending below order=`LIMIT_MAKER` + + + +3\. pending above order=`STOP_LOSS` or `STOP_LOSS_LIMIT` + +1\. working order: + +NONE + + + +2\. pending below order: + +`25010=2|25011=3|25012=0|25013=2|25011=1|25012=2|25013=2|` + + + +3\. pending above order: + +`25010=2|25011=3|25012=0|25013=2|25011=2|25012=1|25013=2|` + +OTOCO + +`2` + +1\. working order + + + +2\. pending below order + + + +3\. pending above order + +1\. working order=`SELL` or `BUY` + + + +2\. pending below order=`SELL` + + + +3\. pending above order=`SELL` + +1\. working order=`LIMIT` or `LIMIT_MAKER` + + + +2\. pending below order=`STOP_LOSS` or `STOP_LOSS_LIMIT` + + + +3\. pending above order=`TAKE_PROFIT` + +1\. working order: + +NONE + + + +2\. pending below order: + +`25010=2|25011=3|25012=0|25013=2|25011=1|25012=2|25013=2|` + + + +3\. pending above order: + +`25010=2|25011=3|25012=0|25013=2|25011=1|25012=1|25013=2|` + +OTOCO + +`2` + +1\. working order + + + +2\. pending below order + + + +3\. pending above order + +1\. working order=`SELL` or `BUY` + + + +2\. pending below order=`BUY` + + + +3\. pending above order=`BUY` + +1\. working order=`LIMIT` or `LIMIT_MAKER` + + + +2\. pending below order=`TAKE_PROFIT` + + + +3\. pending above order=`STOP_LOSS` or `STOP_LOSS_LIMIT` + +1\. working order: + +NONE + + + +2\. pending below order: + +`25010=2|25011=3|25012=0|25013=2|25011=1|25012=2|25013=2|` + + + +3\. pending above order: + +`25010=2|25011=3|25012=0|25013=2|25011=1|25012=1|25013=2|` + +OPO + +`2` + +1\. working order + + + +2\. pending order + +1\. working order=`BUY` + + + +2\. pending order=`SELL` + +1\. working order=`LIMIT` or `LIMIT_MAKER` + + + +2\. pending order=ANY + +1\. working order: + +NONE + + + +2\. pending order: + +`25010=1|25011=3|25012=0|25013=1|` + +OPOCO + +`2` + +1\. working order + + + +2\. pending below order + + + +3\. pending above order + +1\. working order=`BUY` + + + +2\. pending below order=`SELL` + + + +3\. pending above order=`SELL` + +1\. working order=`LIMIT` or `LIMIT_MAKER` + + + +2\. pending below order=`STOP_LOSS` or `STOP_LOSS_LIMIT` + + + +3\. pending above order=`LIMIT_MAKER` + +1\. working order: + +NONE + + + +2\. pending below order: + +`25010=2|25011=3|25012=0|25013=2|25011=2|25012=2|25013=2|` + + + +3\. pending above order: + +`25010=2|25011=3|25012=0|25013=2|25011=1|25012=1|25013=2|` + +OPOCO + +`2` + +1\. working order + + + +2\. pending below order + + + +3\. pending above order + +1\. working order=`BUY` + +2\. pending below order=`SELL` + + + +3\. pending above order=`SELL` + +1\. working order=`LIMIT` or `LIMIT_MAKER` + + + +2\. pending below order=`STOP_LOSS` or `STOP_LOSS_LIMIT` + + + +3\. pending above order=`TAKE_PROFIT` or `TAKE_PROFIT_LIMIT` + +1\. working order: + +NONE + + + +2\. pending below order: + +`25010=2|25011=3|25012=0|25013=2|25011=1|25012=2|25013=2|` + + + +3\. pending above order: + +`25010=2|25011=3|25012=0|25013=2|25011=1|25012=1|25013=2|` + +#### ListStatus ``[​](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +Sent by the server whenever an order list state changes. + +> \[!NOTE\] By default, ListStatus`` is sent for all order lists of an account, including those submitted in different connections. Please see [Response Mode](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) for other behavior options. + +Tag + +Name + +Type + +Required + +Description + +55 + +Symbol + +STRING + +Y + +Symbol of the order list. + +66 + +ListID + +STRING + +N + +`ListID` of the list as assigned by the exchange. + +25014 + +ClListID + +STRING + +N + +`ClListID` of the list as assigned on the request. + +25015 + +OrigClListID + +STRING + +N + +1385 + +ContingencyType + +INT + +N + +Possible values: + +`1` - ONE\_CANCELS\_THE\_OTHER + +`2` - ONE\_TRIGGERS\_THE\_OTHER + +429 + +ListStatusType + +INT + +Y + +Possible values: + +`2` - RESPONSE + +`4` - EXEC\_STARTED + +`5` - ALL\_DONE + +`100` - UPDATED + +431 + +ListOrderStatus + +INT + +Y + +Possible values: + +`3` - EXECUTING + +`6` - ALL\_DONE + +`7` - REJECT + +1386 + +ListRejectReason + +INT + +N + +Possible values: + +`99` - OTHER + +103 + +OrdRejReason + +INT + +N + +Possible values: + +`99` - OTHER + +60 + +TransactTime + +UTCTIMESTAMP + +N + +Timestamp when this event occurred. + +25016 + +ErrorCode + +INT + +N + +API error code (see [Error Codes](https://developers.binance.com/docs/binance-spot-api-docs/errors)). + +58 + +Text + +STRING + +N + +Human-readable error message. + +73 + +NoOrders + +NUMINGROUP + +N + +The length of the array for Orders. + +\=>55 + +Symbol + +STRING + +Y + +Symbol of the order. + +\=>37 + +OrderID + +INT + +Y + +`OrderID` of the order as assigned by the exchange. + +\=>11 + +ClOrdID + +STRING + +Y + +`ClOrdID` of the order as assigned on the request. + +\=>25010 + +NoListTriggeringInstructions + +NUMINGROUP + +N + +The length of the array for ListTriggeringInstructions. + +\==>25011 + +ListTriggerType + +CHAR + +N + +Possible values: + +`1` - ACTIVATED + +`2` - PARTIALLY\_FILLED + +`3` - FILLED + +\==>25012 + +ListTriggerTriggerIndex + +INT + +N + +\==>25013 + +ListTriggerAction + +CHAR + +N + +Possible values: + +`1` - RELEASE + +`2` - CANCEL + +**Sample message:** + +``` +8=FIX.4.4|9=293|35=N|34=2|49=SPOT|52=20240607-02:19:07.837191|56=Eg13pOvN|55=BTCUSDT|60=20240607-02:19:07.836000|66=25|73=2|55=BTCUSDT|37=52|11=w1717726747805308656|55=BTCUSDT|37=53|11=p1717726747805308656|25010=1|25011=3|25012=0|25013=1|429=4|431=3|1385=2|25014=1717726747805308656|25015=1717726747805308656|10=162| +``` + +#### OrderAmendKeepPriorityRequest ``[​](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +Sent by the client to reduce the original quantity of their order. + +This adds 0 orders to the `EXCHANGE_MAX_ORDERS` filter and the `MAX_NUM_ORDERS` filter. + +**Unfilled Order Count:** 0 + +Read [Order Amend Keep Priority FAQ](https://developers.binance.com/docs/binance-spot-api-docs/faqs/order_amend_keep_priority) to learn more. + +**Notes:** + +- The `ClOrdID (11)` is not required to be different from the `ClOrdID` of the order. When the `ClOrdID` of the request is the same as the `ClOrdID` of the order being amended, the `ClOrdID` will remain unchanged. +- If both `OrderID (37)` and `OrigClOrdID (41)` are provided, the `OrderID` is searched first, then the `OrigClOrdID (41)` from that result is checked against that order. If both conditions are not met the request will be rejected. + +Tag + +Name + +Type + +Required + +Description + +11 + +ClOrdID + +STRING + +Y + +The ClOrdID of this request. + +41 + +OrigClOrdID + +STRING + +N + +`ClOrdID (11)` of the order to amend. Either `OrigClOrdID (41)` or `OrderId (37)` have to be specified. + +37 + +OrderID + +INT + +N + +`OrderID (37)` of the order to amend. Either `OrigClOrdID (41)` or `OrderId (37)` have to be specified. + +55 + +Symbol + +STRING + +Y + +Symbol on which to amend the order. + +38 + +OrderQty + +QTY + +N + +New quantity of the order. Required to be smaller than the original OrderQty of the order. + +**Sample message:** + +``` +8=FIX.4.4|9=103|35=XAK|34=2|49=EXAMPLE|52=20250319-12:35:21.087|56=SPOT|11=O2EIAS01742387721086|37=0|38=0.9|55=BTCUSDT|10=254| +``` + +**Response:** + +- [Reject `<3>`](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) if the incoming request is invalid either due to missing required fields, invalid fields, refers to an invalid symbol, or exceeds the message limit. +- [OrderAmendReject ``](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) if failed due to insufficient order rate limits, pointing to a non-existent order, quantity is invalid, etc. +- [ExecutionReport `<8>`](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) if the request succeeded for amending a single order. +- [ExecutionReport `<8>`](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + [ListStatus ``](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) if the request succeeded for amending an order which is part of an Order list. + +### OrderAmendReject ``[​](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +Sent by the server when the OrderAmendKeepPriorityRequest `` has failed. + +Tag + +Name + +Type + +Required + +Description + +11 + +ClOrdID + +STRING + +Y + +`ClOrdId` of the amend request. + +41 + +OrigClOrdID + +STRING + +N + +`OrigClOrdId` (41) from the amend request. + +37 + +OrderID + +INT + +N + +`OrderId (37)` from the amend request. + +55 + +Symbol + +STRING + +Y + +`Symbol (55)` from the amend request. + +38 + +OrderQty + +QTY + +Y + +25016 + +ErrorCode + +INT + +Y + +API error code (see [Error Codes](https://developers.binance.com/docs/binance-spot-api-docs/errors)). + +58 + +Text + +STRING + +Y + +Human-readable error message. + +**Sample message:** + +``` +8=FIX.4.4|9=0000176|35=XAR|49=SPOT|56=OE|34=2|52=20250319-14:27:32.751074|11=1WRGW5J1742394452749|37=0|55=BTCUSDT|38=1.000000|25016=-2038|58=The requested action would change no state; rejecting.|10=235| +``` + +### Limit Messages[​](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +#### LimitQuery ``[​](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +Sent by the client to query current limits. + +Tag + +Name + +Type + +Required + +Description + +6136 + +ReqID + +STRING + +Y + +ID of this request + +**Sample message:** + +``` +8=FIX.4.4|9=82|35=XLQ|34=2|49=7buKHZxZ|52=20240614-05:35:35.357|56=SPOT|6136=1718343335357229749|10=170| +``` + +#### LimitResponse ``[​](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +Sent by the server in response to [LimitQuery``](https://developers.binance.com/docs/binance-spot-api-docs/fix-api). + +Tag + +Name + +Type + +Required + +Description + +6136 + +ReqID + +STRING + +Y + +`ReqID` from the request. + +25003 + +NoLimitIndicators + +NUMINGROUP + +Y + +The length of the array for LimitIndicators. + +\=>25004 + +LimitType + +CHAR + +Y + +Possible values: + +`1` - ORDER\_LIMIT + +`2` - MESSAGE\_LIMIT + +\=>25005 + +LimitCount + +INT + +Y + +The current use of this limit. + +\=>25006 + +LimitMax + +INT + +Y + +The maximum allowed for this limit. + +\=>25007 + +LimitResetInterval + +INT + +N + +How often the limit resets. + +\=>25008 + +LimitResetIntervalResolution + +CHAR + +N + +Time unit of `LimitResetInterval`. Possible values: + +`s` - SECOND + +`m` - MINUTE + +`h` - HOUR + +`d` - DAY + +**Sample message:** + +``` +8=FIX.4.4|9=225|35=XLR|34=2|49=SPOT|52=20240614-05:42:42.724057|56=uGnG0ef8|6136=1718343762723730315|25003=3|25004=2|25005=1|25006=1000|25007=10|25008=s|25004=1|25005=0|25006=200|25007=10|25008=s|25004=1|25005=0|25006=200000|25007=1|25008=d|10=241| +``` + +### Market Data Messages[​](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +> \[!NOTE\] The messages below can only be used for the FIX Market Data. + +#### InstrumentListRequest ``[​](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +Sent by the client to query information about instruments. + +Tag + +Name + +Type + +Required + +Description + +320 + +InstrumentReqID + +STRING + +Y + +ID of this request + +559 + +InstrumentListRequestType + +INT + +Y + +Possible values: + +`0` - SINGLE\_INSTRUMENT + +`4` - ALL\_INSTRUMENTS + +55 + +Symbol + +STRING + +N + +Required when the `InstrumentListRequestType` is set to `SINGLE_INSTRUMENT(0)` + +**Sample message:** + +``` +8=FIX.4.4|9=92|35=x|49=BMDWATCH|56=SPOT|34=2|52=20250114-08:46:56.096691|320=BTCUSDT_INFO|559=0|55=BTCUSDT|10=164| +``` + +#### InstrumentList ``[​](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +Sent by the server in a response to the [InstrumentListRequest``](https://developers.binance.com/docs/binance-spot-api-docs/fix-api). + +> \[!NOTE\] More detailed symbol information is available through the [exchangeInfo](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api/general-endpoints.md) endpoint. + +Tag + +Name + +Type + +Required + +Description + +320 + +InstrumentReqID + +STRING + +Y + +`InstrumentReqID` from the request. + +146 + +NoRelatedSym + +NUMINGROUP + +Y + +Number of symbols + +\=>55 + +Symbol + +STRING + +Y + +\=>15 + +Currency + +STRING + +Y + +Quote asset of this symbol + +\=>562 + +MinTradeVol + +QTY + +N + +Corresponds to the [LOT\_SIZE](https://developers.binance.com/docs/binance-spot-api-docs/filters) filter + +\=>1140 + +MaxTradeVol + +QTY + +N + +Corresponds to the [LOT\_SIZE](https://developers.binance.com/docs/binance-spot-api-docs/filters) filter + +\=>25039 + +MinQtyIncrement + +QTY + +N + +Corresponds to the [LOT\_SIZE](https://developers.binance.com/docs/binance-spot-api-docs/filters) filter + +\=>25040 + +MarketMinTradeVol + +QTY + +N + +Corresponds to the [MARKET\_LOT\_SIZE](https://developers.binance.com/docs/binance-spot-api-docs/filters) filter + +\=>25041 + +MarketMaxTradeVol + +QTY + +N + +Corresponds to the [MARKET\_LOT\_SIZE](https://developers.binance.com/docs/binance-spot-api-docs/filters) filter + +\=>25042 + +MarketMinQtyIncrement + +QTY + +N + +Corresponds to the [MARKET\_LOT\_SIZE](https://developers.binance.com/docs/binance-spot-api-docs/filters) filter + +\=>969 + +MinPriceIncrement + +PRICE + +N + +Corresponds to the [PRICE](https://developers.binance.com/docs/binance-spot-api-docs/filters) filter + +\=>2551 + +StartPriceRange + +PRICE + +N + +Corresponds to the [PRICE](https://developers.binance.com/docs/binance-spot-api-docs/filters) filter + +\=>2552 + +EndPriceRange + +PRICE + +N + +Corresponds to the [PRICE](https://developers.binance.com/docs/binance-spot-api-docs/filters) filter + +**Sample message:** + +``` +8=FIX.4.4|9=218|35=y|49=SPOT|56=BMDWATCH|34=2|52=20250114-08:46:56.100147|320=BTCUSDT_INFO|146=1|55=BTCUSDT|15=USDT|562=0.00001000|1140=9000.00000000|25039=0.00001000|25040=0.00000001|25041=76.79001236|25042=0.00000001|969=0.01000000|10=093| +``` + +#### MarketDataRequest ``[​](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +Sent by the client to subscribe to or unsubscribe from market data stream. + +**Trade Stream** + +The Trade Streams push raw trade information; each trade has a unique buyer and seller. + +**Fields required to subscribe:** + +- `SubscriptionRequestType` present with value `SUBSCRIBE(1)` +- `MDEntryType` present with value `TRADE(2)` + +**Update Speed:** Real-time + +**Individual Symbol Book Ticker Stream** + +Pushes any update to the best bid or offers price or quantity in real-time for a specified symbol. + +**Fields required to subscribe:** + +- `SubscriptionRequestType` with value `SUBSCRIBE(1)` +- `MDEntryType` with value `BID(0)` +- `MDEntryType` with value `OFFER(1)` +- `MarketDepth` with value `1` + +**Update Speed:** Real-time + +> \[!NOTE\] In the [Individual Symbol Book Ticker Stream](https://developers.binance.com/docs/binance-spot-api-docs/fix-api), when `MDUpdateAction` is set to `CHANGE(1)` in a [MarketDataIncrementalRefresh``](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) message sent from the server, it replaces the previous best quote. + +**Diff. Depth Stream** + +Order book price and quantity depth updates used to locally manage an order book. + +**Fields required to subscribe:** + +- `SubscriptionRequestType` with value `SUBSCRIBE(1)` +- `MDEntryType` with value `BID(0)` +- `MDEntryType` with value `OFFER(1)` +- `MarketDepth` with a value between `2` and `5000`, which controls the size of the initial snapshot and has no effect on subsequent [MarketDataIncrementalRefresh``](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) messages + +**Update Speed:** 100ms + +> \[!NOTE\] Since the [MarketDataSnapshot``](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) have a limit on the number of price levels (5000 on each side maximum), you won't learn the quantities for the levels outside of the initial snapshot unless they change. So be careful when using the information for those levels, since they might not reflect the full view of the order book. However, for most use cases, seeing 5000 levels on each side is enough to understand the market and trade effectively. + +Tag + +Name + +Type + +Required + +Description + +262 + +MDReqID + +STRING + +Y + +ID of this request + +263 + +SubscriptionRequestType + +CHAR + +Y + +Subscription Request Type. Possible values: + +`1` - SUBSCRIBE + +`2` - UNSUBSCRIBE + +264 + +MarketDepth + +INT + +N + +Subscription depth. + +Possible values: + +`1` - Book Ticker subscription + +`2`\-`5000` - Diff. Depth Stream + +266 + +AggregatedBook + +NUMINGROUP + +N + +Possible values: + +`Y` - one book entry per side per price + +146 + +NoRelatedSym + +NUMINGROUP + +N + +Number of symbols + +\=>55 + +Symbol + +STRING + +Y + +267 + +NoMDEntryTypes + +NUMINGROUP + +N + +Number of entry types + +\=>269 + +MDEntryType + +CHAR + +Y + +Possible values: + +`0` - BID + +`1` - OFFER + +`2` - TRADE + +**Sample message:** + +``` +# Subscriptions# BOOK TICKER Stream8=FIX.4.4|9=132|35=V|49=TRADER1|56=SPOT|34=4|52=20241122-06:17:14.183428|262=BOOK_TICKER_STREAM|263=1|264=1|266=Y|146=1|55=BTCUSDT|267=2|269=0|269=1|10=010|# DEPTH Stream8=FIX.4.4|9=127|35=V|49=TRADER1|56=SPOT|34=7|52=20241122-06:17:14.443822|262=DEPTH_STREAM|263=1|264=10|266=Y|146=1|55=BTCUSDT|267=2|269=0|269=1|10=111|# TRADE Stream8=FIX.4.4|9=120|35=V|49=TRADER1|56=SPOT|34=3|52=20241122-06:34:14.775606|262=TRADE_STREAM|263=1|264=1|266=Y|146=1|55=BTCUSDT|267=1|269=2|10=040|# Unsubscription from TRADE Stream8=FIX.4.4|9=79|35=V|49=TRADER1|56=SPOT|34=7|52=20241122-06:41:56.966969|262=TRADE_STREAM|263=2|264=1|10=113| +``` + +### MarketDataRequestReject ``[​](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +Sent by the server in a response to an invalid MarketDataRequest ``. + +Tag + +Name + +Type + +Required + +Description + +262 + +MDReqID + +STRING + +Y + +ID of the invalid [MarketDataRequest``](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +281 + +MDReqRejReason + +CHAR + +N + +Possible values: + +`1` - DUPLICATE\_MDREQID + +`2` - TOO\_MANY\_SUBSCRIPTIONS + +25016 + +ErrorCode + +INT + +N + +API Error code. See [Errors](https://developers.binance.com/docs/binance-spot-api-docs/errors) + +58 + +Text + +STRING + +N + +Human-readable error message. + +**Sample message:** + +``` +8=FIX.4.4|9=0000218|35=Y|49=SPOT|56=EXAMPLE|34=5|52=20241019-05:39:36.688964|262=BOOK_TICKER_2|281=2|25016=-1191|58=Similar subscription is already active on this connection. Symbol='BNBBUSD', active subscription id: 'BOOK_TICKER_1'.|10=137| +``` + +### MarketDataSnapshot ``[​](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +Sent by the server in response to a [MarketDataRequest``](https://developers.binance.com/docs/binance-spot-api-docs/fix-api), activating [Individual Symbol Book Ticker Stream](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) or [Diff. Depth Stream](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) subscriptions. + +Tag + +Name + +Type + +Required + +Description + +262 + +MDReqID + +STRING + +Y + +ID of the [MarketDataRequest``](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) that activated this subscription + +55 + +Symbol + +STRING + +Y + +25044 + +LastBookUpdateID + +INT + +N + +268 + +NoMDEntries + +NUMINGROUP + +Y + +Number of entries + +\=>269 + +MDEntryType + +CHAR + +Y + +Possible values: + +`0` - BID + +`1` - OFFER + +`2` - TRADE + +\=>270 + +MDEntryPx + +PRICE + +Y + +Price + +\=>271 + +MDEntrySize + +QTY + +Y + +Quantity + +**Sample message:** + +``` +8=FIX.4.4|9=0000107|35=W|49=SPOT|56=EXAMPLE|34=34|52=20241019-05:41:52.867164|262=BOOK_TICKER_1_2|55=BNBBUSD|25044=0|268=0|10=151| +``` + +### MarketDataIncrementalRefresh ``[​](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +Sent by the server when there is a change in a subscribed stream. + +Tag + +Name + +Type + +Required + +Description + +262 + +MDReqID + +STRING + +Y + +ID of the [MarketDataRequest``](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) that activated this subscription + +893 + +LastFragment + +BOOLEAN + +N + +When present, this indicates that the message was fragmented. Fragmentation occurs when `NoMDEntry` would exceed 10000 in a single [MarketDataIncrementalRefresh``](https://developers.binance.com/docs/binance-spot-api-docs/fix-api), in order to limit it to 10000. The fragments of a fragmented message are guaranteed to be consecutive in the stream. It can only appear in the [Trade Stream](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) and [Diff. Depth Stream](https://developers.binance.com/docs/binance-spot-api-docs/fix-api). + +268 + +NoMDEntries + +NUMINGROUP + +Y + +Number of entries + +\=>279 + +MDUpdateAction + +CHAR + +Y + +Possible values: + +`0` - NEW + +`1` - CHANGE + +`2` - DELETE + +\=>270 + +MDEntryPx + +PRICE + +Y + +Price + +\=>271 + +MDEntrySize + +QTY + +N + +Quantity + +\=>269 + +MDEntryType + +CHAR + +Y + +Possible values: + +`0` - BID + +`1` - OFFER + +`2` - TRADE + +\=>55 + +Symbol + +STRING + +N + +Market Data Entry will default to the same `Symbol` of the previous Market Data Entry in the same Market Data message if `Symbol` is not specified + +\=>60 + +TransactTime + +UTCTIMESTAMP + +N + +\=>1003 + +TradeID + +INT + +N + +\=>2446 + +AggressorSide + +CHAR + +N + +Possible values: + +`1` - BUY + +`2` - SELL + +\=>25043 + +FirstBookUpdateID + +INT + +N + +Only present in [Diff. Depth Stream](https://developers.binance.com/docs/binance-spot-api-docs/fix-api). + +Market Data Entry will default to the same `FirstBookUpdateID` of the previous Market Data Entry in the same Market Data message if `FirstBookUpdateID` is not specified + +\=>25044 + +LastBookUpdateID + +INT + +N + +Only present in [Diff. Depth Stream](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) and [Individual Symbol Book Ticker Stream](https://developers.binance.com/docs/binance-spot-api-docs/fix-api). + +Market Data Entry will default to the same `LastBookUpdateID` of the previous Market Data Entry in the same Market Data message if `LastBookUpdateID` is not specified + +**Sample message:** + +``` +8=FIX.4.4|9=0000313|35=X|49=SPOT|56=EXAMPLE|34=16|52=20241019-05:40:11.466313|262=TRADE_3|893=N|268=3|279=0|269=2|270=10.00000|271=0.01000|55=BNBBUSD|1003=0|60=20241019-05:40:11.464000|279=0|269=2|270=10.00000|271=0.01000|1003=1|60=20241019-05:40:11.464000|279=0|269=2|270=10.00000|271=0.01000|1003=2|60=20241019-05:40:11.464000|10=125| +``` + +**Sample fragmented messages:** + +> \[!NOTE\] Below are example messages, with `NoMDEntry` limited to _2_, In the real streams, the `NoMDEntry` is limited to _10000_. + +[Trade Stream](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +``` +8=FIX.4.4|9=237|35=X|34=114|49=SPOT|52=20250116-19:36:44.544549|56=EXAMPLE|262=id|268=2|279=0|270=240.00|271=3.00000000|269=2|55=BNBBUSD|60=20250116-19:36:44.196569|1003=67|279=0|270=238.00|271=2.00000000|269=2|60=20250116-19:36:44.196569|1003=68|893=N|10=180|8=FIX.4.4|9=163|35=X|34=115|49=SPOT|52=20250116-19:36:44.544659|56=EXAMPLE|262=id|268=1|279=0|270=233.00|271=1.00000000|269=2|55=BNBBUSD|60=20250116-19:36:44.196569|1003=69|893=Y|10=243| +``` + +[Diff. Depth Stream](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +``` +8=FIX.4.4|9=156|35=X|34=12|49=SPOT|52=20250116-19:45:31.774162|56=EXAMPLE|262=id|268=2|279=2|270=362.00|269=0|55=BNBBUSD|25043=1143|25044=1145|279=2|270=313.00|269=0|893=N|10=047|8=FIX.4.4|9=171|35=X|34=13|49=SPOT|52=20250116-19:45:31.774263|56=EXAMPLE|262=id|268=2|279=2|270=284.00|269=0|55=BNBBUSD|25043=1143|25044=1145|279=1|270=264.00|271=3.00000000|269=0|893=N|10=239|8=FIX.4.4|9=149|35=X|34=14|49=SPOT|52=20250116-19:45:31.774281|56=EXAMPLE|262=id|268=1|279=1|270=395.00|271=19.00000000|269=1|55=BNBBUSD|25043=1143|25044=1145|893=Y|10=024| +``` + +## FIX SBE[​](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +FIX SBE (Simple Binary Encoding) can be used instead of FIX with the [spot\_fix\_prod\_latest.xml](https://github.com/binance/binance-spot-api-docs/blob/master/sbe/schemas/spot_fix_prod_latest.xml) schema file. + +### SBE[​](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +Read the [SBE FAQ](https://developers.binance.com/docs/binance-spot-api-docs/faqs/sbe_faq) for important information about using SBE with Binance APIs. + +- Please review and understand the [SBE specification](https://www.fixtrading.org/standards/sbe-online) before attempting to use FIX SBE +- When encoding and decoding SBE payloads, it is recommended to use code generated by [`SbeTool`](https://github.com/aeron-io/simple-binary-encoding) to ensure compliance with the FIX SBE specification. + +### Endpoints[​](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +In addition to FIX encoding available on port 9000, two request/response encoding schemes are supported on additional TCP ports. See below endpoints for each API. + +#### Order Entry[​](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +- `tcp+tls://fix-oe.binance.com:9001`: Send FIX requests; receive FIX SBE responses + - FIX `SbeSchemaId` tag (=25050) must be set to the FIX SBE schema ID (=1) + - The FIX `SbeSchemaVersion` tag (=25051) must be set to the FIX SBE schema version (=0) +- `tcp+tls://fix-oe.binance.com:9002`: Send FIX SBE requests; receive FIX SBE responses + +#### Drop Copy[​](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +- `tcp+tls://fix-dc.binance.com:9001`: Send FIX requests; receive FIX SBE responses + - FIX `SbeSchemaId` tag (=25050) must be set to the FIX SBE schema ID (=1) + - The FIX `SbeSchemaVersion` tag (=25051) must be set to the FIX SBE schema version (=0) +- `tcp+tls://fix-dc.binance.com:9002`: Send FIX SBE requests; receive FIX SBE responses + +#### Market data[​](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +- `tcp+tls://fix-md.binance.com:9001`: Send FIX requests; receive FIX SBE responses + - FIX `SbeSchemaId` tag (=25050) must be set to the FIX SBE schema ID (=1) + - The FIX `SbeSchemaVersion` tag (=25051) must be set to the FIX SBE schema version (=0) +- `tcp+tls://fix-md.binance.com:9002`: Send FIX SBE requests; receive FIX SBE responses + +### FIX SBE encoding layout[​](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +FIX SBE request/response messages always come with a SOFH (Simple Open Framing Header) and message header. A given FIX SBE message of N bytes has the following wire format: + +` ` + +SOFH: This corresponds to the "sofh" composite type in the schema file. This acts as a framing header so that the FIX SBE servers/clients can know the length of SBE messages and ensure messages have been fully received prior to deserializing them + +Notes: + +- The two fields within the SOFH MUST be encoded in little-endian +- The FIX servers only support `0xEB50` for the encodingType field, i.e. only little-endian is supported for all fields + +Message header: This corresponds to the "messageHeader" composite type in the schema file. + +### Logon[​](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +The logon signature (RawData) is computed as documented in the [signature computation](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) section. + +#### Sample FIX SBE `Logon` request message[​](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +Please see below the hexdump of a sample FIX SBE `Logon` message obtained by following the above instructions. + +Bytes + +Description + +0xd1, 0x00, 0x00, 0x00 + +sofh.messageLength + +0x50, 0xeb + +sofh.encodingType + +0x0e, 0x00 + +messageHeader.blockLength + +0x28, 0x4e + +messageHeader.templateId + +0x01, 0x00 + +messageHeader.schemaId + +0x00, 0x00 + +messageHeader.version + +0x01, 0x00, 0x00, 0x00 + +messageHeader.seqNum + +0x58, 0x7a, 0x5f, 0x99, 0xdb, 0x1b, 0x06, 0x00 + +messageHeader.sendingTime + +0x00 + +Logon.EncryptMethod + +0x1e, 0x00, 0x00, 0x00 + +Logon.HeartBtInt + +0x01 + +Logon.ResetSeqNumFlag + +0x02 + +Logon.MessageHandling + +0xff + +Logon.ResponseMode + +0xff + +Logon.ExecutionReportType + +0xff + +Logon.DropCopyFlag + +0xff, 0xff, 0xff, 0xff + +Logon.RecvWindow + +0x07 + +Logon.SenderCompId.length + +0x45, 0x58, 0x41, 0x4d, 0x50, 0x4c, 0x45 + +Logon.SenderCompId.varData + +0x04 + +Logon.TargetCompId.length + +0x53, 0x50, 0x4f, 0x54 + +Logon.TargetCompId.varData + +0x58, 0x00 + +Logon.RawData.length + +0x34, 0x4d, 0x48, 0x58, 0x65, 0x6c, 0x56, 0x56 + +Logon.RawData.varData + +0x63, 0x70, 0x6b, 0x64, 0x77, 0x75, 0x4c, 0x62 + +Logon.RawData.varData + +0x6c, 0x36, 0x6e, 0x37, 0x33, 0x48, 0x51, 0x55 + +Logon.RawData.varData + +0x58, 0x55, 0x66, 0x31, 0x64, 0x73, 0x65, 0x32 + +Logon.RawData.varData + +0x50, 0x43, 0x67, 0x54, 0x31, 0x44, 0x59, 0x71 + +Logon.RawData.varData + +0x57, 0x39, 0x77, 0x38, 0x41, 0x56, 0x5a, 0x31 + +Logon.RawData.varData + +0x52, 0x41, 0x43, 0x46, 0x47, 0x4d, 0x2b, 0x35 + +Logon.RawData.varData + +0x55, 0x64, 0x6c, 0x47, 0x50, 0x72, 0x51, 0x48 + +Logon.RawData.varData + +0x72, 0x67, 0x74, 0x53, 0x33, 0x43, 0x76, 0x73 + +Logon.RawData.varData + +0x52, 0x55, 0x52, 0x43, 0x31, 0x6f, 0x6a, 0x37 + +Logon.RawData.varData + +0x33, 0x6a, 0x38, 0x67, 0x43, 0x41, 0x3d, 0x3d + +Logon.RawData.varData + +0x40, 0x00 + +Logon.Username.length + +0x73, 0x42, 0x52, 0x58, 0x72, 0x4a, 0x78, 0x32 + +Logon.Username.varData + +0x44, 0x73, 0x4f, 0x72, 0x61, 0x4d, 0x58, 0x4f + +Logon.Username.varData + +0x61, 0x55, 0x6f, 0x76, 0x45, 0x68, 0x67, 0x56 + +Logon.Username.varData + +0x52, 0x63, 0x6a, 0x4f, 0x76, 0x43, 0x74, 0x51 + +Logon.Username.varData + +0x77, 0x6e, 0x57, 0x6a, 0x38, 0x56, 0x78, 0x6b + +Logon.Username.varData + +0x4f, 0x68, 0x31, 0x78, 0x71, 0x62, 0x6f, 0x53 + +Logon.Username.varData + +0x30, 0x32, 0x53, 0x50, 0x47, 0x66, 0x4b, 0x69 + +Logon.Username.varData + +0x32, 0x68, 0x38, 0x73, 0x70, 0x5a, 0x4a, 0x62 + +Logon.Username.varData + +### FIX vs. FIX SBE[​](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +General: + +- The `sofh.messageLength` field _must_ include the size of the SOFH (6 bytes) +- FIX SBE has no `Checksum` field +- When sending FIX SBE requests on port 9002 + - All fields must be set in the payload + - Optional fields that are not present must be set to the corresponding `nullValue` + - The encoders generated by `SbeTool` handle this correctly + - Please refer to the definition of `nullValue` in the [SBE specification](https://www.fixtrading.org/standards/sbe-online) if encoding payloads manually + +Decimal encoding: + +- In request messages, the values for `PriceExponent` and `QtyExponent` must be no more precise than the precision of the symbol being transacted. Symbol precision can be retrieved from the `InstrumentList` response. + +**Logon** message: + +- The `SenderCompID`, `TargetCompID` and `RecvWindow` fields are provided in the `Logon` FIX SBE message instead of the message header + - The `RecvWindow` field set in the `Logon` message applies to all trading request messages within the FIX SBE session + - When set, the `RecvWindow` field is in microseconds +- When the `ResponseMode` field is set to `OnlyAcks`, the `ExecutionReportType` field can be set to `Mini` to receive `ExecutionReportAck` messages instead of `ExecutionReport` + - Note: The `ExecutionReportType` field is only supported on port 9001 and port 9002 for the Order Entry and Drop Copy endpoints + +**MarketDataIncrementalRefresh** message: + +- This single message in the FIX schema is split into the following FIX SBE messages: `MarketDataIncrementalTrade`, `MarketDataIncrementalBookTicker` and `MarketDataIncrementalDepth` +- The `MDReqID` field is omitted from the market data snapshot and refresh messages as these messages can be tied to the subscription request using the `Symbol` field and the message's template ID + - `MDReqID` is required in the `MarketDataRequest` message so that it may appear in `MarketDataRequestReject` + - The value of `MDReqID` must be unique across subscriptions + +**MarketDataIncrementalTrade** message: + +- The MDUpdateAction field available in the FIX schema is omitted in FIX SBE since the value is always `NEW`. + +**MarketDataIncrementalBookTicker** message: + +- FIX SBE book ticker subscriptions use **auto-culling**: when the system is under high load, it may drop outdated events instead of queuing all events and delivering them with a delay. + - For example, if a best bid/ask event is generated at time T2 when there is still an undelivered event queued at time T1 (where T1 < T2), the event for T1 is dropped, and the system will deliver only the event for T2. This is done on a per-symbol basis. +- The `MDUpdateAction` field available in the FIX schema is omitted in FIX SBE as its value may be derived from `MDEntrySize`. + - When `MDEntrySize` is unset (`NullVal`), `MDUpdateAction` is `DELETE`. + - When `MDEntrySize` is set, + - if the price level exists in your local order book, `MDUpdateAction` is `CHANGE` + - else `MDUpdateAction` is `NEW`. + +**MarketDataIncrementalDepth** message: + +- FIX SBE depth update speed: 50ms +- The `MDUpdateAction` field available in the FIX schema is omitted in FIX SBE as its value may be derived from `MDEntrySize`. + - When `MDEntrySize` is unset (`NullVal`), `MDUpdateAction` is `DELETE`. + - When `MDEntrySize` is set, + - if the price level exists in your local order book, `MDUpdateAction` is `CHANGE` + - else `MDUpdateAction` is `NEW`. + +### Limits[​](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +Connection limits are shared between FIX and FIX SBE. + +### Errors[​](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +The following FIX SBE-specific errors may be returned: + +Code + +Message + +Description + +\-1152 + +Invalid SBE message header. + +Error when decoding `messageHeader` in FIX SBE request + +\-1153 + +Invalid SBE schema ID or version specified. + +Error when parsing/decoding FIX SBE schema ID/version + +\-1177 + +Invalid encodingType. + +Error when decoding `encodingType` field in sofh composite type + +\-1221 + +Invalid/missing field(s) in SBE message. + +Invalid/missing field when decoding FIX SBE request + +Note: Error codes returned for semantically equivalent FIX and FIX SBE requests may not be identical. + +### FAQ[​](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +See the [SBE FAQ](https://developers.binance.com/docs/binance-spot-api-docs/faqs/sbe_faq) for more information on generating SBE decoders and handling schema updates. + +- [General API Information](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + - [FIX API Order Entry sessions](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + - [FIX API Drop Copy sessions](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + - [FIX API Market Data sessions](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + - [FIX Connection Lifecycle](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + - [API Key Permissions](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + - [On message processing order](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + - [Response Mode](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + - [Timing Security](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + - [How to sign Logon `` request](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) +- [Limits](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + - [Message Limits](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + - [Connection Limits](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + - [Unfilled Order Count](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) +- [Error Handling](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) +- [Types](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) +- [Message Components](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + - [Header](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + - [Trailer](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) +- [Administrative Messages](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + - [Heartbeat `<0>`](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + - [TestRequest `<1>`](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + - [Reject `<3>`](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + - [Logon ``](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + - [Logout `<5>`](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + - [News ``](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + - [Resend Request `<2>`](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) +- [Application Messages](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + - [Order Entry Messages](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + - [OrderAmendReject ``](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + - [Limit Messages](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + - [Market Data Messages](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + - [MarketDataRequestReject ``](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + - [MarketDataSnapshot ``](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + - [MarketDataIncrementalRefresh ``](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) +- [FIX SBE](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + - [SBE](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + - [Endpoints](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + - [FIX SBE encoding layout](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + - [Logon](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + - [FIX vs. FIX SBE](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + - [Limits](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + - [Errors](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + - [FAQ](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) diff --git a/docs/binance/binance-spot/index.md b/docs/binance/binance-spot/index.md new file mode 100644 index 0000000..4ce9648 --- /dev/null +++ b/docs/binance/binance-spot/index.md @@ -0,0 +1,2906 @@ +--- +title: "Changelog | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs" +fetched_at: "2026-02-26T10:38:06.646Z" +--- +# CHANGELOG for Binance's API + +**Last Updated: 2026-02-24** + +### 2026-02-24[​](https://developers.binance.com/docs/binance-spot-api-docs) + +- [ICEBERG\_PARTS](https://developers.binance.com/docs/binance-spot-api-docs/filters) will be increased to 100 for all symbols at **2026-03-12 07:00 UTC**. +- Following the announcement on [2025-12-02](https://developers.binance.com/docs/binance-spot-api-docs), `!ticker@arr` will be retired on **2026-03-26**. + +--- + +### 2026-02-12[​](https://developers.binance.com/docs/binance-spot-api-docs) + +REST and WebSocket API: + +- Reminder that SBE 3:0 schema will be retired on 2026-02-19, [6 months after being deprecated](https://developers.binance.com/docs/binance-spot-api-docs/faqs/sbe_faq). +- The [SBE lifecycle for Production](https://github.com/binance/binance-spot-api-docs/blob/master/sbe/schemas/sbe_schema_lifecycle_prod.json) has been updated to reflect this change. + +--- + +### 2026-02-09[​](https://developers.binance.com/docs/binance-spot-api-docs) + +- Clarified exponent field requirements in [FIX SBE documentation](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +--- + +### 2026-02-02[​](https://developers.binance.com/docs/binance-spot-api-docs) + +- Documented that [FIX Drop Copy session](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) data is delayed by 1 second. This has been the delay since the inception of the FIX API. + +--- + +### 2026-01-29[​](https://developers.binance.com/docs/binance-spot-api-docs) + +- [Demo Mode](https://developers.binance.com/docs/binance-spot-api-docs/demo-mode/general-info) is now available. +- For information on when the Spot Demo Mode environment will be unavailable due to maintenance, please refer to the [Demo Mode Changelog](https://developers.binance.com/docs/binance-spot-api-docs/demo-mode/CHANGELOG) + +--- + +### 2026-01-27[​](https://developers.binance.com/docs/binance-spot-api-docs) + +**Notice: The following changes will occur at 2026-02-11 7:00 UTC**: + +- [ICEBERG\_PARTS](https://developers.binance.com/docs/binance-spot-api-docs/filters) will be increased to 50 for all symbols. + +--- + +### 2026-01-26[​](https://developers.binance.com/docs/binance-spot-api-docs) + +- Added undocumented `recvWindow` to `userDataStream.subscribe.signature`. + +--- + +### 2026-01-21[​](https://developers.binance.com/docs/binance-spot-api-docs) + +Following the announcement from [2025-10-24](https://developers.binance.com/docs/binance-spot-api-docs), the following endpoints/methods will no longer be available starting from **2026-02-20,07:00 UTC** + +REST API + +- `POST /api/v3/userDataStream` +- `PUT /api/v3/userDataStream` +- `DELETE /api/v3/userDataStream` + +WebSocket API + +- `userDataStream.start` +- `userDataStream.ping` +- `userDataStream.stop` + +--- + +### 2025-12-18[​](https://developers.binance.com/docs/binance-spot-api-docs) + +- Updated [FIX SBE documentation](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) +- Clarified User Data Stream documentation regarding [`eventStreamTerminated`](https://developers.binance.com/docs/binance-spot-api-docs/user-data-stream). +- Assets `这是测试币` and `456` and symbol `这是测试币456` have been added to [SPOT Testnet](http://testnet.binance.vision/) for testing endpoints/methods with a Unicode symbol. See the [Testnet CHANGELOG](https://developers.binance.com/docs/binance-spot-api-docs/testnet) for more information. + +--- + +### 2025-12-17[​](https://developers.binance.com/docs/binance-spot-api-docs) + +#### Time-sensitive Notice[​](https://developers.binance.com/docs/binance-spot-api-docs) + +- **The following change to REST API will occur at approximately 2026-01-15 07:00 UTC:** + When calling endpoints that require signatures, percent-encode payloads before computing signatures. Requests that do not follow this order will be rejected with [`-1022 INVALID_SIGNATURE`](https://developers.binance.com/docs/binance-spot-api-docs/errors). Please review and update your signing logic accordingly. This has now been enabled on [SPOT Testnet](http://testnet.binance.vision/) + +#### REST API[​](https://developers.binance.com/docs/binance-spot-api-docs) + +- Updated documentation for REST API regarding [Signed Endpoints examples for placing an order](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/request-security). + +#### WebSocket API[​](https://developers.binance.com/docs/binance-spot-api-docs) + +- Updated documentation for WebSocket API regarding [SIGNED request security](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/request-security). + +--- + +### 2025-12-15[​](https://developers.binance.com/docs/binance-spot-api-docs) + +**Clarification Regarding UTF-8 Encoding:** + +- In [FIX](https://developers.binance.com/docs/binance-spot-api-docs/fix-api), [REST](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information), and [WebSocket APIs](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/general-api-information), if your request contains a symbol name containing non-ASCII characters, then the response may contain non-ASCII characters encoded in UTF-8. +- In REST and WebSocket APIs, some endpoints/methods may return asset and/or symbol names containing non-ASCII characters encoded in UTF-8 even if the request did not contain non-ASCII characters. +- In [WebSocket Streams](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams), if your request contains a symbol name containing non-ASCII characters, then the stream events may contain non-ASCII characters encoded in UTF-8. +- In WebSocket Streams, [All Market Mini Tickers Stream](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) and [All Market Rolling Window Statistics Streams](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) events may contain non-ASCII characters encoded in UTF-8. +- In [SBE Market Data Streams](https://developers.binance.com/docs/binance-spot-api-docs/sbe-market-data-streams), if your request contains a symbol name containing non-ASCII characters, then the stream events may contain non-ASCII characters encoded in UTF-8. +- [UserDataStream events](https://developers.binance.com/docs/binance-spot-api-docs/user-data-stream) may contain non-ASCII characters encoded in UTF-8 if you own or trade any assets or symbols whose names contain non-ASCII characters. +- For full compatibility with Binance APIs, please ensure your code is designed to handle UTF-8-encoded strings. + +--- + +### 2025-12-09[​](https://developers.binance.com/docs/binance-spot-api-docs) + +- [Schema for FIX SBE](https://github.com/binance/binance-spot-api-docs/blob/master/sbe/schemas/spot-fixsbe-1_0.xml) has been updated to use `smallGroupSize16Encoding` in `MarketDataSnapshot` and use `presence="optional"` for incremental book ticker/depth `MDEntrySize` fields. +- Updated documentation re: [FIX vs FIX SBE](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) +- Added documentation in REST, and WebSocket APIs stating: + **Please avoid SQL keywords in requests** as they may trigger a security block by a WAF (Web Application Firewall) rule. + See [https://www.binance.com/en/support/faq/detail/360004492232](https://www.binance.com/en/support/faq/detail/360004492232) for more details. + +--- + +### 2025-12-02[​](https://developers.binance.com/docs/binance-spot-api-docs) + +**Notice:** The changes in this section will be gradually rolled out, and will take approximately up to two weeks to complete. + +#### General Changes[​](https://developers.binance.com/docs/binance-spot-api-docs) + +- Parameter `symbol` and `symbols` can now support Unicode values encoded in UTF-8. +- Following the announcement from [2025-11-14](https://developers.binance.com/docs/binance-spot-api-docs), all documentation related to `!ticker@arr` has been removed. + - The feature will remain available until a future retirement announcement is made. + - Please use `@ticker` or `!miniTicker@arr` instead. + +#### FIX API[​](https://developers.binance.com/docs/binance-spot-api-docs) + +- Unicode values encoded in UTF-8 can now be accepted in FIX messages. This is allowed for the following tags only: + - `Currency (15)` + - `MiscFeeCurr (138)` + - `Symbol (55)` + - `SecondarySymbol (25019)` + - `CounterSymbol (25028)` + - `SecurityDesc (107)` +- When Unicode is put in a tag value that is not one of the tags above, FIX API will now send back a `RefTagID (371)` tag in the Reject `<3>`, pointing to exactly which tag is not allowed to contain Unicode. +- NewOrderList `` accepts `TriggerPriceDirection (1109)` without `TriggerPrice (1102)`. + +#### WebSocket Streams[​](https://developers.binance.com/docs/binance-spot-api-docs) + +- WebSocket Market Streams supports URL-encoded urls. + + + + +**Notice: The following changes will occur at approximately 2025-12-18 7:00 UTC**: + +- [ICEBERG\_PARTS](https://developers.binance.com/docs/binance-spot-api-docs/filters) will be increased to 25 for all symbols. +- [FIX SBE support](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) becomes available. +- [One Pays the Other (OPO)](https://github.com/binance/binance-spot-api-docs/blob/master/faqs/opo.md) becomes available on all symbols. + - `opoAllowed` begins to appear in Exchange Information requests, indicating if One-Pays-the-Other (OPO) orders are supported on each symbol. + - REST API: `GET /api/v3/exchangeInfo` + - WebSocket API: `exchangeInfo` + - New requests for OPO: + - REST API: + - `POST /api/v3/orderList/opo` + - `POST /api/v3/orderList/opoco` + - WebSocket API + - `orderList.place.opo` + - `orderList.place.opoco` + - FIX API + - NewOrderList `` has field `OPO (25046)`. Please update to the latest QuickFIX Schema for OPO support. +- STP mode [`TRANSFER`](https://developers.binance.com/docs/binance-spot-api-docs/faqs/stp_faq) has been added. The exact date that STP `TRANSFER` will be enabled has not yet been determined. +- **SBE: A new schema 3:2 ([spot\_3\_2.xml](https://github.com/binance/binance-spot-api-docs/blob/master/sbe/schemas/spot_3_2.xml)) is available.** + - The current schema 3:1 ([spot\_3\_1.xml](https://github.com/binance/binance-spot-api-docs/blob/master/sbe/schemas/spot_3_1.xml)) is deprecated and will be retired in 6 months as per our schema deprecation policy. + - Changes in 3:2: + - New enum variant `TRANSFER` for `selfTradePreventionMode` and `allowedSelfTradePreventionModes`. + - All schemas below 3:1 are unable to represent any response that could contain the STP mode `TRANSFER` (e.g. Exchange Information, order placement, order cancellation, or querying the status of an order). + When a response cannot be represented in the requested schema, an error is returned. +- FIX API changes: + - `LastFragment (893)` becomes deprecated. + - This means that the MarketIncrementalRefresh `` messages will no longer be fragmented and may contain more than 10,000 entries. + - The documentation has been updated to reflect this change. + - ListStatus `` will no longer emit the optional `symbol` field. + - This applies to FIX Order Entry and FIX Drop Copy. + - The documentation has been updated to reflect this change. + +--- + +### 2025-11-14[​](https://developers.binance.com/docs/binance-spot-api-docs) + +- All Market Tickers Stream (`!ticker@arr`) has been deprecated; This means this will be removed both from the documentation and from our systems at a later date. More details to follow. +- Please use [`@ticker`](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) or [`!miniTicker@arr`](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) instead. + +--- + +### 2025-11-12[​](https://developers.binance.com/docs/binance-spot-api-docs) + +- The steps on [how to manage a local order book correctly](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) has been corrected. + +--- + +### 2025-11-11[​](https://developers.binance.com/docs/binance-spot-api-docs) + +#### SBE Market Data[​](https://developers.binance.com/docs/binance-spot-api-docs) + +- **At 2025-11-26 07:00 UTC, the update speed of `@depth` and `@depth20` streams will be changed to 50ms**. + - This change will apply automatically to all users of SBE Market Data and doesn't require any action. + - The total amount of data received per second will be increased (up to 2x). + - [SPOT Testnet](https://testnet.binance.vision/) will have these changes at **2025-11-11 07:00 UTC**. + - [SBE Market Data](https://developers.binance.com/docs/binance-spot-api-docs/sbe-market-data-streams) has been updated to reflect these changes. + +--- + +### 2025-11-10[​](https://developers.binance.com/docs/binance-spot-api-docs) + +- "Last Updated" dates will be removed from all documents except for CHANGELOG. +- Moving forward, CHANGELOG will be the source of reference for when changes were made to any document. + +--- + +### 2025-10-28[​](https://developers.binance.com/docs/binance-spot-api-docs) + +**Notice: The following changes will be deployed on 2025-10-28, starting at 04:00 UTC and may take several hours to complete:** + +- An optional parameter, `symbolStatus`, has been added to the following endpoints: + - **REST API** + - `GET /api/v3/depth` + - `GET /api/v3/ticker/price` + - `GET /api/v3/ticker/bookTicker` + - `GET /api/v3/ticker/24hr` + - `GET /api/v3/ticker/tradingDay` + - `GET /api/v3/ticker` + - **WebSocket API** + - `depth` + - `ticker.price` + - `ticker.book` + - `ticker.24hr` + - `ticker.tradingDay` + - `ticker` +- When the parameter `symbolStatus=` is provided, only symbols whose trading status matches the specified `STATUS` will be included in the response:\_ + - If a single symbol is specified using the `symbol=` parameter and its trading status does not match the given `STATUS`, the endpoint will return error code [`-1220 SYMBOL_DOES_NOT_MATCH_STATUS`](https://developers.binance.com/docs/binance-spot-api-docs/errors). + - If multiple symbols are specified using the `symbols=[...]` parameter, the response will be an array that excludes any symbols whose trading status does not match `STATUS`. If no symbols from the symbols parameter have a trading status that matches `STATUS`, the response is an empty array. + - For endpoints where the `symbol` and `symbols` parameters are optional, omitting these parameters is treated as if all symbols had been specified in the `symbols=[...]` parameter. See the previous line for the behavior of `symbolStatus=`. + +--- + +### 2025-10-24[​](https://developers.binance.com/docs/binance-spot-api-docs) + +#### SBE[​](https://developers.binance.com/docs/binance-spot-api-docs) + +- SBE: schema 3:1 ([spot\_3\_1.xml](https://github.com/binance/binance-spot-api-docs/blob/master/sbe/schemas/spot_3_1.xml)) has been updated to support [listenToken Subscription Methods](https://developers.binance.com/docs/margin_trading/trade-data-stream/Listen-Token-Websocket-API) for Margin Trading. + +#### REST and WebSocket API[​](https://developers.binance.com/docs/binance-spot-api-docs) + +Following the announcement from [2025-04-07](https://developers.binance.com/docs/binance-spot-api-docs), all documentation related with `listenKey` for use on `wss://stream.binance.com` has been removed. + +**We remind you that you should instead get user data updates by subscribing to the [User Data Stream on the WebSocket API](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/user-data-stream-requests). This will offer better performance (lower latency).** + +Please refer to the list of requests and methods below for more information. + +The features will remain available until a future retirement announcement is made. + +- REST API + + - `POST /api/v3/userDataStream` + - `PUT /api/v3/userDataStream` + - `DELETE /api/v3/userDataStream` +- WebSocket API + + - `userDataStream.start` + - `userDataStream.ping` + - `userDataStream.stop` + +--- + +### 2025-10-21[​](https://developers.binance.com/docs/binance-spot-api-docs) + +REST and WebSocket API: + +- Reminder that SBE 2:1 schema will be retired on 2025-10-24, [6 months after being deprecated](https://developers.binance.com/docs/binance-spot-api-docs/faqs/sbe_faq). +- The [SBE lifecycle for Production](https://github.com/binance/binance-spot-api-docs/blob/master/sbe/schemas/sbe_schema_lifecycle_prod.json) has been updated to reflect this change. + +--- + +### 2025-10-08[​](https://developers.binance.com/docs/binance-spot-api-docs) + +#### FIX API[​](https://developers.binance.com/docs/binance-spot-api-docs) + +- Updated [QuickFIX Schema](https://github.com/binance/binance-spot-api-docs/blob/master/fix/schemas/spot-fix-md.xml) for FIX Market Data: + - Updated `RecvWindow(25000)` to reflect microsecond support announced on [2025-08-12](https://developers.binance.com/docs/binance-spot-api-docs). + - Updated [InstrumentList ``](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) message: + - Added fields: `StartPriceRange`, `EndPriceRange`. + - Made the following fields optional: `MinTradeVol(562)`, `MaxTradeVol(1140)`, `MinQtyIncrement(25039)`, `MarketMinTradeVol(25040)`, `MarketMaxTradeVol(25041)`, `MarketMinQtyIncrement(25042)`, `MinPriceIncrement(969)`. + - **The changes to InstrumentList are breaking changes, and will roll out at around 2025-10-23 07:00 UTC. Please update to the new schema before then.** + - [SPOT Testnet](https://testnet.binance.vision/) has the breaking changes already enabled. + +--- + +### 2025-09-29[​](https://developers.binance.com/docs/binance-spot-api-docs) + +**Notice: The following changes will be deployed on 2025-09-29, starting at 10:00 UTC and may take several hours to complete.** + +- Added an endpoint to retrieve the list of filters relevant to an account on a given symbol. This is the only endpoint that shows if an account has `MAX_ASSET` filters applied to it. + - REST API: [`GET /api/v3/myFilters`](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints) + - WebSocket API: [`myFilters`](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests) +- Comments in **SBE: schema 3:1 ([spot\_3\_1.xml](https://github.com/binance/binance-spot-api-docs/blob/master/sbe/schemas/spot_3_1.xml))** have been added, modified, and removed. Although there is no need for users of `3:1` to update to this version of the file, we advise updating to maintain consistency. +- Added documentation for filter [`MAX_ASSET`](https://developers.binance.com/docs/binance-spot-api-docs/filters). + +--- + +### 2025-09-18[​](https://developers.binance.com/docs/binance-spot-api-docs) + +- Updated documentation for `recvWindow` to reflect microsecond support announced on [2025-08-12](https://developers.binance.com/docs/binance-spot-api-docs). + - REST API: [Timing Security](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/request-security) + - WebSocket API: [Timing Security](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/request-security) + +--- + +### 2025-09-12[​](https://developers.binance.com/docs/binance-spot-api-docs) + +- The [QuickFix schema for FIX Order Entry](https://github.com/binance/binance-spot-api-docs/blob/master/fix/schemas/spot-fix-oe.xml) has been updated to support Pegged Orders. +- Updated FIX API Documentation for `RecvWindow` in + - [Message Components](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + - [Timing Security](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + +--- + +### 2025-08-28[​](https://developers.binance.com/docs/binance-spot-api-docs) + +- Updated SBE FAQ section [regarding legacy support](https://developers.binance.com/docs/binance-spot-api-docs/faqs/sbe_faq) to include more details on schema compatibility and explain `NonRepresentable` and `NonRepresentableMessage`. + +--- + +### 2025-08-26[​](https://developers.binance.com/docs/binance-spot-api-docs) + +- Updated "Request Security" documentation for [REST API](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/request-security) and [WebSocket API](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/request-security) with no functional changes. + +--- + +### 2025-08-25[​](https://developers.binance.com/docs/binance-spot-api-docs) + +- **SBE: schema 3:1 ([spot\_3\_1.xml](https://github.com/binance/binance-spot-api-docs/blob/master/sbe/schemas/spot_3_1.xml))** will be updated on **2025-08-25 at 05:00 UTC** + - The following fields have been renamed because the [SbeTool](https://developers.binance.com/docs/binance-spot-api-docs/faqs/sbe_faq) code generator has been found to generate Java code that does not compile. + - Although only users impacted by this issue need to update the schema, we advise all users to upgrade to the latest version to maintain consistency. + - Message `MaxAssetFilter` + - field `limitExponent` renamed to `qtyExponent` + - field `limit` renamed to `maxQty` + +--- + +### 2025-08-19[​](https://developers.binance.com/docs/binance-spot-api-docs) + +- `userDataStream.subscribe` returns `subscriptionId` in the responses. + This was missed in the [previous](https://developers.binance.com/docs/binance-spot-api-docs) changelog entry. + +--- + +### 2025-08-12[​](https://developers.binance.com/docs/binance-spot-api-docs) + +**Notice:** The changes in this section will be gradually rolled out, and will take approximately up to two weeks to complete. + +#### General Changes[​](https://developers.binance.com/docs/binance-spot-api-docs) + +- New error codes `-1120` and `1211`. See [Errors](https://developers.binance.com/docs/binance-spot-api-docs/errors) for more information. +- The following requests have a new structure called `specialCommission`. See [Commission Rates](https://developers.binance.com/docs/binance-spot-api-docs/faqs/commission_faq). + - REST API + - `GET /api/v3/account/commission` + - `POST /api/v3/order/test` with `computeCommissionRates=true` + - `POST /api/v3/sor/order/test` with `computeCommissionRates=true` + - WebSocket API + - `account.commission` + - `order.test` with `computeCommissionRates=true` + - `sor.order.test` with `computeCommissionRates=true` +- **SBE: A new schema 3:1 ([spot\_3\_1.xml](https://github.com/binance/binance-spot-api-docs/blob/master/sbe/schemas/spot_3_1.xml)) is available.** + - The current schema 3:0 ([spot\_3\_0.xml](https://github.com/binance/binance-spot-api-docs/blob/master/sbe/schemas/spot_3_0.xml)) is deprecated and will retire in 6 months as per our schema deprecation policy. + - Changes in schema 3:1: + - `ExchangeInfoResponse`: new field `pegInstructionsAllowed` + - `ExecutionReportEvent`: new fields `pricePeg`, `pricePegOffsetLevel`, `peggedPrice` + - `UserDataStreamSubscribeResponse`: new field `subscriptionId` + - New field `subscriptionId` for all user data stream events. + - Field `apiKey` renamed to `loggedOnApiKey` for `WebSocketSessionLogonResponse`, `WebSocketSessionStatusResponse` and `WebSocketSessionLogoutResponse` + - `OrderTestWithCommissionsResponse`: 2 new fields `specialCommissionForOrderMaker` and `specialCommissionForOrderTaker` + - `AccountCommissionResponse`: 4 new fields `specialCommissionMaker`, `specialCommissionTaker`, `specialCommissionBuyer` and `specialCommissionSeller` + - Support for `EXCHANGE_MAX_NUM_ORDER_LISTS`, `MAX_NUM_ORDER_LISTS`, and `MAX_NUM_ORDER_AMENDS` filters. + - `ExecutionReportEvent`: fields `rejectReason` and `origClientOrderId` now show their default values in SBE format to match the JSON format. + - `NonRepresentableMessage`: New message added to represent a message that cannot be represented in this schema ID and version. Receipt of this message indicates that something should be available, but it is not representable using the SBE schema currently in use. +- Orders with cumulative quantity of 0 in the final state `EXPIRED_IN_MATCH` (i.e., the order expired due to STP) will be archived after 90 days. +- Query order lists requests will first query the data in the cache, and if it cannot be found, will query the database. + - REST API: `GET /api/v3/openOrderLists` + - WebSocket API: `openOrderLists.status` + +#### WebSocket API[​](https://developers.binance.com/docs/binance-spot-api-docs) + +- A single WebSocket connection can subscribe to multiple User Data Streams at once. + - Only one subscription per account is allowed on a single connection. +- Method `userDataStream.subscribe.signature` has been added that allows you to subscribe to the User Data Stream without needing to login first. + - This also doesn’t require an Ed25519 API Key, and can work with any [API Key type](https://developers.binance.com/docs/binance-spot-api-docs/faqs/api_key_types). + - For [SBE support](https://developers.binance.com/docs/binance-spot-api-docs/faqs/sbe_faq), you need to use at least schema 3:1. +- Method `session.subscriptions` has been added to list all active subscriptions for the current session. +- The meaning of the field `userDataStream` in the session requests has changed slightly. + - Previously, this returned `true` if you were subscribed to the user data stream of your logged-on account. + - Now returns `true` if you have at least one active user data stream subscription, otherwise `false`. +- `userDataStream.unsubscribe` supports closing multiple subscriptions. + - When called with no parameter, this will close all subscriptions. + - When called with `subscriptionId`, this will attempt to close the subscription matching that Id, if it exists. + - The authorization for this request has been changed to `NONE`. +- Field `subscriptionId` has been added to the User Data Stream events payload when listening through the [WebSocket API](https://developers.binance.com/docs/web-socket-api.md). This will identify which subscription the event is coming from. + +#### FIX API[​](https://developers.binance.com/docs/binance-spot-api-docs) + +- When a client sends a reject message, the FIX API will no longer send the client back a Reject `<3>` message. +- Error messages are now clearer when a tag is invalid, missing a value, or when the field value is empty or malformed. + - ``` + { "code": -1169, "msg": "Invalid tag number." } + ``` + + - ``` + { "code": -1177, "msg": "Tag specified without a value." } + ``` + + - ``` + { "code": -1102, "msg": "Field value was empty or malformed." } + ``` + + +#### Future Changes[​](https://developers.binance.com/docs/binance-spot-api-docs) + +The following changes will be available on **2025-08-27 starting at 07:00 UTC**: + +- Exchange Information requests will emit a new field, `pegInstructionsAllowed`. +- Bug fix: The Matching Engine will no longer accept order lists that exceed the order count filter limits. Affected filters: + - `MAX_NUM_ORDERS` + - `MAX_ALGO_ORDERS` + - `MAX_ICEBERG_ORDERS` + - `EXCHANGE_MAX_NUM_ORDERS` + - `EXCHANGE_MAX_ALGO_ORDERS` + - `EXCHANGE_MAX_ICEBERG_ORDERS` + +The following changes will be available on **2025-08-28 starting at 07:00 UTC**: + +- The [pegged orders](https://developers.binance.com/docs/binance-spot-api-docs/faqs/pegged_orders) functionality will be available. + - `pegInstructionsAllowed` will be set to `true` for all symbols, enabling the use of pegged orders for all APIs. + - The following conditional fields `pegPriceType`, `pegOffSetType`, `pegOffsetValues`, and `peggedPrice` will appear in responses of the following requests if the order is a pegged order: + - REST API + - `GET /api/v3/order` + - `GET /api/v3/orderList` + - `GET /api/v3/openOrderList` + - `GET /api/v3/allOrders` + - `DELETE /api/v3/order` + - `DELETE /api/v3/orderList` + - `DELETE /api/v3/openOrders` + - `PUT /api/v3/order/amend/keepPriority` + - WebSocket API + - `order.status` + - `orderList.status` + - `allOrders` + - `order.cancel` + - `orderList.cancel` + - `openOrders.cancelAll` + - `order.amend.keepPriority` + - FIX API + - `OrdType(40)` supports new value `P(PEGGED)` + - Tags `PegOffsetValue(211)`, `PegPriceType(1094)`, `PegMoveType(835)`, and `PegOffsetType(836)` have been added to the following messages: + - NewOrderSingle `` + - NewOrderList `` + - OrderCancelRequestAndNewOrderSingle `` + - When placing an order, the `ExecutionReport` `<8>` message will echo back `PegInstructions`, with an extra optional field `PeggedPrice (839)`. + - New error messages for pegged orders are added. Please see the [Errors](https://developers.binance.com/docs/binance-spot-api-docs/errors) document for more information. +- Changes with `recvWindow` will be enabled. + - A third check is performed after your message leaves our message broker, just before it is sent to the Matching Engine. + - This does not cover potential delays inside the Matching Engine itself. + - `recvWindow` supports microseconds. + - The value is still specified in milliseconds, but it can now include a decimal component for higher precision. + - This means the parameter can now support up to **three decimal places** (e.g., 6000.346). + - APIs affected: + - FIX API + - REST API + - WebSocket API +- New [`MAX_NUM_ORDER_LISTS`](https://developers.binance.com/docs/binance-spot-api-docs/filters) filter will be enabled, limiting the number of order lists to 20 per symbol. +- New [`MAX_NUM_ORDER_AMENDS`](https://developers.binance.com/docs/binance-spot-api-docs/filters) filter will be enabled, limiting each order to a maximum of 10 amendments. + +--- + +### 2025-08-07[​](https://developers.binance.com/docs/binance-spot-api-docs) + +- Updated FIX API documentation + - [FIX Market Data limits](https://developers.binance.com/docs/binance-spot-api-docs/fix-api): The subscription limit has always been present but was undocumented. + - [On message processing order](https://developers.binance.com/docs/binance-spot-api-docs/fix-api): Reworded and reformatted. + +--- + +### 2025-07-03[​](https://developers.binance.com/docs/binance-spot-api-docs) + +- Beginning at **2025-07-08 07:00 UTC**, [WebSocket Streams](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) will be upgraded. +- During the upgrade, **existing and new connections may be disconnected in less than 24 hours**. +- The upgrade may take up to 2 hours; We apologize for the inconvenience. + +--- + +### 2025-06-04[​](https://developers.binance.com/docs/binance-spot-api-docs) + +REST and WebSocket API: + +- Reminder that SBE 2:0 schema will be retired on 2025-06-12, [6 months after being deprecated](https://developers.binance.com/docs/binance-spot-api-docs/faqs/sbe_faq). +- The [SBE lifecycle for Production](https://github.com/binance/binance-spot-api-docs/blob/master/sbe/schemas/sbe_schema_lifecycle_prod.json) has been updated to reflect this change. + +--- + +### 2025-05-28[​](https://developers.binance.com/docs/binance-spot-api-docs) + +- Documented API timeout value and error under General API Information for each API: + - [FIX](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) + - [REST](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) + - [WebSocket](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/general-api-information) + +--- + +### 2025-05-22[​](https://developers.binance.com/docs/binance-spot-api-docs) + +**Notice: The following changes will happen at 2025-06-06 7:00 UTC.** + +- The previous behavior of `recvWindow` on FIX, REST, and WebSocket APIs will be augmented by an additional check. + - To review, the existing behavior is: + - If `timestamp` is greater than `serverTime` + 1 second at receipt of the request, the request is rejected. Rejection by this check increments message limits (FIX API) and IP limits (REST and WebSocket APIs), but not Unfilled Order Count (order placement endpoints of all APIs). + - If the difference between `timestamp` and `serverTime` at receipt of the request is greater than `recvWindow`, the request is rejected. Rejection by this check increments message limits (FIX API) and IP limits (REST and WebSocket APIs) but not Unfilled Order Count (order placement endpoints of all APIs). + - The additional check is: + - Just before a request is forwarded to the Matching Engine, if the difference between `timestamp` and the current `serverTime` is greater than `recvWindow`, the request is rejected. Rejection by this check increments message limits (FIX API), IP limits (REST and WebSocket APIs), and Unfilled Order Count (order placement endpoints of all APIs). + - The documentation for Timing security has been updated to reflect the additional check. + - [REST API](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/request-security) + - [WebSocket API](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/request-security) + - [FIX API](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) +- Fixed a bug in FIX Market Data message InstrumentList ``. Previously, the value of `NoRelatedSym(146)` could have been incorrect. + +--- + +### 2025-04-29[​](https://developers.binance.com/docs/binance-spot-api-docs) + +- Features that currently require an Ed25519 API key will soon be opened up to HMAC and RSA keys. + - For example, subscribing to User Data Stream in WebSocket API will be possible with any API key type before listenKeys are removed. + - Users are still encouraged to migrate to Ed25519 API keys as they are more secure and performant on Binance Spot Trading. + - More details to come. + +--- + +### 2025-04-25[​](https://developers.binance.com/docs/binance-spot-api-docs) + +- The following request weights have been increased from 1 to 4: + - REST API: `PUT /api/v3/order/amend/keepPriority` + - WebSocket API: `order.amend.keepPriority` + - The documentation for both REST and WebSocket API has been updated to reflect these changes. +- Clarified that `SEQNUM` in the FIX-API is a 32-bit unsigned integer that rolls over. This has been the `SEQNUM` data type since the inception of the FIX-API. + +--- + +### 2025-04-21[​](https://developers.binance.com/docs/binance-spot-api-docs) + +**Clarification on the release of [Order Amend Keep Priority](https://developers.binance.com/docs/binance-spot-api-docs/faqs/order_amend_keep_priority) and [STP Decrement](https://developers.binance.com/docs/binance-spot-api-docs/faqs/stp_faq):** + +- At **2025-05-07 07:00 UTC** + - Order Amend Keep Priority will be enabled on all symbols. + - STP Decrement will be allowed on all symbols. +- At **2025-04-24, 07:00 UTC**, the field `amendAllowed` will become visible on Exchange Information requests, but the feature will not be enabled yet. +- [SPOT Testnet](https://testnet.binance.vision/) has both features enabled/allowed on all symbols. + +--- + +### 2025-04-08[​](https://developers.binance.com/docs/binance-spot-api-docs) + +**Notice:** The changes in this section will be gradually rolled out, and will take a week to complete. + +- New Error code `-2039` where if querying an order with both `orderId` and `origClientOrderId` and no order is found with this combination. + - Affected requests: + - REST API: `GET /api/v3/order` + - WebSocket API: `order.status` +- The [Errors Documentation](https://developers.binance.com/docs/binance-spot-api-docs/errors) has also been updated with the new error messages for code `-1034` when the FIX connection rate limits have exceeded. (More details can be found in yesterday's [update](https://developers.binance.com/docs/binance-spot-api-docs)) + +--- + +### 2025-04-07[​](https://developers.binance.com/docs/binance-spot-api-docs) + +#### General Changes[​](https://developers.binance.com/docs/binance-spot-api-docs) + +**Notice:** The changes in this section will be gradually rolled out, and will take a week to complete. + +- FIX Market Data connection limits were increased from 5 to 100 on January 16, 2025. This was not previously highlighted in changelog. +- New Error code `-2038` for order amend keep priority requests that fail. +- New messages for error code `-1034`. +- If the unfilled order count for `intervalNum:DAY` is exceeded, the unfilled order count for `intervalNum:SECOND` is no longer incremented. +- Previously, the request weight for myTrades was 20 regardless of the parameters provided. Now, if you provide `orderId`, the request weight is 5. + - REST API: `GET /api/v3/myTrades` + - WebSocket API: `myTrades` +- Change when querying and deleting orders: + - When neither `orderId` nor `origClientOrderId` are present, the request is now rejected with `-1102` instead of `-1128`. + - Affected requests: + - REST API: + - `GET /api/v3/order` + - `DELETE /api/v3/order` + - WebSocket API + - `order.status` + - `order.cancel` + - FIX API + - OrderCancelRequest `` + +#### FIX API[​](https://developers.binance.com/docs/binance-spot-api-docs) + +**Notice:** The following changes will occur during April 21, 2025. + +- FIX API verifies that `EncryptMethod(98)` is 0 at Logon ``. +- FIX Order Entry connection limits will be a maximum of 10 concurrent connections per account. +- The connection rate limits are now enforced. Note that these limits are checked independently for both the account and the IP address. + - FIX Order Entry: 15 connection attempts within 30 seconds + - FIX Drop Copy: 15 connection attempts within 30 seconds + - FIX Market Data: 300 connection attempts within 300 seconds +- News `` contains a countdown until disconnection in the Headline field. + - Following the completion of this update, when the server enters maintenance, a `News` message will be sent to clients **every 10 seconds for 10 minutes**. After this period, clients will be logged out and their sessions will be closed. +- OrderCancelRequest `` and OrderCancelRequestAndNewOrderSingle `` now allow both `orderId` and `clientOrderId`. +- The [QuickFix schema for FIX OE](https://github.com/binance/binance-spot-api-docs/blob/master/fix/schemas/spot-fix-oe.xml) is updated to support the Order Amend Keep Priority feature and new STP mode, `DECREMENT`. + +#### User Data Streams[​](https://developers.binance.com/docs/binance-spot-api-docs) + +- **Receiving user data streams on wss://stream.binance.com:9443 using a `listenKey` is now deprecated.** + - This feature will be removed from our systems at a later date. +- **Instead, you should get user data updates by subscribing to the [User Data Stream on the WebSocket API](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/user-data-stream-requests)**. + - This should offer slightly better performance **(lower latency)**. + - This requires the use of an Ed25519 API Key. +- In a future update, information about the base WebSocket endpoint for the User Data Streams will be removed. +- In a future update, the following requests will be removed from the documentation: + - `POST /api/v3/userDataStream` + - `PUT /api/v3/userDataStream` + - `DELETE /api/v3/userDataStream` + - `userDataStream.start` + - `userDataStream.ping` + - `userDataStream.stop` +- The [User Data Stream documentation](https://developers.binance.com/docs/binance-spot-api-docs/user-data-stream) will remain as reference for the payloads you can receive. + +#### Future Changes[​](https://developers.binance.com/docs/binance-spot-api-docs) + +The following changes will occur at **April 24, 2025, 07:00 UTC**: + +- [Order Amend Keep Priority](https://github.com/binance/binance-spot-api-docs/blob/master/faqs/order_amend_keep_priority.md) becomes available. (Note that the symbol has to have the feature enabled to be used.) + - **UPDATE 2025-04-21: The exact date "Order Amend Keep Priority" will be enabled has not yet been determined.** + - New field `amendAllowed` becomes visible in Exchange Information responses. + - REST API: `GET /api/v3/exchangeInfo` + - WebSocket API: `exchangeInfo` + - FIX API: New Order Entry Messages **OrderAmendKeepPriorityRequest** and **OrderAmendReject** + - REST API: `PUT /api/v3/order/amend/keepPriority` + - WebSocket API: `order.amend.keepPriority` +- STP mode `DECREMENT` becomes visible in Exchange Information if the symbol has it configured. + - **UPDATE 2025-04-21: The exact date `DECREMENT` STP will be enabled has not yet been determined.** + - Instead of expiring only the maker, only the taker, or unconditionally both orders, STP decrement decreases the available quantity of **both** orders and increases the `prevented quantity` of **both** orders by the amount of the prevented match. + - This expires the order with less available quantity as (`filled quantity` + `prevented quantity`) equals `order quantity`. Both orders expire if their available quantities are equal. It is called a "decrement" because it reduces available quantity. +- Behavior when querying and/or canceling with `orderId` and `origClientOrderId/cancelOrigClientOrderId`: + - The behavior when both parameters were provided was not consistent across all endpoints. + - Moving forward, when both parameters are provided, the order is first searched for using its `orderId`, and if found, `origClientOrderId`/`cancelOrigClientOrderId` is checked against that order. If both conditions pass, the request succeeds. If both conditions are not met the request is rejected. + - Affected requests: + - REST API: + - `GET /api/v3/order` + - `DELETE /api/v3/order` + - `POST /api/v3/order/cancelReplace` + - WebSocket API: + - `order.status` + - `order.cancel` + - `order.cancelReplace` + - FIX API + - OrderCancelRequest `` + - OrderCancelRequestAndNewOrderSingle `` +- Behavior when canceling with `listOrderId` and `listClientOrderId`: + - The behavior when both parameters were provided was not consistent across all endpoints. + - Moving forward, when both parameters are passed, the order list is first searched for using its `listOrderId`, and if found, `listClientOrderId` is checked against that order list. If both conditions are not met the request is rejected. + - Affected requests: + - REST API + - `DELETE /api/v3/orderList` + - WebSocket API + - `orderList.cancel` +- **SBE: A new schema 3:0 ([spot\_3\_0.xml](https://github.com/binance/binance-spot-api-docs/blob/master/sbe/schemas/spot_3_0.xml)) is now available.** + - The current schema 2:1 ([spot\_2\_1.xml](https://github.com/binance/binance-spot-api-docs/blob/master/sbe/schemas/spot_2_1.xml)) is now deprecated and will be retired in 6 months as per our schema deprecation policy. + - Note that trying to use schema 3:0 before it is released will result in an error. + - Changes in schema 3:0: + - Support for Order Amend Keep Priority: + - Added field `amendAllowed` to ExchangeInfoResponse. + - New Messages `OrderAmendmentsResponse` and `OrderAmendKeepPriorityResponse` + - All enums now have a `NON_REPRESENTABLE` variant. This will be used to encode new enum values in the future, which would be incompatible with 3:0. + - New enum variant `DECREMENT` for `selfTradePreventionMode` and `allowedSelfTradePreventionModes` + - `symbolStatus` enum values `AUCTION_MATCH`, `PRE_TRADING` and `POST_TRADING` have been removed. + - Fields `usedSor`, `orderCapacity`, `workingFloor`, `preventedQuantity`, and `matchType` are no longer optional. + - Field `orderCreationTime` in `ExecutionReportEvent` is now optional. + - When using deprecated schema 2:1 on the WebSocket API to listen to the User Data Stream: + - `ListStatusEvent` field `listStatusType` will be rendered as `ExecStarted` when it should have been `Updated`. Upgrade to schema 3:0 to get the correct value. + - `ExecutionReportEvent` field `selfTradePreventionMode` will be rendered as `None` when it should have been `Decrement`. This only happens when `executionType` is `TradePrevention`. + - `ExecutionReportEvent` field `orderCreationTime` will be rendered as -1 when it has no value. + - All schemas below 3:0 are unable to represent responses for Order Amend Keep Priority requests and any response that could contain the STP mode `DECREMENT` (e.g. Exchange Information, order placement, order cancelation, or querying the status of your order). When a response cannot be represented in the requested schema, an error is returned. + +--- + +### 2025-04-03[​](https://developers.binance.com/docs/binance-spot-api-docs) + +- Following SPOT Testnet's latest announcement, updating the URL in the WebSocket API to the latest URL for [SPOT Testnet](https://testnet.binance.vision/). + +--- + +### 2025-03-31[​](https://developers.binance.com/docs/binance-spot-api-docs) + +- Added a clarification on the performance of canceling an order. + +--- + +### 2025-03-10[​](https://developers.binance.com/docs/binance-spot-api-docs) + +- **Notice: The following changes will happen on 2025-03-13 09:00 UTC** + - FIX Drop Copy sessions will have a limit of **60 messages per minute**. + - FIX Market Data sessions will have a limit of **2000 messages per minute**. + - The FIX API documentation has been updated to reflect the upcoming changes. +- **SBE Market Data Streams will be available on March 18 2025, 07:00 UTC.** These streams offer a smaller payload and should offer better latency than the equivalent JSON streams for a subset of latency-sensitive market data streams. + - Streams available in SBE format: + - Real-time: trade stream + - Real-time: best bid/ask + - Every 100 ms: diff. depth + - Every 100 ms: partial book depth + - For more information please refer to the [SBE Market Data Streams](https://developers.binance.com/docs/binance-spot-api-docs/sbe-market-data-streams). + +--- + +### 2025-03-05[​](https://developers.binance.com/docs/binance-spot-api-docs) + +- **Notice: The following changes will happen on March 10, 2025 12:00 UTC.** + The following request weights will be increased from 2 to 4: + - REST API: `GET /api/v3/aggTrade` + - WebSocket API: `trades.aggregate` +- The documentation for both REST and WebSocket API has been updated to reflect the upcoming changes. + +--- + +### 2025-02-12[​](https://developers.binance.com/docs/binance-spot-api-docs) + +- **Notice: These changes will take effect on February 26, 2025 05:00 UTC.** Please ensure you have downloaded the latest schema before then. +- `AggressorSide (2446)` will be rendered in the [FIX Market Data Trade Stream](https://developers.binance.com/docs/binance-spot-api-docs/fix-api). The QuickFix schema [file](https://github.com/binance/binance-spot-api-docs/blob/master/fix/schemas/spot-fix-md.xml) has also been updated. + +--- + +### 2025-01-28[​](https://developers.binance.com/docs/binance-spot-api-docs) + +- **Notice: These changes will be gradually rolled out between February 3, 2025 and February 14, 2025.** **The following changes will apply to WebSocket Market Data Streams, User Data Streams, and the WebSocket API:** + - Our WebSocket services will send a ping frame **every 20 seconds** instead of 3 minutes. + - The allowed pong delay will be **every 1 minute** instead of 10 minutes. + - The documentation for these services have been updated to reflect the change. + +--- + +### 2025-01-09[​](https://developers.binance.com/docs/binance-spot-api-docs) + +- FIX Market Data will be available at **January 16, 05:00 UTC**. The FIX API documentation has been updated regarding this feature. +- Please refer to this [link](https://github.com/binance/binance-spot-api-docs/blob/master/fix/schemas/spot-fix-md.xml) for the QuickFIX Schema for FIX Market Data. + +--- + +### 2024-12-17[​](https://developers.binance.com/docs/binance-spot-api-docs) + +General Changes: + +The system now supports microseconds in all related time and/or timestamp fields. Microsecond support is **opt-in**, by default the requests and responses still use milliseconds. Examples in documentation are also using milliseconds for the foreseeable future. + +WebSocket Streams + +- A new optional parameter `timeUnit` can be used in the connection URL to select the time unit. + - For example: `/stream?streams=btcusdt@trade&timeUnit=millisecond` + - Supported values are: + - `MILLISECOND` + - `millisecond` + - `MICROSECOND` + - `microsecond` + - If the time unit is not selected, milliseconds will be used by default. + +REST API + +- A new optional header `X-MBX-TIME-UNIT` can be sent in the request to select the time unit. + - Supported values: + - `MILLISECOND` + - `millisecond` + - `MICROSECOND` + - `microsecond` + - The time unit affects timestamp fields in JSON responses (e.g., `time`, `transactTime`). + - SBE responses continue to be in microseconds regardless of time unit. + - If the time unit is not selected, milliseconds will be used by default. +- Timestamp parameters (e.g. `startTime`, `endTime`, `timestamp)` can now be passed in milliseconds or microseconds. + +WebSocket API + +- A new optional parameter `timeUnit` can be used in the connection URL to select the time unit. + - Supported values: + - `MILLISECOND` + - `millisecond` + - `MICROSECOND` + - `microsecond` + - The time unit affects timestamp fields in JSON responses (e.g., `time`, `transactTime`). + - SBE responses continue to be in microseconds regardless of time unit. + - If the time unit is not selected, milliseconds will be used by default. +- Timestamp parameters (e.g. `startTime`, `endTime`, `timestamp)` can now be passed in milliseconds or microseconds. + +User Data Streams + +- A new optional parameter `timeUnit` can be used in the connection URL to select the time unit. + - Supported values + - `MILLISECOND` + - `MICROSECOND`. + - `microsecond` + - `millisecond` + +--- + +### 2024-12-09[​](https://developers.binance.com/docs/binance-spot-api-docs) + +**Notice:** The changes below will be rolled out starting at **2024-12-12** and may take approximately a week to complete. + +General Changes + +- Timestamp parameters now reject values too far into the past or the future. To be specific, the parameter will be rejected if: + - `timestamp` before 2017-01-01 (less than 1483228800000) + - `timestamp` is more than 10 seconds after the current time (e.g., if current time is 1729745280000 then it is an error to use 1729745291000 or greater) +- If `startTime` and/or `endTime` values are outside of range, the values will be adjusted to fit the correct range. +- The field for quote order quantity (`origQuoteOrderQty`) has been added to responses that previously did not have it. Note that for order placement endpoints the field will only appear for requests with `newOrderRespType` set to `RESULT` or `FULL`. + - Please refer to the table below for affected requests with: `origQuoteOrderQty`: + +Service + +Request + +REST + +`POST /api/v3/order` + +`POST /api/v3/sor/order` + +`POST /api/v3/order/oco` + +`POST /api/v3/orderList/oco` + +`POST /api/v3/orderList/oto` + +`POST /api/v3/orderList/otoco` + +`DELETE /api/v3/order` + +`DELETE /api/v3/orderList` + +`POST /api/v3/order/cancelReplace` + +WebSocket API + +`order.place` + +`sor.order.place` + +`orderList.place` + +`orderList.place.oco` + +`orderList.place.oto` + +`orderList.place.otoco` + +`order.cancel` + +`orderList.cancel` + +`order.cancelReplace` + +SBE + +- A new schema 2:1 [spot\_2\_1.xml](https://github.com/binance/binance-spot-api-docs/blob/master/sbe/schemas/spot_2_1.xml) has been released. The current schema 2:0 [spot\_2\_0.xml](https://github.com/binance/binance-spot-api-docs/blob/master/sbe/schemas/spot_2_0.xml) will thus be deprecated, and retired from the API in 6 months as per our schema deprecation policy. +- Schema 2:1 is a backward compatible update of schema 2:0. You will always receive payloads in 2:1 format when you request either schema 2:0 or 2:1. +- Changes in SBE schema 2:1: + - New field `origQuoteOrderQty` in order placement/cancellation responses (Note: Decoders generated using the 2:0 schema will skip this field.): + - `NewOrderResultResponse` + - `NewOrderFullResponse` + - `CancelOrderResponse` + - `NewOrderListResultResponse` + - `NewOrderListFullResponse` + - `CancelOrderListResponse` + - WebSocket API only: New field `userDataStream` in session status responses: + - `WebSocketSessionLogonResponse` + - `WebSocketSessionStatusResponse` + - `WebSocketSessionLogoutResponse` + - WebSocket API only: New messages for User Data Stream support: + - `UserDataStreamSubscribeResponse` + - `UserDataStreamUnsubscribeResponse` + - `BalanceUpdateEvent` + - `EventStreamTerminatedEvent` + - `ExecutionReportEvent` + - `ExternalLockUpdateEvent` + - `ListStatusEvent` + - `OutboundAccountPositionEvent` + +WebSocket API + +- You can now subscribe to User Data Stream events through your WebSocket API connection. + - Note: This feature is only available for users of the Ed25519 API keys. + - Note: New SBE schema 2:1 is required for User Data Stream subscriptions in SBE format. +- New requests: + - `userDataStream.subscribe` + - `userDataStream.unsubscribe` +- Changes to `session.logon`, `session.status`, and `session.logout` + - Added a new field `userDataStream` indicating if the user data stream subscription is active. +- Fixed a bug where you wouldn't receive a new listenKey using `userDataStream.start` after `session.logon` + +User Data Stream + +- WebSocket API only: New event `eventStreamTerminated` is emitted when you either logout from your websocket session or you have unsubscribed from the user data stream. +- New event `externalLockUpdate` is sent when your spot wallet balance is locked/unlocked by an external system. + +FIX API + +- The [schema](https://github.com/binance/binance-spot-api-docs/blob/master/fix/schemas/spot-fix-oe.xml) has been updated with a new Administrative message News , which can be used for all FIX services. Receiving this message indicates that your connection is about to be closed. + +The following changes will occur **between 2024-12-16 to 2024-12-20**: + +- Fixed a bug that prevented orders from being placed when submitting OCOs on the `BUY` side without providing a `stopPrice`. +- `TAKE_PROFIT` and `TAKE_PROFIT_LIMIT` support has been added for OCOs. + - Previously OCOs could only be composed by the following order types: + - `LIMIT_MAKER` + `STOP_LOSS` + - `LIMIT_MAKER` + `STOP_LOSS_LIMIT` + - Now OCOs can be composed of the following order types: + - `LIMIT_MAKER` + `STOP_LOSS` + - `LIMIT_MAKER` + `STOP_LOSS_LIMIT` + - `TAKE_PROFIT` + `STOP_LOSS` + - `TAKE_PROFIT` + `STOP_LOSS_LIMIT` + - `TAKE_PROFIT_LIMIT` + `STOP_LOSS` + - `TAKE_PROFIT_LIMIT` + `STOP_LOSS_LIMIT` + - This is supported by the following requests: + - `POST /api/v3/orderList/oco` + - `POST /api/v3/orderList/otoco` + - `orderList.place.oco` + - `orderList.place.otoco` + - `NewOrderList` + - Error code -1167 will be obsolete after this update and will be removed from the documentation in a later update. + +--- + +### 2024-10-18[​](https://developers.binance.com/docs/binance-spot-api-docs) + +REST and WebSocket API: + +- Reminder that SBE 1:0 schema will be disabled on 2024-10-25, [6 months after being deprecated](https://developers.binance.com/docs/binance-spot-api-docs/faqs/sbe_faq), as per our SBE policy. +- The [SBE lifecycle for Prod](https://github.com/binance/binance-spot-api-docs/blob/master/sbe/schemas/sbe_schema_lifecycle_prod.json) has been updated to reflect this change. + +--- + +### 2024-10-17[​](https://developers.binance.com/docs/binance-spot-api-docs) + +Changes to Exchange Information (i.e. [`GET /api/v3/exchangeInfo`](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-endpoints) from REST and [`exchangeInfo`](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/general-requests) for WebSocket API). + +- A new optional parameter `showPermissionSets` can be used to hide the permissions from `permissionsSets`; This can be used for a reduced payload size. +- A new optional parameter `symbolStatus` can now be used to only show symbols with the specified status. (e.g. `TRADING`, `HALT`, `BREAK`) + +--- + +### 2024-08-26[​](https://developers.binance.com/docs/binance-spot-api-docs) + +- [Spot Unfilled Order Count Rules](https://developers.binance.com/docs/binance-spot-api-docs/faqs/order_count_decrement) have been updated to explain how to decrease your unfilled order count when placing orders. + +--- + +### 2024-08-16[​](https://developers.binance.com/docs/binance-spot-api-docs) + +**Notice:** The changes below are being rolled out gradually, and may take approximately a week to complete. + +General Changes: + +- New error messages have been added when quote quantity market orders (aka reverse market orders) are rejected in low-liquidity situations. + +--- + +### 2024-08-01[​](https://developers.binance.com/docs/binance-spot-api-docs) + +- [FIX API and Drop Copy Sessions](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) will be available on **August 8, 05:00 UTC**. + +--- + +### 2024-07-26[​](https://developers.binance.com/docs/binance-spot-api-docs) + +- [FIX API and Drop Copy Sessions](https://developers.binance.com/docs/binance-spot-api-docs/fix-api) has been added to the documentation. +- The release date to the live exchange has not been determined. + +--- + +### 2024-07-22[​](https://developers.binance.com/docs/binance-spot-api-docs) + +General changes: + +- Fixed a bug where klines had incorrect timestamps. + - REST API: `GET /api/v3/klines` and `GET /api/v3/uiKlines` with `timeZone` parameter + - WebSocket API: `klines` and `uiKlines` with `timeZone` parameter + - WebSocket Streams: `@kline_@+08:00` streams + +--- + +### 2024-06-11[​](https://developers.binance.com/docs/binance-spot-api-docs) + +- On **June 11, 05:00 UTC**, One-Triggers-the-Other (OTO) orders and One-Triggers-a-One-Cancels-The-Other (OTOCO) orders will be enabled. (Note this may take a few hours to be rolled out to all servers.) + - New requests have been added: + - REST API: + - `POST /api/v3/orderList/oto` + - `POST /api/v3/orderList/otoco` + - WebSocket API: + - `orderList.place.oto` + - `orderList.place.otoco` +- On **June 18, 05:00 UTC**, Buyer order ID `b` and Seller order ID `a` will be removed from the Trade Streams (i.e. `@trade`). (Note that this may take a few hours to be rolled out to all servers.) + - [WebSocket Streams](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) has been updated regarding this change. + - To monitor if your order was part of a trade, please listen to the [User Data Streams](https://developers.binance.com/docs/binance-spot-api-docs/user-data-stream) + +--- + +### 2024-06-06[​](https://developers.binance.com/docs/binance-spot-api-docs) + +This will be available by **June 6, 11:59 UTC**. + +REST API + +- `orderRateLimitExceededMode` has been added to `POST /api/v3/order/cancelReplace`. + +WebSocket API + +- `orderRateLimitExceededMode` has been added to `order.cancelReplace`. + +--- + +### 2024-05-30[​](https://developers.binance.com/docs/binance-spot-api-docs) + +WebSocket Streams: + +- Kline/Candlestick streams can now support a UTC+8 timezone offset. (e.g. `btcusdt@kline_1d@+08:00`) + +--- + +### 2024-04-10[​](https://developers.binance.com/docs/binance-spot-api-docs) + +The following changes have been postponed to take effect on **April 25, 05:00 UTC** + +General changes: + +- Symbol permission information in Exchange Information responses has moved from field `permissions` to field `permissionSets`. +- Field `permissions` will be empty and will be removed in a future release. +- Previously, `"permissions":["SPOT","MARGIN"]` meant that you could place an order on the symbol if your account had `SPOT` or `MARGIN` permissions. The equivalent is `"permissionSets":[["SPOT","MARGIN"]]`. (Note the extra set of square brackets.) Each array of permissions inside the `permissionSets` array is called a "permission set". +- Symbol permissions can now be more complex. `"permissionSets":[["SPOT","MARGIN"],["TRD_GRP_004","TRD_GRP_005"]]` means that you may place an order on the symbol if your account has SPOT or MARGIN permissions **and** `TRD_GRP_004` or `TRD_GRP_005` permissions. There may be an arbitrary number of permission sets in a symbol's `permissionSets`. + +REST API + +- `otoAllowed` will now appear on `GET /api/v3/exchangeInfo`, that indicates if One-Triggers-the-Other (OTO) orders are supported on that symbol. + +WebSocket API + +- `otoAllowed` will now appear on `exchangeInfo`, that indicates if One-Triggers-the-Other (OTO) orders are supported on that symbol. + +SBE + +- A new schema 2:0 [spot\_2\_0.xml](https://github.com/binance/binance-spot-api-docs/blob/master/sbe/schemas/spot_2_0.xml) has been released. The current schema 1:0 [spot\_1\_0.xml](https://github.com/binance/binance-spot-api-docs/blob/becd4d44a09d94821d2dc761ba9197aae8b495c3/sbe/schemas/spot_1_0.xml) will thus be deprecated, and retired from the API in 6 months as per our schema deprecation policy. +- When using schema 1:0 on REST API or WebSocket API, group "permissions" in message "ExchangeInfoResponse" will always be empty. Upgrade to schema 2:0 to find permission information in group "permissionSets". See General changes above for more details. +- Deprecated OCO requests will still be supported by the latest schema. +- Note that trying to use schema 2:0 before it is actually released will result in an error. + +--- + +### 2024-04-02[​](https://developers.binance.com/docs/binance-spot-api-docs) + +**Notice:** The changes below are being rolled out gradually, and will take approximately a week to complete. + +General changes: + +- `GET /api/v3/account` has a new optional parameter `omitZeroBalances`, which if enabled hides all zero balances. +- `account.status` has a new optional parameter `omitZeroBalances` which if enabled hides all zero balances. +- **The weight of the following requests has been increased from 10 to 25 (This will take effect on April 4, 2024)**: + - `GET /api/v3/trades` + - `GET /api/v3/historicalTrades` + - `trades.recent` + - `trades.historical` + +User Data Stream: + +- New event `listenKeyExpired` that will be emitted in the streams if the `listenKey` expired. + +REST API + +- The `POST /api/v3/order/oco` endpoint is now deprecated on the REST API. You should use the new `POST /api/v3/orderList/oco` endpoint instead. Note that this new endpoint uses different parameters. + +WebSocket API + +- The `orderList.place` request is now deprecated on the WebSocket API. You should now use the new `orderList.place.oco` request instead. Note that this new request uses different parameters. + +**The following will take effect _approximately_ a week after the release date:** + +General changes: + +- Symbol permission information in Exchange Information responses has moved from field `permissions` to field `permissionSets`. +- Field `permissions` will be empty and will be removed in a future release. +- Previously, `"permissions":["SPOT","MARGIN"]` meant that you could place an order on the symbol if your account had `SPOT` or `MARGIN` permissions. The equivalent is `"permissionSets":[["SPOT","MARGIN"]]`. (Note the extra set of square brackets.) Each array of permissions inside the `permissionSets` array is called a "permission set". +- Symbol permissions can now be more complex. `"permissionSets":[["SPOT","MARGIN"],["TRD_GRP_004","TRD_GRP_005"]]` means that you may place an order on the symbol if your account has SPOT or MARGIN permissions **and** `TRD_GRP_004` or `TRD_GRP_005` permissions. There may be an arbitrary number of permission sets in a symbol's `permissionSets`. + +REST API + +- `otoAllowed` will now appear on `GET /api/v3/exchangeInfo`, that indicates if One-Triggers-the-Other (OTO) orders are supported on that symbol. + +WebSocket API + +- `otoAllowed` will now appear on `exchangeInfo`, that indicates if One-Triggers-the-Other (OTO) orders are supported on that symbol. + +SBE + +- A new schema 2:0 [spot\_2\_0.xml](https://github.com/binance/binance-spot-api-docs/blob/master/sbe/schemas/spot_2_0.xml) has been released. The current schema 1:0 [spot\_1\_0.xml](https://github.com/binance/binance-spot-api-docs/blob/becd4d44a09d94821d2dc761ba9197aae8b495c3/sbe/schemas/spot_1_0.xml) will thus be deprecated, and retired from the API in 6 months as per our schema deprecation policy. +- When using schema 1:0 on REST API or WebSocket API, group "permissions" in message "ExchangeInfoResponse" will always be empty. Upgrade to schema 2:0 to find permission information in group "permissionSets". See General changes above for more details. +- Deprecated OCO requests will still be supported by the latest schema. +- Note that trying to use schema 2:0 before it is actually released will result in an error. + +--- + +### 2024-02-28[​](https://developers.binance.com/docs/binance-spot-api-docs) + +**This will take effect on March 5, 2024.** + +Simple Binary Encoding (SBE) will be added to the live exchange, both for the Rest API and WebSocket API. + +For more information on SBE, please refer to the [FAQ](https://developers.binance.com/docs/binance-spot-api-docs/faqs/sbe_faq) + +--- + +### 2024-02-08[​](https://developers.binance.com/docs/binance-spot-api-docs) + +The SPOT WebSocket API can now support SBE on [SPOT Testnet](https://testnet.binance.vision/). + +The SBE schema has been updated with WebSocket API metadata without incrementing either `schemaId` or `version`. + +Users using SBE only on the REST API may continue to use the SBE schema with git commit hash [`128b94b2591944a536ae427626b795000100cf1d`](https://github.com/binance/binance-spot-api-docs/blob/128b94b2591944a536ae427626b795000100cf1d/sbe/schemas/spot_1_0.xml) or update to the newly-published SBE schema. + +Users who want to use SBE on the WebSocket API must use the [newly-published SBE schema](https://github.com/binance/binance-spot-api-docs/blob/becd4d44a09d94821d2dc761ba9197aae8b495c3/sbe/schemas/spot_1_0.xml). + +The [FAQ](https://developers.binance.com/docs/binance-spot-api-docs/faqs/sbe_faq) for SBE has been updated. + +--- + +### 2023-12-08[​](https://developers.binance.com/docs/binance-spot-api-docs) + +Simple Binary Encoding (SBE) has been added to [SPOT Testnet](https://testnet.binance.vision/). + +This will be added to the live exchange at a later date. + +For more information on what SBE is, please refer to the [FAQ](https://developers.binance.com/docs/binance-spot-api-docs/faqs/sbe_faq) + +--- + +### 2023-12-04[​](https://developers.binance.com/docs/binance-spot-api-docs) + +**Notice:** The changes below are being rolled out gradually, and will take approximately a week to complete. + +General Changes: + +- Error message `Precision is over the maximum defined for this asset.` has been changed to `Parameter '%s' has too much precision.` + - This error message is returned when a parameter has more precision than allowed: e.g. if `base asset` precision is 6 and `quantity=0.1234567` then this error message will appear. + - This affects all requests with the following parameters: + - `quantity` + - `quoteOrderQty` + - `icebergQty` + - `limitIcebergQty` + - `stopIcebergQty` + - `price` + - `stopPrice` + - `stopLimitPrice` +- Requests for open OCO now correctly return results in **ascending order**. This affects the following requests: + - REST API: `GET /api/v3/openOrderList` + - WebSocket API: `openOrderList.status` +- Requests for all OCO now correctly return results in **ascending order** when `startTime` or `fromId` are specified. This affects the following requests: + - REST API: `GET /api/v3/allOrderList` + - WebSocket API: `allOrderLists` +- Fixed a bug where order query requests would incorrectly return [`-2026 ORDER_ARCHIVED`](https://developers.binance.com/docs/binance-spot-api-docs/errors) error for newly placed orders. + - REST API: `GET /api/v3/order` + - WebSocket API: `order.status` + +REST API + +- New endpoint `GET /api/v3/account/commission` +- New endpoint `GET /api/v3/ticker/tradingDay` +- `GET /api/v3/avgPrice` response has a new field `closeTime`, indicating the last trade time. +- `GET /api/v3/klines` and `/api/v3/uiKlines` have a new optional parameter `timeZone`. +- `POST /api/v3/order/test` and `POST /api/v3/sor/order/test` have a new optional parameter `computeCommissionRates`. +- Changes regarding invalid endpoints being sent: + - Previously, if you query an non-existing endpoint (e.g. `curl -X GET "https://api.binance.com/api/v3/exchangie`) you would get a HTTP 404 code with the response `

404 Not found

` + - From now on the HTML response will only appear if the Accept request header has `text/html` for this situation. The HTTP code will remain the same. + +WebSocket API + +- New request `account.commission` +- New requests to allow session authentication: **(Note that these requests can only be used with Ed25519 keys.)** + - `session.logon` + - `session.logout` + - `session.status` +- New request `ticker.tradingDay` +- `avgPrice` response has a new field `closeTime`, indicating the last trade time. +- `klines` and `uiKlines` have a new optional parameter `timeZone`. +- `order.test` and `sor.order.test` have a new optional parameter `computeCommissionRates`. +- Fixed a bug where unsolicited pongs sent before the ping would cause disconnection. + +WebSocket Streams + +- New stream `@avgPrice` +- `id` now supports the same values as used for `id` in the WebSocket API: + - 64-bit signed integers (previously this was unsigned) + - Alphanumeric strings, max of 36 in length + - `null` +- Fixed a bug where unsolicited pongs sent before the ping would cause disconnection. + +User Data Streams + +- When an event of type `executionReport` has an execution type (`x`) of `TRADE_PREVENTION`, fields `l`, `L` and `Y` will now always be 0. New fields `pl`, `pL` and `pY` will describe the prevented execution quantity, prevented execution price, and prevented execution notional instead. These new fields show the values of what would `l`, `L` and `Y` have been if the taker order didn't have self-trade prevention enabled. + +**The following will take effect _approximately_ a week after the release date:** + +- Symbol Permissions will only affect order placement, not cancellation. + - `permissions` still apply to Cancel-Replace orders (i.e. The cancellation won't be allowed if your account does have the permission to place an order using this request.) + +--- + +### 2023-10-19[​](https://developers.binance.com/docs/binance-spot-api-docs) + +**Effective on 2023-10-19 00:00 UTC** + +- The request weights of the following requests have been increased: + +REST API + +WebSocket API + +Condition + +Previous Request Weight + +New Request Weight + +`GET /api/v3/trades` + +`trades.recent` + +N/A + +2 + +10 + +`GET /api/v3/depth` + +`depth` + +**Limit 1-100** + +2 + +5 + +**Limit 101-500** + +10 + +25 + +**Limit 501-1000** + +20 + +50 + +**Limit 1001-5000** + +100 + +250 + +--- + +### 2023-10-03[​](https://developers.binance.com/docs/binance-spot-api-docs) + +- **Order decrement feature went live at 06:15 UTC**. +- For more information on this feature, please refer to our [FAQ](https://developers.binance.com/docs/binance-spot-api-docs/faqs/order_count_decrement) + +--- + +### 2023-08-25[​](https://developers.binance.com/docs/binance-spot-api-docs) + +- For WebSocket API, removed `RAW REQUESTS` rate limit in `exchangeInfo`, replaced it with `CONNECTIONS` rate limit, which is the limit for new Websocket connections. + +**The following changes will be effective from 2023-08-25 at UTC 00:00.** + +- The `CONNECTIONS` rate limit for WebSocket API has been adjusted to 300 every 5 minutes. +- The `REQUEST_WEIGHT` rate limit for both REST and WebSocket API has been adjusted to 6,000 every minute. +- The `RAW_REQUESTS` rate limit for REST API has been adjusted to 61,000 every 5 minutes. +- Previously, connecting to WebSocket API used to cost 1 weight. **The cost is now 2**. +- The weights to the following requests for both REST API and WebSocket API have been adjusted. + +Please refer to the table for more details: + +Request + +Previous Request Weight + +New Request Weight + +`GET /api/v3/order` +`order.status` + +2 + +4 + +`GET /api/v3/orderList` +orderList.status + +2 + +4 + +`GET /api/v3/openOrders` +`openOrders.status` - **With `symbol`** + +3 + +6 + +`GET /api/v3/openOrders` +`openOrders.status` - **Without `symbol`** + +40 + +80 + +`GET /api/v3/openOrderList` +`openOrderLists.status` + +3 + +6 + +`GET /api/v3/allOrders` +`allOrders` + +10 + +20 + +`GET /api/v3/allOrderList` +`allOrderLists` + +10 + +20 + +`GET /api/v3/myTrades` +`myTrades` + +10 + +20 + +`GET /api/v3/myAllocations` +`myAllocations` + +10 + +20 + +`GET /api/v3/myPreventedMatches` +`myPreventedMatches` - **Using `preventedMatchId`** + +1 + +2 + +`GET /api/v3/myPreventedMatches` +`myPreventedMatches` - **Using `orderId`** + +10 + +20 + +`GET /api/v3/account` +`account.status` + +10 + +20 + +`GET /api/v3/rateLimit/order` +`account.rateLimits.orders` + +20 + +40 + +`GET /api/v3/exchangeInfo` +`exchangeInfo` + +10 + +20 + +`GET /api/v3/depth` +`depth` - **Limit 1-100** + +1 + +2 + +`GET /api/v3/depth` +`depth` - **Limit 101-500** + +5 + +10 + +`GET /api/v3/depth` +`depth` - **Limit 501-1000** + +10 + +20 + +`GET /api/v3/depth` +`depth` - **Limit 1001-5000** + +50 + +100 + +`GET /api/v3/aggTrades` +`trades.aggregate` + +1 + +2 + +`GET /api/v3/trades` +`trades.recent` + +1 + +2 + +`GET /api/v3/historicalTrades` +`trades.historical` + +5 + +10 + +`GET /api/v3/klines` +`klines` + +1 + +2 + +`GET /api/v3/uiKlines` +`uiKlines` + +1 + +2 + +`GET /api/v3/ticker/bookTicker` +`ticker.book` - **With `symbol`** + +1 + +2 + +`GET /api/v3/ticker/bookTicker` +`ticker.book` - **Without `symbol`** or **With `symbols`** + +2 + +4 + +`GET /api/v3/ticker/price` +`ticker.price` - **With `symbol`** + +1 + +2 + +`GET /api/v3/ticker/price` +`ticker.price` - **Without `symbol`** or **With `symbols`** + +2 + +4 + +`GET /api/v3/ticker/24hr` +`ticker.24hr` - **With `symbol`** or **With `symbols` using 1-20 symbols** + +1 + +2 + +`GET /api/v3/ticker/24hr` +`ticker.24hr` - **With `symbols using 21-100 symbols`** + +20 + +40 + +`GET /api/v3/ticker/24hr` +`ticker.24hr` - **Without `symbol` or `symbols using 101 or more symbols`** + +40 + +80 + +`GET /api/v3/avgPrice` +`avgPrice` + +1 + +2 + +`GET /api/v3/ticker` +`ticker` + +2 + +4 + +`GET /api/v3/ticker` +`ticker` - Maximum weight for this request + +100 + +200 + +`POST /api/v3/userDataStream` +`userDataStream.start` + +1 + +2 + +`PUT /api/v3/userDataStream` +`userDataStream.ping` + +1 + +2 + +`DELETE /api/v3/userDataStream` +`userDataStream.stop` + +1 + +2 + +--- + +### 2023-08-08[​](https://developers.binance.com/docs/binance-spot-api-docs) + +Smart Order Routing (SOR) has been added to the APIs. For more information please refer to our [FAQ](https://developers.binance.com/docs/binance-spot-api-docs/faqs/sor_faq). Please wait for future announcements on when the feature will be enabled. + +REST API + +- Changes to `GET /api/v3/exchangeInfo`: + - New field in response: `sors`, describing SORs enabled on the exchange. +- Changes to `GET /api/v3/myPreventedMatches` + - New field `makerSymbol` will appear in the response for all prevented matches. +- New endpoints for order placement using SOR: + - `POST /api/v3/sor/order` + - `POST /api/v3/sor/order/test` +- New endpoint `GET /api/v3/myAllocations` + +WEBSOCKET API + +- Changes to `exchangeInfo`: + - New field in response: `sors`, describing SORs enabled on the exchange. +- Changes to `myPreventedMatches`: + - New field `makerSymbol` will appear in the response for all prevented matches. +- New requests for order placement using SOR: + - `sor.order.place` + - `sor.order.test` +- New request `myAllocations` + +USER DATA STREAM + +- Changes to `executionReport`: + - These fields are only relevant for orders placed using SOR: + - New field `b` for `matchType` + - New field `a` for `allocId` + - New field `k` for `workingFloor` + - This field is only relevant for orders expiring due to STP: + - New field `Cs` for `counterSymbol` + +--- + +### 2023-07-18[​](https://developers.binance.com/docs/binance-spot-api-docs) + +- New API key type – Ed25519 – is now supported. (UI support will be released this week.) + - Ed25519 API keys are an alternative to RSA API keys, using asymmetric cryptography to authenticate your requests on the API. + - **We recommend switching to Ed25519** for improved performance and security. + For more information, please refer to the [API Key Types](https://developers.binance.com/docs/binance-spot-api-docs/faqs/api_key_types). +- Documentation has been updated with how to sign a payload with Ed25519 keys. + +--- + +### 2023-07-11[​](https://developers.binance.com/docs/binance-spot-api-docs) + +**Notice:** The change below are being rolled out, and will take approximately a week to complete. + +General Changes: + +- Changes to error messages: + - Previously, when duplicate symbols were passed to requests that do not allow it, the error would be "Mandatory parameter symbols was not sent, was empty/null, or malformed." + - Now, the error message is "Symbol is present multiple times in the list", with a new error code `-1151` + - This affects the following requests: + - `GET /api/v3/exchangeInfo` + - `GET /api/v3/ticker/24hr` + - `GET /api/v3/ticker/price` + - `GET/api/v3/ticker/bookTicker` + - `exchangeInfo` + - `ticker.24hr` + - `ticker.price` + - `ticker.book` +- Fixed a bug where some non-archived orders being queried would receive the error code that their order was archived. + +Rest API + +- Changes to `GET /api/v3/account`: + - New field `preventSor` will appear in the response. + - New field `uid` that shows the User Id/Account will appear in the response. +- Changes to `GET /api/v3/historicalTrades`: + - Changed security type from `MARKET_DATA` to `NONE`. + - This means that the `X-MBX-APIKEY` header is no longer necessary and is now ignored. + +Websocket API + +- Changes to `account.status`: + - New field `preventSor` will appear in the response. + - New field `uid` that shows the User Id/Account will appear in the response. +- Changes to `trades.historical`: + - Changed security type from `MARKET_DATA` to `NONE`. + - This means that the `apiKey` parameter is no longer necessary and is now ignored. + +**The following changes will take effect _approximately a week from the release date_:**: + +- Fixed multiple bugs with orders that use `type=MARKET` and `quoteOrderQty`, also known as “reverse market orders”: + - Reverse market orders are no longer partially filled, or filled for zero or negative quantity under extreme market conditions. + - `MARKET_LOT_SIZE` filter now correctly rejects reverse market orders that go over the symbol's `maxQty`. +- Fixed a bug where OCO orders using `trailingDelta` could have an incorrect `trailingTime` value after either leg of the OCO is touched. +- New field `transactTime` will appear in order cancellation responses. This affects the following requests: + - `DELETE /api/v3/order` + - `POST /api/v3/order/cancelReplace` + - `DELETE /api/v3/openOrders` + - `DELETE /api/v3/orderList` + - `order.cancel` + - `order.cancelReplace` + - `openOrders.cancelAll` + - `orderList.cancel` + +--- + +### 2023-06-06[​](https://developers.binance.com/docs/binance-spot-api-docs) + +- A new endpoint is now available for redundancy: **[https://api-gcp.binance.com/](https://api-gcp.binance.com/)** + - This is using the GCP (Google Cloud Platform) CDN and may have slower performance compared to `api1`\-`api4` endpoints. + +--- + +### 2023-05-26[​](https://developers.binance.com/docs/binance-spot-api-docs) + +**Notice:** The change below are being rolled out, and will take approximately a week to complete. + +- The following base endpoints may give better performance but have less stability than **[https://api.binance.com](https://api.binance.com/)**: + - **[https://api1.binance.com](https://api1.binance.com/)** + - **[https://api2.binance.com](https://api2.binance.com/)** + - **[https://api3.binance.com](https://api3.binance.com/)** + - **[https://api4.binance.com](https://api4.binance.com/)** + +--- + +### 2023-05-24[​](https://developers.binance.com/docs/binance-spot-api-docs) + +- **The previous market data URLs have been deprecated. Please update your code immediately to prevent interruption of our services.** + - API Market data from `data.binance.com` can now be accessed from `data-api.binance.vision`. + - Websocket Market Data from `data-stream.binance.com` can now be accessed from `data-stream.binance.vision`. + +--- + +### 2023-03-13[​](https://developers.binance.com/docs/binance-spot-api-docs) + +**Notice:** All changes are being rolled out gradually to all our servers, and may take a week to complete. + +GENERAL CHANGES + +- The error messages for certain issues have been improved for easier troubleshooting. + +Situation + +Old Error Message + +New Error Message + +An account cannot place or cancel an order, due to trading ability disabled. + +This action is disabled on this account. + +This account may not place or cancel orders. + +When the permissions configured on the symbol do not match the permissions on the account. + +This symbol is not permitted for this account. + +When the account tries to place an order on a symbol it has no permissions for. + +This symbol is restricted for this account. + +Placing an order when symbol is not TRADING. + +Unsupported order combination. + +This order type is not possible in this trading phase. + +Placing an order with timeinForce\=IOC or FOK on a trading phase that does not support it. + +Limit orders require GTC for this phase. + +- Fixed error message for querying archived orders: + + - Previously, if an archived order (i.e. order with status `CANCELED` or `EXPIRED` where `executedQty` == 0 that occurred more than 90 days in the past.) is queried, the error message would be: + + ``` + { "code": -2013, "msg": "Order does not exist."} + ``` + + - Now, the error message is: + + ``` + { "code": -2026, "msg": "Order was canceled or expired with no executed qty over 90 days ago and has been archived."} + ``` + +- Behavior for API requests with `startTime` and `endTime`: + - Previously some requests failed if the `startTime` == `endTime`. + - Now, all API requests that accept `startTime` and `endTime` allow the parameters to be equal. This applies to the following requests: + - Rest API + - `GET /api/v3/aggTrades` + - `GET /api/v3/klines` + - `GET /api/v3/allOrderList` + - `GET /api/v3/allOrders` + - `GET /api/v3/myTrades` + - Websocket API + - `trades.aggregate` + - `klines` + - `allOrderList` + - `allOrders` + - `myTrades` +- Users connected to the websocket API will now be disconnected if their IP is banned due to violation of the IP rate limits (status `418`). + +The following changes will take effect **approximately a week from the release date**, but the rest of the documentation has been updated to reflect the future changes: + +- Changes to Filter Evaluation: + - Previous behavior: `LOT_SIZE` and `MARKET_LOT_SIZE` required that (`quantity` - `minQty`) % `stepSize` == 0. + - New behavior: This has now been changed to (`quantity` % `stepSize`) == 0. +- Bug fix with reverse `MARKET` orders (i.e., `MARKET` using `quoteOrderQty`): + - Previous behavior: Reverse market orders would always have the status `FILLED` even if the order did not fully fill due to low liquidity. + - New behavior: If the reverse market order did not fully fill due to low liquidity the order status will be `EXPIRED`, and `FILLED` only if the order was completely filled. + +REST API + +- Changes to `DELETE /api/v3/order` and `POST /api/v3/order/cancelReplace`: + + - A new optional parameter `cancelRestrictions` that determines whether the cancel will succeed if the order status is `NEW` or `PARTIALLY_FILLED`. + - If the order cancellation fails due to `cancelRestrictions`, the error will be: + + ``` + { "code": -2011, "msg": "Order was not canceled due to cancel restrictions."} + ``` + + +WEBSOCKET API + +- Changes to `order.cancel` and `order.cancelReplace`: + + - A new optional parameter `cancelRestrictions` that determines whether the cancel will succeed if the order status is `NEW` or `PARTIALLY_FILLED`. + - If the order cancellation fails due to `cancelRestrictions`, the error will be: + + ``` + { "code": -2011, "msg": "Order was not canceled due to cancel restrictions."} + ``` + + +--- + +### 2023-02-17[​](https://developers.binance.com/docs/binance-spot-api-docs) + +**Changes to Websocket Limits** + +The WS-API and Websocket Stream now only allows 300 connections requests every 5 minutes. + +This limit is **per IP address**. + +Please be careful when trying to open multiple connections or reconnecting to the Websocket API. + +--- + +### 2023-01-26[​](https://developers.binance.com/docs/binance-spot-api-docs) + +As per the [announcement](https://www.binance.com/en/support/announcement/binance-spot-launches-self-trade-prevention-stp-function-on-api-312fd0112fb44635b397c116e56d8f84), Self Trade Prevention will be enabled at **2023-01-26 08:00 UTC**. + +Please refer to `GET /api/v3/exchangeInfo` from the Rest API or `exchangeInfo` from the Websocket API on the default and allowed modes. + +--- + +### 2023-01-23[​](https://developers.binance.com/docs/binance-spot-api-docs) + +New API cluster has been added. Note that all endpoints are functionally equal, but may vary in performance. + +- [https://api4.binance.com](https://api4.binance.com/) + +--- + +### 2023-01-19[​](https://developers.binance.com/docs/binance-spot-api-docs) + +**ACTUAL RELEASE DATE TBD** + +**New Feature**: Self-Trade Prevention (aka STP) will be added to the system at a later date. This will prevent orders from matching with orders from the same account, or accounts under the same `tradeGroupId`. + +Please refer to `GET /api/v3/exchangeInfo` from the Rest API or `exchangeInfo` from the Websocket API on the status. + +``` +{ "defaultSelfTradePreventionMode": "NONE", // If selfTradePreventionMode not provided, this will be the value passed to the engine "allowedSelfTradePreventionModes": [ // What the allowed modes of selfTradePrevention are "NONE", "EXPIRE_TAKER", "EXPIRE_BOTH", "EXPIRE_MAKER" ]} +``` + +Additional details on the functionality of STP is explained in the [STP FAQ](https://developers.binance.com/docs/binance-spot-api-docs/faqs/stp_faq) document. + +REST API + +- New order status: `EXPIRED_IN_MATCH` - This means that the order expired due to STP being triggered. +- New endpoint: + - `GET /api/v3/myPreventedMatches` - This queries the orders that expired due to STP being triggered. +- New optional parameter `selfTradePreventionMode` has been added to the following endpoints: + - `POST /api/v3/order` + - `POST /api/v3/order/oco` + - `POST /api/v3/cancelReplace` +- New responses that will appear for all order placement endpoints if there was a prevented match (i.e. if an order could have matched with an order of the same account, or the accounts are in the same `tradeGroupId`): + - `tradeGroupId` - This will only appear if account is configured to a `tradeGroupId` and if there was a prevented match. + - `preventedQuantity` - Only appears if there was a prevented match. + - An array `preventedMatches` with the following fields: + - `preventedMatchId` + - `makerOrderId` + - `price` + - `takerPreventedQuantity` - This will only appear if `selfTradePreventionMode` set is `EXPIRE_TAKER` or `EXPIRE_BOTH`. + - `makerPreventedQuantity` - This will only appear if `selfTradePreventionMode` set is `EXPIRE_MAKER` or `EXPIRE_BOTH`. +- New fields `preventedMatchId` and `preventedQuantity` that can appear in the order query endpoints if the order had expired due to an STP trigger: + - `GET /api/v3/order` + - `GET /api/v3/openOrders` + - `GET /api/v3/allOrders` + +WEBSOCKET API + +- New order status: `EXPIRED_IN_MATCH` - This means that the order expired due to STP being triggered. +- New optional parameter `selfTradePreventionMode` has been added to the following requests: + - `order.place` + - `orderList.place` + - `order.cancelReplace` +- New request: `myPreventedMatches` - This queries the orders that expired due to STP being triggered. +- New responses that will appear for all order placement endpoints if there was a prevented match (i.e. if an order could have matched with an order of the same account, or the accounts are in the same `tradeGroupId`): + - `tradeGroupId` - This will only appear if account is configured to a `tradeGroupId` and if there was a prevented match. + - `preventedQuantity` - Only appears if there was a prevented match. + - An array `preventedMatches` with the following fields: + - `preventedMatchId` + - `makerOrderId` + - `price` + - `takerPreventedQuantity` - This will only appear if `selfTradePreventionMode` set is `EXPIRE_TAKER` or `EXPIRE_BOTH`. + - `makerPreventedQuantity` - This will only appear if `selfTradePreventionMode` set is `EXPIRE_MAKER` or `EXPIRE_BOTH`. +- New fields `preventedMatchId` and `preventedQuantity` that can appear in the order query requests if the order had expired due to STP trigger: + - `order.status` + - `openOrders.status` + - `allOrders` + +USER DATA STREAM + +- New execution Type: `TRADE_PREVENTION` +- New fields for `executionReport` (These fields will only appear if the order has expired due to STP trigger) + - `u` - `tradeGroupId` + - `v` - `preventedMatchId` + - `U` - `counterOrderId` + - `A` - `preventedQuantity` + - `B` - `lastPreventedQuantity` + +--- + +### 2022-12-28[​](https://developers.binance.com/docs/binance-spot-api-docs) + +- SPOT WebSocket API documentation has been updated to show how to sign a request using an RSA key. + +--- + +### 2022-12-26[​](https://developers.binance.com/docs/binance-spot-api-docs) + +- Spot WebSocket API is now available on the live exchange. +- Spot Websocket API can be accessed through this URL: `wss://ws-api.binance.com/ws-api/v3` + +--- + +### 2022-12-15[​](https://developers.binance.com/docs/binance-spot-api-docs) + +- New RSA signature + - Documentation has been updated to show how to create RSA keys. + - For security reasons, we recommend to use RSA keys instead of HMAC keys when generating an API key. + - We accept `PKCS#8` (BEGIN PUBLIC KEY). + - More details on how to upload your RSA public key will be added at a later date. +- SPOT WebSocket API is now available on **SPOT Testnet**. + - WebSocket API allows placing orders, canceling orders, etc. through a WebSocket connection. + - WebSocket API is a **separate** service from WebSocket Market Data streams. I.e., placing orders and listening to market data requires two separate WebSocket connections. + - WebSocket API is subject to the same Filter and Rate Limit rules as REST API. + - WebSocket API and REST API are functionally equivalent: they provide the same features, accept the same parameters, return the same status and error codes. + +**WEBSOCKET API WILL BE AVAILABLE ON THE LIVE EXCHANGE AT A LATER DATE.** + +--- + +### 2022-12-13[​](https://developers.binance.com/docs/binance-spot-api-docs) + +REST API + +Some error messages on error code `-1003` have changed. + +- Previous error message: `Too much request weight used; current limit is %s request weight per %s %s. Please use the websocket for live updates to avoid polling the API.` has been updated to: + +``` +Too much request weight used; current limit is %s request weight per %s. Please use WebSocket Streams for live updates to avoid polling the API. +``` + +- Previous error message `Way too much request weight used; IP banned until %s. Please use the websocket for live updates to avoid bans.` has been updated to: + +``` +Way too much request weight used; IP banned until %s. Please use WebSocket Streams for live updates to avoid bans. +``` + +--- + +### 2022-12-05[​](https://developers.binance.com/docs/binance-spot-api-docs) + +**Notice:** These changes are being rolled out gradually to all our servers, and will take approximately a week to complete. + +WEBSOCKET + +- `!bookTicker` will be removed by **December 7, 2022**. Please use the Individual Book Ticker Streams instead (`@bookTicker`). + - Multiple `@bookTicker` streams can be subscribed to over one connection. (E.g. `wss://stream.binance.com:9443/stream?streams=btcusdt@bookTicker/bnbbtc@bookTicker`) + +REST API + +- New error code `-1135` + - This error code will occur if a parameter requiring a JSON object is invalid. +- New error code `-1108` + - This error will occur if a value to a parameter being sent was too large, potentially causing overflow. + - This error code can occur in the following endpoints: + - `POST /api/v3/order` + - `POST /api/v3/order/cancelReplace` + - `POST /api/v3/order/oco` +- Changes to `GET /api/v3/aggTrades` + - Previous behavior: `startTime` and `endTime` had to be used in combination and could only be an hour apart. + - New behavior: `startTime` and `endTime` can be used individually and the 1 hour limit has been removed. + - When using `startTime` only, this will return trades from that time, up to the `limit` provided. + - When using `endTime` only, this will return trades before that time, up to the `limit` provided. + - If `limit` not provided, regardless of used in combination or sent individually, the endpoint will use the default limit. +- Changes to `GET /api/v3/myTrades` + - Fixed a bug where `symbol` + `orderId` combination would return all trades even if the number of trades went beyond the `500` default limit. + + - Previous behavior: The API would send specific error messages depending on the combination of parameters sent. E.g: + + ``` + { "code": -1106, "msg": "Parameter X was sent when not required."} + ``` + + - New behavior: If the combinations of optional parameters to the endpoint were not supported, then the endpoint will respond with the generic error: + + ``` + { "code": -1128, "msg": "Combination of optional parameters invalid."} + ``` + + - Added a new combination of supported parameters: `symbol` + `orderId` + `fromId`. + + - The following combinations of parameters were previously supported but no longer accepted, as these combinations were only taking `fromId` into consideration, ignoring `startTime` and `endTime`: + + - `symbol` + `fromId` + `startTime` + - `symbol` + `fromId` + `endTime` + - `symbol` + `fromId` + `startTime` + `endTime` + - Thus, these are the supported combinations of parameters: + + - `symbol` + - `symbol` + `orderId` + - `symbol` + `startTime` + - `symbol` + `endTime` + - `symbol` + `fromId` + - `symbol` + `startTime` + `endTime` + - `symbol`\+ `orderId` + `fromId` + +**Note:** These new fields will appear approximately a week from the release date. + +- Changes to `GET /api/v3/exchangeInfo` + - New fields `defaultSelfTradePreventionMode` and `allowedSelfTradePreventionModes` +- Changes to the Order Placement Endpoints/Order Query/Order Cancellation Endpoints: + - New field `selfTradePreventionMode` will appear in the response. + - Affects the following endpoints: + - `POST /api/v3/order` + - `POST /api/v3/order/oco` + - `POST /api/v3/order/cancelReplace` + - `GET /api/v3/order` + - `DELETE /api/v3/order` + - `DELETE /api/v3/orderList` +- Changes to `GET /api/v3/account` + - New field `requireSelfTradePrevention` will appear in the response. +- New field `workingTime`, indicating when the order started working on the order book, will appear in the following endpoints: + - `POST /api/v3/order` + - `GET /api/v3/order` + - `POST /api/v3/order/cancelReplace` + - `POST /api/v3/order/oco` + - `GET /api/v3/order` + - `GET /api/v3/openOrders` + - `GET /api/v3/allOrders` +- Field `trailingTime`, indicating the time when the trailing order is active and tracking price changes, will appear for the following order types (`TAKE_PROFIT`, `TAKE_PROFIT_LIMIT`, `STOP_LOSS`, `STOP_LOSS_LIMIT` if `trailingDelta` parameter was provided) for the following endpoints: + - `POST /api/v3/order` + - `GET /api/v3/order` + - `GET /api/v3/openOrders` + - `GET /api/v3/allOrders` + - `POST /api/v3/order/cancelReplace` + - `DELETE /api/v3/order` +- Field `commissionRates` will appear in the `GET /api/v3/acccount` response + +USER DATA STREAM + +- eventType `executionReport` has new fields + - `V` - `selfTradePreventionMode` + - `D` - `trailing_time` (Appears if the trailing stop order is active) + - `W` - `workingTime` (Appears if `isWorking`\=`true`) + +--- + +### 2022-12-02[​](https://developers.binance.com/docs/binance-spot-api-docs) + +- Added a new market data base URL `https://data.binance.com`. +- Added a new WebSocket URL `wss://data-stream.binance.com`. + +--- + +### 2022-09-30[​](https://developers.binance.com/docs/binance-spot-api-docs) + +Scheduled changes to the removal of `!bookTicker` around November 2022. + +- The All Book Tickers stream (`!bookTicker`) is set to be removed in **November 2022**. +- More details of the actual removal date will be announced at a later time. +- Please use the Individual Book Ticker Streams instead. (`@bookTicker`). +- Multiple `@bookTicker` streams can be subscribed to over one connection. + - Example: wss://stream.binance.com:9443/stream?streams=btcusdt@bookTicker/bnbbtc@bookTicker + +--- + +### 2022-09-15[​](https://developers.binance.com/docs/binance-spot-api-docs) + +Note that these are rolling changes, so it may take a few days for it to rollout to all our servers. + +- Changes to `GET /api/v3/exchangeInfo` + - New optional parameter `permissions` added to display all symbols with the permissions matching the parameter provided. (eg.`SPOT`,`MARGIN`) + - If not provided, the default value will be `["SPOT","MARGIN","LEVERAGED"]`. + - This means the request `GET /api/v3/exchangeInfo` without any parameters will show all symbols that can be used for `SPOT`, `MARGIN`, and/or `LEVERAGED` trading. + - To search for symbols that can be traded on other permissions (e.g. `TRD_GRP_004`, etc), then this needs to be searched for explicitly. (e.g.`permissions`\=`TRD_GRP_004`) + - Cannot be combined with `symbol` or `symbols` + +--- + +### 2022-08-23[​](https://developers.binance.com/docs/binance-spot-api-docs) + +Note that these are rolling changes, so it may take a few days for it to rollout to all our servers. + +- Changes to `GET /api/v3/ticker` and `GET /api/v3/ticker/24hr` + - New optional parameter `type` added + - Supported values for parameter `type` are `FULL` and `MINI` + - `FULL` is the default value and the response that is currently being returned from the endpoint + - `MINI` omits the following fields from the response: `priceChangePercent`, `weightedAvgPrice`, `bidPrice`, `bidQty`, `askPrice`, `askQty`, and `lastQty` +- New error code `-1008` + - This is sent whenever the servers are overloaded with requests. +- New field `brokered` has been added to `GET /api/v3/account` +- New kline interval: `1s` +- New endpoint added: `GET /api/v3/uiKlines` + +--- + +### 2022-08-08[​](https://developers.binance.com/docs/binance-spot-api-docs) + +REST API + +- Changes to `POST /api/v3/order` and `POST /api/v3/order/cancelReplace` + - New optional fields `strategyId` and `strategyType` + - `strategyId` is a parameter used to identify an order as part of a strategy. + - `strategyType` is a parameter used to identify what strategy was running. (E.g. If all the orders are part of spot grid strategy, it can be set to `strategyType=1000000`) + - Note that the minimum value allowed for `strategyType` is `1000000`. +- Changes to `POST /api/v3/order/oco` + - New optional fields `limitStrategyId`, `limitStrategyType`, `stopStrategyId`, `stopStrategyType` + - These are the strategy metadata parameters for both legs of the OCO orders. + - `limitStrategyType` and `stopStrategyType` both cannot be less than `1000000`. +- Changes to `GET /api/v3/order`, `GET /api/v3/openOrders`, and `GET /api/v3/allOrders` + - New fields `strategyId` and `strategyType` will appear in the response JSON for orders that had these fields populated upon order placement. +- Changes to `DELETE /api/v3/order` and `DELETE /api/v3/openOrders` + - New fields `strategyId` and `strategyType` will appear in the response JSON for cancelled orders that had these fields populated upon order placement. + +USER DATA STREAM + +- New fields to eventType `executionReport` + - `j` for `strategyId` + - `J` for `strategyType` + - Note that these fields only appear if these were populated upon order placement. + +--- + +### 2022-06-20[​](https://developers.binance.com/docs/binance-spot-api-docs) + +Changes to `GET /api/v3/ticker` + +- Weight has been reduced from 5 to 2 per symbol, regardless of `windowSize`. +- The max number of symbols that can be processed in a request is 100. + + - If the number of `symbols` sent is more than 100, the error will be as follows: + + ``` + { "code": -1101, "msg": "Too many values sent for parameter 'symbols', maximum allowed up to 100."} + ``` + +- The max Weight for this endpoint will cap at 100. + - I.e. If the request has more than 50 symbols, the Weight will still be 100, regardless of `windowSize`. + +--- + +### 2022-06-15[​](https://developers.binance.com/docs/binance-spot-api-docs) + +**Note:** The update is being rolled out over the next few days, so these changes may not be visible right away. + +SPOT API + +- `GET /api/v3/ticker` added + - Rolling window price change statistics based on `windowSize` provided. + - Contrary to `GET /api/v3/ticker/24hr` the list of symbols cannot be omitted. + - If `windowSize` not specified, the value will default to `1d`. + - Response is similar to `GET /api/v3/ticker/24hr`, minus the following fields: `prevClosePrice`, `lastQty`, `bidPrice`, `bidQty`, `askPrice`, `askQty` +- `GET /api/v3/exchangeInfo` returns new field `cancelReplaceAllowed` in `symbols` list. +- `POST /api/v3/order/cancelReplace` added + - Cancels an existing order and places a new order on the same symbol. + - The filters are evaluated **before** the cancel order is placed. + - e.g. If the `MAX_NUM_ORDERS` filter is 10, and the total number of open orders on the account is also 10, when using `POST /api/v3/order/cancelReplace` both the cancel order placement and new order will fail because of the filter. + - The change is being rolled out in the next few days, thus this feature will be enabled once the upgrade is completed. +- New filter `NOTIONAL` has been added. + - Defines the allowed notional value (`price * quantity`) based on a configured `minNotional` and `maxNotional` +- New exchange filter `EXCHANGE_MAX_NUM_ICEBERG_ORDERS` has been added. + - Defines the limit of open iceberg orders on an account + +--- + +### 2022-05-23[​](https://developers.binance.com/docs/binance-spot-api-docs) + +- Changes to Order Book Depth Levels + + - Quantities in the Depth levels were returning negative values in situations where they were exceeding the max value, resulting in an overflow. + - Going forward depth levels will not overflow, but will be capped at the max value based on the precision of the base asset. This means that the depth level is at max value _or more_. + - E.g. If the precision is 8, then the max value for quantity will be at 92,233,720,368.54775807. + - When the fix has been applied, a change in the order book at the affected price level is required for the changes to be visible. +- What does this affect? + + - SPOT API + - `GET /api/v3/depth` + - Websocket Streams + - `@depth` + - `@depth@100ms` + - `@depth` + - `@depth@100ms` +- Updates to `MAX_POSITION` + + - If an order's `quantity` can cause the position to overflow, this will now fail the `MAX_POSITION` filter. + +--- + +### 2022-05-17[​](https://developers.binance.com/docs/binance-spot-api-docs) + +- Changes to GET `api/v3/aggTrades` + - When providing `startTime` and `endTime`, the oldest items are returned. +- Changed error messaging on `GET /api/v3/myTrades` where parameter `symbol` is not provided: + +``` +{ "code": -1102, "msg": "Mandatory parameter 'symbol' was not sent, was empty/null, or malformed."} +``` + +- The following endpoints now support multi-symbol querying using the parameter `symbols`. + - `GET /api/v3/ticker/24hr` + - `GET /api/v3/ticker/price` + - `GET /api/v3/ticker/bookTicker` +- In the above, the request weight will depend on the number of symbols provided in `symbols`. + Please refer to the table below: + +Endpoint + +Number of Symbols + +Weight + +`GET /api/v3/ticker/price` + +Any + +2 + +`GET /api/v3/ticker/bookTicker` + +Any + +2 + +`GET /api/v3/ticker/24hr` + +1-20 + +1 + +`GET /api/v3/ticker/24hr` + +21-100 + +20 + +`GET /api/v3/ticker/24hr` + +101 or more + +40 + +--- + +### 2022-04-13[​](https://developers.binance.com/docs/binance-spot-api-docs) + +REST API + +- Trailing Stops have been enabled. + - This is a type of algo order where the activation is based on a percentage of a price change in the market using the new parameter `trailingDelta`. + - This can only used with any of the following order types: `STOP_LOSS`, `STOP_LOSS_LIMIT`, `TAKE_PROFIT`, `TAKE_PROFIT_LIMIT`. + - The `trailingDelta` parameter will be done in Basis Points or BIPS. + - For example: a STOP\_LOSS SELL order with a `trailingDelta` of 100 will trigger after a price decrease of 1% from the highest price after the order is placed. (100 / 10,000 => 0.01 => 1%) + - When used in combination with OCO Orders, the `trailingDelta` will determine when the contingent leg of the OCO will trigger. + - When `trailingDelta` is used in combination with `stopPrice`, once the `stopPrice` condition is met, the trailing stop starts tracking the price change from the `stopPrice` based on the `trailingDelta` provided. + - When no `stopPrice` is sent, the trailing stop starts tracking the price changes from the last price based on the `trailingDelta` provided. +- Changes to POST `/api/v3/order` + - New optional field `trailingDelta` +- Changes to POST `/api/v3/order/test` + - New optional field `trailingDelta` +- Changes to POST `/api/v3/order/oco` + - New optional field `trailingDelta` +- A new filter `TRAILING_DELTA` has been added. + - This filter is defined by the minimum and maximum values for the `trailingDelta` value. + +USER DATA STREAM + +- New field in `executionReport` + - "d" for `trailingDelta` + +--- + +### 2022-04-12[​](https://developers.binance.com/docs/binance-spot-api-docs) + +**Note:** The changes are being rolled out during the next few days, so these will not appear right away. + +- Error message changed on `GET api/v3/allOrders` where `symbol` is not provided: + + ``` + { "code": -1102, "msg": "Mandatory parameter 'symbol' was not sent, was empty/null, or malformed."} + ``` + +- Fixed a typo with an error message when an account has disabled permissions (e.g. to withdraw, to trade, etc) + + ``` + "This action is disabled on this account." + ``` + +- During a market data audit, we detected some issues with the Spot aggregate trade data. + - Missing aggregate trades were recovered. + - Duplicated records were marked invalid with the following values: + - p = '0' // price + - q = '0' // qty + - f = -1 // first\_trade\_id + - l = -1 // last\_trade\_id + +--- + +### 2022-02-28[​](https://developers.binance.com/docs/binance-spot-api-docs) + +- New field `allowTrailingStop` has been added to `GET /api/v3/exchangeInfo` + +--- + +### 2022-02-24[​](https://developers.binance.com/docs/binance-spot-api-docs) + +- `(price-minPrice) % tickSize == 0` rule in `PRICE_FILTER` has been changed to `price % tickSize == 0`. +- A new filter `PERCENT_PRICE_BY_SIDE` has been added. +- Changes to GET `api/v3/depth` + - The `limit` value can be outside of the previous values (i.e. 5, 10, 20, 50, 100, 500, 1000,5000) and will return the correct limit. (i.e. if limit=3 then the response will be the top 3 bids and asks) + - The limit still cannot exceed 5000. If the limit provided is greater than 5000, then the response will be truncated to 5000. + - Due to the changes, these are the updated request weights based on the limit value provided: + +Limit + +Request Weight + +1-100 + +1 + +101-500 + +5 + +501-1000 + +10 + +1001-5000 + +50 + +- Changes to GET `api/v3/aggTrades` + - When providing `startTime` and `endTime`, the oldest items are returned. + +--- + +### 2021-12-29[​](https://developers.binance.com/docs/binance-spot-api-docs) + +- Removed out dated "Symbol Type" enum; added "Permissions" enum. + +### 2021-11-01[​](https://developers.binance.com/docs/binance-spot-api-docs) + +- `GET /api/v3/rateLimit/order` added + - The endpoint will display the user's current order count usage for all intervals. + - This endpoint will have a request weight of 20. + +### 2021-09-14[​](https://developers.binance.com/docs/binance-spot-api-docs) + +- Add a [YAML file](https://github.com/binance/binance-api-swagger) with OpenApi specification on the RESTful API. + +### 2021-08-12[​](https://developers.binance.com/docs/binance-spot-api-docs) + +- GET `api/v3/myTrades` has a new optional field `orderId` + +--- + +### 2021-05-12[​](https://developers.binance.com/docs/binance-spot-api-docs) + +- Added `Data Source` in the documentation to explain where each endpoint is retrieving its data. +- Added field `Data Source` to each API endpoint in the documentation +- GET `api/v3/exchangeInfo` now supports single or multi-symbol query + +--- + +### 2021-04-26[​](https://developers.binance.com/docs/binance-spot-api-docs) + +On **April 28, 2021 00:00 UTC** the weights to the following endpoints will be adjusted: + +- `GET /api/v3/order` weight increased to 2 +- `GET /api/v3/openOrders` weight increased to 3 +- `GET /api/v3/allOrders` weight increased to 10 +- `GET /api/v3/orderList` weight increased to 2 +- `GET /api/v3/openOrderList` weight increased to 3 +- `GET /api/v3/account` weight increased to 10 +- `GET /api/v3/myTrades` weight increased to 10 +- `GET /api/v3/exchangeInfo` weight increased to 10 + +--- + +### 2021-01-01[​](https://developers.binance.com/docs/binance-spot-api-docs) + +**USER DATA STREAM** + +- `outboundAccountInfo` has been removed. + +--- + +### 2020-11-27[​](https://developers.binance.com/docs/binance-spot-api-docs) + +New API clusters have been added in order to improve performance. + +Users can access any of the following API clusters, in addition to `api.binance.com` + +If there are any performance issues with accessing `api.binance.com` please try any of the following instead: + +- [https://api1.binance.com/api/v3/](https://api1.binance.com/api/v3)\* +- [https://api2.binance.com/api/v3/](https://api2.binance.com/api/v3)\* +- [https://api3.binance.com/api/v3/](https://api3.binance.com/api/v3)\* + +### 2020-09-09[​](https://developers.binance.com/docs/binance-spot-api-docs) + +USER DATA STREAM + +- `outboundAccountInfo` has been deprecated. +- `outboundAccountInfo` will be removed in the future. (Exact date unknown) **Please use `outboundAccountPosition` instead.** +- `outboundAccountInfo` will now only show the balance of non-zero assets and assets that have been reduced to 0. + +--- + +### 2020-05-01[​](https://developers.binance.com/docs/binance-spot-api-docs) + +- From 2020-05-01 UTC 00:00, all symbols will have a limit of 200 open orders using the [MAX\_NUM\_ORDERS](https://developers.binance.com/docs/rest-api.md) filter. + - No existing orders will be removed or canceled. + - Accounts that have 200 or more open orders on a symbol will not be able to place new orders on that symbol until the open order count is below 200. + - OCO orders count as 2 open orders before the `LIMIT` order is touched or the `STOP_LOSS` (or `STOP_LOSS_LIMIT`) order is triggered; once this happens the other order is canceled and will no longer count as an open order. + +--- + +### 2020-04-25[​](https://developers.binance.com/docs/binance-spot-api-docs) + +REST API + +- New field `permissions` + - Defines the trading permissions that are allowed on accounts and symbols. + - `permissions` is an enum array; values: + - `SPOT` + - `MARGIN` + - `permissions` will replace `isSpotTradingAllowed` and `isMarginTradingAllowed` on `GET api/v3/exchangeInfo` in future API versions (v4+). + - For an account to trade on a symbol, the account and symbol must share at least 1 permission in common. +- Updates to `GET api/v3/exchangeInfo` + - New field `permissions` added. + - New field `quoteAssetPrecision` added; a duplicate of the `quotePrecision` field. `quotePrecision` will be removed in future API versions (v4+). +- Updates to `GET api/v3/account` + - New field `permissions` added. +- New endpoint `DELETE api/v3/openOrders` + - This will allow a user to cancel all open orders on a single symbol. + - This endpoint will cancel all open orders including OCO orders. +- Orders can be canceled via the API on symbols in the `BREAK` or `HALT` status. + +USER DATA STREAM + +- `OutboundAccountInfo` has new field `P` which shows the trading permissions of the account. + +--- + +### 2020-04-23[​](https://developers.binance.com/docs/binance-spot-api-docs) + +WEB SOCKET STREAM + +- WebSocket connections have a limit of 5 incoming messages per second. A message is considered: + - A PING frame + - A PONG frame + - A JSON control message (e.g. subscribe, unsubscribe) +- A connection that goes beyond the limit will be disconnected; IPs that are repeatedly disconnected may be banned. +- A single connection can listen to a maximum of 1024 streams. + +--- + +### 2020-03-24[​](https://developers.binance.com/docs/binance-spot-api-docs) + +- `MAX_POSITION` filter added. + - This filter defines the allowed maximum position an account can have on the base asset of a symbol. An account's position defined as the sum of the account's: + + - free balance of the base asset + - locked balance of the base asset + - sum of the qty of all open BUY orders + - `BUY` orders will be rejected if the account's position is greater than the maximum position allowed. + + +--- + +### 2019-11-22[​](https://developers.binance.com/docs/binance-spot-api-docs) + +- Quote Order Qty Market orders have been enabled on all symbols. + - Quote Order Qty `MARKET` orders allow a user to specify the total `quoteOrderQty` spent or received in the `MARKET` order. + - Quote Order Qty `MARKET` orders will not break `LOT_SIZE` filter rules; the order will execute a quantity that will have the notional value as close as possible to `quoteOrderQty`. + - Using `BNBBTC` as an example: + - On the `BUY` side, the order will buy as many BNB as `quoteOrderQty` BTC can. + - On the `SELL` side, the order will sell as much BNB as needed to receive `quoteOrderQty` BTC. + +--- + +### 2019-11-13[​](https://developers.binance.com/docs/binance-spot-api-docs) + +REST API + +- api/v3/exchangeInfo has new fields: + - `quoteOrderQtyMarketAllowed` + - `baseCommissionDecimalPlaces` + - `quoteCommissionDecimalPlaces` +- `MARKET` orders have a new optional field: `quoteOrderQty` used to specify the quote quantity to BUY or SELL. This cannot be used in combination with `quantity`. + - The exact timing that `quoteOrderQty` MARKET orders will be enabled is TBD. There will be a separate announcement and further details at that time. +- All order query endpoints will return a new field `origQuoteOrderQty` in the JSON payload. (e.g. GET api/v3/allOrders) +- Updated error messages for -1128 + + - Sending an `OCO` with a `stopLimitPrice` but without a `stopLimitTimeInForce` will return the error: + + ``` + { "code": -1128, "msg": "Combination of optional parameters invalid. Recommendation: 'stopLimitTimeInForce' should also be sent."} + ``` + +- Updated error messages for -1003 to specify the limit is referring to the request weight, not to the number of requests. + +**Deprecation of v1 endpoints**: + +By end of Q1 2020, the following endpoints will be removed from the API. The documentation has been updated to use the v3 versions of these endpoints. + +- GET api/v1/depth +- GET api/v1/historicalTrades +- GET api/v1/aggTrades +- GET api/v1/klines +- GET api/v1/ticker/24hr +- GET api/v1/ticker/price +- GET api/v1/exchangeInfo +- POST api/v1/userDataStream +- PUT api/v1/userDataStream +- GET api/v1/ping +- GET api/v1/time +- GET api/v1/ticker/bookTicker + +**These endpoints however, will NOT be migrated to v3. Please use the following endpoints instead moving forward.** + +Old V1 Endpoints + +New V3 Endpoints + +GET api/v1/ticker/allPrices + +GET api/v3/ticker/price + +GET api/v1/ticker/allBookTickers + +GET api/v3/ticker/bookTicker + +USER DATA STREAM + +- Changes to`executionReport` event + + - If the C field is empty, it will now properly return `null`, instead of `"null"`. + - New field Q which represents the `quoteOrderQty`. +- `balanceUpdate` event type added + + - This event occurs when funds are deposited or withdrawn from your account. + +WEB SOCKET STREAMS + +- WSS now supports live subscribing/unsubscribing to streams. + +--- + +### 2019-09-09[​](https://developers.binance.com/docs/binance-spot-api-docs) + +- New WebSocket streams for bookTickers added: `@bookTicker` and `!bookTicker`. See `web-socket-streams.md` for details. + +--- + +### 2019-09-03[​](https://developers.binance.com/docs/binance-spot-api-docs) + +- Faster order book data with 100ms updates: `@depth@100ms` and `@depth#@100ms` +- Added "Update Speed:" to `web-socket-streams.md` +- Removed deprecated v1 endpoints as per previous announcement: + - GET api/v1/order + - GET api/v1/openOrders + - POST api/v1/order + - DELETE api/v1/order + - GET api/v1/allOrders + - GET api/v1/account + - GET api/v1/myTrades + +--- + +### 2019-08-16 (Update 2)[​](https://developers.binance.com/docs/binance-spot-api-docs) + +- GET api/v1/depth `limit` of 10000 has been temporarily removed + +--- + +### 2019-08-16[​](https://developers.binance.com/docs/binance-spot-api-docs) + +- In Q4 2017, the following endpoints were deprecated and removed from the API documentation. They have been permanently removed from the API as of this version. We apologize for the omission from the original changelog: + + - GET api/v1/order + - GET api/v1/openOrders + - POST api/v1/order + - DELETE api/v1/order + - GET api/v1/allOrders + - GET api/v1/account + - GET api/v1/myTrades +- Streams, endpoints, parameters, payloads, etc. described in the documents in this repository are **considered official** and **supported**. The use of any other streams, endpoints, parameters, or payloads, etc. is **not supported; use them at your own risk and with no guarantees.** + + +--- + +### 2019-08-15[​](https://developers.binance.com/docs/binance-spot-api-docs) + +REST API + +- New order type: OCO ("One Cancels the Other") + + - An OCO has 2 orders: (also known as legs in financial terms) + + - `STOP_LOSS` or `STOP_LOSS_LIMIT` leg + - `LIMIT_MAKER` leg + - Price Restrictions: + + - `SELL Orders` : Limit Price > Last Price > Stop Price + - `BUY Orders` : Limit Price < Last Price < Stop Price + - As stated, the prices must "straddle" the last traded price on the symbol. EX: If the last price is 10: + - A SELL OCO must have the limit price greater than 10, and the stop price less than 10. + - A BUY OCO must have a limit price less than 10, and the stop price greater than 10. + - Quantity Restrictions: + + - Both legs must have the **same quantity**. + - `ICEBERG` quantities however, do not have to be the same. + - Execution Order: + + - If the `LIMIT_MAKER` is touched, the limit maker leg will be executed first BEFORE canceling the Stop Loss Leg. + - if the Market Price moves such that the `STOP_LOSS` or `STOP_LOSS_LIMIT` will trigger, the Limit Maker leg will be canceled BEFORE executing the `STOP_LOSS` Leg. + - Canceling an OCO + + - Canceling either order leg will cancel the entire OCO. + - The entire OCO can be canceled via the `orderListId` or the `listClientOrderId`. + - New Enums for OCO: + + 1. `ListStatusType` + - `RESPONSE` - used when ListStatus is responding to a failed action. (either order list placement or cancellation) + - `EXEC_STARTED` - used when an order list has been placed or there is an update to a list's status. + - `ALL_DONE` - used when an order list has finished executing and is no longer active. + 2. `ListOrderStatus` + - `EXECUTING` - used when an order list has been placed or there is an update to a list's status. + - `ALL_DONE` - used when an order list has finished executing and is no longer active. + - `REJECT` - used when ListStatus is responding to a failed action. (either order list placement or cancellation) + 3. `ContingencyType` + - `OCO` - specifies the type of order list. + - New Endpoints: + + - POST api/v3/order/oco + - DELETE api/v3/orderList + - GET api/v3/orderList +- `recvWindow` cannot exceed 60000. + +- New `intervalLetter` values for headers: + + - SECOND => S + - MINUTE => M + - HOUR => H + - DAY => D +- New Headers `X-MBX-USED-WEIGHT-(intervalNum)(intervalLetter)` will give your current used request weight for the (intervalNum)(intervalLetter) rate limiter. For example, if there is a one minute request rate weight limiter set, you will get a `X-MBX-USED-WEIGHT-1M` header in the response. The legacy header `X-MBX-USED-WEIGHT` will still be returned and will represent the current used weight for the one minute request rate weight limit. + +- New Header `X-MBX-ORDER-COUNT-(intervalNum)(intervalLetter)`that is updated on any valid order placement and tracks your current order count for the interval; rejected/unsuccessful orders are not guaranteed to have `X-MBX-ORDER-COUNT-**` headers in the response. + + - Eg. `X-MBX-ORDER-COUNT-1S` for "orders per 1 second" and `X-MBX-ORDER-COUNT-1D` for orders per "one day" +- GET api/v1/depth now supports `limit` 5000 and 10000; weights are 50 and 100 respectively. + +- GET api/v1/exchangeInfo has a new parameter `ocoAllowed`. + + +USER DATA STREAM + +- `executionReport` event now contains "g" which has the `orderListId`; it will be set to -1 for non-OCO orders. +- New Event Type `listStatus`; `listStatus` is sent on an update to any OCO order. +- New Event Type `outboundAccountPosition`; `outboundAccountPosition` is sent any time an account's balance changes and contains the assets that could have changed by the event that generated the balance change (a deposit, withdrawal, trade, order placement, or cancellation). + +NEW ERRORS + +- **\-1131 BAD\_RECV\_WINDOW** + - `recvWindow` must be less than 60000 +- **\-1099 Not found, authenticated, or authorized** + - This replaces error code -1999 + +NEW -2011 ERRORS + +- **OCO\_BAD\_ORDER\_PARAMS** + - A parameter for one of the orders is incorrect. +- **OCO\_BAD\_PRICES** + - The relationship of the prices for the orders is not correct. +- **UNSUPPORTED\_ORD\_OCO** + - OCO orders are not supported for this symbol. + +--- + +### 2019-03-12[​](https://developers.binance.com/docs/binance-spot-api-docs) + +REST API + +- X-MBX-USED-WEIGHT header added to Rest API responses. +- Retry-After header added to Rest API 418 and 429 responses. +- When canceling the Rest API can now return `errorCode` -1013 OR -2011 if the symbol's `status` isn't `TRADING`. +- `api/v1/depth` no longer has the ignored and empty `[]`. +- `api/v3/myTrades` now returns `quoteQty`; the price \* qty of for the trade. + +WEBSOCKET STREAMS + +- `@depth` and `@depthX` streams no longer have the ignored and empty `[]`. + +SYSTEM IMPROVEMENTS + +- Matching Engine stability/reliability improvements. +- Rest API performance improvements. + +--- + +### 2018-11-13[​](https://developers.binance.com/docs/binance-spot-api-docs) + +REST API + +- Can now cancel orders through the Rest API during a trading ban. +- New filters: `PERCENT_PRICE`, `MARKET_LOT_SIZE`, `MAX_NUM_ICEBERG_ORDERS`. +- Added `RAW_REQUESTS` rate limit. Limits based on the number of requests over X minutes regardless of weight. +- /api/v3/ticker/price increased to weight of 2 for a no symbol query. +- /api/v3/ticker/bookTicker increased weight of 2 for a no symbol query. +- DELETE /api/v3/order will now return an execution report of the final state of the order. +- `MIN_NOTIONAL` filter has two new parameters: `applyToMarket` (whether or not the filter is applied to MARKET orders) and `avgPriceMins` (the number of minutes over which the price averaged for the notional estimation). +- `intervalNum` added to /api/v1/exchangeInfo limits. `intervalNum` describes the amount of the interval. For example: `intervalNum` 5, with `interval` minute, means "every 5 minutes". + +#### Explanation for the average price calculation:[​](https://developers.binance.com/docs/binance-spot-api-docs) + +1. (qty \* price) of all trades / sum of qty of all trades over previous 5 minutes. + +2. If there is no trade in the last 5 minutes, it takes the first trade that happened outside of the 5min window. For example if the last trade was 20 minutes ago, that trade's price is the 5 min average. + +3. If there is no trade on the symbol, there is no average price and market orders cannot be placed. On a new symbol with `applyToMarket` enabled on the `MIN_NOTIONAL` filter, market orders cannot be placed until there is at least 1 trade. + +4. The current average price can be checked here: `https://api.binance.com/api/v3/avgPrice?symbol=` For example: [https://api.binance.com/api/v3/avgPrice?symbol=BNBUSDT](https://api.binance.com/api/v3/avgPrice?symbol=BNBUSDT) + + +USER DATA STREAM + +- `Last quote asset transacted quantity` (as variable `Y`) added to execution reports. Represents the `lastPrice` \* `lastQty` (`L` \* `l`). + +--- + +### 2018-07-18[​](https://developers.binance.com/docs/binance-spot-api-docs) + +REST API + +- New filter: `ICEBERG_PARTS` +- `POST api/v3/order` new defaults for `newOrderRespType`. `ACK`, `RESULT`, or `FULL`; `MARKET` and `LIMIT` order types default to `FULL`, all other orders default to `ACK`. +- POST api/v3/order `RESULT` and `FULL` responses now have `cummulativeQuoteQty` +- GET api/v3/openOrders with no symbol weight reduced to 40. +- GET api/v3/ticker/24hr with no symbol weight reduced to 40. +- Max amount of trades from GET /api/v1/trades increased to 1000. +- Max amount of trades from GET /api/v1/historicalTrades increased to 1000. +- Max amount of aggregate trades from GET /api/v1/aggTrades increased to 1000. +- Max amount of aggregate trades from GET /api/v1/klines increased to 1000. +- Rest API Order lookups now return `updateTime` which represents the last time the order was updated; `time` is the order creation time. +- Order lookup endpoints will now return `cummulativeQuoteQty`. If `cummulativeQuoteQty` is < 0, it means the data isn't available for this order at this time. +- `REQUESTS` rate limit type changed to `REQUEST_WEIGHT`. This limit was always logically request weight and the previous name for it caused confusion. + +USER DATA STREAM + +- `cummulativeQuoteQty` field added to order responses and execution reports (as variable `Z`). Represents the cummulative amount of the `quote` that has been spent (with a `BUY` order) or received (with a `SELL` order). Historical orders will have a value < 0 in this field indicating the data is not available at this time. `cummulativeQuoteQty` divided by `cummulativeQty` will give the average price for an order. +- `O` (order creation time) added to execution reports + +--- + +### 2018-01-23[​](https://developers.binance.com/docs/binance-spot-api-docs) + +- GET /api/v1/historicalTrades weight decreased to 5 +- GET /api/v1/aggTrades weight decreased to 1 +- GET /api/v1/klines weight decreased to 1 +- GET /api/v1/ticker/24hr all symbols weight decreased to number of trading symbols / 2 +- GET /api/v3/allOrders weight decreased to 5 +- GET /api/v3/myTrades weight decreased to 5 +- GET /api/v3/account weight decreased to 5 +- GET /api/v1/depth limit=500 weight decreased to 5 +- GET /api/v1/depth limit=1000 weight decreased to 10 +- \-1003 error message updated to direct users to websockets + +--- + +### 2018-01-20[​](https://developers.binance.com/docs/binance-spot-api-docs) + +- GET /api/v1/ticker/24hr single symbol weight decreased to 1 +- GET /api/v3/openOrders all symbols weight decreased to number of trading symbols / 2 +- GET /api/v3/allOrders weight decreased to 15 +- GET /api/v3/myTrades weight decreased to 15 +- GET /api/v3/order weight decreased to 1 +- myTrades will now return both sides of a self-trade/wash-trade + +--- + +### 2018-01-14[​](https://developers.binance.com/docs/binance-spot-api-docs) + +- GET /api/v1/aggTrades weight changed to 2 +- GET /api/v1/klines weight changed to 2 +- GET /api/v3/order weight changed to 2 +- GET /api/v3/allOrders weight changed to 20 +- GET /api/v3/account weight changed to 20 +- GET /api/v3/myTrades weight changed to 20 +- GET /api/v3/historicalTrades weight changed to 20 + +- [2026-02-24](https://developers.binance.com/docs/binance-spot-api-docs) +- [2026-02-12](https://developers.binance.com/docs/binance-spot-api-docs) +- [2026-02-09](https://developers.binance.com/docs/binance-spot-api-docs) +- [2026-02-02](https://developers.binance.com/docs/binance-spot-api-docs) +- [2026-01-29](https://developers.binance.com/docs/binance-spot-api-docs) +- [2026-01-27](https://developers.binance.com/docs/binance-spot-api-docs) +- [2026-01-26](https://developers.binance.com/docs/binance-spot-api-docs) +- [2026-01-21](https://developers.binance.com/docs/binance-spot-api-docs) +- [2025-12-18](https://developers.binance.com/docs/binance-spot-api-docs) +- [2025-12-17](https://developers.binance.com/docs/binance-spot-api-docs) +- [2025-12-15](https://developers.binance.com/docs/binance-spot-api-docs) +- [2025-12-09](https://developers.binance.com/docs/binance-spot-api-docs) +- [2025-12-02](https://developers.binance.com/docs/binance-spot-api-docs) +- [2025-11-14](https://developers.binance.com/docs/binance-spot-api-docs) +- [2025-11-12](https://developers.binance.com/docs/binance-spot-api-docs) +- [2025-11-11](https://developers.binance.com/docs/binance-spot-api-docs) +- [2025-11-10](https://developers.binance.com/docs/binance-spot-api-docs) +- [2025-10-28](https://developers.binance.com/docs/binance-spot-api-docs) +- [2025-10-24](https://developers.binance.com/docs/binance-spot-api-docs) +- [2025-10-21](https://developers.binance.com/docs/binance-spot-api-docs) +- [2025-10-08](https://developers.binance.com/docs/binance-spot-api-docs) +- [2025-09-29](https://developers.binance.com/docs/binance-spot-api-docs) +- [2025-09-18](https://developers.binance.com/docs/binance-spot-api-docs) +- [2025-09-12](https://developers.binance.com/docs/binance-spot-api-docs) +- [2025-08-28](https://developers.binance.com/docs/binance-spot-api-docs) +- [2025-08-26](https://developers.binance.com/docs/binance-spot-api-docs) +- [2025-08-25](https://developers.binance.com/docs/binance-spot-api-docs) +- [2025-08-19](https://developers.binance.com/docs/binance-spot-api-docs) +- [2025-08-12](https://developers.binance.com/docs/binance-spot-api-docs) +- [2025-08-07](https://developers.binance.com/docs/binance-spot-api-docs) +- [2025-07-03](https://developers.binance.com/docs/binance-spot-api-docs) +- [2025-06-04](https://developers.binance.com/docs/binance-spot-api-docs) +- [2025-05-28](https://developers.binance.com/docs/binance-spot-api-docs) +- [2025-05-22](https://developers.binance.com/docs/binance-spot-api-docs) +- [2025-04-29](https://developers.binance.com/docs/binance-spot-api-docs) +- [2025-04-25](https://developers.binance.com/docs/binance-spot-api-docs) +- [2025-04-21](https://developers.binance.com/docs/binance-spot-api-docs) +- [2025-04-08](https://developers.binance.com/docs/binance-spot-api-docs) +- [2025-04-07](https://developers.binance.com/docs/binance-spot-api-docs) +- [2025-04-03](https://developers.binance.com/docs/binance-spot-api-docs) +- [2025-03-31](https://developers.binance.com/docs/binance-spot-api-docs) +- [2025-03-10](https://developers.binance.com/docs/binance-spot-api-docs) +- [2025-03-05](https://developers.binance.com/docs/binance-spot-api-docs) +- [2025-02-12](https://developers.binance.com/docs/binance-spot-api-docs) +- [2025-01-28](https://developers.binance.com/docs/binance-spot-api-docs) +- [2025-01-09](https://developers.binance.com/docs/binance-spot-api-docs) +- [2024-12-17](https://developers.binance.com/docs/binance-spot-api-docs) +- [2024-12-09](https://developers.binance.com/docs/binance-spot-api-docs) +- [2024-10-18](https://developers.binance.com/docs/binance-spot-api-docs) +- [2024-10-17](https://developers.binance.com/docs/binance-spot-api-docs) +- [2024-08-26](https://developers.binance.com/docs/binance-spot-api-docs) +- [2024-08-16](https://developers.binance.com/docs/binance-spot-api-docs) +- [2024-08-01](https://developers.binance.com/docs/binance-spot-api-docs) +- [2024-07-26](https://developers.binance.com/docs/binance-spot-api-docs) +- [2024-07-22](https://developers.binance.com/docs/binance-spot-api-docs) +- [2024-06-11](https://developers.binance.com/docs/binance-spot-api-docs) +- [2024-06-06](https://developers.binance.com/docs/binance-spot-api-docs) +- [2024-05-30](https://developers.binance.com/docs/binance-spot-api-docs) +- [2024-04-10](https://developers.binance.com/docs/binance-spot-api-docs) +- [2024-04-02](https://developers.binance.com/docs/binance-spot-api-docs) +- [2024-02-28](https://developers.binance.com/docs/binance-spot-api-docs) +- [2024-02-08](https://developers.binance.com/docs/binance-spot-api-docs) +- [2023-12-08](https://developers.binance.com/docs/binance-spot-api-docs) +- [2023-12-04](https://developers.binance.com/docs/binance-spot-api-docs) +- [2023-10-19](https://developers.binance.com/docs/binance-spot-api-docs) +- [2023-10-03](https://developers.binance.com/docs/binance-spot-api-docs) +- [2023-08-25](https://developers.binance.com/docs/binance-spot-api-docs) +- [2023-08-08](https://developers.binance.com/docs/binance-spot-api-docs) +- [2023-07-18](https://developers.binance.com/docs/binance-spot-api-docs) +- [2023-07-11](https://developers.binance.com/docs/binance-spot-api-docs) +- [2023-06-06](https://developers.binance.com/docs/binance-spot-api-docs) +- [2023-05-26](https://developers.binance.com/docs/binance-spot-api-docs) +- [2023-05-24](https://developers.binance.com/docs/binance-spot-api-docs) +- [2023-03-13](https://developers.binance.com/docs/binance-spot-api-docs) +- [2023-02-17](https://developers.binance.com/docs/binance-spot-api-docs) +- [2023-01-26](https://developers.binance.com/docs/binance-spot-api-docs) +- [2023-01-23](https://developers.binance.com/docs/binance-spot-api-docs) +- [2023-01-19](https://developers.binance.com/docs/binance-spot-api-docs) +- [2022-12-28](https://developers.binance.com/docs/binance-spot-api-docs) +- [2022-12-26](https://developers.binance.com/docs/binance-spot-api-docs) +- [2022-12-15](https://developers.binance.com/docs/binance-spot-api-docs) +- [2022-12-13](https://developers.binance.com/docs/binance-spot-api-docs) +- [2022-12-05](https://developers.binance.com/docs/binance-spot-api-docs) +- [2022-12-02](https://developers.binance.com/docs/binance-spot-api-docs) +- [2022-09-30](https://developers.binance.com/docs/binance-spot-api-docs) +- [2022-09-15](https://developers.binance.com/docs/binance-spot-api-docs) +- [2022-08-23](https://developers.binance.com/docs/binance-spot-api-docs) +- [2022-08-08](https://developers.binance.com/docs/binance-spot-api-docs) +- [2022-06-20](https://developers.binance.com/docs/binance-spot-api-docs) +- [2022-06-15](https://developers.binance.com/docs/binance-spot-api-docs) +- [2022-05-23](https://developers.binance.com/docs/binance-spot-api-docs) +- [2022-05-17](https://developers.binance.com/docs/binance-spot-api-docs) +- [2022-04-13](https://developers.binance.com/docs/binance-spot-api-docs) +- [2022-04-12](https://developers.binance.com/docs/binance-spot-api-docs) +- [2022-02-28](https://developers.binance.com/docs/binance-spot-api-docs) +- [2022-02-24](https://developers.binance.com/docs/binance-spot-api-docs) +- [2021-12-29](https://developers.binance.com/docs/binance-spot-api-docs) +- [2021-11-01](https://developers.binance.com/docs/binance-spot-api-docs) +- [2021-09-14](https://developers.binance.com/docs/binance-spot-api-docs) +- [2021-08-12](https://developers.binance.com/docs/binance-spot-api-docs) +- [2021-05-12](https://developers.binance.com/docs/binance-spot-api-docs) +- [2021-04-26](https://developers.binance.com/docs/binance-spot-api-docs) +- [2021-01-01](https://developers.binance.com/docs/binance-spot-api-docs) +- [2020-11-27](https://developers.binance.com/docs/binance-spot-api-docs) +- [2020-09-09](https://developers.binance.com/docs/binance-spot-api-docs) +- [2020-05-01](https://developers.binance.com/docs/binance-spot-api-docs) +- [2020-04-25](https://developers.binance.com/docs/binance-spot-api-docs) +- [2020-04-23](https://developers.binance.com/docs/binance-spot-api-docs) +- [2020-03-24](https://developers.binance.com/docs/binance-spot-api-docs) +- [2019-11-22](https://developers.binance.com/docs/binance-spot-api-docs) +- [2019-11-13](https://developers.binance.com/docs/binance-spot-api-docs) +- [2019-09-09](https://developers.binance.com/docs/binance-spot-api-docs) +- [2019-09-03](https://developers.binance.com/docs/binance-spot-api-docs) +- [2019-08-16 (Update 2)](https://developers.binance.com/docs/binance-spot-api-docs) +- [2019-08-16](https://developers.binance.com/docs/binance-spot-api-docs) +- [2019-08-15](https://developers.binance.com/docs/binance-spot-api-docs) +- [2019-03-12](https://developers.binance.com/docs/binance-spot-api-docs) +- [2018-11-13](https://developers.binance.com/docs/binance-spot-api-docs) +- [2018-07-18](https://developers.binance.com/docs/binance-spot-api-docs) +- [2018-01-23](https://developers.binance.com/docs/binance-spot-api-docs) +- [2018-01-20](https://developers.binance.com/docs/binance-spot-api-docs) +- [2018-01-14](https://developers.binance.com/docs/binance-spot-api-docs) diff --git a/docs/binance/binance-spot/rest-api.md.error.txt b/docs/binance/binance-spot/rest-api.md.error.txt new file mode 100644 index 0000000..a9bd885 --- /dev/null +++ b/docs/binance/binance-spot/rest-api.md.error.txt @@ -0,0 +1,2 @@ +URL: https://developers.binance.com/docs/binance-spot-api-docs/rest-api.md +Error: 404 diff --git a/docs/binance/binance-spot/rest-api_account-endpoints.md b/docs/binance/binance-spot/rest-api_account-endpoints.md new file mode 100644 index 0000000..e440784 --- /dev/null +++ b/docs/binance/binance-spot/rest-api_account-endpoints.md @@ -0,0 +1,976 @@ +--- +title: "Account Endpoints | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints" +fetched_at: "2026-02-26T10:38:08.458Z" +--- +### Account information (USER\_DATA)[​](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints) + +``` +GET /api/v3/account +``` + +Get current account information. + +**Weight:** 20 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +omitZeroBalances + +BOOLEAN + +NO + +When set to `true`, emits only the non-zero balances of an account. +Default value: `false` + +recvWindow + +DECIMAL + +NO + +The value cannot be greater than `60000`. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +timestamp + +LONG + +YES + +**Data Source:** Memory => Database + +**Response:** + +``` +{ "makerCommission": 15, "takerCommission": 15, "buyerCommission": 0, "sellerCommission": 0, "commissionRates": { "maker": "0.00150000", "taker": "0.00150000", "buyer": "0.00000000", "seller": "0.00000000" }, "canTrade": true, "canWithdraw": true, "canDeposit": true, "brokered": false, "requireSelfTradePrevention": false, "preventSor": false, "updateTime": 123456789, "accountType": "SPOT", "balances": [ { "asset": "BTC", "free": "4723846.89208129", "locked": "0.00000000" }, { "asset": "LTC", "free": "4763368.68006011", "locked": "0.00000000" } ], "permissions": ["SPOT"], "uid": 354937868} +``` + +### Query order (USER\_DATA)[​](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints) + +``` +GET /api/v3/order +``` + +Check an order's status. + +**Weight:** 4 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +orderId + +LONG + +NO + +origClientOrderId + +STRING + +NO + +recvWindow + +DECIMAL + +NO + +The value cannot be greater than `60000`. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +timestamp + +LONG + +YES + +**Notes:** + +- Either `orderId` or `origClientOrderId` must be sent. +- If both `orderId` and `origClientOrderId` are provided, the `orderId` is searched first, then the `origClientOrderId` from that result is checked against that order. If both conditions are not met the request will be rejected. +- For some historical orders `cummulativeQuoteQty` will be < 0, meaning the data is not available at this time. + +**Data Source:** Memory => Database + +**Response:** + +``` +{ "symbol": "LTCBTC", "orderId": 1, "orderListId": -1, // This field will always have a value of -1 if not an order list. "clientOrderId": "myOrder1", "price": "0.1", "origQty": "1.0", "executedQty": "0.0", "cummulativeQuoteQty": "0.0", "status": "NEW", "timeInForce": "GTC", "type": "LIMIT", "side": "BUY", "stopPrice": "0.0", "icebergQty": "0.0", "time": 1499827319559, "updateTime": 1499827319559, "isWorking": true, "workingTime": 1499827319559, "origQuoteOrderQty": "0.000000", "selfTradePreventionMode": "NONE"} +``` + +**Note:** The payload above does not show all fields that can appear. Please refer to [Conditional fields in Order Responses](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints). + +### Current open orders (USER\_DATA)[​](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints) + +``` +GET /api/v3/openOrders +``` + +Get all open orders on a symbol. **Careful** when accessing this with no symbol. + +**Weight:** 6 for a single symbol; **80** when the symbol parameter is omitted + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +NO + +recvWindow + +DECIMAL + +NO + +The value cannot be greater than `60000`. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +timestamp + +LONG + +YES + +- If the symbol is not sent, orders for all symbols will be returned in an array. + +**Data Source:** Memory => Database + +**Response:** + +``` +[ { "symbol": "LTCBTC", "orderId": 1, "orderListId": -1, // Unless it's part of an order list, value will be -1 "clientOrderId": "myOrder1", "price": "0.1", "origQty": "1.0", "executedQty": "0.0", "cummulativeQuoteQty": "0.0", "status": "NEW", "timeInForce": "GTC", "type": "LIMIT", "side": "BUY", "stopPrice": "0.0", "icebergQty": "0.0", "time": 1499827319559, "updateTime": 1499827319559, "isWorking": true, "origQuoteOrderQty": "0.000000", "workingTime": 1499827319559, "selfTradePreventionMode": "NONE" }] +``` + +**Note:** The payload above does not show all fields that can appear. Please refer to [Conditional fields in Order Responses](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints). + +### All orders (USER\_DATA)[​](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints) + +``` +GET /api/v3/allOrders +``` + +Get all account orders; active, canceled, or filled. + +**Weight:** 20 + +**Data Source:** Database + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +orderId + +LONG + +NO + +startTime + +LONG + +NO + +endTime + +LONG + +NO + +limit + +INT + +NO + +Default: 500; Maximum: 1000. + +recvWindow + +DECIMAL + +NO + +The value cannot be greater than `60000`. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +timestamp + +LONG + +YES + +**Notes:** + +- If `orderId` is set, it will get orders >= that `orderId`. Otherwise most recent orders are returned. +- For some historical orders `cummulativeQuoteQty` will be < 0, meaning the data is not available at this time. +- If `startTime` and/or `endTime` provided, `orderId` is not required. +- The time between `startTime` and `endTime` can't be longer than 24 hours. + +**Response:** + +``` +[ { "symbol": "LTCBTC", "orderId": 1, "orderListId": -1, // Unless it's part of an order list, value will be -1 "clientOrderId": "myOrder1", "price": "0.1", "origQty": "1.0", "executedQty": "0.0", "cummulativeQuoteQty": "0.0", "status": "NEW", "timeInForce": "GTC", "type": "LIMIT", "side": "BUY", "stopPrice": "0.0", "icebergQty": "0.0", "time": 1499827319559, "updateTime": 1499827319559, "isWorking": true, "origQuoteOrderQty": "0.000000", "workingTime": 1499827319559, "selfTradePreventionMode": "NONE" }] +``` + +**Note:** The payload above does not show all fields that can appear. Please refer to [Conditional fields in Order Responses](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints). + +### Query Order list (USER\_DATA)[​](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints) + +``` +GET /api/v3/orderList +``` + +Retrieves a specific order list based on provided optional parameters. + +**Weight:** 4 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +orderListId + +LONG + +NO\* + +Query order list by `orderListId`. +`orderListId` or `origClientOrderId` must be provided. + +origClientOrderId + +STRING + +NO\* + +Query order list by `listClientOrderId`. +`orderListId` or `origClientOrderId` must be provided. + +recvWindow + +DECIMAL + +NO + +The value cannot be greater than `60000`. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +timestamp + +LONG + +YES + +**Data Source:** Database + +**Response:** + +``` +{ "orderListId": 27, "contingencyType": "OCO", "listStatusType": "EXEC_STARTED", "listOrderStatus": "EXECUTING", "listClientOrderId": "h2USkA5YQpaXHPIrkd96xE", "transactionTime": 1565245656253, "symbol": "LTCBTC", "orders": [ { "symbol": "LTCBTC", "orderId": 4, "clientOrderId": "qD1gy3kc3Gx0rihm9Y3xwS" }, { "symbol": "LTCBTC", "orderId": 5, "clientOrderId": "ARzZ9I00CPM8i3NhmU9Ega" } ]} +``` + +### Query all Order lists (USER\_DATA)[​](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints) + +``` +GET /api/v3/allOrderList +``` + +Retrieves all order lists based on provided optional parameters. + +Note that the time between `startTime` and `endTime` can't be longer than 24 hours. + +**Weight:** 20 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +fromId + +LONG + +NO + +If supplied, neither `startTime` or `endTime` can be provided + +startTime + +LONG + +NO + +endTime + +LONG + +NO + +limit + +INT + +NO + +Default: 500; Maximum: 1000 + +recvWindow + +DECIMAL + +NO + +The value cannot be greater than `60000`. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +timestamp + +LONG + +YES + +**Data Source:** Database + +**Response:** + +``` +[ { "orderListId": 29, "contingencyType": "OCO", "listStatusType": "EXEC_STARTED", "listOrderStatus": "EXECUTING", "listClientOrderId": "amEEAXryFzFwYF1FeRpUoZ", "transactionTime": 1565245913483, "symbol": "LTCBTC", "orders": [ { "symbol": "LTCBTC", "orderId": 4, "clientOrderId": "oD7aesZqjEGlZrbtRpy5zB" }, { "symbol": "LTCBTC", "orderId": 5, "clientOrderId": "Jr1h6xirOxgeJOUuYQS7V3" } ] }, { "orderListId": 28, "contingencyType": "OCO", "listStatusType": "EXEC_STARTED", "listOrderStatus": "EXECUTING", "listClientOrderId": "hG7hFNxJV6cZy3Ze4AUT4d", "transactionTime": 1565245913407, "symbol": "LTCBTC", "orders": [ { "symbol": "LTCBTC", "orderId": 2, "clientOrderId": "j6lFOfbmFMRjTYA7rRJ0LP" }, { "symbol": "LTCBTC", "orderId": 3, "clientOrderId": "z0KCjOdditiLS5ekAFtK81" } ] }] +``` + +### Query Open Order lists (USER\_DATA)[​](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints) + +``` +GET /api/v3/openOrderList +``` + +**Weight:** 6 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +recvWindow + +DECIMAL + +NO + +The value cannot be greater than `60000`. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +timestamp + +LONG + +YES + +**Data Source:** Database + +**Response:** + +``` +[ { "orderListId": 31, "contingencyType": "OCO", "listStatusType": "EXEC_STARTED", "listOrderStatus": "EXECUTING", "listClientOrderId": "wuB13fmulKj3YjdqWEcsnp", "transactionTime": 1565246080644, "symbol": "LTCBTC", "orders": [ { "symbol": "LTCBTC", "orderId": 4, "clientOrderId": "r3EH2N76dHfLoSZWIUw1bT" }, { "symbol": "LTCBTC", "orderId": 5, "clientOrderId": "Cv1SnyPD3qhqpbjpYEHbd2" } ] }] +``` + +### Account trade list (USER\_DATA)[​](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints) + +``` +GET /api/v3/myTrades +``` + +Get trades for a specific account and symbol. + +**Weight:** + +Condition + +Weight + +Without orderId + +20 + +With orderId + +5 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +orderId + +LONG + +NO + +This can only be used in combination with `symbol`. + +startTime + +LONG + +NO + +endTime + +LONG + +NO + +fromId + +LONG + +NO + +TradeId to fetch from. Default gets most recent trades. + +limit + +INT + +NO + +Default: 500; Maximum: 1000. + +recvWindow + +DECIMAL + +NO + +The value cannot be greater than `60000`. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +timestamp + +LONG + +YES + +**Notes:** + +- If `fromId` is set, it will get trades >= that `fromId`. Otherwise most recent trades are returned. +- The time between `startTime` and `endTime` can't be longer than 24 hours. +- These are the supported combinations of all parameters: + - `symbol` + - `symbol` + `orderId` + - `symbol` + `startTime` + - `symbol` + `endTime` + - `symbol` + `fromId` + - `symbol` + `startTime` + `endTime` + - `symbol`\+ `orderId` + `fromId` + +**Data Source:** Memory => Database + +**Response:** + +``` +[ { "symbol": "BNBBTC", "id": 28457, "orderId": 100234, "orderListId": -1, "price": "4.00000100", "qty": "12.00000000", "quoteQty": "48.000012", "commission": "10.10000000", "commissionAsset": "BNB", "time": 1499865549590, "isBuyer": true, "isMaker": false, "isBestMatch": true }] +``` + +### Query Unfilled Order Count (USER\_DATA)[​](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints) + +``` +GET /api/v3/rateLimit/order +``` + +Displays the user's unfilled order count for all intervals. + +**Weight:** 40 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +recvWindow + +DECIMAL + +NO + +The value cannot be greater than `60000`. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +timestamp + +LONG + +YES + +**Data Source:** Memory + +**Response:** + +``` +[ { "rateLimitType": "ORDERS", "interval": "SECOND", "intervalNum": 10, "limit": 50, "count": 0 }, { "rateLimitType": "ORDERS", "interval": "DAY", "intervalNum": 1, "limit": 160000, "count": 0 }] +``` + +### Query Prevented Matches (USER\_DATA)[​](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints) + +``` +GET /api/v3/myPreventedMatches +``` + +Displays the list of orders that were expired due to STP. + +These are the combinations supported: + +- `symbol` + `preventedMatchId` +- `symbol` + `orderId` +- `symbol` + `orderId` + `fromPreventedMatchId` (`limit` will default to 500) +- `symbol` + `orderId` + `fromPreventedMatchId` + `limit` + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +preventedMatchId + +LONG + +NO + +orderId + +LONG + +NO + +fromPreventedMatchId + +LONG + +NO + +limit + +INT + +NO + +Default: `500`; Maximum: `1000` + +recvWindow + +DECIMAL + +NO + +The value cannot be greater than `60000`. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +timestamp + +LONG + +YES + +**Weight:** + +Case + +Weight + +If `symbol` is invalid + +2 + +Querying by `preventedMatchId` + +2 + +Querying by `orderId` + +20 + +**Data Source:** + +Database + +**Response:** + +``` +[ { "symbol": "BTCUSDT", "preventedMatchId": 1, "takerOrderId": 5, "makerSymbol": "BTCUSDT", "makerOrderId": 3, "tradeGroupId": 1, "selfTradePreventionMode": "EXPIRE_MAKER", "price": "1.100000", "makerPreventedQuantity": "1.300000", "transactTime": 1669101687094 }] +``` + +### Query Allocations (USER\_DATA)[​](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints) + +``` +GET /api/v3/myAllocations +``` + +Retrieves allocations resulting from SOR order placement. + +**Weight:** 20 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +Yes + +startTime + +LONG + +No + +endTime + +LONG + +No + +fromAllocationId + +INT + +No + +limit + +INT + +No + +Default: 500; Maximum: 1000 + +orderId + +LONG + +No + +recvWindow + +DECIMAL + +No + +The value cannot be greater than `60000`. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +timestamp + +LONG + +No + +Supported parameter combinations: + +Parameters + +Response + +`symbol` + +allocations from oldest to newest + +`symbol` + `startTime` + +oldest allocations since `startTime` + +`symbol` + `endTime` + +newest allocations until `endTime` + +`symbol` + `startTime` + `endTime` + +allocations within the time range + +`symbol` + `fromAllocationId` + +allocations by allocation ID + +`symbol` + `orderId` + +allocations related to an order starting with oldest + +`symbol` + `orderId` + `fromAllocationId` + +allocations related to an order by allocation ID + +**Note:** The time between `startTime` and `endTime` can't be longer than 24 hours. + +**Data Source:** Database + +**Response:** + +``` +[ { "symbol": "BTCUSDT", "allocationId": 0, "allocationType": "SOR", "orderId": 1, "orderListId": -1, "price": "1.00000000", "qty": "5.00000000", "quoteQty": "5.00000000", "commission": "0.00000000", "commissionAsset": "BTC", "time": 1687506878118, "isBuyer": true, "isMaker": false, "isAllocator": false }] +``` + +### Query Commission Rates (USER\_DATA)[​](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints) + +``` +GET /api/v3/account/commission +``` + +Get current account commission rates. + +**Weight:** 20 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +**Data Source:** Database + +**Response:** + +``` +{ "symbol": "BTCUSDT", "standardCommission": { // Commission rates on trades from the order. "maker": "0.00000010", "taker": "0.00000020", "buyer": "0.00000030", "seller": "0.00000040" }, "specialCommission": { // Special commission rates from the order. "maker": "0.01000000", "taker": "0.02000000", "buyer": "0.03000000", "seller": "0.04000000" }, "taxCommission": { // Tax commission rates for trades from the order. "maker": "0.00000112", "taker": "0.00000114", "buyer": "0.00000118", "seller": "0.00000116" }, "discount": { // Discount commission when paying in BNB "enabledForAccount": true, "enabledForSymbol": true, "discountAsset": "BNB", "discount": "0.75000000" // Standard commission is reduced by this rate when paying commission in BNB. }} +``` + +### Query Order Amendments (USER\_DATA)[​](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints) + +``` +GET /api/v3/order/amendments +``` + +Queries all amendments of a single order. + +**Weight**: 4 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +orderId + +LONG + +YES + +fromExecutionId + +LONG + +NO + +limit + +LONG + +NO + +Default:500; Maximum: 1000 + +recvWindow + +DECIMAL + +NO + +The value cannot be greater than `60000`. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +timestamp + +LONG + +YES + +**Data Source:** + +Database + +**Response:** + +``` +[ { "symbol": "BTCUSDT", "orderId": 9, "executionId": 22, "origClientOrderId": "W0fJ9fiLKHOJutovPK3oJp", "newClientOrderId": "UQ1Np3bmQ71jJzsSDW9Vpi", "origQty": "5.00000000", "newQty": "4.00000000", "time": 1741669661670 }, { "symbol": "BTCUDST", "orderId": 9, "executionId": 25, "origClientOrderId": "UQ1Np3bmQ71jJzsSDW9Vpi", "newClientOrderId": "5uS0r35ohuQyDlCzZuYXq2", "origQty": "4.00000000", "newQty": "3.00000000", "time": 1741672924895 }] +``` + +### Query relevant filters (USER\_DATA)[​](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints) + +``` +GET /api/v3/myFilters +``` + +Retrieves the list of [filters](https://developers.binance.com/docs/binance-spot-api-docs/filters) relevant to an account on a given symbol. This is the only endpoint that shows if an account has [`MAX_ASSET`](https://developers.binance.com/docs/binance-spot-api-docs/filters) filters applied to it. + +**Weight:** 40 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +recvWindow + +DECIMAL + +NO + +The value cannot be greater than `60000`. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +timestamp + +LONG + +YES + +**Data Source:** Memory + +**Response:** + +``` +{ "exchangeFilters": [ { "filterType": "EXCHANGE_MAX_NUM_ORDERS", "maxNumOrders": 1000 } ], "symbolFilters": [ { "filterType": "MAX_NUM_ORDER_LISTS", "maxNumOrderLists": 20 } ], "assetFilters": [ { "filterType": "MAX_ASSET", "asset": "JPY", "limit": "1000000.00000000" } ]} +``` + +- [Account information (USER\_DATA)](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints) +- [Query order (USER\_DATA)](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints) +- [Current open orders (USER\_DATA)](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints) +- [All orders (USER\_DATA)](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints) +- [Query Order list (USER\_DATA)](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints) +- [Query all Order lists (USER\_DATA)](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints) +- [Query Open Order lists (USER\_DATA)](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints) +- [Account trade list (USER\_DATA)](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints) +- [Query Unfilled Order Count (USER\_DATA)](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints) +- [Query Prevented Matches (USER\_DATA)](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints) +- [Query Allocations (USER\_DATA)](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints) +- [Query Commission Rates (USER\_DATA)](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints) +- [Query Order Amendments (USER\_DATA)](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints) +- [Query relevant filters (USER\_DATA)](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints) diff --git a/docs/binance/binance-spot/rest-api_data-sources.md b/docs/binance/binance-spot/rest-api_data-sources.md new file mode 100644 index 0000000..a8e689c --- /dev/null +++ b/docs/binance/binance-spot/rest-api_data-sources.md @@ -0,0 +1,15 @@ +--- +title: "Data Sources | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs/rest-api/data-sources" +fetched_at: "2026-02-26T10:38:08.532Z" +--- +- The API system is asynchronous, so some delay in the response is normal and expected. +- Each endpoint has a data source indicating where the data is being retrieved, and thus which endpoints have the most up-to-date response. + +These are the three sources, ordered by least to most potential for delays in data updates. + +- **Matching Engine** - the data is from the Matching Engine +- **Memory** - the data is from a server's local or external memory +- **Database** - the data is taken directly from a database + +Some endpoints can have more than 1 data source. (e.g. Memory => Database) This means that the endpoint will check the first Data Source, and if it cannot find the value it's looking for it will check the next one. diff --git a/docs/binance/binance-spot/rest-api_error-codes.md b/docs/binance/binance-spot/rest-api_error-codes.md new file mode 100644 index 0000000..00d73ab --- /dev/null +++ b/docs/binance/binance-spot/rest-api_error-codes.md @@ -0,0 +1,14 @@ +--- +title: "Error Codes | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs/rest-api/error-codes" +fetched_at: "2026-02-26T10:38:08.716Z" +--- +- Any endpoint can return an ERROR + +Sample Payload below: + +``` +{ "code": -1121, "msg": "Invalid symbol."} +``` + +- Specific error codes and messages are defined in [Errors Codes](https://developers.binance.com/docs/binance-spot-api-docs/errors). diff --git a/docs/binance/binance-spot/rest-api_general-api-information.md b/docs/binance/binance-spot/rest-api_general-api-information.md new file mode 100644 index 0000000..d2bbfd5 --- /dev/null +++ b/docs/binance/binance-spot/rest-api_general-api-information.md @@ -0,0 +1,32 @@ +--- +title: "General API Information | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information" +fetched_at: "2026-02-26T10:38:08.655Z" +--- +- The following base endpoints are available. Please use whichever works best for your setup: + - **[https://api.binance.com](https://api.binance.com/)** + - **[https://api-gcp.binance.com](https://api-gcp.binance.com/)** + - **[https://api1.binance.com](https://api1.binance.com/)** + - **[https://api2.binance.com](https://api2.binance.com/)** + - **[https://api3.binance.com](https://api3.binance.com/)** + - **[https://api4.binance.com](https://api4.binance.com/)** +- The last 4 endpoints in the point above (`api1`\-`api4`) should give better performance but have less stability. +- Responses are in JSON by default. To receive responses in SBE, refer to the [SBE FAQ](https://developers.binance.com/docs/binance-spot-api-docs/faqs/sbe_faq) page. +- If your request contains a symbol name containing non-ASCII characters, then the response may contain non-ASCII characters encoded in UTF-8. +- Some endpoints may return asset and/or symbol names containing non-ASCII characters encoded in UTF-8 even if the request did not contain non-ASCII characters. +- Data is returned in **chronological order**, unless noted otherwise. + - Without `startTime` or `endTime`, returns the most recent items up to the limit. + - With `startTime`, returns oldest items from `startTime` up to the limit. + - With `endTime`, returns most recent items up to `endTime` and the limit. + - With both, behaves like `startTime` but does not exceed `endTime`. +- All time and timestamp related fields in the JSON responses are in **milliseconds by default.** To receive the information in microseconds, please add the header `X-MBX-TIME-UNIT:MICROSECOND` or `X-MBX-TIME-UNIT:microsecond`. +- We support HMAC, RSA, and Ed25519 keys. For more information, please see [API Key types](https://developers.binance.com/docs/binance-spot-api-docs/faqs/api_key_types). +- Timestamp parameters (e.g. `startTime`, `endTime`, `timestamp`) can be passed in milliseconds or microseconds. +- For APIs that only send public market data, please use the base endpoint **[https://data-api.binance.vision](https://data-api.binance.vision/)**. Please refer to [Market Data Only](https://developers.binance.com/docs/binance-spot-api-docs/faqs/market_data_only) page. +- If there are enums or terms you want clarification on, please see the [SPOT Glossary](https://developers.binance.com/docs/binance-spot-api-docs/faqs/spot_glossary) for more information. +- APIs have a timeout of 10 seconds when processing a request. If a response from the Matching Engine takes longer than this, the API responds with "Timeout waiting for response from backend server. Send status unknown; execution status unknown." [(-1007 TIMEOUT)](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - This does not always mean that the request failed in the Matching Engine. + - If the status of the request has not appeared in [User Data Stream](https://developers.binance.com/docs/binance-spot-api-docs/user-data-stream), please perform an API query for its status. +- **Please avoid SQL keywords in requests** as they may trigger a security block by a WAF (Web Application Firewall) rule. See [https://www.binance.com/en/support/faq/detail/360004492232](https://www.binance.com/en/support/faq/detail/360004492232) for more details. +- If your request contains a symbol name containing non-ASCII characters, then the response may contain non-ASCII characters encoded in UTF-8. +- Some endpoints may return asset and/or symbol names containing non-ASCII characters encoded in UTF-8 even if the request did not contain non-ASCII characters. diff --git a/docs/binance/binance-spot/rest-api_general-endpoints.md b/docs/binance/binance-spot/rest-api_general-endpoints.md new file mode 100644 index 0000000..e994742 --- /dev/null +++ b/docs/binance/binance-spot/rest-api_general-endpoints.md @@ -0,0 +1,137 @@ +--- +title: "General endpoints | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-endpoints" +fetched_at: "2026-02-26T10:38:08.963Z" +--- +### Test connectivity[​](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-endpoints) + +``` +GET /api/v3/ping +``` + +Test connectivity to the Rest API. + +**Weight:** 1 + +**Parameters:** NONE + +**Data Source:** Memory + +**Response:** + +``` +{} +``` + +### Check server time[​](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-endpoints) + +``` +GET /api/v3/time +``` + +Test connectivity to the Rest API and get the current server time. + +**Weight:** 1 + +**Parameters:** NONE + +**Data Source:** Memory + +**Response:** + +``` +{ "serverTime": 1499827319559} +``` + +### Exchange information[​](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-endpoints) + +``` +GET /api/v3/exchangeInfo +``` + +Current exchange trading rules and symbol information + +**Weight:** 20 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +No + +Example: curl -X GET "[https://api.binance.com/api/v3/exchangeInfo?symbol=BNBBTC](https://api.binance.com/api/v3/exchangeInfo?symbol=BNBBTC)" + +symbols + +ARRAY OF STRING + +No + +Examples: curl -X GET "[https://api.binance.com/api/v3/exchangeInfo?symbols=%5B%22BNBBTC%22,%22BTCUSDT%22%5D](https://api.binance.com/api/v3/exchangeInfo?symbols=%5B%22BNBBTC%22,%22BTCUSDT%22%5D)" +or +curl -g -X GET '[https://api.binance.com/api/v3/exchangeInfo?symbols=\["BTCUSDT","BNBBTC](https://api.binance.com/api/v3/exchangeInfo?symbols=%5B%22BTCUSDT%22,%22BNBBTC)"\]' + +permissions + +ENUM + +No + +Examples: curl -X GET "[https://api.binance.com/api/v3/exchangeInfo?permissions=SPOT](https://api.binance.com/api/v3/exchangeInfo?permissions=SPOT)" +or +curl -X GET "[https://api.binance.com/api/v3/exchangeInfo?permissions=%5B%22MARGIN%22%2C%22LEVERAGED%22%5D](https://api.binance.com/api/v3/exchangeInfo?permissions=%5B%22MARGIN%22%2C%22LEVERAGED%22%5D)" +or +curl -g -X GET '[https://api.binance.com/api/v3/exchangeInfo?permissions=\["MARGIN","LEVERAGED](https://api.binance.com/api/v3/exchangeInfo?permissions=%5B%22MARGIN%22,%22LEVERAGED)"\]' + +showPermissionSets + +BOOLEAN + +No + +Controls whether the content of the `permissionSets` field is populated or not. Defaults to `true` + +symbolStatus + +ENUM + +No + +Filters for symbols that have this `tradingStatus`. Valid values: `TRADING`, `HALT`, `BREAK` +Cannot be used in combination with `symbols` or `symbol`. + +**Notes:** + +- If the value provided to `symbol` or `symbols` do not exist, the endpoint will throw an error saying the symbol is invalid. +- All parameters are optional. +- `permissions` can support single or multiple values (e.g. `SPOT`, `["MARGIN","LEVERAGED"]`). This cannot be used in combination with `symbol` or `symbols`. +- If `permissions` parameter not provided, all symbols that have either `SPOT`, `MARGIN`, or `LEVERAGED` permission will be exposed. + - To display symbols with any permission you need to specify them explicitly in `permissions`: (e.g. `["SPOT","MARGIN",...]`.). See [Account and Symbol Permissions](https://developers.binance.com/docs/binance-spot-api-docs/enums) for the full list. + +**Examples of Symbol Permissions Interpretation from the Response:** + +- `[["A","B"]]` means you may place an order if your account has either permission "A" **or** permission "B". +- `[["A"],["B"]]` means you can place an order if your account has permission "A" **and** permission "B". +- `[["A"],["B","C"]]` means you can place an order if your account has permission "A" **and** permission "B" or permission "C". (Inclusive or is applied here, not exclusive or, so your account may have both permission "B" and permission "C".) + +**Data Source:** Memory + +**Response:** + +``` +{ "timezone": "UTC", "serverTime": 1565246363776, "rateLimits": [ { // These are defined in the `ENUM definitions` section under `Rate Limiters (rateLimitType)`. // All limits are optional } ], "exchangeFilters": [ // These are the defined filters in the `Filters` section. // All filters are optional. ], "symbols": [ { "symbol": "ETHBTC", "status": "TRADING", "baseAsset": "ETH", "baseAssetPrecision": 8, "quoteAsset": "BTC", "quotePrecision": 8, // will be removed in future api versions (v4+) "quoteAssetPrecision": 8, "baseCommissionPrecision": 8, "quoteCommissionPrecision": 8, "orderTypes": [ "LIMIT", "LIMIT_MAKER", "MARKET", "STOP_LOSS", "STOP_LOSS_LIMIT", "TAKE_PROFIT", "TAKE_PROFIT_LIMIT" ], "icebergAllowed": true, "ocoAllowed": true, "otoAllowed": true, "opoAllowed": true, "quoteOrderQtyMarketAllowed": true, "allowTrailingStop": false, "cancelReplaceAllowed": false, "amendAllowed": false, "pegInstructionsAllowed": true, "isSpotTradingAllowed": true, "isMarginTradingAllowed": true, "filters": [ // These are defined in the Filters section. // All filters are optional ], "permissions": [], "permissionSets": [["SPOT", "MARGIN"]], "defaultSelfTradePreventionMode": "NONE", "allowedSelfTradePreventionModes": ["NONE"] } ], // Optional field. Present only when SOR is available. // https://github.com/binance/binance-spot-api-docs/blob/master/faqs/sor_faq.md "sors": [ { "baseAsset": "BTC", "symbols": ["BTCUSDT", "BTCUSDC"] } ]} +``` + +- [Test connectivity](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-endpoints) +- [Check server time](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-endpoints) +- [Exchange information](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-endpoints) diff --git a/docs/binance/binance-spot/rest-api_general-information-on-endpoints.md b/docs/binance/binance-spot/rest-api_general-information-on-endpoints.md new file mode 100644 index 0000000..d7824b3 --- /dev/null +++ b/docs/binance/binance-spot/rest-api_general-information-on-endpoints.md @@ -0,0 +1,9 @@ +--- +title: "General Information on Endpoints | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-information-on-endpoints" +fetched_at: "2026-02-26T10:38:08.909Z" +--- +- For `GET` endpoints, parameters must be sent as a `query string`. +- For `POST`, `PUT`, and `DELETE` endpoints, the parameters may be sent as a `query string` or in the `request body` with content type `application/x-www-form-urlencoded`. You may mix parameters between both the `query string` and `request body` if you wish to do so. +- Parameters may be sent in any order. +- If a parameter sent in both the `query string` and `request body`, the `query string` parameter will be used. diff --git a/docs/binance/binance-spot/rest-api_http-return-codes.md b/docs/binance/binance-spot/rest-api_http-return-codes.md new file mode 100644 index 0000000..1f882b2 --- /dev/null +++ b/docs/binance/binance-spot/rest-api_http-return-codes.md @@ -0,0 +1,11 @@ +--- +title: "HTTP Return Codes | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs/rest-api/http-return-codes" +fetched_at: "2026-02-26T10:38:08.904Z" +--- +- HTTP `4XX` return codes are used for malformed requests; the issue is on the sender's side. +- HTTP `403` return code is used when a WAF (Web Application Firewall) rule has been violated. This can indicate a rate limit violation or a security block. See [https://www.binance.com/en/support/faq/detail/360004492232](https://www.binance.com/en/support/faq/detail/360004492232) for more details. +- HTTP `409` return code is used when a cancelReplace order partially succeeds. (i.e. if the cancellation of the order fails but the new order placement succeeds.) +- HTTP `429` return code is used when breaking a request rate limit. +- HTTP `418` return code is used when an IP has been auto-banned for continuing to send requests after receiving `429` codes. +- HTTP `5XX` return codes are used for internal errors; the issue is on Binance's side. It is important to **NOT** treat this as a failure operation; the execution status is **UNKNOWN** and could have been a success. diff --git a/docs/binance/binance-spot/rest-api_limits.md b/docs/binance/binance-spot/rest-api_limits.md new file mode 100644 index 0000000..9be8b53 --- /dev/null +++ b/docs/binance/binance-spot/rest-api_limits.md @@ -0,0 +1,39 @@ +--- +title: "LIMITS | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs/rest-api/limits" +fetched_at: "2026-02-26T10:38:08.971Z" +--- +### General Info on Limits[​](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/limits) + +- The following `intervalLetter` values for headers: + - SECOND => S + - MINUTE => M + - HOUR => H + - DAY => D +- `intervalNum` describes the amount of the interval. For example, `intervalNum` 5 with `intervalLetter` M means "Every 5 minutes". +- The `/api/v3/exchangeInfo` `rateLimits` array contains objects related to the exchange's `RAW_REQUESTS`, `REQUEST_WEIGHT`, and `ORDERS` rate limits. These are further defined in the `ENUM definitions` section under `Rate limiters (rateLimitType)`. +- Requests fail with HTTP status code 429 when you exceed the request rate limit. + +### IP Limits[​](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/limits) + +- Every request will contain `X-MBX-USED-WEIGHT-(intervalNum)(intervalLetter)` in the response headers which has the current used weight for the IP for all request rate limiters defined. +- Each route has a `weight` which determines for the number of requests each endpoint counts for. Heavier endpoints and endpoints that do operations on multiple symbols will have a heavier `weight`. +- When a 429 is received, it's your obligation as an API to back off and not spam the API. +- **Repeatedly violating rate limits and/or failing to back off after receiving 429s will result in an automated IP ban (HTTP status 418).** +- IP bans are tracked and **scale in duration** for repeat offenders, **from 2 minutes to 3 days**. +- A `Retry-After` header is sent with a 418 or 429 responses and will give the **number of seconds** required to wait, in the case of a 429, to prevent a ban, or, in the case of a 418, until the ban is over. +- **The limits on the API are based on the IPs, not the API keys.** + +### Unfilled Order Count[​](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/limits) + +- Every successful order response will contain a `X-MBX-ORDER-COUNT-(intervalNum)(intervalLetter)` header indicating how many orders you have placed for that interval. + + To monitor this, refer to [`GET api/v3/rateLimit/order`](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints). +- Rejected/unsuccessful orders are not guaranteed to have `X-MBX-ORDER-COUNT-**` headers in the response. +- If you have exceeded this, you will receive a 429 error with the `Retry-After` header. +- **Please note that if your orders are consistently filled by trades, you can continuously place orders on the API**. For more information, please see [Spot Unfilled Order Count Rules](https://developers.binance.com/docs/binance-spot-api-docs/faqs/order_count_decrement). +- **The number of unfilled orders is tracked for each account.** + +- [General Info on Limits](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/limits) +- [IP Limits](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/limits) +- [Unfilled Order Count](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/limits) diff --git a/docs/binance/binance-spot/rest-api_market-data-endpoints.md b/docs/binance/binance-spot/rest-api_market-data-endpoints.md new file mode 100644 index 0000000..da904e6 --- /dev/null +++ b/docs/binance/binance-spot/rest-api_market-data-endpoints.md @@ -0,0 +1,981 @@ +--- +title: "Market Data endpoints | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints" +fetched_at: "2026-02-26T10:38:09.201Z" +--- +### Order book[​](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints) + +``` +GET /api/v3/depth +``` + +**Weight:** Adjusted based on the limit: + +Limit + +Request Weight + +1-100 + +5 + +101-500 + +25 + +501-1000 + +50 + +1001-5000 + +250 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +limit + +INT + +NO + +Default: 100; Maximum: 5000. +If limit > 5000, only 5000 entries will be returned. + +symbolStatus + +ENUM + +NO + +Filters for symbols that have this `tradingStatus`. +A status mismatch returns error `-1220 SYMBOL_DOES_NOT_MATCH_STATUS`. +Valid values: `TRADING`, `HALT`, `BREAK` + +**Data Source:** Memory + +**Response:** + +``` +{ "lastUpdateId": 1027024, "bids": [ [ "4.00000000", // PRICE "431.00000000" // QTY ] ], "asks": [["4.00000200", "12.00000000"]]} +``` + +### Recent trades list[​](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints) + +``` +GET /api/v3/trades +``` + +Get recent trades. + +**Weight:** 25 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +limit + +INT + +NO + +Default: 500; Maximum: 1000. + +**Data Source:** Memory + +**Response:** + +``` +[ { "id": 28457, "price": "4.00000100", "qty": "12.00000000", "quoteQty": "48.000012", "time": 1499865549590, "isBuyerMaker": true, "isBestMatch": true }] +``` + +### Old trade lookup[​](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints) + +``` +GET /api/v3/historicalTrades +``` + +Get older trades. + +**Weight:** 25 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +limit + +INT + +NO + +Default: 500; Maximum: 1000. + +fromId + +LONG + +NO + +TradeId to fetch from. Default gets most recent trades. + +**Data Source:** Database + +**Response:** + +``` +[ { "id": 28457, "price": "4.00000100", "qty": "12.00000000", "quoteQty": "48.000012", "time": 1499865549590, "isBuyerMaker": true, "isBestMatch": true }] +``` + +### Compressed/Aggregate trades list[​](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints) + +``` +GET /api/v3/aggTrades +``` + +Get compressed, aggregate trades. Trades that fill at the time, from the same taker order, with the same price will have the quantity aggregated. + +**Weight:** 4 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +fromId + +LONG + +NO + +ID to get aggregate trades from INCLUSIVE. + +startTime + +LONG + +NO + +Timestamp in ms to get aggregate trades from INCLUSIVE. + +endTime + +LONG + +NO + +Timestamp in ms to get aggregate trades until INCLUSIVE. + +limit + +INT + +NO + +Default: 500; Maximum: 1000. + +- If fromId, startTime, and endTime are not sent, the most recent aggregate trades will be returned. + +**Data Source:** Database + +**Response:** + +``` +[ { "a": 26129, // Aggregate tradeId "p": "0.01633102", // Price "q": "4.70443515", // Quantity "f": 27781, // First tradeId "l": 27781, // Last tradeId "T": 1498793709153, // Timestamp "m": true, // Was the buyer the maker? "M": true // Was the trade the best price match? }] +``` + +### Kline/Candlestick data[​](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints) + +``` +GET /api/v3/klines +``` + +Kline/candlestick bars for a symbol. Klines are uniquely identified by their open time. + +**Weight:** 2 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +interval + +ENUM + +YES + +startTime + +LONG + +NO + +endTime + +LONG + +NO + +timeZone + +STRING + +NO + +Default: 0 (UTC) + +limit + +INT + +NO + +Default: 500; Maximum: 1000. + +Supported kline intervals (case-sensitive): + +Interval + +`interval` value + +seconds + +`1s` + +minutes + +`1m`, `3m`, `5m`, `15m`, `30m` + +hours + +`1h`, `2h`, `4h`, `6h`, `8h`, `12h` + +days + +`1d`, `3d` + +weeks + +`1w` + +months + +`1M` + +**Notes:** + +- If `startTime` and `endTime` are not sent, the most recent klines are returned. +- Supported values for `timeZone`: + - Hours and minutes (e.g. `-1:00`, `05:45`) + - Only hours (e.g. `0`, `8`, `4`) + - Accepted range is strictly \[-12:00 to +14:00\] inclusive +- If `timeZone` provided, kline intervals are interpreted in that timezone instead of UTC. +- Note that `startTime` and `endTime` are always interpreted in UTC, regardless of `timeZone`. + +**Data Source:** Database + +**Response:** + +``` +[ [ 1499040000000, // Kline open time "0.01634790", // Open price "0.80000000", // High price "0.01575800", // Low price "0.01577100", // Close price "148976.11427815", // Volume 1499644799999, // Kline Close time "2434.19055334", // Quote asset volume 308, // Number of trades "1756.87402397", // Taker buy base asset volume "28.46694368", // Taker buy quote asset volume "0" // Unused field, ignore. ]] +``` + +### UIKlines[​](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints) + +``` +GET /api/v3/uiKlines +``` + +The request is similar to klines having the same parameters and response. + +`uiKlines` return modified kline data, optimized for presentation of candlestick charts. + +**Weight:** 2 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +interval + +ENUM + +YES + +See [`klines`](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints) + +startTime + +LONG + +NO + +endTime + +LONG + +NO + +timeZone + +STRING + +NO + +Default: 0 (UTC) + +limit + +INT + +NO + +Default: 500; Maximum: 1000. + +- If `startTime` and `endTime` are not sent, the most recent klines are returned. +- Supported values for `timeZone`: + - Hours and minutes (e.g. `-1:00`, `05:45`) + - Only hours (e.g. `0`, `8`, `4`) + - Accepted range is strictly \[-12:00 to +14:00\] inclusive +- If `timeZone` provided, kline intervals are interpreted in that timezone instead of UTC. +- Note that `startTime` and `endTime` are always interpreted in UTC, regardless of `timeZone`. + +**Data Source:** Database + +**Response:** + +``` +[ [ 1499040000000, // Kline open time "0.01634790", // Open price "0.80000000", // High price "0.01575800", // Low price "0.01577100", // Close price "148976.11427815", // Volume 1499644799999, // Kline close time "2434.19055334", // Quote asset volume 308, // Number of trades "1756.87402397", // Taker buy base asset volume "28.46694368", // Taker buy quote asset volume "0" // Unused field. Ignore. ]] +``` + +### Current average price[​](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints) + +``` +GET /api/v3/avgPrice +``` + +Current average price for a symbol. + +**Weight:** 2 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +**Data Source:** Memory + +**Response:** + +``` +{ "mins": 5, // Average price interval (in minutes) "price": "9.35751834", // Average price "closeTime": 1694061154503 // Last trade time} +``` + +### 24hr ticker price change statistics[​](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints) + +``` +GET /api/v3/ticker/24hr +``` + +24 hour rolling window price change statistics. **Careful** when accessing this with no symbol. + +**Weight:** + +Parameter + +Symbols Provided + +Weight + +symbol + +1 + +2 + +symbol parameter is omitted + +80 + +symbols + +1-20 + +2 + +21-100 + +40 + +101 or more + +80 + +symbols parameter is omitted + +80 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +NO + +Parameter symbol and symbols cannot be used in combination. +If neither parameter is sent, tickers for all symbols will be returned in an array. + +Examples of accepted format for the symbols parameter: \["BTCUSDT","BNBUSDT"\] +or +%5B%22BTCUSDT%22,%22BNBUSDT%22%5D + +symbols + +STRING + +NO + +type + +ENUM + +NO + +Supported values: FULL or MINI. +If none provided, the default is FULL + +symbolStatus + +ENUM + +NO + +Filters for symbols that have this `tradingStatus`. +For a single symbol, a status mismatch returns error `-1220 SYMBOL_DOES_NOT_MATCH_STATUS`. +For multiple or all symbols, non-matching ones are simply excluded from the response. +Valid values: `TRADING`, `HALT`, `BREAK` + +**Data Source:** Memory + +**Response - FULL:** + +``` +{ "symbol": "BNBBTC", "priceChange": "-94.99999800", "priceChangePercent": "-95.960", "weightedAvgPrice": "0.29628482", "prevClosePrice": "0.10002000", "lastPrice": "4.00000200", "lastQty": "200.00000000", "bidPrice": "4.00000000", "bidQty": "100.00000000", "askPrice": "4.00000200", "askQty": "100.00000000", "openPrice": "99.00000000", "highPrice": "100.00000000", "lowPrice": "0.10000000", "volume": "8913.30000000", "quoteVolume": "15.30000000", "openTime": 1499783499040, "closeTime": 1499869899040, "firstId": 28385, // First tradeId "lastId": 28460, // Last tradeId "count": 76 // Trade count} +``` + +OR + +``` +[ { "symbol": "BNBBTC", "priceChange": "-94.99999800", "priceChangePercent": "-95.960", "weightedAvgPrice": "0.29628482", "prevClosePrice": "0.10002000", "lastPrice": "4.00000200", "lastQty": "200.00000000", "bidPrice": "4.00000000", "bidQty": "100.00000000", "askPrice": "4.00000200", "askQty": "100.00000000", "openPrice": "99.00000000", "highPrice": "100.00000000", "lowPrice": "0.10000000", "volume": "8913.30000000", "quoteVolume": "15.30000000", "openTime": 1499783499040, "closeTime": 1499869899040, "firstId": 28385, // First tradeId "lastId": 28460, // Last tradeId "count": 76 // Trade count }] +``` + +**Response - MINI:** + +``` +{ "symbol": "BNBBTC", // Symbol Name "openPrice": "99.00000000", // Opening price of the Interval "highPrice": "100.00000000", // Highest price in the interval "lowPrice": "0.10000000", // Lowest price in the interval "lastPrice": "4.00000200", // Closing price of the interval "volume": "8913.30000000", // Total trade volume (in base asset) "quoteVolume": "15.30000000", // Total trade volume (in quote asset) "openTime": 1499783499040, // Start of the ticker interval "closeTime": 1499869899040, // End of the ticker interval "firstId": 28385, // First tradeId considered "lastId": 28460, // Last tradeId considered "count": 76 // Total trade count} +``` + +OR + +``` +[ { "symbol": "BNBBTC", "openPrice": "99.00000000", "highPrice": "100.00000000", "lowPrice": "0.10000000", "lastPrice": "4.00000200", "volume": "8913.30000000", "quoteVolume": "15.30000000", "openTime": 1499783499040, "closeTime": 1499869899040, "firstId": 28385, "lastId": 28460, "count": 76 }, { "symbol": "LTCBTC", "openPrice": "0.07000000", "highPrice": "0.07000000", "lowPrice": "0.07000000", "lastPrice": "0.07000000", "volume": "11.00000000", "quoteVolume": "0.77000000", "openTime": 1656908192899, "closeTime": 1656994592899, "firstId": 0, "lastId": 10, "count": 11 }] +``` + +### Trading Day Ticker[​](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints) + +``` +GET /api/v3/ticker/tradingDay +``` + +Price change statistics for a trading day. + +**Weight:** + +4 for each requested symbol. + +The weight for this request will cap at 200 once the number of `symbols` in the request is more than 50. + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +Either symbol or symbols must be provided + +Examples of accepted format for the symbols parameter: +\["BTCUSDT","BNBUSDT"\] +or +%5B%22BTCUSDT%22,%22BNBUSDT%22%5D + +The maximum number of symbols allowed in a request is 100. + +symbols + +timeZone + +STRING + +NO + +Default: 0 (UTC) + +type + +ENUM + +NO + +Supported values: FULL or MINI. +If none provided, the default is FULL + +symbolStatus + +ENUM + +NO + +Filters for symbols that have this `tradingStatus`. +For a single symbol, a status mismatch returns error `-1220 SYMBOL_DOES_NOT_MATCH_STATUS`. +For multiple symbols, non-matching ones are simply excluded from the response. +Valid values: `TRADING`, `HALT`, `BREAK` + +**Notes:** + +- Supported values for `timeZone`: + - Hours and minutes (e.g. `-1:00`, `05:45`) + - Only hours (e.g. `0`, `8`, `4`) + +**Data Source:** Database + +**Response - FULL:** + +With `symbol`: + +``` +{ "symbol": "BTCUSDT", "priceChange": "-83.13000000", // Absolute price change "priceChangePercent": "-0.317", // Relative price change in percent "weightedAvgPrice": "26234.58803036", // quoteVolume / volume "openPrice": "26304.80000000", "highPrice": "26397.46000000", "lowPrice": "26088.34000000", "lastPrice": "26221.67000000", "volume": "18495.35066000", // Volume in base asset "quoteVolume": "485217905.04210480", // Volume in quote asset "openTime": 1695686400000, "closeTime": 1695772799999, "firstId": 3220151555, // Trade ID of the first trade in the interval "lastId": 3220849281, // Trade ID of the last trade in the interval "count": 697727 // Number of trades in the interval} +``` + +With `symbols`: + +``` +[ { "symbol": "BTCUSDT", "priceChange": "-83.13000000", "priceChangePercent": "-0.317", "weightedAvgPrice": "26234.58803036", "openPrice": "26304.80000000", "highPrice": "26397.46000000", "lowPrice": "26088.34000000", "lastPrice": "26221.67000000", "volume": "18495.35066000", "quoteVolume": "485217905.04210480", "openTime": 1695686400000, "closeTime": 1695772799999, "firstId": 3220151555, "lastId": 3220849281, "count": 697727 }, { "symbol": "BNBUSDT", "priceChange": "2.60000000", "priceChangePercent": "1.238", "weightedAvgPrice": "211.92276958", "openPrice": "210.00000000", "highPrice": "213.70000000", "lowPrice": "209.70000000", "lastPrice": "212.60000000", "volume": "280709.58900000", "quoteVolume": "59488753.54750000", "openTime": 1695686400000, "closeTime": 1695772799999, "firstId": 672397461, "lastId": 672496158, "count": 98698 }] +``` + +**Response - MINI:** + +With `symbol`: + +``` +{ "symbol": "BTCUSDT", "openPrice": "26304.80000000", "highPrice": "26397.46000000", "lowPrice": "26088.34000000", "lastPrice": "26221.67000000", "volume": "18495.35066000", // Volume in base asset "quoteVolume": "485217905.04210480", // Volume in quote asset "openTime": 1695686400000, "closeTime": 1695772799999, "firstId": 3220151555, // Trade ID of the first trade in the interval "lastId": 3220849281, // Trade ID of the last trade in the interval "count": 697727 // Number of trades in the interval} +``` + +With `symbols`: + +``` +[ { "symbol": "BTCUSDT", "openPrice": "26304.80000000", "highPrice": "26397.46000000", "lowPrice": "26088.34000000", "lastPrice": "26221.67000000", "volume": "18495.35066000", "quoteVolume": "485217905.04210480", "openTime": 1695686400000, "closeTime": 1695772799999, "firstId": 3220151555, "lastId": 3220849281, "count": 697727 }, { "symbol": "BNBUSDT", "openPrice": "210.00000000", "highPrice": "213.70000000", "lowPrice": "209.70000000", "lastPrice": "212.60000000", "volume": "280709.58900000", "quoteVolume": "59488753.54750000", "openTime": 1695686400000, "closeTime": 1695772799999, "firstId": 672397461, "lastId": 672496158, "count": 98698 }] +``` + +### Symbol price ticker[​](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints) + +``` +GET /api/v3/ticker/price +``` + +Latest price for a symbol or symbols. + +**Weight:** + +Parameter + +Symbols Provided + +Weight + +symbol + +1 + +2 + +symbol parameter is omitted + +4 + +symbols + +Any + +4 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +NO + +Parameter symbol and symbols cannot be used in combination. +If neither parameter is sent, prices for all symbols will be returned in an array. + +Examples of accepted format for the symbols parameter: \["BTCUSDT","BNBUSDT"\] +or +%5B%22BTCUSDT%22,%22BNBUSDT%22%5D + +symbols + +STRING + +NO + +symbolStatus + +ENUM + +NO + +Filters for symbols that have this `tradingStatus`. +For a single symbol, a status mismatch returns error `-1220 SYMBOL_DOES_NOT_MATCH_STATUS`. +For multiple or all symbols, non-matching ones are simply excluded from the response. +Valid values: `TRADING`, `HALT`, `BREAK` + +**Data Source:** Memory + +**Response:** + +``` +{ "symbol": "LTCBTC", "price": "4.00000200"} +``` + +OR + +``` +[ { "symbol": "LTCBTC", "price": "4.00000200" }, { "symbol": "ETHBTC", "price": "0.07946600" }] +``` + +### Symbol order book ticker[​](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints) + +``` +GET /api/v3/ticker/bookTicker +``` + +Best price/qty on the order book for a symbol or symbols. + +**Weight:** + +Parameter + +Symbols Provided + +Weight + +symbol + +1 + +2 + +symbol parameter is omitted + +4 + +symbols + +Any + +4 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +NO + +Parameter symbol and symbols cannot be used in combination. +If neither parameter is sent, bookTickers for all symbols will be returned in an array. + +Examples of accepted format for the symbols parameter: \["BTCUSDT","BNBUSDT"\] +or +%5B%22BTCUSDT%22,%22BNBUSDT%22%5D + +symbols + +STRING + +NO + +symbolStatus + +ENUM + +NO + +Filters for symbols that have this `tradingStatus`. +For a single symbol, a status mismatch returns error `-1220 SYMBOL_DOES_NOT_MATCH_STATUS`. +For multiple or all symbols, non-matching ones are simply excluded from the response. +Valid values: `TRADING`, `HALT`, `BREAK` + +**Data Source:** Memory + +**Response:** + +``` +{ "symbol": "LTCBTC", "bidPrice": "4.00000000", "bidQty": "431.00000000", "askPrice": "4.00000200", "askQty": "9.00000000"} +``` + +OR + +``` +[ { "symbol": "LTCBTC", "bidPrice": "4.00000000", "bidQty": "431.00000000", "askPrice": "4.00000200", "askQty": "9.00000000" }, { "symbol": "ETHBTC", "bidPrice": "0.07946700", "bidQty": "9.00000000", "askPrice": "100000.00000000", "askQty": "1000.00000000" }] +``` + +### Rolling window price change statistics[​](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints) + +``` +GET /api/v3/ticker +``` + +**Note:** This endpoint is different from the `GET /api/v3/ticker/24hr` endpoint. + +The window used to compute statistics will be no more than 59999ms from the requested `windowSize`. + +`openTime` for `/api/v3/ticker` always starts on a minute, while the `closeTime` is the current time of the request. As such, the effective window will be up to 59999ms wider than `windowSize`. + +E.g. If the `closeTime` is 1641287867099 (January 04, 2022 09:17:47:099 UTC) , and the `windowSize` is `1d`. the `openTime` will be: 1641201420000 (January 3, 2022, 09:17:00) + +**Weight:** + +4 for each requested symbol regardless of windowSize. + +The weight for this request will cap at 200 once the number of `symbols` in the request is more than 50. + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +Either symbol or symbols must be provided + +Examples of accepted format for the symbols parameter: +\["BTCUSDT","BNBUSDT"\] +or +%5B%22BTCUSDT%22,%22BNBUSDT%22%5D + +The maximum number of symbols allowed in a request is 100. + +symbols + +windowSize + +ENUM + +NO + +Defaults to 1d if no parameter provided +Supported windowSize values: +1m,2m....59m for minutes +1h, 2h....23h - for hours +1d...7d - for days + +Units cannot be combined (e.g. 1d2h is not allowed) + +type + +ENUM + +NO + +Supported values: FULL or MINI. +If none provided, the default is FULL + +symbolStatus + +ENUM + +NO + +Filters for symbols that have this `tradingStatus`. +For a single symbol, a status mismatch returns error `-1220 SYMBOL_DOES_NOT_MATCH_STATUS`. +For multiple symbols, non-matching ones are simply excluded from the response. +Valid values: `TRADING`, `HALT`, `BREAK` + +**Data Source:** Database + +**Response - FULL:** + +When using `symbol`: + +``` +{ "symbol": "BNBBTC", "priceChange": "-8.00000000", // Absolute price change "priceChangePercent": "-88.889", // Relative price change in percent "weightedAvgPrice": "2.60427807", // QuoteVolume / Volume "openPrice": "9.00000000", "highPrice": "9.00000000", "lowPrice": "1.00000000", "lastPrice": "1.00000000", "volume": "187.00000000", "quoteVolume": "487.00000000", // Sum of (price * volume) for all trades "openTime": 1641859200000, // Open time for ticker window "closeTime": 1642031999999, // Close time for ticker window "firstId": 0, // Trade IDs "lastId": 60, "count": 61 // Number of trades in the interval} +``` + +or + +When using `symbols`: + +``` +[ { "symbol": "BTCUSDT", "priceChange": "-154.13000000", // Absolute price change "priceChangePercent": "-0.740", // Relative price change in percent "weightedAvgPrice": "20677.46305250", // QuoteVolume / Volume "openPrice": "20825.27000000", "highPrice": "20972.46000000", "lowPrice": "20327.92000000", "lastPrice": "20671.14000000", "volume": "72.65112300", "quoteVolume": "1502240.91155513", // Sum of (price * volume) for all trades "openTime": 1655432400000, // Open time for ticker window "closeTime": 1655446835460, // Close time for ticker window "firstId": 11147809, // Trade IDs "lastId": 11149775, "count": 1967 // Number of trades in the interval }, { "symbol": "BNBBTC", "priceChange": "0.00008530", "priceChangePercent": "0.823", "weightedAvgPrice": "0.01043129", "openPrice": "0.01036170", "highPrice": "0.01049850", "lowPrice": "0.01033870", "lastPrice": "0.01044700", "volume": "166.67000000", "quoteVolume": "1.73858301", "openTime": 1655432400000, "closeTime": 1655446835460, "firstId": 2351674, "lastId": 2352034, "count": 361 }] +``` + +**Response - MINI:** + +When using `symbol`: + +``` +{ "symbol": "LTCBTC", "openPrice": "0.10000000", "highPrice": "2.00000000", "lowPrice": "0.10000000", "lastPrice": "2.00000000", "volume": "39.00000000", "quoteVolume": "13.40000000", // Sum of (price * volume) for all trades "openTime": 1656986580000, // Open time for ticker window "closeTime": 1657001016795, // Close time for ticker window "firstId": 0, // Trade IDs "lastId": 34, "count": 35 // Number of trades in the interval} +``` + +OR + +When using `symbols`: + +``` +[ { "symbol": "BNBBTC", "openPrice": "0.10000000", "highPrice": "2.00000000", "lowPrice": "0.10000000", "lastPrice": "2.00000000", "volume": "39.00000000", "quoteVolume": "13.40000000", // Sum of (price * volume) for all trades "openTime": 1656986880000, // Open time for ticker window "closeTime": 1657001297799, // Close time for ticker window "firstId": 0, // Trade IDs "lastId": 34, "count": 35 // Number of trades in the interval }, { "symbol": "LTCBTC", "openPrice": "0.07000000", "highPrice": "0.07000000", "lowPrice": "0.07000000", "lastPrice": "0.07000000", "volume": "33.00000000", "quoteVolume": "2.31000000", "openTime": 1656986880000, "closeTime": 1657001297799, "firstId": 0, "lastId": 32, "count": 33 }] +``` + +- [Order book](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints) +- [Recent trades list](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints) +- [Old trade lookup](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints) +- [Compressed/Aggregate trades list](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints) +- [Kline/Candlestick data](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints) +- [UIKlines](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints) +- [Current average price](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints) +- [24hr ticker price change statistics](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints) +- [Trading Day Ticker](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints) +- [Symbol price ticker](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints) +- [Symbol order book ticker](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints) +- [Rolling window price change statistics](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints) diff --git a/docs/binance/binance-spot/rest-api_request-security.md b/docs/binance/binance-spot/rest-api_request-security.md new file mode 100644 index 0000000..ea8c5e9 --- /dev/null +++ b/docs/binance/binance-spot/rest-api_request-security.md @@ -0,0 +1,600 @@ +--- +title: "Request Security | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs/rest-api/request-security" +fetched_at: "2026-02-26T10:38:09.213Z" +--- +- Each endpoint has a security type indicating required API key permissions, shown next to the endpoint name (e.g., [New order (TRADE)](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/request-security)). +- If unspecified, the security type is `NONE`. +- Except for `NONE`, all endpoints with a security type are considered `SIGNED` requests (i.e. including a `signature`), except for [listenKey management](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/request-security). +- Secure endpoints require a valid API key to be specified and authenticated. + - API keys can be created on the [API Management](https://www.binance.com/en/support/faq/360002502072) page of your Binance account. + - **Both API key and secret key are sensitive.** Never share them with anyone. If you notice unusual activity in your account, immediately revoke all the keys and contact Binance support. +- API keys can be configured to allow access only to certain types of secure endpoints. + - For example, you can have an API key with `TRADE` permission for trading, while using a separate API key with `USER_DATA` permission to monitor your order status. + - By default, an API key cannot `TRADE`. You need to enable trading in API Management first. + +Security type + +Description + +`NONE` + +Public market data + +`TRADE` + +Trading on the exchange, placing and canceling orders + +`USER_DATA` + +Private account information, such as order status and your trading history + +`USER_STREAM` + +Managing User Data Stream subscriptions + +### SIGNED Endpoint security[​](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/request-security) + +- `SIGNED` endpoints require an additional parameter, `signature`, to be sent in the `query string` or `request body`. + +#### Signature Case Sensitivity[​](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/request-security) + +- **HMAC:** Signatures generated using HMAC are **not case-sensitive**. This means the signature string can be verified regardless of letter casing. +- **RSA:** Signatures generated using RSA are **case-sensitive**. +- **Ed25519:** Signatures generated using Ed25519 are also **case-sensitive** + +Please consult [SIGNED request example (HMAC)](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/request-security), [SIGNED request example (RSA)](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/request-security), and [SIGNED request example (Ed25519)](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/request-security) on how to compute signature, depending on which API key type you are using. + +### Timing security[​](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/request-security) + +- `SIGNED` requests also require a `timestamp` parameter which should be the current timestamp either in milliseconds or microseconds. (See [General API Information](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/request-security)) +- An additional optional parameter, `recvWindow`, specifies for how long the request stays valid and may only be specified in milliseconds. + - `recvWindow` supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + - If `recvWindow` is not sent, **it defaults to 5000 milliseconds**. + - Maximum `recvWindow` is 60000 milliseconds. +- Request processing logic is as follows: + +``` +serverTime = getCurrentTime()if (timestamp < (serverTime + 1 second) && (serverTime - timestamp) <= recvWindow) { // begin processing request serverTime = getCurrentTime() if (serverTime - timestamp) <= recvWindow { // forward request to Matching Engine } else { // reject request } // finish processing request} else { // reject request} +``` + +**Serious trading is about timing.** Networks can be unstable and unreliable, which can lead to requests taking varying amounts of time to reach the servers. With `recvWindow`, you can specify that the request must be processed within a certain number of milliseconds or be rejected by the server. + +**It is recommended to use a small recvWindow of 5000 or less! The max cannot go beyond 60,000!** + +### SIGNED Endpoint Examples for POST /api/v3/order[​](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/request-security) + +#### HMAC Keys[​](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/request-security) + +The signature payload of your request is the query string concatenated without separator to the HTTP body. Any non-ASCII character must be percent-encoded before signing. + +Here is a step-by-step example of how to send a valid signed payload from the Linux command line using `echo`, `openssl`, and `curl`. There is one example with a symbol name comprised entirely of ASCII characters and one example with a symbol name containing non-ASCII characters. + +Example API key and secret key: + +Key + +Value + +`apiKey` + +vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A + +`secretKey` + +NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j + +**WARNING: DO NOT SHARE YOUR API KEY AND SECRET KEY WITH ANYONE.** + +The example keys are provided here only for illustrative purposes. + +Example of request with a symbol name comprised entirely of ASCII characters: + +Parameter + +Value + +`symbol` + +LTCBTC + +`side` + +BUY + +`type` + +LIMIT + +`timeInForce` + +GTC + +`quantity` + +1 + +`price` + +0.1 + +`recvWindow` + +5000 + +`timestamp` + +1499827319559 + +Example of a request with a symbol name containing non-ASCII characters: + +Parameter + +Value + +`symbol` + +123456 + +`side` + +BUY + +`type` + +LIMIT + +`timeInForce` + +GTC + +`quantity` + +1 + +`price` + +0.1 + +`recvWindow` + +5000 + +`timestamp` + +1499827319559 + +**Step 1: Construct the signature payload** + +1. Format parameters as `parameter=value` pairs separated by `&`. +2. Percent-encode the string. + +For the first set of example parameters (ASCII only), the `parameter=value` string should look like this: + +``` +symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559 +``` + +After percent-encoding, the signature payload should look like this: + +``` +symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559 +``` + +For the second set of example parameters (some non-ASCII characters), the `parameter=value` string should look like this: + +``` +symbol=123456&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559 +``` + +After percent-encoding, the signature payload should look like this: + +``` +symbol=%EF%BC%91%EF%BC%92%EF%BC%93%EF%BC%94%EF%BC%95%EF%BC%96&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559 +``` + +**Step 2: Compute the signature** + +1. Use the `secretKey` of your API key as the signing key for the HMAC-SHA-256 algorithm. +2. Sign the signature payload constructed in Step 1. +3. Encode the HMAC-SHA-256 output as a hex string. + +Note that `secretKey` and the payload are **case-sensitive**, while the resulting signature value is case-insensitive. + +**Example commands** + +For the first set of example parameters (ASCII only): + +``` +$ echo -n "symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559" | openssl dgst -sha256 -hmac "NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j"c8db56825ae71d6d79447849e617115f4a920fa2acdcab2b053c4b2838bd6b71 +``` + +For the second set of example parameters (some non-ASCII characters): + +``` +$ echo -n "symbol=%EF%BC%91%EF%BC%92%EF%BC%93%EF%BC%94%EF%BC%95%EF%BC%96&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559" | openssl dgst -sha256 -hmac "NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j"e1353ec6b14d888f1164ae9af8228a3dbd508bc82eb867db8ab6046442f33ef3 +``` + +**Step 3: Add signature to the request** + +Complete the request by adding the `signature` parameter to the query string. + +For the first set of example parameters (ASCII only): + +``` +curl -s -v -H "X-MBX-APIKEY: $apiKey" -X POST "https://api.binance.com/api/v3/order?symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559&signature=c8db56825ae71d6d79447849e617115f4a920fa2acdcab2b053c4b2838bd6b71" +``` + +For the second set of example parameters (some non-ASCII characters) + +``` +curl -s -v -H "X-MBX-APIKEY: $apiKey" -X POST "https://api.binance.com/api/v3/order?symbol=%EF%BC%91%EF%BC%92%EF%BC%93%EF%BC%94%EF%BC%95%EF%BC%96&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559&signature=e1353ec6b14d888f1164ae9af8228a3dbd508bc82eb867db8ab6046442f33ef3" +``` + +Here is a sample Bash script performing all the steps above: + +``` +apiKey="vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A"secretKey="NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j"payload="symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559"# Sign the requestsignature=$(echo -n "$payload" | openssl dgst -sha256 -hmac "$secretKey")signature=${signature#*= } # Keep only the part after the "= "# Send the requestcurl -H "X-MBX-APIKEY: $apiKey" -X POST "https://api.binance.com/api/v3/order?$payload&signature=$signature" +``` + +#### RSA Keys[​](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/request-security) + +The signature payload of your request is the query string concatenated without separator to the HTTP body. Any non-ASCII character must be percent-encoded before signing. + +To get your API key, you need to upload your RSA Public Key to your account and a corresponding API key will be provided for you. + +Only `PKCS#8` keys are supported. + +There is one example with a symbol name comprised entirely of ASCII characters and one example with a symbol name containing non-ASCII characters. + +These examples assume the private key is stored in the file `./test-prv-key.pem`. + +Key + +Value + +`apiKey` + +CAvIjXy3F44yW6Pou5k8Dy1swsYDWJZLeoK2r8G4cFDnE9nosRppc2eKc1T8TRTQ + +Example of request with a symbol name comprised entirely of ASCII characters: + +Parameter + +Value + +`symbol` + +BTCUSDT + +`side` + +SELL + +`type` + +LIMIT + +`timeInForce` + +GTC + +`quantity` + +1 + +`price` + +0.2 + +`timestamp` + +1668481559918 + +`recvWindow` + +5000 + +Example of a request with a symbol name containing non-ASCII characters: + +Parameter + +Value + +`symbol` + +123456 + +`side` + +SELL + +`type` + +LIMIT + +`timeInForce` + +GTC + +`quantity` + +1 + +`price` + +0.2 + +`timestamp` + +1668481559918 + +`recvWindow` + +5000 + +**Step 1: Construct the signature payload** + +1. Format parameters as `parameter=value` pairs separated by `&`. +2. Percent-encode the string. + +For the first set of example parameters (ASCII only), the `parameter=value` string should look like this: + +``` +symbol=BTCUSDT&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000 +``` + +After percent-encoding, the signature payload should look like this: + +``` +symbol=BTCUSDT&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000 +``` + +For the second set of example parameters (some non-ASCII characters), the `parameter=value` string should look like this: + +``` +symbol=123456=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000 +``` + +After percent-encoding, the signature payload should look like this: + +``` +symbol=%EF%BC%91%EF%BC%92%EF%BC%93%EF%BC%94%EF%BC%95%EF%BC%96&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000 +``` + +**Step 2: Compute the signature** + +1. Sign the signature payload constructed in Step 1 using the RSASSA-PKCS1-v1\_5 algorithm with SHA-256 hash function. +2. Encode the output in base64. + +Note that the payload and the resulting `signature` are **case-sensitive**. + +For the first set of example parameters (ASCII only): + +``` +$ echo -n 'symbol=BTCUSDT&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000' | openssl dgst -sha256 -sign ./test-prv-key.pem | openssl enc -base64 -A | tr -d '\n'HZ8HOjiJ1s/igS9JA+n7+7Ti/ihtkRF5BIWcPIEluJP6tlbFM/Bf44LfZka/iemtahZAZzcO9TnI5uaXh3++lrqtNonCwp6/245UFWkiW1elpgtVAmJPbogcAv6rSlokztAfWk296ZJXzRDYAtzGH0gq7CgSJKfH+XxaCmR0WcvlKjNQnp12/eKXJYO4tDap8UCBLuyxDnR7oJKLHQHJLP0r0EAVOOSIbrFang/1WOq+Jaq4Efc4XpnTgnwlBbWTmhWDR1pvS9iVEzcSYLHT/fNnMRxFc7u+j3qI//5yuGuu14KR0MuQKKCSpViieD+fIti46sxPTsjSemoUKp0oXA== +``` + +For the second set of example parameters (some non-ASCII characters): + +``` +$ echo -n 'symbol=%EF%BC%91%EF%BC%92%EF%BC%93%EF%BC%94%EF%BC%95%EF%BC%96&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000' | openssl dgst -sha256 -sign ./test-prv-key.pem | openssl enc -base64 -A | tr -d '\n'qJtv66wyp/1mZE+mIFAAMUoTe8xkmLN7/eAZjuC9x1ocxovItHLl/sNK7Wq8QjgiHqGn0bb8P7yVvGBEd1gFe71NQ8aM0M+JNIMz5UFxfeA53rXjFlvsyH1Sig+OuO9Nz5nhCaJ6bEfj2iuv7w27pB3L8MVqmoCi6D9C/QMiLxtPaR70CxtnvoOlIgPmpv2bQy029A31NEK19ieVLkoyp1EUkXRaX3v0mohx8yMnUG1dhX9nUg3Oy8TYZ03DQy7kHDGkMKisNX7rt/GuGx1HIgjFclDGLsbAFIodvSLjm9FbseasMELoxlAJDlwRnW8zo5sQmL0Fz7ao935QBynrng== +``` + +3. Percent-encode the base64 string. + +For the first set of example parameters (ASCII only): + +``` +HZ8HOjiJ1s%2FigS9JA%2Bn7%2B7Ti%2FihtkRF5BIWcPIEluJP6tlbFM%2FBf44LfZka%2FiemtahZAZzcO9TnI5uaXh3%2B%2BlrqtNonCwp6%2F245UFWkiW1elpgtVAmJPbogcAv6rSlokztAfWk296ZJXzRDYAtzGH0gq7CgSJKfH%2BXxaCmR0WcvlKjNQnp12%2FeKXJYO4tDap8UCBLuyxDnR7oJKLHQHJLP0r0EAVOOSIbrFang%2F1WOq%2BJaq4Efc4XpnTgnwlBbWTmhWDR1pvS9iVEzcSYLHT%2FfNnMRxFc7u%2Bj3qI%2F%2F5yuGuu14KR0MuQKKCSpViieD%2BfIti46sxPTsjSemoUKp0oXA%3D%3D +``` + +For the second set of example parameters (some non-ASCII characters): + +``` +qJtv66wyp%2F1mZE%2BmIFAAMUoTe8xkmLN7%2FeAZjuC9x1ocxovItHLl%2FsNK7Wq8QjgiHqGn0bb8P7yVvGBEd1gFe71NQ8aM0M%2BJNIMz5UFxfeA53rXjFlvsyH1Sig%2BOuO9Nz5nhCaJ6bEfj2iuv7w27pB3L8MVqmoCi6D9C%2FQMiLxtPaR70CxtnvoOlIgPmpv2bQy029A31NEK19ieVLkoyp1EUkXRaX3v0mohx8yMnUG1dhX9nUg3Oy8TYZ03DQy7kHDGkMKisNX7rt%2FGuGx1HIgjFclDGLsbAFIodvSLjm9FbseasMELoxlAJDlwRnW8zo5sQmL0Fz7ao935QBynrng%3D%3D +``` + +**Step 3: Add signature to the request** + +Complete the request by adding the `signature` parameter to the query string. + +For the first set of example parameters (ASCII only): + +``` +curl -H "X-MBX-APIKEY: CAvIjXy3F44yW6Pou5k8Dy1swsYDWJZLeoK2r8G4cFDnE9nosRppc2eKc1T8TRTQ" -X POST 'https://api.binance.com/api/v3/order?symbol=BTCUSDT&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000&signature=HZ8HOjiJ1s%2FigS9JA%2Bn7%2B7Ti%2FihtkRF5BIWcPIEluJP6tlbFM%2FBf44LfZka%2FiemtahZAZzcO9TnI5uaXh3%2B%2BlrqtNonCwp6%2F245UFWkiW1elpgtVAmJPbogcAv6rSlokztAfWk296ZJXzRDYAtzGH0gq7CgSJKfH%2BXxaCmR0WcvlKjNQnp12%2FeKXJYO4tDap8UCBLuyxDnR7oJKLHQHJLP0r0EAVOOSIbrFang%2F1WOq%2BJaq4Efc4XpnTgnwlBbWTmhWDR1pvS9iVEzcSYLHT%2FfNnMRxFc7u%2Bj3qI%2F%2F5yuGuu14KR0MuQKKCSpViieD%2BfIti46sxPTsjSemoUKp0oXA%3D%3D' +``` + +For the second set of example parameters (some non-ASCII characters): + +``` +curl -H "X-MBX-APIKEY: CAvIjXy3F44yW6Pou5k8Dy1swsYDWJZLeoK2r8G4cFDnE9nosRppc2eKc1T8TRTQ" -X POST 'https://api.binance.com/api/v3/order?symbol=%EF%BC%91%EF%BC%92%EF%BC%93%EF%BC%94%EF%BC%95%EF%BC%96&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000&signature=qJtv66wyp%2F1mZE%2BmIFAAMUoTe8xkmLN7%2FeAZjuC9x1ocxovItHLl%2FsNK7Wq8QjgiHqGn0bb8P7yVvGBEd1gFe71NQ8aM0M%2BJNIMz5UFxfeA53rXjFlvsyH1Sig%2BOuO9Nz5nhCaJ6bEfj2iuv7w27pB3L8MVqmoCi6D9C%2FQMiLxtPaR70CxtnvoOlIgPmpv2bQy029A31NEK19ieVLkoyp1EUkXRaX3v0mohx8yMnUG1dhX9nUg3Oy8TYZ03DQy7kHDGkMKisNX7rt%2FGuGx1HIgjFclDGLsbAFIodvSLjm9FbseasMELoxlAJDlwRnW8zo5sQmL0Fz7ao935QBynrng%3D%3D' +``` + +Here is a sample Bash script performing all the steps above: + +``` +function rawurlencode { local string="${1}" local strlen=${#string} local encoded="" local pos c o for (( pos=0 ; pos Last Price > Stop Price + - `BUY`: Limit Price < Last Price < Stop Price +- Quantity Restrictions: + - Both legs must have the same quantity. + - `ICEBERG` quantities however do not have to be the same +- `OCO` adds **2 orders** to the `EXCHANGE_MAX_ORDERS` filter and the `MAX_NUM_ORDERS` filter. + +**Weight:** 1 + +**Unfilled Order Count:** 2 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +listClientOrderId + +STRING + +NO + +A unique Id for the entire orderList + +side + +ENUM + +YES + +quantity + +DECIMAL + +YES + +limitClientOrderId + +STRING + +NO + +A unique Id for the limit order + +price + +DECIMAL + +YES + +limitStrategyId + +LONG + +NO + +limitStrategyType + +INT + +NO + +The value cannot be less than `1000000`. + +limitIcebergQty + +DECIMAL + +NO + +Used to make the `LIMIT_MAKER` leg an iceberg order. + +trailingDelta + +LONG + +NO + +stopClientOrderId + +STRING + +NO + +A unique Id for the stop loss/stop loss limit leg + +stopPrice + +DECIMAL + +YES + +stopStrategyId + +LONG + +NO + +stopStrategyType + +INT + +NO + +The value cannot be less than `1000000`. + +stopLimitPrice + +DECIMAL + +NO + +If provided, `stopLimitTimeInForce` is required. + +stopIcebergQty + +DECIMAL + +NO + +Used with `STOP_LOSS_LIMIT` leg to make an iceberg order. + +stopLimitTimeInForce + +ENUM + +NO + +Valid values are `GTC`/`FOK`/`IOC` + +newOrderRespType + +ENUM + +NO + +Set the response JSON. + +selfTradePreventionMode + +ENUM + +NO + +The allowed enums is dependent on what is configured on the symbol. The possible supported values are: [STP Modes](https://developers.binance.com/docs/binance-spot-api-docs/enums). + +recvWindow + +DECIMAL + +NO + +The value cannot be greater than `60000`. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +timestamp + +LONG + +YES + +**Data Source:** Matching Engine + +**Response:** + +``` +{ "orderListId": 0, "contingencyType": "OCO", "listStatusType": "EXEC_STARTED", "listOrderStatus": "EXECUTING", "listClientOrderId": "JYVpp3F0f5CAG15DhtrqLp", "transactionTime": 1563417480525, "symbol": "LTCBTC", "orders": [ { "symbol": "LTCBTC", "orderId": 2, "clientOrderId": "Kk7sqHb9J6mJWTMDVW7Vos" }, { "symbol": "LTCBTC", "orderId": 3, "clientOrderId": "xTXKaGYd4bluPVp78IVRvl" } ], "orderReports": [ { "symbol": "LTCBTC", "orderId": 2, "orderListId": 0, "clientOrderId": "Kk7sqHb9J6mJWTMDVW7Vos", "transactTime": 1563417480525, "price": "0.000000", "origQty": "0.624363", "executedQty": "0.000000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "0.000000", "status": "NEW", "timeInForce": "GTC", "type": "STOP_LOSS", "side": "BUY", "stopPrice": "0.960664", "workingTime": -1, "selfTradePreventionMode": "NONE" }, { "symbol": "LTCBTC", "orderId": 3, "orderListId": 0, "clientOrderId": "xTXKaGYd4bluPVp78IVRvl", "transactTime": 1563417480525, "price": "0.036435", "origQty": "0.624363", "executedQty": "0.000000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "0.000000", "status": "NEW", "timeInForce": "GTC", "type": "LIMIT_MAKER", "side": "BUY", "workingTime": 1563417480525, "selfTradePreventionMode": "NONE" } ]} +``` + +#### New Order list - OCO (TRADE)[​](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints) + +``` +POST /api/v3/orderList/oco +``` + +Send in an one-cancels-the-other (OCO) pair, where activation of one order immediately cancels the other. + +- An OCO has 2 orders called the **above order** and **below order**. +- One of the orders must be a `LIMIT_MAKER/TAKE_PROFIT/TAKE_PROFIT_LIMIT` order and the other must be `STOP_LOSS` or `STOP_LOSS_LIMIT` order. +- Price restrictions + - If the OCO is on the `SELL` side: + - `LIMIT_MAKER/TAKE_PROFIT_LIMIT` `price` > Last Traded Price > `STOP_LOSS/STOP_LOSS_LIMIT` `stopPrice` + - `TAKE_PROFIT stopPrice` > Last Traded Price > `STOP_LOSS/STOP_LOSS_LIMIT stopPrice` + - If the OCO is on the `BUY` side: + - `LIMIT_MAKER/TAKE_PROFIT_LIMIT price` < Last Traded Price < `stopPrice` + - `TAKE_PROFIT stopPrice` < Last Traded Price < `STOP_LOSS/STOP_LOSS_LIMIT stopPrice` +- OCOs add **2 orders** to the `EXCHANGE_MAX_ORDERS` filter and the `MAX_NUM_ORDERS` filter. + +**Weight:** 1 + +**Unfilled Order Count:** 2 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +Yes + +listClientOrderId + +STRING + +No + +Arbitrary unique ID among open order lists. Automatically generated if not sent. +A new order list with the same `listClientOrderId` is accepted only when the previous one is filled or completely expired. +`listClientOrderId` is distinct from the `aboveClientOrderId` and the `belowCLientOrderId`. + +side + +ENUM + +Yes + +`BUY` or `SELL` + +quantity + +DECIMAL + +Yes + +Quantity for both orders of the order list. + +aboveType + +ENUM + +Yes + +Supported values: `STOP_LOSS_LIMIT`, `STOP_LOSS`, `LIMIT_MAKER`, `TAKE_PROFIT`, `TAKE_PROFIT_LIMIT` + +aboveClientOrderId + +STRING + +No + +Arbitrary unique ID among open orders for the above order. Automatically generated if not sent + +aboveIcebergQty + +LONG + +No + +Note that this can only be used if `aboveTimeInForce` is `GTC`. + +abovePrice + +DECIMAL + +No + +Can be used if `aboveType` is `STOP_LOSS_LIMIT` , `LIMIT_MAKER`, or `TAKE_PROFIT_LIMIT` to specify the limit price. + +aboveStopPrice + +DECIMAL + +No + +Can be used if `aboveType` is `STOP_LOSS`, `STOP_LOSS_LIMIT`, `TAKE_PROFIT`, `TAKE_PROFIT_LIMIT`. +Either `aboveStopPrice` or `aboveTrailingDelta` or both, must be specified. + +aboveTrailingDelta + +LONG + +No + +See [Trailing Stop order FAQ](https://developers.binance.com/docs/binance-spot-api-docs/faqs/trailing-stop-faq). + +aboveTimeInForce + +ENUM + +No + +Required if `aboveType` is `STOP_LOSS_LIMIT` or `TAKE_PROFIT_LIMIT` + +aboveStrategyId + +LONG + +No + +Arbitrary numeric value identifying the above order within an order strategy. + +aboveStrategyType + +INT + +No + +Arbitrary numeric value identifying the above order strategy. +Values smaller than 1000000 are reserved and cannot be used. + +abovePegPriceType + +ENUM + +NO + +See [Pegged Orders](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints) + +abovePegOffsetType + +ENUM + +NO + +abovePegOffsetValue + +INT + +NO + +belowType + +ENUM + +Yes + +Supported values: `STOP_LOSS`, `STOP_LOSS_LIMIT`, `TAKE_PROFIT`,`TAKE_PROFIT_LIMIT` + +belowClientOrderId + +STRING + +No + +Arbitrary unique ID among open orders for the below order. Automatically generated if not sent + +belowIcebergQty + +LONG + +No + +Note that this can only be used if `belowTimeInForce` is `GTC`. + +belowPrice + +DECIMAL + +No + +Can be used if `belowType` is `STOP_LOSS_LIMIT`, `LIMIT_MAKER`, or `TAKE_PROFIT_LIMIT` to specify the limit price. + +belowStopPrice + +DECIMAL + +No + +Can be used if `belowType` is `STOP_LOSS`, `STOP_LOSS_LIMIT, TAKE_PROFIT` or `TAKE_PROFIT_LIMIT` +Either belowStopPrice or belowTrailingDelta or both, must be specified. + +belowTrailingDelta + +LONG + +No + +See [Trailing Stop order FAQ](https://developers.binance.com/docs/binance-spot-api-docs/faqs/trailing-stop-faq). + +belowTimeInForce + +ENUM + +No + +Required if `belowType` is `STOP_LOSS_LIMIT` or `TAKE_PROFIT_LIMIT`. + +belowStrategyId + +LONG + +No + +Arbitrary numeric value identifying the below order within an order strategy. + +belowStrategyType + +INT + +No + +Arbitrary numeric value identifying the below order strategy. +Values smaller than 1000000 are reserved and cannot be used. + +belowPegPriceType + +ENUM + +NO + +See [Pegged Orders](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints) + +belowPegOffsetType + +ENUM + +NO + +belowPegOffsetValue + +INT + +NO + +newOrderRespType + +ENUM + +No + +Select response format: `ACK`, `RESULT`, `FULL` + +selfTradePreventionMode + +ENUM + +No + +The allowed enums is dependent on what is configured on the symbol. Supported values: [STP Modes](https://developers.binance.com/docs/binance-spot-api-docs/enums) + +recvWindow + +DECIMAL + +No + +The value cannot be greater than `60000`. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +timestamp + +LONG + +Yes + +**Data Source:** Matching Engine + +**Response:** + +Response format for `orderReports` is selected using the `newOrderRespType` parameter. The following example is for the `RESULT` response type. See [`POST /api/v3/order`](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints) for more examples. + +``` +{ "orderListId": 1, "contingencyType": "OCO", "listStatusType": "EXEC_STARTED", "listOrderStatus": "EXECUTING", "listClientOrderId": "lH1YDkuQKWiXVXHPSKYEIp", "transactionTime": 1710485608839, "symbol": "LTCBTC", "orders": [ { "symbol": "LTCBTC", "orderId": 10, "clientOrderId": "44nZvqpemY7sVYgPYbvPih" }, { "symbol": "LTCBTC", "orderId": 11, "clientOrderId": "NuMp0nVYnciDiFmVqfpBqK" } ], "orderReports": [ { "symbol": "LTCBTC", "orderId": 10, "orderListId": 1, "clientOrderId": "44nZvqpemY7sVYgPYbvPih", "transactTime": 1710485608839, "price": "1.00000000", "origQty": "5.00000000", "executedQty": "0.00000000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "0.00000000", "status": "NEW", "timeInForce": "GTC", "type": "STOP_LOSS_LIMIT", "side": "SELL", "stopPrice": "1.00000000", "workingTime": -1, "icebergQty": "1.00000000", "selfTradePreventionMode": "NONE" }, { "symbol": "LTCBTC", "orderId": 11, "orderListId": 1, "clientOrderId": "NuMp0nVYnciDiFmVqfpBqK", "transactTime": 1710485608839, "price": "3.00000000", "origQty": "5.00000000", "executedQty": "0.00000000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "0.00000000", "status": "NEW", "timeInForce": "GTC", "type": "LIMIT_MAKER", "side": "SELL", "workingTime": 1710485608839, "selfTradePreventionMode": "NONE" } ]} +``` + +#### New Order list - OTO (TRADE)[​](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints) + +``` +POST /api/v3/orderList/oto +``` + +Place an OTO. + +- 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 `EXCHANGE_MAX_NUM_ORDERS` filter and `MAX_NUM_ORDERS` filter. + +**Weight:** 1 + +**Unfilled Order Count:** 2 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +listClientOrderId + +STRING + +NO + +Arbitrary unique ID among open order lists. Automatically generated if not sent. +A new order list with the same listClientOrderId is accepted only when the previous one is filled or completely expired. +`listClientOrderId` is distinct from the `workingClientOrderId` and the `pendingClientOrderId`. + +newOrderRespType + +ENUM + +NO + +Format of the JSON response. Supported values: [Order Response Type](https://developers.binance.com/docs/binance-spot-api-docs/enums) + +selfTradePreventionMode + +ENUM + +NO + +The allowed values are dependent on what is configured on the symbol. Supported values: [STP Modes](https://developers.binance.com/docs/binance-spot-api-docs/enums) + +workingType + +ENUM + +YES + +Supported values: `LIMIT`,`LIMIT_MAKER` + +workingSide + +ENUM + +YES + +Supported values: [Order Side](https://developers.binance.com/docs/binance-spot-api-docs/enums) + +workingClientOrderId + +STRING + +NO + +Arbitrary unique ID among open orders for the working order. +Automatically generated if not sent. + +workingPrice + +DECIMAL + +YES + +workingQuantity + +DECIMAL + +YES + +Sets the quantity for the working order. + +workingIcebergQty + +DECIMAL + +NO + +This can only be used if `workingTimeInForce` is `GTC`, or if `workingType` is `LIMIT_MAKER`. + +workingTimeInForce + +ENUM + +NO + +Supported values: [Time In Force](https://developers.binance.com/docs/binance-spot-api-docs/enums) + +workingStrategyId + +LONG + +NO + +Arbitrary numeric value identifying the working order within an order strategy. + +workingStrategyType + +INT + +NO + +Arbitrary numeric value identifying the working order strategy. +Values smaller than 1000000 are reserved and cannot be used. + +workingPegPriceType + +ENUM + +NO + +See [Pegged Orders](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints) + +workingPegOffsetType + +ENUM + +NO + +workingPegOffsetValue + +INT + +NO + +pendingType + +ENUM + +YES + +Supported values: [Order Types](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints) +Note that `MARKET` orders using `quoteOrderQty` are not supported. + +pendingSide + +ENUM + +YES + +Supported values: [Order Side](https://developers.binance.com/docs/binance-spot-api-docs/enums) + +pendingClientOrderId + +STRING + +NO + +Arbitrary unique ID among open orders for the pending order. +Automatically generated if not sent. + +pendingPrice + +DECIMAL + +NO + +pendingStopPrice + +DECIMAL + +NO + +pendingTrailingDelta + +DECIMAL + +NO + +pendingQuantity + +DECIMAL + +YES + +Sets the quantity for the pending order. + +pendingIcebergQty + +DECIMAL + +NO + +This can only be used if `pendingTimeInForce` is `GTC` or if `pendingType` is `LIMIT_MAKER`. + +pendingTimeInForce + +ENUM + +NO + +Supported values: [Time In Force](https://developers.binance.com/docs/binance-spot-api-docs/enums) + +pendingStrategyId + +LONG + +NO + +Arbitrary numeric value identifying the pending order within an order strategy. + +pendingStrategyType + +INT + +NO + +Arbitrary numeric value identifying the pending order strategy. +Values smaller than 1000000 are reserved and cannot be used. + +pendingPegPriceType + +ENUM + +NO + +See [Pegged Orders](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints) + +pendingPegOffsetType + +ENUM + +NO + +pendingPegOffsetValue + +INT + +NO + +recvWindow + +DECIMAL + +NO + +The value cannot be greater than `60000`. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +timestamp + +LONG + +YES + +**Mandatory parameters based on `pendingType` or `workingType`** + +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` + +**Data Source:** + +Matching Engine + +**Response:** + +``` +{ "orderListId": 0, "contingencyType": "OTO", "listStatusType": "EXEC_STARTED", "listOrderStatus": "EXECUTING", "listClientOrderId": "yl2ERtcar1o25zcWtqVBTC", "transactionTime": 1712289389158, "symbol": "LTCBTC", "orders": [ { "symbol": "LTCBTC", "orderId": 4, "clientOrderId": "Bq17mn9fP6vyCn75Jw1xya" }, { "symbol": "LTCBTC", "orderId": 5, "clientOrderId": "arLFo0zGJVDE69cvGBaU0d" } ], "orderReports": [ { "symbol": "LTCBTC", "orderId": 4, "orderListId": 0, "clientOrderId": "Bq17mn9fP6vyCn75Jw1xya", "transactTime": 1712289389158, "price": "1.00000000", "origQty": "1.00000000", "executedQty": "0.00000000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "0.00000000", "status": "NEW", "timeInForce": "GTC", "type": "LIMIT", "side": "SELL", "workingTime": 1712289389158, "selfTradePreventionMode": "NONE" }, { "symbol": "LTCBTC", "orderId": 5, "orderListId": 0, "clientOrderId": "arLFo0zGJVDE69cvGBaU0d", "transactTime": 1712289389158, "price": "0.00000000", "origQty": "5.00000000", "executedQty": "0.00000000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "0.00000000", "status": "PENDING_NEW", "timeInForce": "GTC", "type": "MARKET", "side": "BUY", "workingTime": -1, "selfTradePreventionMode": "NONE" } ]} +``` + +**Note:** The payload above does not show all fields that can appear. Please refer to [Conditional fields in Order Responses](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints). + +#### New Order list - OTOCO (TRADE)[​](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints) + +``` +POST /api/v3/orderList/otoco +``` + +Place an OTOCO. + +- 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](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints). +- 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](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints). +- OTOCOs add **3 orders** to the `EXCHANGE_MAX_NUM_ORDERS` filter and `MAX_NUM_ORDERS` filter. + +**Weight:** 1 + +**Unfilled Order Count:** 3 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +listClientOrderId + +STRING + +NO + +Arbitrary unique ID among open order lists. Automatically generated if not sent. +A new order list with the same listClientOrderId is accepted only when the previous one is filled or completely expired. +`listClientOrderId` is distinct from the `workingClientOrderId`, `pendingAboveClientOrderId`, and the `pendingBelowClientOrderId`. + +newOrderRespType + +ENUM + +NO + +Format of the JSON response. Supported values: [Order Response Type](https://developers.binance.com/docs/binance-spot-api-docs/enums) + +selfTradePreventionMode + +ENUM + +NO + +The allowed values are dependent on what is configured on the symbol. Supported values: [STP Modes](https://developers.binance.com/docs/binance-spot-api-docs/enums) + +workingType + +ENUM + +YES + +Supported values: `LIMIT`, `LIMIT_MAKER` + +workingSide + +ENUM + +YES + +Supported values: [Order side](https://developers.binance.com/docs/binance-spot-api-docs/enums) + +workingClientOrderId + +STRING + +NO + +Arbitrary unique ID among open orders for the working order. +Automatically generated if not sent. + +workingPrice + +DECIMAL + +YES + +workingQuantity + +DECIMAL + +YES + +workingIcebergQty + +DECIMAL + +NO + +This can only be used if `workingTimeInForce` is `GTC` or if `workingType` is `LIMIT_MAKER`. + +workingTimeInForce + +ENUM + +NO + +Supported values: [Time In Force](https://developers.binance.com/docs/binance-spot-api-docs/enums) + +workingStrategyId + +LONG + +NO + +Arbitrary numeric value identifying the working order within an order strategy. + +workingStrategyType + +INT + +NO + +Arbitrary numeric value identifying the working order strategy. +Values smaller than 1000000 are reserved and cannot be used. + +workingPegPriceType + +ENUM + +NO + +See [Pegged Orders](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints) + +workingPegOffsetType + +ENUM + +NO + +workingPegOffsetValue + +INT + +NO + +pendingSide + +ENUM + +YES + +Supported values: [Order side](https://developers.binance.com/docs/binance-spot-api-docs/enums) + +pendingQuantity + +DECIMAL + +YES + +pendingAboveType + +ENUM + +YES + +Supported values: `STOP_LOSS_LIMIT`, `STOP_LOSS`, `LIMIT_MAKER`, `TAKE_PROFIT`, `TAKE_PROFIT_LIMIT` + +pendingAboveClientOrderId + +STRING + +NO + +Arbitrary unique ID among open orders for the pending above order. +Automatically generated if not sent. + +pendingAbovePrice + +DECIMAL + +NO + +Can be used if `pendingAboveType` is `STOP_LOSS_LIMIT` , `LIMIT_MAKER`, or `TAKE_PROFIT_LIMIT` to specify the limit price. + +pendingAboveStopPrice + +DECIMAL + +NO + +Can be used if `pendingAboveType` is `STOP_LOSS`, `STOP_LOSS_LIMIT`, `TAKE_PROFIT`, `TAKE_PROFIT_LIMIT` + +pendingAboveTrailingDelta + +DECIMAL + +NO + +See [Trailing Stop FAQ](https://developers.binance.com/docs/binance-spot-api-docs/faqs/trailing-stop-faq) + +pendingAboveIcebergQty + +DECIMAL + +NO + +This can only be used if `pendingAboveTimeInForce` is `GTC` or if `pendingAboveType` is `LIMIT_MAKER`. + +pendingAboveTimeInForce + +ENUM + +NO + +pendingAboveStrategyId + +LONG + +NO + +Arbitrary numeric value identifying the pending above order within an order strategy. + +pendingAboveStrategyType + +INT + +NO + +Arbitrary numeric value identifying the pending above order strategy. +Values smaller than 1000000 are reserved and cannot be used. + +pendingAbovePegPriceType + +ENUM + +NO + +See [Pegged Orders](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints) + +pendingAbovePegOffsetType + +ENUM + +NO + +pendingAbovePegOffsetValue + +INT + +NO + +pendingBelowType + +ENUM + +NO + +Supported values: `STOP_LOSS`, `STOP_LOSS_LIMIT`, `TAKE_PROFIT`,`TAKE_PROFIT_LIMIT` + +pendingBelowClientOrderId + +STRING + +NO + +Arbitrary unique ID among open orders for the pending below order. +Automatically generated if not sent. + +pendingBelowPrice + +DECIMAL + +NO + +Can be used if `pendingBelowType` is `STOP_LOSS_LIMIT` or `TAKE_PROFIT_LIMIT` to specify limit price + +pendingBelowStopPrice + +DECIMAL + +NO + +Can be used if `pendingBelowType` is `STOP_LOSS`, `STOP_LOSS_LIMIT, TAKE_PROFIT or TAKE_PROFIT_LIMIT`. +Either `pendingBelowStopPrice` or `pendingBelowTrailingDelta` or both, must be specified. + +pendingBelowTrailingDelta + +DECIMAL + +NO + +pendingBelowIcebergQty + +DECIMAL + +NO + +This can only be used if `pendingBelowTimeInForce` is `GTC`, or if `pendingBelowType` is `LIMIT_MAKER`. + +pendingBelowTimeInForce + +ENUM + +NO + +Supported values: [Time In Force](https://developers.binance.com/docs/binance-spot-api-docs/enums) + +pendingBelowStrategyId + +LONG + +NO + +Arbitrary numeric value identifying the pending below order within an order strategy. + +pendingBelowStrategyType + +INT + +NO + +Arbitrary numeric value identifying the pending below order strategy. +Values smaller than 1000000 are reserved and cannot be used. + +pendingBelowPegPriceType + +ENUM + +NO + +See [Pegged Orders](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints) + +pendingBelowPegOffsetType + +ENUM + +NO + +pendingBelowPegOffsetValue + +INT + +NO + +recvWindow + +DECIMAL + +NO + +The value cannot be greater than `60000`. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +timestamp + +LONG + +YES + +**Mandatory parameters based on `pendingAboveType`, `pendingBelowType` or `workingType`** + +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/TAKE_PROFIT` + +`pendingAboveStopPrice` and/or `pendingAboveTrailingDelta` + +`pendingAboveType=STOP_LOSS_LIMIT/TAKE_PROFIT_LIMIT` + +`pendingAbovePrice`, `pendingAboveStopPrice` and/or `pendingAboveTrailingDelta`, `pendingAboveTimeInForce` + +`pendingBelowType`\= `LIMIT_MAKER` + +`pendingBelowPrice` + +`pendingBelowType= STOP_LOSS/TAKE_PROFIT` + +`pendingBelowStopPrice` and/or `pendingBelowTrailingDelta` + +`pendingBelowType=STOP_LOSS_LIMIT/TAKE_PROFIT_LIMIT` + +`pendingBelowPrice`, `pendingBelowStopPrice` and/or `pendingBelowTrailingDelta`, `pendingBelowTimeInForce` + +**Data Source:** + +Matching Engine + +**Response:** + +``` +{ "orderListId": 1, "contingencyType": "OTO", "listStatusType": "EXEC_STARTED", "listOrderStatus": "EXECUTING", "listClientOrderId": "RumwQpBaDctlUu5jyG5rs0", "transactionTime": 1712291372842, "symbol": "LTCBTC", "orders": [ { "symbol": "LTCBTC", "orderId": 6, "clientOrderId": "fM9Y4m23IFJVCQmIrlUmMK" }, { "symbol": "LTCBTC", "orderId": 7, "clientOrderId": "6pcQbFIzTXGZQ1e2MkGDq4" }, { "symbol": "LTCBTC", "orderId": 8, "clientOrderId": "r4JMv9cwAYYUwwBZfbussx" } ], "orderReports": [ { "symbol": "LTCBTC", "orderId": 6, "orderListId": 1, "clientOrderId": "fM9Y4m23IFJVCQmIrlUmMK", "transactTime": 1712291372842, "price": "1.00000000", "origQty": "1.00000000", "executedQty": "0.00000000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "0.00000000", "status": "NEW", "timeInForce": "GTC", "type": "LIMIT", "side": "SELL", "workingTime": 1712291372842, "selfTradePreventionMode": "NONE" }, { "symbol": "LTCBTC", "orderId": 7, "orderListId": 1, "clientOrderId": "6pcQbFIzTXGZQ1e2MkGDq4", "transactTime": 1712291372842, "price": "1.00000000", "origQty": "5.00000000", "executedQty": "0.00000000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "0.00000000", "status": "PENDING_NEW", "timeInForce": "IOC", "type": "STOP_LOSS_LIMIT", "side": "BUY", "stopPrice": "6.00000000", "workingTime": -1, "selfTradePreventionMode": "NONE" }, { "symbol": "LTCBTC", "orderId": 8, "orderListId": 1, "clientOrderId": "r4JMv9cwAYYUwwBZfbussx", "transactTime": 1712291372842, "price": "3.00000000", "origQty": "5.00000000", "executedQty": "0.00000000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "0.00000000", "status": "PENDING_NEW", "timeInForce": "GTC", "type": "LIMIT_MAKER", "side": "BUY", "workingTime": -1, "selfTradePreventionMode": "NONE" } ]} +``` + +**Note:** The payload above does not show all fields that can appear. Please refer to [Conditional fields in Order Responses](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints). + +#### New Order List - OPO (TRADE)[​](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints) + +``` +POST /api/v3/orderList/opo +``` + +Place an [OPO](https://developers.binance.com/docs/binance-spot-api-docs/faqs/opo). + +- OPOs add 2 orders to the EXCHANGE\_MAX\_NUM\_ORDERS filter and MAX\_NUM\_ORDERS filter. + +**Weight:** 1 + +**Unfilled Order Count:** 2 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +listClientOrderId + +STRING + +NO + +Arbitrary unique ID among open order lists. Automatically generated if not sent. A new order list with the same listClientOrderId is accepted only when the previous one is filled or completely expired. `listClientOrderId` is distinct from the `workingClientOrderId` and the `pendingClientOrderId`. + +newOrderRespType + +ENUM + +NO + +Format of the JSON response. Supported values: [Order Response Type](https://developers.binance.com/docs/binance-spot-api-docs/enums) + +selfTradePreventionMode + +ENUM + +NO + +The allowed values are dependent on what is configured on the symbol. Supported values: [STP Modes](https://developers.binance.com/docs/binance-spot-api-docs/enums) + +workingType + +ENUM + +YES + +Supported values: `LIMIT`,`LIMIT_MAKER` + +workingSide + +ENUM + +YES + +Supported values: [Order Side](https://developers.binance.com/docs/binance-spot-api-docs/enums) + +workingClientOrderId + +STRING + +NO + +Arbitrary unique ID among open orders for the working order. Automatically generated if not sent. + +workingPrice + +DECIMAL + +YES + +workingQuantity + +DECIMAL + +YES + +Sets the quantity for the working order. + +workingIcebergQty + +DECIMAL + +NO + +This can only be used if `workingTimeInForce` is `GTC`, or if `workingType` is `LIMIT_MAKER`. + +workingTimeInForce + +ENUM + +NO + +Supported values: [Time In Force](https://developers.binance.com/docs/binance-spot-api-docs/enums) + +workingStrategyId + +LONG + +NO + +Arbitrary numeric value identifying the working order within an order strategy. + +workingStrategyType + +INT + +NO + +Arbitrary numeric value identifying the working order strategy. Values smaller than 1000000 are reserved and cannot be used. + +workingPegPriceType + +ENUM + +NO + +See [Pegged Orders](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints) + +workingPegOffsetType + +ENUM + +NO + +workingPegOffsetValue + +INT + +NO + +pendingType + +ENUM + +YES + +Supported values: [Order Types](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints) Note that `MARKET` orders using `quoteOrderQty` are not supported. + +pendingSide + +ENUM + +YES + +Supported values: [Order Side](https://developers.binance.com/docs/binance-spot-api-docs/enums) + +pendingClientOrderId + +STRING + +NO + +Arbitrary unique ID among open orders for the pending order. Automatically generated if not sent. + +pendingPrice + +DECIMAL + +NO + +pendingStopPrice + +DECIMAL + +NO + +pendingTrailingDelta + +DECIMAL + +NO + +pendingIcebergQty + +DECIMAL + +NO + +This can only be used if `pendingTimeInForce` is `GTC` or if `pendingType` is `LIMIT_MAKER`. + +pendingTimeInForce + +ENUM + +NO + +Supported values: [Time In Force](https://developers.binance.com/docs/binance-spot-api-docs/enums) + +pendingStrategyId + +LONG + +NO + +Arbitrary numeric value identifying the pending order within an order strategy. + +pendingStrategyType + +INT + +NO + +Arbitrary numeric value identifying the pending order strategy. Values smaller than 1000000 are reserved and cannot be used. + +pendingPegPriceType + +ENUM + +NO + +See [Pegged Orders](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints) + +pendingPegOffsetType + +ENUM + +NO + +pendingPegOffsetValue + +INT + +NO + +recvWindow + +DECIMAL + +NO + +The value cannot be greater than `60000`. Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +timestamp + +LONG + +YES + +**Data Source**: Matching Engine + +**Response:** + +``` +{ "orderListId": 0, "contingencyType": "OTO", "listStatusType": "EXEC_STARTED", "listOrderStatus": "EXECUTING", "listClientOrderId": "H94qCqO27P74OEiO4X8HOG", "transactionTime": 1762998011671, "symbol": "BTCUSDT", "orders": [ { "symbol": "BTCUSDT", "orderId": 2, "clientOrderId": "JX6xfdjo0wysiGumfHNmPu" }, { "symbol": "BTCUSDT", "orderId": 3, "clientOrderId": "2ZJCY0IjOhuYIMLGN8kU8S" } ], "orderReports": [ { "symbol": "BTCUSDT", "orderId": 2, "orderListId": 0, "clientOrderId": "JX6xfdjo0wysiGumfHNmPu", "transactTime": 1762998011671, "price": "102264.00000000", "origQty": "0.00060000", "executedQty": "0.00000000", "origQuoteOrderQty": "0.00000000", "cummulativeQuoteQty": "0.00000000", "status": "NEW", "timeInForce": "GTC", "type": "LIMIT", "side": "BUY", "workingTime": 1762998011671, "selfTradePreventionMode": "NONE" }, { "symbol": "BTCUSDT", "orderId": 3, "orderListId": 0, "clientOrderId": "2ZJCY0IjOhuYIMLGN8kU8S", "transactTime": 1762998011671, "price": "0.00000000", "executedQty": "0.00000000", "origQuoteOrderQty": "0.00000000", "cummulativeQuoteQty": "0.00000000", "status": "PENDING_NEW", "timeInForce": "GTC", "type": "MARKET", "side": "SELL", "workingTime": -1, "selfTradePreventionMode": "NONE" } ]} +``` + +**Note:** The payload above does not show all fields that can appear. Please refer to [Conditional fields in Order Responses](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints). + +#### New Order List - OPOCO (TRADE)[​](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints) + +``` +POST /api/v3/orderList/opoco +``` + +Place an [OPOCO](https://developers.binance.com/docs/binance-spot-api-docs/faqs/opo). + +**Weight**: 1 + +**Unfilled Order Count:** 3 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +listClientOrderId + +STRING + +NO + +Arbitrary unique ID among open order lists. Automatically generated if not sent. A new order list with the same listClientOrderId is accepted only when the previous one is filled or completely expired. `listClientOrderId` is distinct from the `workingClientOrderId`, `pendingAboveClientOrderId`, and the `pendingBelowClientOrderId`. + +newOrderRespType + +ENUM + +NO + +Format of the JSON response. Supported values: [Order Response Type](https://developers.binance.com/docs/binance-spot-api-docs/enums) + +selfTradePreventionMode + +ENUM + +NO + +The allowed values are dependent on what is configured on the symbol. Supported values: [STP Modes](https://developers.binance.com/docs/binance-spot-api-docs/enums) + +workingType + +ENUM + +YES + +Supported values: `LIMIT`, `LIMIT_MAKER` + +workingSide + +ENUM + +YES + +Supported values: [Order side](https://developers.binance.com/docs/binance-spot-api-docs/enums) + +workingClientOrderId + +STRING + +NO + +Arbitrary unique ID among open orders for the working order. Automatically generated if not sent. + +workingPrice + +DECIMAL + +YES + +workingQuantity + +DECIMAL + +YES + +workingIcebergQty + +DECIMAL + +NO + +This can only be used if `workingTimeInForce` is `GTC` or if `workingType` is `LIMIT_MAKER`. + +workingTimeInForce + +ENUM + +NO + +Supported values: [Time In Force](https://developers.binance.com/docs/binance-spot-api-docs/enums) + +workingStrategyId + +LONG + +NO + +Arbitrary numeric value identifying the working order within an order strategy. + +workingStrategyType + +INT + +NO + +Arbitrary numeric value identifying the working order strategy. Values smaller than 1000000 are reserved and cannot be used. + +workingPegPriceType + +ENUM + +NO + +See [Pegged Orders](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints) + +workingPegOffsetType + +ENUM + +NO + +workingPegOffsetValue + +INT + +NO + +pendingSide + +ENUM + +YES + +Supported values: [Order side](https://developers.binance.com/docs/binance-spot-api-docs/enums) + +pendingAboveType + +ENUM + +YES + +Supported values: `STOP_LOSS_LIMIT`, `STOP_LOSS`, `LIMIT_MAKER`, `TAKE_PROFIT`, `TAKE_PROFIT_LIMIT` + +pendingAboveClientOrderId + +STRING + +NO + +Arbitrary unique ID among open orders for the pending above order. Automatically generated if not sent. + +pendingAbovePrice + +DECIMAL + +NO + +Can be used if `pendingAboveType` is `STOP_LOSS_LIMIT` , `LIMIT_MAKER`, or `TAKE_PROFIT_LIMIT` to specify the limit price. + +pendingAboveStopPrice + +DECIMAL + +NO + +Can be used if `pendingAboveType` is `STOP_LOSS`, `STOP_LOSS_LIMIT`, `TAKE_PROFIT`, `TAKE_PROFIT_LIMIT` + +pendingAboveTrailingDelta + +DECIMAL + +NO + +See [Trailing Stop FAQ](https://developers.binance.com/docs/binance-spot-api-docs/faqs/trailing-stop-faq) + +pendingAboveIcebergQty + +DECIMAL + +NO + +This can only be used if `pendingAboveTimeInForce` is `GTC` or if `pendingAboveType` is `LIMIT_MAKER`. + +pendingAboveTimeInForce + +ENUM + +NO + +pendingAboveStrategyId + +LONG + +NO + +Arbitrary numeric value identifying the pending above order within an order strategy. + +pendingAboveStrategyType + +INT + +NO + +Arbitrary numeric value identifying the pending above order strategy. Values smaller than 1000000 are reserved and cannot be used. + +pendingAbovePegPriceType + +ENUM + +NO + +See [Pegged Orders](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints) + +pendingAbovePegOffsetType + +ENUM + +NO + +pendingAbovePegOffsetValue + +INT + +NO + +pendingBelowType + +ENUM + +NO + +Supported values: `STOP_LOSS`, `STOP_LOSS_LIMIT`, `TAKE_PROFIT`,`TAKE_PROFIT_LIMIT` + +pendingBelowClientOrderId + +STRING + +NO + +Arbitrary unique ID among open orders for the pending below order. Automatically generated if not sent. + +pendingBelowPrice + +DECIMAL + +NO + +Can be used if `pendingBelowType` is `STOP_LOSS_LIMIT` or `TAKE_PROFIT_LIMIT` to specify limit price + +pendingBelowStopPrice + +DECIMAL + +NO + +Can be used if `pendingBelowType` is `STOP_LOSS`, `STOP_LOSS_LIMIT, TAKE_PROFIT or TAKE_PROFIT_LIMIT`. Either `pendingBelowStopPrice` or `pendingBelowTrailingDelta` or both, must be specified. + +pendingBelowTrailingDelta + +DECIMAL + +NO + +pendingBelowIcebergQty + +DECIMAL + +NO + +This can only be used if `pendingBelowTimeInForce` is `GTC`, or if `pendingBelowType` is `LIMIT_MAKER`. + +pendingBelowTimeInForce + +ENUM + +NO + +Supported values: [Time In Force](https://developers.binance.com/docs/binance-spot-api-docs/enums) + +pendingBelowStrategyId + +LONG + +NO + +Arbitrary numeric value identifying the pending below order within an order strategy. + +pendingBelowStrategyType + +INT + +NO + +Arbitrary numeric value identifying the pending below order strategy. Values smaller than 1000000 are reserved and cannot be used. + +pendingBelowPegPriceType + +ENUM + +NO + +See [Pegged Orders](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints) + +pendingBelowPegOffsetType + +ENUM + +NO + +pendingBelowPegOffsetValue + +INT + +NO + +recvWindow + +DECIMAL + +NO + +The value cannot be greater than `60000`. Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +timestamp + +LONG + +YES + +**Response** + +``` +{ "orderListId": 2, "contingencyType": "OTO", "listStatusType": "EXEC_STARTED", "listOrderStatus": "EXECUTING", "listClientOrderId": "bcedxMpQG6nFrZUPQyshoL", "transactionTime": 1763000506354, "symbol": "BTCUSDT", "orders": [ { "symbol": "BTCUSDT", "orderId": 9, "clientOrderId": "OLSBhMWaIlLSzZ9Zm7fnKB" }, { "symbol": "BTCUSDT", "orderId": 10, "clientOrderId": "mfif39yPTHsB3C0FIXznR2" }, { "symbol": "BTCUSDT", "orderId": 11, "clientOrderId": "yINkaXSJeoi3bU5vWMY8Z8" } ], "orderReports": [ { "symbol": "BTCUSDT", "orderId": 9, "orderListId": 2, "clientOrderId": "OLSBhMWaIlLSzZ9Zm7fnKB", "transactTime": 1763000506354, "price": "102496.00000000", "origQty": "0.00170000", "executedQty": "0.00000000", "origQuoteOrderQty": "0.00000000", "cummulativeQuoteQty": "0.00000000", "status": "NEW", "timeInForce": "GTC", "type": "LIMIT", "side": "BUY", "workingTime": 1763000506354, "selfTradePreventionMode": "NONE" }, { "symbol": "BTCUSDT", "orderId": 10, "orderListId": 2, "clientOrderId": "mfif39yPTHsB3C0FIXznR2", "transactTime": 1763000506354, "price": "101613.00000000", "executedQty": "0.00000000", "origQuoteOrderQty": "0.00000000", "cummulativeQuoteQty": "0.00000000", "status": "PENDING_NEW", "timeInForce": "GTC", "type": "STOP_LOSS_LIMIT", "side": "SELL", "stopPrice": "10100.00000000", "workingTime": -1, "selfTradePreventionMode": "NONE" }, { "symbol": "BTCUSDT", "orderId": 11, "orderListId": 2, "clientOrderId": "yINkaXSJeoi3bU5vWMY8Z8", "transactTime": 1763000506354, "price": "104261.00000000", "executedQty": "0.00000000", "origQuoteOrderQty": "0.00000000", "cummulativeQuoteQty": "0.00000000", "status": "PENDING_NEW", "timeInForce": "GTC", "type": "LIMIT_MAKER", "side": "SELL", "workingTime": -1, "selfTradePreventionMode": "NONE" } ]} +``` + +**Note:** The payload above does not show all fields that can appear. Please refer to [Conditional fields in Order Responses](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints). + +#### Cancel Order list (TRADE)[​](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints) + +``` +DELETE /api/v3/orderList +``` + +Cancel an entire Order list + +**Weight:** 1 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +orderListId + +LONG + +NO + +Either `orderListId` or `listClientOrderId` must be provided + +listClientOrderId + +STRING + +NO + +Either `orderListId` or `listClientOrderId` must be provided + +newClientOrderId + +STRING + +NO + +Used to uniquely identify this cancel. Automatically generated by default + +recvWindow + +DECIMAL + +NO + +The value cannot be greater than `60000`. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +timestamp + +LONG + +YES + +**Notes:** + +- Canceling an individual order from an order list will cancel the entire order list. +- If both `orderListId` and `listClientOrderId` parameters are provided, the `orderListId` is searched first, then the `listClientOrderId` from that result is checked against that order. If both conditions are not met the request will be rejected. + +**Data Source:** Matching Engine + +**Response:** + +``` +{ "orderListId": 0, "contingencyType": "OCO", "listStatusType": "ALL_DONE", "listOrderStatus": "ALL_DONE", "listClientOrderId": "C3wyj4WVEktd7u9aVBRXcN", "transactionTime": 1574040868128, "symbol": "LTCBTC", "orders": [ { "symbol": "LTCBTC", "orderId": 2, "clientOrderId": "pO9ufTiFGg3nw2fOdgeOXa" }, { "symbol": "LTCBTC", "orderId": 3, "clientOrderId": "TXOvglzXuaubXAaENpaRCB" } ], "orderReports": [ { "symbol": "LTCBTC", "origClientOrderId": "pO9ufTiFGg3nw2fOdgeOXa", "orderId": 2, "orderListId": 0, "clientOrderId": "unfWT8ig8i0uj6lPuYLez6", "transactTime": 1688005070874, "price": "1.00000000", "origQty": "10.00000000", "executedQty": "0.00000000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "0.00000000", "status": "CANCELED", "timeInForce": "GTC", "type": "STOP_LOSS_LIMIT", "side": "SELL", "stopPrice": "1.00000000", "selfTradePreventionMode": "NONE" }, { "symbol": "LTCBTC", "origClientOrderId": "TXOvglzXuaubXAaENpaRCB", "orderId": 3, "orderListId": 0, "clientOrderId": "unfWT8ig8i0uj6lPuYLez6", "transactTime": 1688005070874, "price": "3.00000000", "origQty": "10.00000000", "executedQty": "0.00000000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "0.00000000", "status": "CANCELED", "timeInForce": "GTC", "type": "LIMIT_MAKER", "side": "SELL", "selfTradePreventionMode": "NONE" } ]} +``` + +### SOR[​](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints) + +#### New order using SOR (TRADE)[​](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints) + +``` +POST /api/v3/sor/order +``` + +Places an order using smart order routing (SOR). + +This adds 1 order to the `EXCHANGE_MAX_ORDERS` filter and the `MAX_NUM_ORDERS` filter. + +Read [SOR FAQ](https://developers.binance.com/docs/binance-spot-api-docs/faqs/sor_faq) to learn more. + +**Weight:** 1 + +**Unfilled Order Count:** 1 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +side + +ENUM + +YES + +type + +ENUM + +YES + +timeInForce + +ENUM + +NO + +quantity + +DECIMAL + +YES + +price + +DECIMAL + +NO + +newClientOrderId + +STRING + +NO + +A unique id among open orders. Automatically generated if not sent. +Orders with the same `newClientOrderID` can be accepted only when the previous one is filled, otherwise the order will be rejected. + +strategyId + +LONG + +NO + +strategyType + +INT + +NO + +The value cannot be less than `1000000`. + +icebergQty + +DECIMAL + +NO + +Used with `LIMIT` to create an iceberg order. + +newOrderRespType + +ENUM + +NO + +Set the response JSON. `ACK`, `RESULT`, or `FULL`. Default to `FULL` + +selfTradePreventionMode + +ENUM + +NO + +The allowed enums is dependent on what is configured on the symbol. The possible supported values are: [STP Modes](https://developers.binance.com/docs/binance-spot-api-docs/enums). + +recvWindow + +DECIMAL + +NO + +The value cannot be greater than `60000`. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +timestamp + +LONG + +YES + +**Note:** `POST /api/v3/sor/order` only supports `LIMIT` and `MARKET` orders. `quoteOrderQty` is not supported. + +**Data Source:** Matching Engine + +**Response:** + +``` +{ "symbol": "BTCUSDT", "orderId": 2, "orderListId": -1, "clientOrderId": "sBI1KM6nNtOfj5tccZSKly", "transactTime": 1689149087774, "price": "31000.00000000", "origQty": "0.50000000", "executedQty": "0.50000000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "14000.00000000", "status": "FILLED", "timeInForce": "GTC", "type": "LIMIT", "side": "BUY", "workingTime": 1689149087774, "fills": [ { "matchType": "ONE_PARTY_TRADE_REPORT", "price": "28000.00000000", "qty": "0.50000000", "commission": "0.00000000", "commissionAsset": "BTC", "tradeId": -1, "allocId": 0 } ], "workingFloor": "SOR", "selfTradePreventionMode": "NONE", "usedSor": true} +``` + +#### Test new order using SOR (TRADE)[​](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints) + +``` +POST /api/v3/sor/order/test +``` + +Test new order creation and signature/recvWindow using smart order routing (SOR). Creates and validates a new order but does not send it into the matching engine. + +**Weight:** + +Condition + +Request Weight + +Without `computeCommissionRates` + +1 + +With `computeCommissionRates` + +20 + +**Parameters:** + +In addition to all parameters accepted by [`POST /api/v3/sor/order`](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints), the following optional parameters are also accepted: + +Name + +Type + +Mandatory + +Description + +computeCommissionRates + +BOOLEAN + +NO + +Default: `false` + +**Data Source:** Memory + +**Response:** + +Without `computeCommissionRates` + +``` +{} +``` + +With `computeCommissionRates` + +``` +{ "standardCommissionForOrder": { // Standard commission rates on trades from the order. "maker": "0.00000112", "taker": "0.00000114" }, "taxCommissionForOrder": { // Tax commission rates for trades from the order "maker": "0.00000112", "taker": "0.00000114" }, "discount": { // Discount on standard commissions when paying in BNB. "enabledForAccount": true, "enabledForSymbol": true, "discountAsset": "BNB", "discount": "0.25000000" // Standard commission is reduced by this rate when paying commission in BNB. }} +``` + +- [New order (TRADE)](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints) +- [Test new order (TRADE)](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints) +- [Cancel order (TRADE)](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints) +- [Cancel All Open Orders on a Symbol (TRADE)](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints) +- [Cancel an Existing Order and Send a New Order (TRADE)](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints) +- [Order Amend Keep Priority (TRADE)](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints) +- [Order lists](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints) +- [SOR](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints) diff --git a/docs/binance/binance-spot/sbe-market-data-streams.md b/docs/binance/binance-spot/sbe-market-data-streams.md new file mode 100644 index 0000000..b22b87b --- /dev/null +++ b/docs/binance/binance-spot/sbe-market-data-streams.md @@ -0,0 +1,100 @@ +--- +title: "SBE Market Data | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs/sbe-market-data-streams" +fetched_at: "2026-02-26T10:38:09.225Z" +--- +# SBE Market Data Streams + +## General Information[​](https://developers.binance.com/docs/binance-spot-api-docs/sbe-market-data-streams) + +- The base endpoint is **stream-sbe.binance.com** or **stream-sbe.binance.com:9443**. +- To retrieve market data in JSON format, please refer to [this page](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams). +- SBE schema used for decoding the streams can be found [here](https://github.com/binance/binance-spot-api-docs/blob/master/sbe/schemas/stream_1_0.xml). +- All symbols in stream names are **lowercase**. +- You can subscribe to a single stream at **/ws/**. +- You can subscribe to multiple streams at **/stream?streams=//**. +- A single connection to **stream-sbe.binance.com** is **only valid for 24 hours**; expect to be disconnected at the 24 hour mark. +- All time and timestamp fields are in **microseconds**. +- **An API Key is necessary for access**. + - Only Ed25519 keys are allowed. + - Please put your API Key in the `X-MBX-APIKEY` header when opening the connection. Timestamp and signature are not necessary. + - No extra API key permissions are necessary to access public market data. Symbol whitelist also does not affect access to SBE Market Data Streams. + - However, if you use an IP whitelist for the API key, only specified IP addresses are allowed to use the API key. +- The server sends a `ping frame` every 20 seconds. + - If the server does not receive a `pong frame` back from you within a minute, the connection will be closed. + - When you receive a ping, you must send a pong with a copy of ping's payload as soon as possible. + - Unsolicited `pong frames` are allowed, but will not prevent disconnection. **It is recommended that the payload for these pong frames are empty.** +- [Live Subscribing and Unsubscribing](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) is also supported. + - You must send the subscription requests in JSON, and will receive the subscription response also in JSON. + - You can differentiate subscription responses from market data events by looking at the WebSocket frame type: subscription responses are always sent in text frames (containing JSON), and events are always sent in binary frames (containing SBE). +- If your request contains a symbol name containing non-ASCII characters, then the stream events may contain non-ASCII characters encoded in UTF-8. + +## WebSocket Limits[​](https://developers.binance.com/docs/binance-spot-api-docs/sbe-market-data-streams) + +- WebSocket connections have a rate limit of **5 requests per second**. + - Only messages from your client are considered: + - `PING frame` + - `PONG frame` + - `Text frame` with JSON control request + - Events pushed by the server are not rate-limited. + - Connections that go beyond the limit will be closed. Repeatedly disconnected IP addresses may be banned. +- A single connection can listen to a maximum of 1024 streams. +- There is a limit of **300 connection attempts every 5 minutes per IP address**. + +## Available Streams[​](https://developers.binance.com/docs/binance-spot-api-docs/sbe-market-data-streams) + +### Trades Streams[​](https://developers.binance.com/docs/binance-spot-api-docs/sbe-market-data-streams) + +Raw trade information, pushed in real-time. + +**SBE Message Name:** `TradesStreamEvent` + +**Stream Name**: @trade + +**Update Speed**: Real time + +### Best Bid/Ask Streams[​](https://developers.binance.com/docs/binance-spot-api-docs/sbe-market-data-streams) + +The best bid and ask price and quantity, pushed in real-time when the order book changes. + +> \[!NOTE\] Best bid/ask streams in SBE are the equivalent of bookTicker streams in JSON, except they support auto-culling, and also include the `eventTime` field. + +**SBE Message Name:** `BestBidAskStreamEvent` + +**Stream Name**: @bestBidAsk + +**Update Speed**: Real time + +SBE best bid/ask streams use **auto-culling**: when the system is under high load, it may drop outdated events instead of queuing all events and delivering them with a delay. + +For example, if a best bid/ask event is generated at time T2 when there is still an undelivered event queued at time T1 (where T1 < T2), the event for T1 is dropped, and the system will deliver only the event for T2. This is done on a per-symbol basis. + +### Diff. Depth Streams[​](https://developers.binance.com/docs/binance-spot-api-docs/sbe-market-data-streams) + +Incremental updates to the order book, pushed at regular intervals. Use this stream to maintain a local order book. + +[How to manage a local order book.](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) + +**SBE Message Name:** `DepthDiffStreamEvent` + +**Stream Name**: @depth + +**Update Speed:** 50ms + +### Partial Book Depth Streams[​](https://developers.binance.com/docs/binance-spot-api-docs/sbe-market-data-streams) + +Snapshots of the top 20 levels of the order book, pushed at regular intervals. + +**SBE Message Name:** `DepthSnapshotStreamEvent` + +**Stream Name**: @depth20 + +**Update Speed:** 50ms + +- [General Information](https://developers.binance.com/docs/binance-spot-api-docs/sbe-market-data-streams) +- [WebSocket Limits](https://developers.binance.com/docs/binance-spot-api-docs/sbe-market-data-streams) +- [Available Streams](https://developers.binance.com/docs/binance-spot-api-docs/sbe-market-data-streams) + - [Trades Streams](https://developers.binance.com/docs/binance-spot-api-docs/sbe-market-data-streams) + - [Best Bid/Ask Streams](https://developers.binance.com/docs/binance-spot-api-docs/sbe-market-data-streams) + - [Diff. Depth Streams](https://developers.binance.com/docs/binance-spot-api-docs/sbe-market-data-streams) + - [Partial Book Depth Streams](https://developers.binance.com/docs/binance-spot-api-docs/sbe-market-data-streams) diff --git a/docs/binance/binance-spot/testnet.md b/docs/binance/binance-spot/testnet.md new file mode 100644 index 0000000..9192079 --- /dev/null +++ b/docs/binance/binance-spot/testnet.md @@ -0,0 +1,1204 @@ +--- +title: "Changelog | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs/testnet" +fetched_at: "2026-02-26T10:38:09.536Z" +--- +# CHANGELOG for Binance SPOT Testnet + +**Last Updated: 2026-02-24** + +**Note:** All features here will only apply to the [SPOT Testnet](https://testnet.binance.vision/). This is not always synced with the live exchange. + +### 2026-02-24[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet) + +- Following the announcement on [2025-11-28](https://developers.binance.com/docs/binance-spot-api-docs/testnet), `!ticker@arr` will be retired on **2026-03-26** +- [`ICEBERG_PARTS`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/filters) will be increased to 100 for all symbols starting 07:30 UTC. + +--- + +### 2026-02-09[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet) + +- Clarified exponent field requirements in [FIX SBE documentation](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +--- + +### 2026-02-04[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet) + +**Data reset** + +All data on the Spot Test Network will be deleted today according to the periodic reset procedure. See [F.A.Q.](https://developers.binance.com/docs/faqs/testnet.md) for more details. + +REST and WebSocket API: + +- Reminder that SBE 3:0 schema will be retired on 2026-02-06, [6 months after being deprecated](https://developers.binance.com/docs/binance-spot-api-docs/faqs/sbe_faq). + +--- + +### 2026-02-02[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet) + +- Documented that [FIX Drop Copy session](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) data is delayed by 1 second. This has been the delay since the inception of the FIX API. + +--- + +### 2026-01-27[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet) + +- [ICEBERG\_PARTS](https://developers.binance.com/docs/binance-spot-api-docs/testnet/filters) will be increased to 50 for all symbols today. + +--- + +### 2026-01-26[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet) + +- Added undocumented `recvWindow` to `userDataStream.subscribe.signature`. + +--- + +### 2026-01-21[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet) + +#### REST and WebSocket API[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet) + +Following the announcement from [2025-10-24](https://developers.binance.com/docs/binance-spot-api-docs/testnet), the following endpoints/methods will no longer be available starting from **2026-02-04, 07:00 UTC** + +REST API + +- `POST /api/v3/userDataStream` +- `PUT /api/v3/userDataStream` +- `DELETE /api/v3/userDataStream` + +WebSocket API + +- `userDataStream.start` +- `userDataStream.ping` +- `userDataStream.stop` + +--- + +### 2026-01-07[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet) + +**Data reset** + +All data on the Spot Test Network will be deleted today according to the periodic reset procedure. See [F.A.Q.](https://developers.binance.com/docs/faqs/testnet.md) for more details. + +--- + +### 2025-12-18[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet) + +- Updated [FIX SBE documentation](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) +- Clarified User Data Stream documentation regarding [`eventStreamTerminated`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/user-data-stream). +- Assets `这是测试币` and `456` and symbol `这是测试币456` have been added for testing endpoints/methods with a Unicode symbol. Balances for both assets have been distributed to all accounts. + +--- + +### 2025-12-17[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet) + +#### REST API[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet) + +- When calling endpoints that require signatures, percent-encode payloads before computing signatures. Requests that do not follow this order will be rejected with [`-1022 INVALID_SIGNATURE`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors). Please review and update your signing logic accordingly. +- Updated documentation for REST API regarding [Signed Endpoints examples for placing an order](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/request-security) + +#### WebSocket API[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet) + +- Updated documentation for WebSocket API regarding [SIGNED request security](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/request-security) + +--- + +### 2025-12-15[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet) + +**Clarification Regarding UTF-8 Encoding:** + +- In [FIX](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api), [REST](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/general-api-information), and [WebSocket APIs](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/general-api-information), if your request contains a symbol name containing non-ASCII characters, then the response may contain non-ASCII characters encoded in UTF-8. +- In REST and WebSocket APIs, some endpoints/methods may return asset and/or symbol names containing non-ASCII characters encoded in UTF-8 even if the request did not contain non-ASCII characters. +- In [WebSocket Streams](https://developers.binance.com/docs/binance-spot-api-docs/testnet/web-socket-streams), if your request contains a symbol name containing non-ASCII characters, then the stream events may contain non-ASCII characters encoded in UTF-8. +- In WebSocket Streams, [All Market Mini Tickers Stream](https://developers.binance.com/docs/binance-spot-api-docs/testnet/web-socket-streams) and [All Market Rolling Window Statistics Streams](https://developers.binance.com/docs/binance-spot-api-docs/testnet/web-socket-streams) events may contain non-ASCII characters encoded in UTF-8. +- In [SBE Market Data Streams](https://developers.binance.com/docs/binance-spot-api-docs/testnet/sbe-market-data-streams), if your request contains a symbol name containing non-ASCII characters, then the stream events may contain non-ASCII characters encoded in UTF-8. +- [UserDataStream events](https://developers.binance.com/docs/binance-spot-api-docs/testnet/user-data-stream) may contain non-ASCII characters encoded in UTF-8 if you own or trade any assets or symbols whose names contain non-ASCII characters. +- For full compatibility with Binance APIs, please ensure your code is designed to handle UTF-8-encoded strings. + +--- + +### 2025-12-09[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet) + +- [Schema for FIX SBE](https://github.com/binance/binance-spot-api-docs/blob/master/sbe/schemas/spot-fixsbe-1_0.xml) has been updated to use `smallGroupSize16Encoding` in `MarketDataSnapshot` and use `presence="optional"` for incremental book ticker/depth `MDEntrySize` fields. +- Updated documentation re: [FIX vs FIX SBE](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) +- Added documentation in REST, and WebSocket APIs stating: + **Please avoid SQL keywords in requests** as they may trigger a security block by a WAF (Web Application Firewall) rule. + See [https://www.binance.com/en/support/faq/detail/360004492232](https://www.binance.com/en/support/faq/detail/360004492232) for more details. + +--- + +### 2025-12-04[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet) + +- [QuickFix Schema for FIX OE](https://github.com/binance/binance-spot-api-docs/blob/master/fix/schemas/spot-fix-oe.xml) has been updated to add `ExecutionReportType` and `SBESchemaVersionDeprecated` for FIX SBE support. +- [QuickFix Schema for FIX MD](https://github.com/binance/binance-spot-api-docs/blob/master/fix/schemas/spot-fix-md.xml) has been updated to add `SBESchemaVersionDeprecated` for FIX SBE support. + +--- + +### 2025-11-28[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet) + +**Notice: The following changes will be deployed starting from 2025-12-01 2:00 UTC and may take several hours to complete** + +#### General Changes[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet) + +- Parameter `symbol` and `symbols` can now support Unicode values encoded in UTF-8. +- Following the announcement from [2025-11-14](https://developers.binance.com/docs/binance-spot-api-docs/testnet), all documentation related to `!ticker@arr` has been removed. + - The feature will remain available until a future retirement announcement is made. + - Please use `@ticker` or `!miniTicker@arr` instead. + +#### FIX API[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet) + +- Unicode values encoded in UTF-8 can now be accepted in FIX messages. This is allowed for the following tags only: + - `Currency (15)` + - `MiscFeeCurr (138)` + - `Symbol (55)` + - `SecondarySymbol (25019)` + - `CounterSymbol (25028)` + - `SecurityDesc (107)` +- When Unicode is put in a tag value that is not one of the tags above, FIX API will now send back a `RefTagID (371)` tag in the Reject `<3>`, pointing to exactly which tag is not allowed to contain Unicode. +- NewOrderList `` accepts `TriggerPriceDirection (1109)` without `TriggerPrice (1102)`. + +#### WebSocket Streams[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet) + +- WebSocket Market Streams supports URL-encoded urls. + + + + +**Notice: The following changes will occur at approximately 2025-12-02 11:00 UTC**: + +- [FIX SBE support](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) becomes available. +- [One Pays the Other (OPO)](https://github.com/binance/binance-spot-api-docs/blob/master/faqs/opo.md) becomes available on all symbols. + - `opoAllowed` begins to appear in Exchange Information requests, indicating if One-Pays-the-Other (OPO) orders are supported on each symbol. + - REST API: `GET /api/v3/exchangeInfo` + - WebSocket API: `exchangeInfo` + - New requests for OPO: + - REST API: + - `POST /api/v3/orderList/opo` + - `POST /api/v3/orderList/opoco` + - WebSocket API + - `orderList.place.opo` + - `orderList.place.opoco` + - FIX API + - NewOrderList `` has field `OPO (25046)`. Please update to the latest QuickFIX Schema for OPO support. +- STP mode [`TRANSFER`](https://developers.binance.com/docs/binance-spot-api-docs/faqs/stp_faq) has been added. The exact date that STP `TRANSFER` will be enabled has not yet been determined. +- **SBE: A new schema 3:2 ([spot\_3\_2.xml](https://github.com/binance/binance-spot-api-docs/blob/master/sbe/schemas/spot_3_2.xml)) is available.** + - The current schema 3:1 ([spot\_3\_1.xml](https://github.com/binance/binance-spot-api-docs/blob/master/sbe/schemas/spot_3_1.xml)) is deprecated and will be retired in 6 months as per our schema deprecation policy. + - Changes in 3:2: + - New enum variant `TRANSFER` for `selfTradePreventionMode` and `allowedSelfTradePreventionModes`. + - All schemas below 3:1 are unable to represent any response that could contain the STP mode `TRANSFER` (e.g. Exchange Information, order placement, order cancellation, or querying the status of an order). + When a response cannot be represented in the requested schema, an error is returned. +- FIX API changes: + - `LastFragment (893)` becomes deprecated. + - This means that the MarketIncrementalRefresh `` messages will no longer be fragmented and may contain more than 10,000 entries. + - The documentation has been updated to reflect this change. + - ListStatus `` will no longer emit the optional `symbol` field. + - This applies to FIX Order Entry and FIX Drop Copy. + - The documentation has been updated to reflect this change. + +--- + +### 2025-11-25[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet) + +- [`ICEBERG_PARTS`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/filters) will be increased to 25 for all symbols. + +--- + +### 2025-11-14[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet) + +- All Market Tickers Stream (`!ticker@arr`) has been deprecated; This means this will be removed both from the documentation and from our systems at a later date. More details to follow. +- Please use [`@ticker`](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) or [`!miniTicker@arr`](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) instead. + +--- + +### 2025-11-12[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet) + +- The steps on [how to manage a local order book correctly](https://developers.binance.com/docs/binance-spot-api-docs/testnet/web-socket-streams) has been corrected. + +--- + +### 2025-11-11[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet) + +#### SBE Market Data[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet) + +- **At 2025-11-11 07:00 UTC, the update speed of `@depth` and `@depth20` streams will be changed to 50ms**. + - This change will apply automatically to all users of SBE Market Data and doesn't require any action. + - The total amount of data received per second will be increased (up to 2x). + - These new update speeds will take effect on the live exchange at **2025-11-26 07:00 UTC**. + - [SBE Market Data](https://developers.binance.com/docs/binance-spot-api-docs/testnet/sbe-market-data-streams) has been updated to reflect these changes. + +--- + +### 2025-11-10[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet) + +- "Last Updated" dates will be removed from all documents except for CHANGELOG. +- Moving forward, CHANGELOG will be the source of reference for when changes were made to any document. + +--- + +### 2025-11-05[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet) + +**Data reset** + +All data on the Spot Test Network will be deleted today according to the periodic reset procedure. See [F.A.Q.](https://developers.binance.com/docs/faqs/testnet.md) for more details. + +--- + +### 2025-10-24[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet) + +#### SBE[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet) + +- SBE: schema 3:1 ([spot\_3\_1.xml](https://github.com/binance/binance-spot-api-docs/blob/master/sbe/schemas/spot_3_1.xml)) has been updated to support [listenToken Subscription Methods](https://developers.binance.com/docs/margin_trading/trade-data-stream/Listen-Token-Websocket-API) for Margin Trading. + +#### REST and WebSocket API[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet) + +Following the announcement from [2025-04-01](https://developers.binance.com/docs/binance-spot-api-docs/testnet), all documentation related with `listenKey` for use on `wss://stream.binance.com` has been removed. + +Please refer to the list of requests and methods below for more information. + +The features will remain available until a future retirement announcement is made. + +REST API + +- `POST /api/v3/userDataStream` +- `PUT /api/v3/userDataStream` +- `DELETE /api/v3/userDataStream` + +WebSocket API + +- `userDataStream.start` +- `userDataStream.ping` +- `userDataStream.stop` + +--- + +### 2025-10-17[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet) + +**Notice: The following changes will be enabled at 2025-10-17 07:00 UTC** + +- An optional parameter, `symbolStatus`, has been added to the following endpoints: + - **REST API** + - `GET /api/v3/depth` + - `GET /api/v3/ticker/price` + - `GET /api/v3/ticker/bookTicker` + - `GET /api/v3/ticker/24hr` + - `GET /api/v3/ticker/tradingDay` + - `GET /api/v3/ticker` + - **WebSocket API** + - `depth` + - `ticker.price` + - `ticker.book` + - `ticker.24hr` + - `ticker.tradingDay` + - `ticker` +- When the parameter `symbolStatus=` is provided, only symbols whose trading status matches the specified `STATUS` will be included in the response: + - If a single symbol is specified using the `symbol=` parameter and its trading status does not match the given `STATUS`, the endpoint will return error code [`-1220 SYMBOL_DOES_NOT_MATCH_STATUS`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors). + - If multiple symbols are specified using the `symbols=[...]` parameter, the response will be an array that excludes any symbols whose trading status does not match `STATUS`. If no symbols from the symbols parameter have a trading status that matches `STATUS`, the response is an empty array. + - For endpoints where the `symbol` and `symbols` parameters are optional, omitting these parameters is treated as if all symbols had been specified in the `symbols=[...]` parameter. See the previous line for the behavior of `symbolStatus=`. + +--- + +### 2025-10-08[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet) + +#### FIX API[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet) + +**Notice: The following changes will be enabled at 2025-10-08 07:00 UTC** + +- Updated [QuickFIX Schema](https://github.com/binance/binance-spot-api-docs/blob/master/fix/schemas/spot-fix-md.xml) for FIX Market Data: + - Updated RecvWindow (25000) to reflect microsecond support announced on [2025-08-05](https://developers.binance.com/docs/binance-spot-api-docs/testnet). + - Updated [InstrumentList ``](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) message: + - Added fields: `StartPriceRange`, `EndPriceRange`. + - Made the following fields optional: `MinTradeVol`, `MaxTradeVol`, `MinQtyIncrement`, `MarketMinTradeVol`, `MarketMaxTradeVol`, `MarketMinQtyIncrement`, `MinPriceIncrement`. + - The changes to InstrumentList `` are breaking changes. Please update to the new schema. + +--- + +### 2025-10-01[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet) + +**Data reset** + +All data on the Spot Test Network will be deleted today according to the periodic reset procedure. See [F.A.Q.](https://developers.binance.com/docs/faqs/testnet.md) for more details. + +REST and WebSocket API: + +- Reminder that SBE 2:1 schema will be retired on 2025-10-02, [6 months after being deprecated](https://developers.binance.com/docs/binance-spot-api-docs/faqs/sbe_faq). +- The [SBE lifecycle for Testnet](https://github.com/binance/binance-spot-api-docs/blob/master/sbe/schemas/sbe_schema_lifecycle_testnet.json) has been updated to reflect this change. + +--- + +### 2025-09-24[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet) + +**Notice: The following changes will be deployed on 2025-09-24, starting at 7:00 UTC and may take several hours to complete.** + +- Added an endpoint to retrieve the list of filters relevant to an account on a given symbol. This is the only endpoint that shows if an account has `MAX_ASSET` filters applied to it. + - REST API: [`GET /api/v3/myFilters`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/account-endpoints) + - WebSocket API: [`myFilters`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/account-requests) +- Comments in **SBE: schema 3:1 ([spot\_3\_1.xml](https://github.com/binance/binance-spot-api-docs/blob/master/sbe/schemas/spot_3_1.xml))** have been added, modified, and removed. Although there is no need for users of `3:1` to update to this version of the file, we advise updating to maintain consistency. +- Added documentation for filter [`MAX_ASSET`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/filters). + - In `Testnet` only: all accounts have a `MAX_ASSET` filter for asset `JPY` with value set to `1000000`. + +--- + +### 2025-09-18[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet) + +- Updated documentation for `recvWindow` to reflect microsecond support announced on [2025-08-05](https://developers.binance.com/docs/binance-spot-api-docs/testnet). + - REST API: [Timing Security](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/request-security) + - WebSocket API: [Timing Security](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/request-security) + +--- + +### 2025-09-12[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet) + +- The [QuickFix schema for FIX Order Entry](https://github.com/binance/binance-spot-api-docs/blob/master/fix/schemas/spot-fix-oe.xml) has been updated to support Pegged Orders. +- Updated FIX API Documentation for `RecvWindow` in + - [Message Components](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + - [Timing Security](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +--- + +### 2025-09-05[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet) + +**Data reset** + +All data on the Spot Test Network will be deleted today according to the periodic reset procedure. See [F.A.Q.](https://developers.binance.com/docs/faqs/testnet.md) for more details. + +--- + +### 2025-08-28[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet) + +- Updated SBE FAQ section [regarding legacy support](https://developers.binance.com/docs/binance-spot-api-docs/faqs/sbe_faq) to include more details on schema compatibility and explain `NonRepresentable` and `NonRepresentableMessage`. + +--- + +### 2025-08-26[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet) + +- Updated "Request Security" documentation for [REST API](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/request-security) and [WebSocket API](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/request-security) with no functional changes. + +--- + +### 2025-08-25[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet) + +- **SBE: schema 3:1 ([spot\_3\_1.xml](https://github.com/binance/binance-spot-api-docs/blob/master/sbe/schemas/spot_3_1.xml))** will be updated on **2025-08-25 at 05:00 UTC** + - The following fields have been renamed because the [SbeTool](https://developers.binance.com/docs/binance-spot-api-docs/faqs/sbe_faq) code generator has been found to generate Java code that does not compile. + - Although only users impacted by this issue need to update the schema, we advise all users to upgrade to the latest version to maintain consistency. + - Message `MaxAssetFilter` + - field `limitExponent` renamed to `qtyExponent` + - field `limit` renamed to `maxQty` + +--- + +### 2025-08-19[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet) + +- `userDataStream.subscribe` returns `subscriptionId` in the responses. + This was missed in a [previous](https://developers.binance.com/docs/binance-spot-api-docs/testnet) changelog entry. + +--- + +### 2025-08-07[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet) + +- Updated FIX API documentation + - [FIX Market Data limits](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api): The subscription limit has always been present but was undocumented. + - [On message processing order](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api): Reworded and reformatted. + +**Notice: The following will be enabled on 2025-08-08, 07:00 UTC** + +- Filter [`MAX_NUM_ORDER_LISTS`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/filters), is enabled with the limit of 20 per symbol. + +--- + +### 2025-08-05[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet) + +**Notice: The following changes will be deployed on 2025-08-06, starting 7:00 UTC and may take several hours to complete.** +Please consult the Spot Test Network's [homepage](https://testnet.binance.vision/) to be informed of the release completion. + +#### General Changes[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet) + +- The [pegged order](https://developers.binance.com/docs/binance-spot-api-docs/faqs/pegged_orders) functionality is now available. + - Exchange Information requests emit the field `pegInstructionsAllowed`. + - The following conditional fields `pegPriceType`, `pegOffSetType`, `pegOffsetValues`, and `peggedPrice` appear in responses of the following requests if the order was a pegged order: + - REST API + - `GET /api/v3/order` + - `GET /api/v3/orderList` + - `GET /api/v3/openOrderList` + - `GET /api/v3/allOrders` + - `DELETE /api/v3/order` + - `DELETE /api/v3/orderList` + - `DELETE /api/v3/openOrders` + - `PUT /api/v3/order/amend/keepPriority` + - WebSocket API + - `order.status` + - `orderList.status` + - `allOrders` + - `order.cancel` + - `orderList.cancel` + - `openOrders.cancelAll` + - `order.amend.keepPriority` + - FIX API + - `OrdType(4)` supports new value `P(PEGGED)` + - Tags `PegOffsetValue(211)`, `PegPriceType(1094)`, `PegMoveType(835)`, and `PegOffsetType(836)` have been added to the following messages: + - NewOrderSingle `` + - NewOrderList `` + - OrderCancelRequestAndNewOrderSingle `` + - When placing an order, the `ExecutionReport` `<8>` message will echo back `PegInstructions`, with an extra optional field `PeggedPrice (839)`. + - New error messages for pegged orders are added. Please see the [Errors](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) document for more information. +- Changes with `recvWindow`: + - A third check is made after your message leaves the message broker just before it is sent to the Matching Engine. + - This does not cover potential delays inside the Matching Engine itself. + - `recvWindow` supports microseconds. + - The value is still specified in milliseconds, but can now take a decimal component to specify it with higher precision. + - This means that the parameter supports a **maximum precision of 3 decimal places**. (e.g. 6000.346) + - APIs affected: + - FIX API + - REST API + - WebSocket API +- The following requests have a new structure called `specialCommission`. See [Commission Rates](https://developers.binance.com/docs/binance-spot-api-docs/faqs/commission_faq). + - REST API + - `GET /api/v3/account/commission` + - `POST /api/v3/order/test` with `computeCommissionRates=true` + - `POST /api/v3/sor/order/test` with `computeCommissionRates=true` + - WebSocket API + - `account.commission` + - `order.test` with `computeCommissionRates=true` + - `sor.order.test` with `computeCommissionRates=true` +- The new [`MAX_NUM_ORDER_AMENDS`](https://github.com/binance/binance-spot-api-docs/blob/master/testnet/filters.md) filter is enabled with a limit of 10 amendments per order. +- New error codes `-1120` and `1211`. See [Errors](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) for more information. +- **SBE: A new schema 3:1 ([spot\_3\_1.xml](https://github.com/binance/binance-spot-api-docs/blob/master/sbe/schemas/spot_3_1.xml)) is available.** + - The current schema 3:0 ([spot\_3\_0.xml](https://github.com/binance/binance-spot-api-docs/blob/master/sbe/schemas/spot_3_0.xml)) is deprecated and will be retired in 6 months as per our schema deprecation policy. + - Changes in schema 3:1: + - `ExchangeInfoResponse`: new field `pegInstructionsAllowed` + - `ExecutionReportEvent`: new fields `pricePeg`, `pricePegOffsetLevel`, `peggedPrice` + - `UserDataStreamSubscribeResponse`: new field `subscriptionId` + - New field `subscriptionId` for all user data stream events. + - Field `apiKey` renamed to `loggedOnApiKey` for `WebSocketSessionLogonResponse`, `WebSocketSessionStatusResponse` and WebSocketSessionLogoutResponse + - `OrderTestWithCommissionsResponse`: 2 new fields `specialCommissionForOrderMaker` and `specialCommissionForOrderTaker` + - `AccountCommissionResponse`: 4 new fields `specialCommissionMaker`, `specialCommissionTaker`, `specialCommissionBuyer` and `specialCommissionSeller` + - Support for `EXCHANGE_MAX_NUM_ORDER_LISTS`, `MAX_NUM_ORDER_LISTS`, and `MAX_NUM_ORDER_AMENDS` filters. + - `ExecutionReportEvent`: fields `rejectReason` and `origClientOrderId` now show their default values in SBE format to match the JSON format. + - `NonRepresentableMessage`: New message added to represent a message that cannot be represented in this schema ID and version. Receipt of this message indicates that something should be available, but it is not representable using the SBE schema currently in use. +- Query order lists requests will first query the data in the cache, and if it cannot be found will query the database. + - REST API: `GET /api/v3/openOrderLists` + - WebSocket API: `openOrderLists.status` +- Orders with cumulative quantity of 0 in the final state `EXPIRED_IN_MATCH` (i.e. the order expired due to STP) will be archived after 90 days. +- Bug fix: The Matching Engine no longer accepts order lists that exceed the order count filter limits. Affected filters: + - `MAX_NUM_ORDERS` + - `MAX_ALGO_ORDERS` + - `MAX_ICEBERG_ORDERS` + - `EXCHANGE_MAX_NUM_ORDERS` + - `EXCHANGE_MAX_ALGO_ORDERS` + - `EXCHANGE_MAX_ICEBERG_ORDERS` + +#### WebSocket API[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet) + +- A single WebSocket connection can subscribe to multiple User Data Streams at once. + - Only one subscription per account is allowed on a single connection. +- Method `userDataStream.subscribe.signature` has been added that allows you to subscribe to the User Data Stream without needing to login first. + - This also doesn’t require an Ed25519 API Key, and can work with any [API Key type](https://developers.binance.com/docs/binance-spot-api-docs/faqs/api_key_types). + - For [SBE support](https://developers.binance.com/docs/binance-spot-api-docs/faqs/sbe_faq) you need to use schema 3:1 at least. +- Method `session.subscriptions` has been added that lists all the subscriptions active for the current session. +- The meaning of the field `userDataStream` in the session requests has changed slightly. + - Previously, this returned `true` if you were subscribed to the user data stream of your logged-on account. + - Now it returns `true` if you have at least one active user data stream subscription + - `true` - If there is at least one subscription active + - `false` - If there are no active subscriptions +- `userDataStream.unsubscribe` supports closing multiple subscriptions. + - When called with no parameter, this will close all subscriptions. + - When called with `subscriptionId`, this will attempt to close the subscription matching that Id, if it exists. + - The authorization for this request has been changed to `NONE`. + +#### User Data Stream[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet) + +- Field `subscriptionId` has been added to the User Data Stream events payload when listening through the [WebSocket API](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api.md). This will identify which subscription the event is coming from. + +#### FIX API[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet) + +- When a client sends a reject message, the FIX API will no longer send the client back a Reject `<3>` message. Error messages are clearer when a tag is invalid, missing a value, or when the field value is empty or malformed + - If the tag number was invalid, you will receive the error: + + ``` + { "code": -1169, "msg": "Invalid tag number." } + ``` + + - If a valid tag was specified without a value, you will receive the error: + + ``` + { "code": -1177, "msg": "Tag specified without a value." } + ``` + + - If the field value was empty or malformed, you will still receive the error: + + ``` + { "code": -1102, "msg": "Field value was empty or malformed." } + ``` + + +--- + +### 2025-07-02[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet) + +**Data reset** + +All data on the Spot Test Network will be deleted today according to the periodic reset procedure. (see [F.A.Q.](https://developers.binance.com/docs/faqs/testnet.md) for more details) + +--- + +### 2025-06-04[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet) + +**Data reset** + +All data on the Spot Test Network will be deleted today according to the periodic reset procedure. (see [F.A.Q.](https://developers.binance.com/docs/faqs/testnet.md) for more details) + +--- + +### 2025-05-28[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet) + +- Documented API timeout value and error under General API Information for each API: + - [FIX](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + - [REST](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/general-api-information) + - [WebSocket](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/general-api-information) + +--- + +### 2025-05-22[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet) + +REST and WebSocket API: + +- Reminder that SBE 2:0 schema will be retired on 2025-05-28, [6 months after being deprecated](https://developers.binance.com/docs/binance-spot-api-docs/faqs/sbe_faq). +- The [SBE lifecycle for Testnet](https://github.com/binance/binance-spot-api-docs/blob/master/sbe/schemas/sbe_schema_lifecycle_testnet.json) has been updated to reflect this change. + +--- + +### 2025-05-21[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet) + +**Notice: The following changes will happen at 2025-05-21 7:00 UTC.** + +- The previous behavior of `recvWindow` on FIX, REST, and WebSocket APIs will be augmented by an additional check. + - To review, the existing behavior is: + - If `timestamp` is greater than `serverTime` + 1 second at receipt of the request, the request is rejected. Rejection by this check increments message limits (FIX API) and IP limits (REST and WebSocket APIs), but not Unfilled Order Count (order placement endpoints of all APIs). + - If the difference between `timestamp` and `serverTime` at receipt of the request is greater than `recvWindow`, the request is rejected. Rejection by this check increments message limits (FIX API) and IP limits (REST and WebSocket APIs) but not Unfilled Order Count (order placement endpoints of all APIs). + - The additional check is: + - Just before a request is forwarded to the Matching Engine, if the difference between `timestamp` and the current `serverTime` is greater than `recvWindow`, the request is rejected. Rejection by this check increments message limits (FIX API), IP limits (REST and WebSocket APIs), and Unfilled Order Count (order placement endpoints of all APIs). + - The documentation for Timing security has been updated to reflect the additional check. + - [REST API](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/request-security) + - [WebSocket API](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/request-security) + - [FIX API](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) +- Fixed a bug in FIX Market Data message InstrumentList ``. Previously, the value of `NoRelatedSym(146)` could have been incorrect. + +--- + +### 2025-04-29[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet) + +- Features that currently require an Ed25519 API key will soon be opened up to HMAC and RSA keys. + - For example, subscribing to User Data Stream in WebSocket API will be possible with any API key type before listenKeys are removed. + - Users are still encouraged to migrate to Ed25519 API keys as they are more secure and performant on Binance Spot Trading. + - More details to come. + +--- + +### 2025-04-25[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet) + +- **Notice: The following changes will happen at 2025-04-25 09:00 UTC.** +- The following request weights will be increased from 1 to 4: + - REST API: `PUT /api/v3/order/amend/keepPriority` + - WebSocket API: `order.amend.keepPriority` + - The documentation for both REST and WebSocket API has been updated to reflect the upcoming changes. +- Clarified that `SEQNUM` in the FIX-API is a 32-bit unsigned integer that rolls over. This has been the `SEQNUM` data type since the inception of the FIX-API. + +--- + +### 2025-04-21[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet) + +- **[Order Amend Keep Priority](https://github.com/binance/binance-spot-api-docs/blob/master/faqs/order_amend_keep_priority.md) is now enabled on all symbols.** +- **[Self-trade prevention mode `DECREMENT`](https://github.com/binance/binance-spot-api-docs/blob/master/faqs/stp_faq.md) is now enabled on all symbols.** + +--- + +### 2025-04-01[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet) + +**Notice:** The following changes will be deployed tomorrow **April 2, 2025 starting at 7:00 UTC** and may take several hours to complete. +Please consult the Spot Test Network's [homepage](https://testnet.binance.vision/) to be informed of the release completion. + +#### New Features[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet) + +- **[Order Amend Keep Priority](https://github.com/binance/binance-spot-api-docs/blob/master/faqs/order_amend_keep_priority.md) is now available.** + - FIX API: New Order Entry Messages **OrderAmendKeepPriorityRequest** and **OrderAmendReject** + - REST API: `PUT /api/v3/order/amend/keepPriority` + - WebSocket API: `order.amend.keepPriority` + - You can check the new `allowAmend` field in Exchange Information Requests to see if it's enabled on a given symbol: + - REST API: `GET /api/v3/exchangeInfo` + - WebSocket API: `exchangeInfo` +- **Self-trade prevention mode `DECREMENT` is now available.** + - Instead of expiring one or both orders, `DECREMENT` mode decreases the available quantity of both orders by increasing the `prevented quantity` of both orders by the amount of the prevented match. + - This can expire the orders if their `filled quantity` + `prevented quantity` >= `order quantity`. + - You can check the `allowedSelfTradePreventionModes` field in Exchange Information Requests to see if this mode is enabled on a given symbol. + +#### General Changes[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet) + +- **Important:** The following legacy URLs will be **removed in May 2025**. Please change to the new URLs as soon as possible: + +Legacy URL + +Latest URL + +`wss://testnet.binance.vision/ws-api/v3` + +`wss://ws-api.testnet.binance.vision/ws-api/v3` + +`wss://testnet.binance.vision/ws` + +`wss://stream.testnet.binance.vision/ws` + +- Behavior when querying and/or canceling with `orderId` and `origClientOrderId/cancelOrigClientOrderId`: + - The behavior when both parameters were provided was not consistent across all endpoints. + - Moving forward, when both parameters are provided, the order is first searched for using its `orderId`, and if found, `origClientOrderId`/`cancelOrigClientOrderId` is checked against that order. If both conditions pass, the request succeeds. If both conditions are not met the request is rejected. + - Affected requests: + - REST API: + - `GET /api/v3/order` + - `DELETE /api/v3/order` + - `POST /api/v3/order/cancelReplace` + - WebSocket API: + - `order.status` + - `order.cancel` + - `order.cancelReplace` + - FIX API + - OrderCancelRequest `` + - OrderCancelRequestAndNewOrderSingle `` +- Behavior when canceling with `listOrderId` and `listClientOrderId`: + - The behavior when both parameters were provided was not consistent across all endpoints. + - Moving forward, when both parameters are passed, the order list is first searched for using its `listOrderId`, and if found, `listClientOrderId` is checked against that order list. If both conditions are not met the request is rejected. + - Affected requests: + - REST API + - `DELETE /api/v3/orderList` + - WebSocket API + - `orderList.cancel` +- Previously, the request weight for myTrades was 20 regardless of the parameters provided. Now, if you provide `orderId`, the request weight is 5. + - REST API: `GET /api/v3/myTrades` + - WebSocket API: `myTrades` +- If the unfilled order count for `intervalNum:DAY` is exceeded, the unfilled order count for `intervalNum:SECOND` is no longer incremented. +- Change when querying and deleting orders: + - When neither `orderId` nor `origClientOrderId` are present, the request is now rejected with `-1102` instead of `-1128`. + - Affected requests: + - REST API: + - `GET /api/v3/order` + - `DELETE /api/v3/order` + - WebSocket API + - `order.status` + - `order.cancel` + - FIX API + - OrderCancelRequest `` +- New Error code `-2038` for order amend keep priority requests that fail. +- New messages for error code `-1034`. + +#### FIX API[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet) + +- The [QuickFix schema for FIX OE](https://github.com/binance/binance-spot-api-docs/blob/master/fix/schemas/spot-fix-oe.xml) is updated to support the Order Amend Keep Priority feature and new STP mode, `DECREMENT`. +- FIX Order Entry connection limits will be a maximum of 10 concurrent connections per account. +- The connection rate limits are now enforced. Note that these limits are checked independently for both the account and the IP address. + - FIX Order Entry: 15 connection attempts within 30 seconds + - FIX Drop Copy: 15 connection attempts within 30 seconds + - FIX Market Data: 300 connection attempts within 300 seconds +- News `` contains a countdown until disconnection in the Headline field. + - Following the completion of this update, when the server enters maintenance, a `News` message will be sent to clients **every 10 seconds for 10 minutes**. After this period, clients will be logged out and their sessions will be closed. +- OrderCancelRequest `` and OrderCancelRequestAndNewOrderSingle `` will now allow both `orderId` and `clientOrderId`. +- FIX API verifies that `EncryptMethod(98)` is 0 at Logon `
`. + +#### User Data Streams[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet) + +- **Receiving user data streams on stream.testnet.binance.vision using a `listenKey` is now deprecated.** + - This feature will be removed from our systems at a later date. +- **Instead, you should get user data updates by subscribing to the [User Data Stream on the WebSocket API](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/user-data-stream-requests).** + - This should offer slightly better performance (lower latency). + - This requires the use of an Ed25519 API Key. +- In a future update, information about the base WebSocket endpoint for the User Data Streams will be removed. +- In a future update, the following requests will be removed from the documentation: + - `POST /api/v3/userDataStream` + - `PUT /api/v3/userDataStream` + - `DELETE /api/v3/userDataStream` + - `userDataStream.start` + - `userDataStream.ping` + - `userDataStream.stop` +- The [User Data Stream documentation](https://developers.binance.com/docs/binance-spot-api-docs/testnet/user-data-stream) will remain as reference for the payloads you can receive. + +#### SBE[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet) + +- **A new schema 3:0 ([spot\_3\_0.xml](https://github.com/binance/binance-spot-api-docs/blob/master/sbe/schemas/spot_3_0.xml)) is now available.** + - The current schema 2:1 ([spot\_2\_1.xml](https://github.com/binance/binance-spot-api-docs/blob/master/sbe/schemas/spot_2_1.xml)) is now deprecated and will be retired in 6 months as per our schema deprecation policy. + - Note that trying to use schema 3:0 before it is released will result in an error. +- Changes in schema 3:0: + - Support for Order Amend Keep Priority: + - Added field `amendAllowed` to ExchangeInfoResponse. + - New Messages `OrderAmendmentsResponse` and `OrderAmendKeepPriorityResponse` + - Breaking changes: + - All enums now have a `NON_REPRESENTABLE` variant. This will be used to encode new enum values in the future, which would be incompatible with 3:0. + - New enum variant `DECREMENT` for `selfTradePreventionMode` and `allowedSelfTradePreventionModes` + - `symbolStatus` enum values `AUCTION_MATCH`, `PRE_TRADING` and `POST_TRADING` have been removed. + - Fields `usedSor`, `orderCapacity`, `workingFloor`, `preventedQuantity`, and `matchType` are no longer optional. + - Field `orderCreationTime` in `ExecutionReportEvent` is now optional. +- When using deprecated schema 2:1 on the WebSocket API to listen to the User Data Stream: + - `ListStatusEvent` field `listStatusType` will be rendered as `ExecStarted` when it should have been `Updated`. Upgrade to schema 3:0 to get the correct value. + - `ExecutionReportEvent` field `selfTradePreventionMode` will be rendered as `None` when it should have been `Decrement`. This only happens when `executionType` is `TradePrevention`. + - `ExecutionReportEvent` field `orderCreationTime` will be rendered as -1 when it has no value. +- All schemas below 3:0 are unable to represent responses for Order Amend Keep Priority requests and any response that could contain the STP mode `DECREMENT` (e.g. Exchange Information, order placement, order cancelation, or querying the status of your order). When a response cannot be represented in the requested schema, an error is returned. + +--- + +### 2025-03-31[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet) + +- Added a clarification on the performance of canceling an order. + +--- + +### 2025-03-13[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet) + +- **Notice: The following changes will happen on March 13,2025 at 05:00 UTC:** + - FIX Drop Copy sessions will have a limit of **60 messages per minute**. + - FIX Market Data sessions will have a limit of **2000 messages per minute**. + - The FIX API documentation has been updated to reflect the upcoming changes. + +--- + +### 2025-03-05[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet) + +- **Notice: This is in the process of being deployed. Please consult the Spot Test Network's [homepage](https://testnet.binance.vision/) to be informed of the release completion.** + The following request weights will be increased from 2 to 4: + - REST API: `GET /api/v3/aggTrade` + - WebSocket API: `trades.aggregate` +- The documentation for both REST and WebSocket API has been updated to reflect the upcoming changes. + +--- + +### 2025-02-28[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet) + +- **SBE Market Data Streams** are now available. These streams offer a smaller payload and should offer better latency than the equivalent JSON streams for a subset of latency-sensitive market data streams. +- Streams available in SBE format: + - Real-time: trade stream + - Real-time: best bid/ask + - Every 100 ms: diff. depth + - Every 100 ms: partial book depth +- For more information please refer to the [SBE Market Data Streams](https://developers.binance.com/docs/binance-spot-api-docs/testnet/sbe-market-data-streams). + +--- + +### 2025-02-05[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet) + +- **Notice: These changes will be deployed starting at 7:00 UTC, and may take several hours to complete.** **The following changes will apply to WebSocket Market Data Streams, User Data Streams, and the WebSocket API:** + - Our WebSocket services will send a ping frame **every 20 seconds** instead of 3 minutes. + - The allowed pong delay will be **1 minute** instead of 10 minutes. + - The documentation for these services have been updated to reflect the change. +- `AggressorSide (2446)` is now rendered in the [FIX Market Data Trade Stream](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api). The QuickFIX schema [file](https://github.com/binance/binance-spot-api-docs/blob/master/fix/schemas/spot-fix-md.xml) has also been updated. Please download the latest schema before the Spot Testnet upgrade is completed. + +--- + +### 2024-12-17[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet) + +- FIX Market Data is now available. The [FIX API](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) documentation for SPOT Testnet has been updated regarding this feature. +- Please refer to this [link](https://github.com/binance/binance-spot-api-docs/blob/master/fix/schemas/spot-fix-md.xml) for the QuickFIX Schema for FIX Market Data. + +--- + +### 2024-11-27[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet) + +**Note:** These changes will be deployed live **starting 2024-11-28** and may take several hours for all features to work as intended. + +**New Feature: Microsecond support:** + +The system now supports microseconds in all related time and/or timestamp fields. Microsecond support is **opt-in**, by default the requests and responses still use milliseconds. + +Examples in documentation are also using milliseconds for the foreseeable future. + +WebSocket Streams + +- A new optional parameter `timeUnit` can be used in the connection URL to select the time unit. + - For example: `/stream?streams=btcusdt@trade&timeUnit=millisecond` + - Supported values are: + - `MILLISECOND` + - `millisecond` + - `MICROSECOND` + - `microsecond` + - If the time unit is not selected, milliseconds will be used by default. + +REST API + +- A new optional header `X-MBX-TIME-UNIT` can be sent in the request to select the time unit. + - Supported values: + - `MILLISECOND` + - `millisecond` + - `MICROSECOND` + - `microsecond` + - The time unit affects time-related parameters in requests (e.g, `startTime`, `endTime`, `timestamp`). + - The time unit affects timestamp fields in responses (e.g., `time`, `transactTime`). + - If the time unit is not selected, milliseconds will be used by default. + +WebSocket API + +- A new optional parameter `timeUnit` can be used in the connection URL to select the time unit. + - Supported values: + - `MILLISECOND` + - `millisecond` + - `MICROSECOND` + - `microsecond` + - The time unit affects time-related parameters in requests (e.g, `startTime`, `endTime`, `timestamp`). + - The time unit affects timestamp fields in responses (e.g., `time`, `transactTime`). + - If the time unit is not selected, milliseconds will be used by default. + +User Data Streams + +- A new optional parameter `timeUnit` can be used in the connection URL to select the time unit. + - Supported values + - `MILLISECOND` + - `MICROSECOND`. + - `microsecond` + - `millisecond` + +General Changes: + +- Fixed a bug that prevented orders from being placed when submitting OCOs on the `BUY` side without providing a `stopPrice`. + +- `TAKE_PROFIT` and `TAKE_PROFIT_LIMIT` support has been added for OCOs. + + - Previously OCOs could only be composed by the following order types: + - `LIMIT_MAKER` + `STOP_LOSS` + - `LIMIT_MAKER` + `STOP_LOSS_LIMIT` + - Now OCOs can be composed of the following order types: + - `LIMIT_MAKER` + `STOP_LOSS` + - `LIMIT_MAKER` + `STOP_LOSS_LIMIT` + - `TAKE_PROFIT` + `STOP_LOSS` + - `TAKE_PROFIT` + `STOP_LOSS_LIMIT` + - `TAKE_PROFIT_LIMIT` + `STOP_LOSS` + - `TAKE_PROFIT_LIMIT` + `STOP_LOSS_LIMIT` + - This is supported by the following requests: + - `POST /api/v3/orderList/oco` + - `POST /api/v3/orderList/otoco` + - `orderList.place.oco` + - `orderList.place.otoco` + - `NewOrderList` + - Error code `-1167` will be obsolete after this update and will be removed from the documentation in a later update. +- Timestamp parameters now reject values too far into the past or the future. To be specific, the parameter will be rejected if: + + - `timestamp` before 2017-01-01 (less than 1483228800000) + - `timestamp` is more than 10 seconds after the current time (e.g., if current time is 1729745280000 then it is an error to use 1729745291000 or greater) +- If `startTime` and/or `endTime` values are outside of range, the values will be adjusted to fit the correct range. + +- The field for quote order quantity (`origQuoteOrderQty`) has been added to responses that previously did not have it. Note that for order placement endpoints the field will only appear for requests with `newOrderRespType` set to `RESULT` or `FULL`. + + - Please refer to the table for requests with `origQuoteOrderQty`: + + Service + + Request + + REST + + `POST /api/v3/order` + + `POST /api/v3/sor/order` + + `POST /api/v3/order/oco` + + `POST /api/v3/orderList/oco` + + `POST /api/v3/orderList/oto` + + `POST /api/v3/orderList/otoco` + + `DELETE /api/v3/order` + + `DELETE /api/v3/orderList` + + `POST /api/v3/order/cancelReplace` + + WebSocket API + + `order.place` + + `sor.order.place` + + `orderList.place` + + `orderList.place.oco` + + `orderList.place.oto` + + `orderList.place.otoco` + + `order.cancel` + + `orderList.cancel` + + `order.cancelReplace` + + +SBE + +- A new schema 2:1 [spot\_2\_1.xml](https://github.com/binance/binance-spot-api-docs/blob/master/sbe/schemas/spot_2_1.xml) has been released. The current schema 2:0 [spot\_2\_0.xml](https://github.com/binance/binance-spot-api-docs/blob/master/sbe/schemas/spot_2_0.xml) will thus be deprecated, and retired from the API in 6 months as per our schema deprecation policy. +- Schema 2:1 is a backward compatible update of schema 2:0. You will always receive payloads in 2:1 format when you request either schema 2:0 or 2:1. +- Changes in SBE schema 2:1: + - New field `origQuoteOrderQty` in order placement/cancellation responses (Note: Decoders generated using the 2:0 schema will skip this field.): + - `NewOrderResultResponse` + - `NewOrderFullResponse` + - `CancelOrderResponse` + - `NewOrderListResultResponse` + - `NewOrderListFullResponse` + - `CancelOrderListResponse` + - WebSocket API only: New field `userDataStream` in session status responses: + - `WebSocketSessionLogonResponse` + - `WebSocketSessionStatusResponse` + - `WebSocketSessionLogoutResponse` + - WebSocket API only: New messages for User Data Stream support: + - `UserDataStreamSubscribeResponse` + - `UserDataStreamUnsubscribeResponse` + - `BalanceUpdateEvent` + - `EventStreamTerminatedEvent` + - `ExecutionReportEvent` + - `ExternalLockUpdateEvent` + - `ListStatusEvent` + - `OutboundAccountPositionEvent` + +WebSocket API + +- You can now subscribe to User Data Stream events through your WebSocket API connection. + - Note: This feature is only available for users of Ed25519 API keys. + - Note: New SBE schema 2:1 is required for User Data Stream subscriptions in SBE format. +- New requests: + - `userDataStream.subscribe` + - `userDataStream.unsubscribe` +- Changes to `session.logon`, `session.status`, and `session.logout` + - Added a new field `userDataStream` indicating if the user data stream subscription is active. +- Fixed a bug where you wouldn't receive a new listenKey using `userDataStream.start` after `session.logon` + +User Data Stream + +- WebSocket API only: New event `eventStreamTerminated` is emitted when you either logout from your websocket session or you have unsubscribed from the user data stream. +- New event `externalLockUpdate` is sent when your spot wallet balance is locked/unlocked by an external system. + +FIX API + +- The [schema](https://github.com/binance/binance-spot-api-docs/blob/master/fix/schemas/spot-fix-oe.xml) has been updated with a new Administrative message News , which can be used for all FIX services. Receiving this message indicates that your connection is about to be closed. +- **Note:** This message will be available in the live exchange at a later date. + +--- + +### 2024-11-05[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet) + +**Note:** This is in the process of being deployed. Please consult the Spot Test Network's [homepage](https://testnet.binance.vision/) to be informed of the release completion. + +Changes to Exchange Information (i.e. [`GET /api/v3/exchangeInfo`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/general-endpoints) from REST and [`exchangeInfo`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/general-requests) for WebSocket API). + +- A new optional parameter `showPermissionSets` can be used to hide the permissions from `permissionsSets`; This can be used for a reduced payload size. +- A new optional parameter `symbolStatus` can now be used to only show symbols with the specified status. (e.g. `TRADING`, `HALT`, `BREAK`) + +--- + +### 2024-10-02[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet) + +REST and WebSocket API: + +- Reminder that SBE 1:0 schema will be disabled on 2024-10-04, [6 months after being deprecated](https://developers.binance.com/docs/binance-spot-api-docs/faqs/sbe_faq), as per our SBE policy. +- The [SBE lifecycle for Testnet](https://github.com/binance/binance-spot-api-docs/blob/master/sbe/schemas/sbe_schema_lifecycle_testnet.json) has been updated to reflect this change. + +--- + +### 2024-09-04[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet) + +- Spot Testnet now supports Unfilled Order Count. Please refer to this [page](https://developers.binance.com/docs/binance-spot-api-docs/faqs/order_count_decrement) on how you can decrement your unfilled order count when placing orders. +- The documentation has been updated to reflect the wording. + +--- + +### 2024-08-16[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet) + +General Changes: + +- New error messages have been added when quote quantity market orders (aka reverse market orders) are rejected in low-liquidity situations. + +--- + +### 2024-08-07[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet) + +- The [QuickFIX schema](https://github.com/binance/binance-spot-api-docs/blob/master/fix/schemas/spot-fix-oe.xml) has been modified. + +--- + +### 2024-07-23[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet) + +**Note:** This will be deployed starting around 7am UTC. Please consult the Spot Test Network's [homepage](https://testnet.binance.vision/) to be informed of the release completion. + +- FIX Drop Copy sessions are now supported on the Spot Test Network. +- New API Key permission `FIX_API_READ_ONLY` has been introduced. + +--- + +### 2024-07-17[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet) + +General changes: + +- Fixed a bug where klines had incorrect timestamps. + - REST API: `GET /api/v3/klines` and `GET /api/v3/uiKlines` with `timeZone` parameter + - WebSocket API: `klines` and `uiKlines` with `timeZone` parameter + - WebSocket Streams: `@kline_@+08:00` streams + +--- + +### 2024-06-21[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet) + +- [FIX API](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) will be available today (2024-06-21) on the Spot Test Network. Please consult the Spot Test Network's [homepage](https://testnet.binance.vision/) to be informed of the release completion. + - Using the FIX API requires an Ed25519 API Key with the `FIX_API` permission. + - The release date on the live exchange has not been determined. + +--- + +### 2024-06-05[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet) + +WebSocket Streams + +- Buyer order ID (`b`) and Seller order ID (`a`) have been removed from the Trade streams. (i.e. `@trade`) +- To monitor if your order was part of a trade, please listen to the [User Data Streams](https://developers.binance.com/docs/binance-spot-api-docs/testnet/user-data-stream). + +--- + +### 2024-05-30[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet) + +WebSocket API + +- `wss://ws-api.testnet.binance.vision/ws-api/v3` is now the primary URL for the Spot Testnet WebSocket API. Other URLs will be phased out over time. + +WebSocket Streams + +- `wss://stream.testnet.binance.vision/ws` and `wss://stream.testnet.binance.vision/stream` are now the primary URLs for the Spot Testnet WebSocket Streams. Other URLs will be phased out over time. + +--- + +### 2024-05-23[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet) + +REST API + +- `orderRateLimitExceededMode` has been added to `POST /api/v3/order/cancelReplace` + +WebSocket API + +- `orderRateLimitExceededMode` has been added to `order.cancelReplace` + +WebSocket Streams + +- Kline/Candlestick streams can now support a UTC+8:00 timezone offset. (e.g. `btcusdt@kline_1d@+08:00`) + +--- + +### 2024-05-02[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet) + +- One-Triggers-the-Other (OTO) orders and One-Triggers-a-One-Cancels-The-Other (OTOCO) orders are now enabled. +- New requests have been added: + - REST API: + - `POST /api/v3/orderList/oto` + - `POST /api/v3/orderList/otoco` + - WebSocket API: + - `orderList.place.oto` + - `orderList.place.otoco` + +--- + +### 2024-04-04[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet) + +General changes: + +- Symbol permission information in Exchange Information responses has moved from field `permissions` to field `permissionSets`. +- Field `permissions` will be empty and will be removed in a future release. +- Previously, `"permissions":["SPOT","MARGIN"]` meant that you could place an order on the symbol if your account had `SPOT` or `MARGIN` permissions. The equivalent is `"permissionSets":[["SPOT","MARGIN"]]`. (Note the extra set of square brackets.) Each array of permissions inside the `permissionSets` array is called a "permission set". +- Symbol permissions can now be more complex. `"permissionSets":[["SPOT","MARGIN"],["TRD_GRP_004","TRD_GRP_005"]]` means that you may place an order on the symbol if your account has SPOT or MARGIN permissions **and** `TRD_GRP_004` or `TRD_GRP_005` permissions. There may be an arbitrary number of permission sets in a symbol's `permissionSets`. +- **The weight of the following requests has increased from 10 to 25**: + - `GET /api/v3/trades` + - `GET /api/v3/historicalTrades` + - `trades.recent` + - `trades.historical` + +REST API + +- The `POST /api/v3/order/oco` endpoint is now deprecated on the REST API. You should use the new `POST /api/v3/orderList/oco` endpoint instead. Note that this new endpoint uses different parameters. +- `POST /api/v3/order/oco` has been removed from the Rest API documentation for SPOT Testnet. +- `otoAllowed` will now appear on `GET /api/v3/exchangeInfo`, that indicates if One-Triggers-the-Other (OTO) orders are supported on that symbol. + +WebSocket API + +- The `orderList.place` request is now deprecated on the WebSocket API. You should now use the new `orderList.place.oco` request instead. Note that this new request uses different parameters. +- `orderList.place` has been removed from the WebSocket API documentation for SPOT Testnet. +- `otoAllowed` will now appear on `exchangeInfo`, that indicates if One-Triggers-the-Other (OTO) orders are supported on that symbol. + +SBE + +- A new schema 2:0 [spot\_2\_0.xml](https://github.com/binance/binance-spot-api-docs/blob/master/sbe/schemas/spot_2_0.xml) has been released for SPOT Testnet. The current schema, 1:0 [spot\_1\_0.xml](https://github.com/binance/binance-spot-api-docs/blob/becd4d44a09d94821d2dc761ba9197aae8b495c3/sbe/schemas/spot_1_0.xml), will thus be deprecated and retired from the Testnet APIs in 6 months as per our schema deprecation policy. +- When using schema 1:0 on REST API or WebSocket API, group "permissions" in message "ExchangeInfoResponse" will always be empty. Upgrade to schema 2:0 to find permission information in group "permissionSets". See General changes above for more details. +- Responses for deprecated OCO requests are supported by both schema 1:0 and 2:0 + +--- + +### 2024-03-13[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet) + +General changes: + +- `GET /api/v3/account` has a new optional parameter `omitZeroBalances`, allowing to hide all zero balances +- `account.status` has a new optional parameter `omitZeroBalances` allowing to hide all zero balances. + +User Data Stream: + +- New event `listenKeyExpired` is now emitted when a `listenKey` expires. + +- [2026-02-24](https://developers.binance.com/docs/binance-spot-api-docs/testnet) +- [2026-02-09](https://developers.binance.com/docs/binance-spot-api-docs/testnet) +- [2026-02-04](https://developers.binance.com/docs/binance-spot-api-docs/testnet) +- [2026-02-02](https://developers.binance.com/docs/binance-spot-api-docs/testnet) +- [2026-01-27](https://developers.binance.com/docs/binance-spot-api-docs/testnet) +- [2026-01-26](https://developers.binance.com/docs/binance-spot-api-docs/testnet) +- [2026-01-21](https://developers.binance.com/docs/binance-spot-api-docs/testnet) +- [2026-01-07](https://developers.binance.com/docs/binance-spot-api-docs/testnet) +- [2025-12-18](https://developers.binance.com/docs/binance-spot-api-docs/testnet) +- [2025-12-17](https://developers.binance.com/docs/binance-spot-api-docs/testnet) +- [2025-12-15](https://developers.binance.com/docs/binance-spot-api-docs/testnet) +- [2025-12-09](https://developers.binance.com/docs/binance-spot-api-docs/testnet) +- [2025-12-04](https://developers.binance.com/docs/binance-spot-api-docs/testnet) +- [2025-11-28](https://developers.binance.com/docs/binance-spot-api-docs/testnet) +- [2025-11-25](https://developers.binance.com/docs/binance-spot-api-docs/testnet) +- [2025-11-14](https://developers.binance.com/docs/binance-spot-api-docs/testnet) +- [2025-11-12](https://developers.binance.com/docs/binance-spot-api-docs/testnet) +- [2025-11-11](https://developers.binance.com/docs/binance-spot-api-docs/testnet) +- [2025-11-10](https://developers.binance.com/docs/binance-spot-api-docs/testnet) +- [2025-11-05](https://developers.binance.com/docs/binance-spot-api-docs/testnet) +- [2025-10-24](https://developers.binance.com/docs/binance-spot-api-docs/testnet) +- [2025-10-17](https://developers.binance.com/docs/binance-spot-api-docs/testnet) +- [2025-10-08](https://developers.binance.com/docs/binance-spot-api-docs/testnet) +- [2025-10-01](https://developers.binance.com/docs/binance-spot-api-docs/testnet) +- [2025-09-24](https://developers.binance.com/docs/binance-spot-api-docs/testnet) +- [2025-09-18](https://developers.binance.com/docs/binance-spot-api-docs/testnet) +- [2025-09-12](https://developers.binance.com/docs/binance-spot-api-docs/testnet) +- [2025-09-05](https://developers.binance.com/docs/binance-spot-api-docs/testnet) +- [2025-08-28](https://developers.binance.com/docs/binance-spot-api-docs/testnet) +- [2025-08-26](https://developers.binance.com/docs/binance-spot-api-docs/testnet) +- [2025-08-25](https://developers.binance.com/docs/binance-spot-api-docs/testnet) +- [2025-08-19](https://developers.binance.com/docs/binance-spot-api-docs/testnet) +- [2025-08-07](https://developers.binance.com/docs/binance-spot-api-docs/testnet) +- [2025-08-05](https://developers.binance.com/docs/binance-spot-api-docs/testnet) +- [2025-07-02](https://developers.binance.com/docs/binance-spot-api-docs/testnet) +- [2025-06-04](https://developers.binance.com/docs/binance-spot-api-docs/testnet) +- [2025-05-28](https://developers.binance.com/docs/binance-spot-api-docs/testnet) +- [2025-05-22](https://developers.binance.com/docs/binance-spot-api-docs/testnet) +- [2025-05-21](https://developers.binance.com/docs/binance-spot-api-docs/testnet) +- [2025-04-29](https://developers.binance.com/docs/binance-spot-api-docs/testnet) +- [2025-04-25](https://developers.binance.com/docs/binance-spot-api-docs/testnet) +- [2025-04-21](https://developers.binance.com/docs/binance-spot-api-docs/testnet) +- [2025-04-01](https://developers.binance.com/docs/binance-spot-api-docs/testnet) +- [2025-03-31](https://developers.binance.com/docs/binance-spot-api-docs/testnet) +- [2025-03-13](https://developers.binance.com/docs/binance-spot-api-docs/testnet) +- [2025-03-05](https://developers.binance.com/docs/binance-spot-api-docs/testnet) +- [2025-02-28](https://developers.binance.com/docs/binance-spot-api-docs/testnet) +- [2025-02-05](https://developers.binance.com/docs/binance-spot-api-docs/testnet) +- [2024-12-17](https://developers.binance.com/docs/binance-spot-api-docs/testnet) +- [2024-11-27](https://developers.binance.com/docs/binance-spot-api-docs/testnet) +- [2024-11-05](https://developers.binance.com/docs/binance-spot-api-docs/testnet) +- [2024-10-02](https://developers.binance.com/docs/binance-spot-api-docs/testnet) +- [2024-09-04](https://developers.binance.com/docs/binance-spot-api-docs/testnet) +- [2024-08-16](https://developers.binance.com/docs/binance-spot-api-docs/testnet) +- [2024-08-07](https://developers.binance.com/docs/binance-spot-api-docs/testnet) +- [2024-07-23](https://developers.binance.com/docs/binance-spot-api-docs/testnet) +- [2024-07-17](https://developers.binance.com/docs/binance-spot-api-docs/testnet) +- [2024-06-21](https://developers.binance.com/docs/binance-spot-api-docs/testnet) +- [2024-06-05](https://developers.binance.com/docs/binance-spot-api-docs/testnet) +- [2024-05-30](https://developers.binance.com/docs/binance-spot-api-docs/testnet) +- [2024-05-23](https://developers.binance.com/docs/binance-spot-api-docs/testnet) +- [2024-05-02](https://developers.binance.com/docs/binance-spot-api-docs/testnet) +- [2024-04-04](https://developers.binance.com/docs/binance-spot-api-docs/testnet) +- [2024-03-13](https://developers.binance.com/docs/binance-spot-api-docs/testnet) diff --git a/docs/binance/binance-spot/testnet_TESTNET-TERMS-OF-USE.md b/docs/binance/binance-spot/testnet_TESTNET-TERMS-OF-USE.md new file mode 100644 index 0000000..474c9a7 --- /dev/null +++ b/docs/binance/binance-spot/testnet_TESTNET-TERMS-OF-USE.md @@ -0,0 +1,9 @@ +--- +title: "Testnet Terms of Use | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs/testnet/TESTNET-TERMS-OF-USE" +fetched_at: "2026-02-26T10:38:09.536Z" +--- +# SPOT Testnet Terms of Use + +The Binance Spot Testnet and Futures Testnet are subject to the [Testnet Terms of Use](https://www.binance.com/en/about-legal/terms-testnets). +Please read it carefully before proceeding. diff --git a/docs/binance/binance-spot/testnet_enums.md b/docs/binance/binance-spot/testnet_enums.md new file mode 100644 index 0000000..85b2868 --- /dev/null +++ b/docs/binance/binance-spot/testnet_enums.md @@ -0,0 +1,213 @@ +--- +title: "Enums | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums" +fetched_at: "2026-02-26T10:38:09.538Z" +--- +# ENUM Definitions + +This will apply for both REST API and WebSocket API. + +## Symbol status (status):[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums) + +- `TRADING` +- `END_OF_DAY` +- `HALT` +- `BREAK` + +## Account and Symbol Permissions (permissions)[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums) + +- `SPOT` + +## Order status (status)[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums) + +Status + +Description + +`NEW` + +The order has been accepted by the engine. + +`PENDING_NEW` + +The order is in a pending phase until the working order of an order list has been fully filled. + +`PARTIALLY_FILLED` + +A part of the order has been filled. + +`FILLED` + +The order has been completed. + +`CANCELED` + +The order has been canceled by the user. + +`PENDING_CANCEL` + +Currently unused + +`REJECTED` + +The order was not accepted by the engine and not processed. + +`EXPIRED` + +The order was canceled according to the order type's rules (e.g. LIMIT FOK orders with no fill, LIMIT IOC or MARKET orders that partially fill) +or by the exchange, (e.g. orders canceled during liquidation, orders canceled during maintenance) + +`EXPIRED_IN_MATCH` + +The order was expired by the exchange due to STP. (e.g. an order with `EXPIRE_TAKER` will match with existing orders on the book with the same account or same `tradeGroupId`) + +## Order List Status (listStatusType)[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums) + +Status + +Description + +`RESPONSE` + +This is used when the ListStatus is responding to a failed action. (E.g. order list placement or cancellation) + +`EXEC_STARTED` + +The order list has been placed or there is an update to the order list status. + +`UPDATED` + +The clientOrderId of an order in the order list has been changed. + +`ALL_DONE` + +The order list has finished executing and thus is no longer active. + +## Order List Order Status (listOrderStatus)[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums) + +Status + +Description + +`EXECUTING` + +Either an order list has been placed or there is an update to the status of the list. + +`ALL_DONE` + +An order list has completed execution and thus no longer active. + +`REJECT` + +The List Status is responding to a failed action either during order placement or order canceled. + +## ContingencyType[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums) + +- `OCO` +- `OTO` + +## AllocationType[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums) + +- `SOR` + +## Order types (orderTypes, type)[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums) + +- `LIMIT` +- `MARKET` +- `STOP_LOSS` +- `STOP_LOSS_LIMIT` +- `TAKE_PROFIT` +- `TAKE_PROFIT_LIMIT` +- `LIMIT_MAKER` + +## Order Response Type (newOrderRespType)[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums) + +- `ACK` +- `RESULT` +- `FULL` + +## Working Floor[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums) + +- `EXCHANGE` +- `SOR` + +## Order side (side)[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums) + +- `BUY` +- `SELL` + +## Time in force (timeInForce)[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums) + +This sets how long an order will be active before expiration. + +Status + +Description + +`GTC` + +Good Til Canceled +An order will be on the book unless the order is canceled. + +`IOC` + +Immediate Or Cancel +An order will try to fill the order as much as it can before the order expires. + +`FOK` + +Fill or Kill +An order will expire if the full order cannot be filled upon execution. + +## Rate limiters (rateLimitType)[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums) + +- REQUEST\_WEIGHT + +``` +{ "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000} +``` + +- ORDERS + +``` +{ "rateLimitType": "ORDERS", "interval": "SECOND", "intervalNum": 1, "limit": 10} +``` + +- RAW\_REQUESTS + +``` +{ "rateLimitType": "RAW_REQUESTS", "interval": "MINUTE", "intervalNum": 5, "limit": 61000} +``` + +## Rate limit intervals (interval)[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums) + +- SECOND +- MINUTE +- DAY + +## STP Modes[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums) + +Read [Self Trade Prevention (STP) FAQ](https://developers.binance.com/docs/binance-spot-api-docs/faqs/stp_faq) to learn more. + +- `NONE` +- `EXPIRE_MAKER` +- `EXPIRE_TAKER` +- `EXPIRE_BOTH` +- `DECREMENT` +- `TRANSFER` + +- [Symbol status (status):](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums) +- [Account and Symbol Permissions (permissions)](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums) +- [Order status (status)](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums) +- [Order List Status (listStatusType)](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums) +- [Order List Order Status (listOrderStatus)](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums) +- [ContingencyType](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums) +- [AllocationType](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums) +- [Order types (orderTypes, type)](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums) +- [Order Response Type (newOrderRespType)](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums) +- [Working Floor](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums) +- [Order side (side)](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums) +- [Time in force (timeInForce)](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums) +- [Rate limiters (rateLimitType)](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums) +- [Rate limit intervals (interval)](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums) +- [STP Modes](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums) diff --git a/docs/binance/binance-spot/testnet_errors.md b/docs/binance/binance-spot/testnet_errors.md new file mode 100644 index 0000000..875ca02 --- /dev/null +++ b/docs/binance/binance-spot/testnet_errors.md @@ -0,0 +1,833 @@ +--- +title: "Errors | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors" +fetched_at: "2026-02-26T10:38:09.991Z" +--- +# Error codes for Binance SPOT Testnet + +Errors consist of two parts: an error code and a message. Codes are universal, but messages can vary. Here is the error JSON payload: + +``` +{ "code": -1121, "msg": "Invalid symbol."} +``` + +## 10xx - General Server or Network issues[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +### \-1000 UNKNOWN[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- An unknown error occurred while processing the request. + +### \-1001 DISCONNECTED[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- Internal error; unable to process your request. Please try again. + +### \-1002 UNAUTHORIZED[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- You are not authorized to execute this request. + +### \-1003 TOO\_MANY\_REQUESTS[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- Too many requests queued. +- Too much request weight used; current limit is %s request weight per %s. Please use WebSocket Streams for live updates to avoid polling the API. +- Way too much request weight used; IP banned until %s. Please use WebSocket Streams for live updates to avoid bans. + +### \-1006 UNEXPECTED\_RESP[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- An unexpected response was received from the message bus. Execution status unknown. + +### \-1007 TIMEOUT[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- Timeout waiting for response from backend server. Send status unknown; execution status unknown. + +### \-1008 SERVER\_BUSY[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- Server is currently overloaded with other requests. Please try again in a few minutes. + +### \-1013 INVALID\_MESSAGE[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- The request is rejected by the API. (i.e. The request didn't reach the Matching Engine.) +- Potential error messages can be found in [Filter Failures](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) or [Failures during order placement](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors). + +### \-1014 UNKNOWN\_ORDER\_COMPOSITION[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- Unsupported order combination. + +### \-1015 TOO\_MANY\_ORDERS[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- Too many new orders. +- Too many new orders; current limit is %s orders per %s. + +### \-1016 SERVICE\_SHUTTING\_DOWN[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- This service is no longer available. + +### \-1020 UNSUPPORTED\_OPERATION[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- This operation is not supported. + +### \-1021 INVALID\_TIMESTAMP[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- Timestamp for this request is outside of the recvWindow. +- Timestamp for this request was 1000ms ahead of the server's time. + +### \-1022 INVALID\_SIGNATURE[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- Signature for this request is not valid. + +### \-1033 COMP\_ID\_IN\_USE[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- `SenderCompId(49)` is currently in use. Concurrent use of the same SenderCompId within one account is not allowed. + +### \-1034 TOO\_MANY\_CONNECTIONS[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- Too many concurrent connections; current limit is '%s'. +- Too many connection attempts for account; current limit is %s per '%s'. +- Too many connection attempts from IP; current limit is %s per '%s'. + +### \-1035 LOGGED\_OUT[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- Please send [Logout`<5>`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) message to close the session. + +## 11xx - Request issues[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +### \-1100 ILLEGAL\_CHARS[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- Illegal characters found in a parameter. +- Illegal characters found in parameter '%s'; legal range is '%s'. + +### \-1101 TOO\_MANY\_PARAMETERS[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- Too many parameters sent for this endpoint. +- Too many parameters; expected '%s' and received '%s'. +- Duplicate values for a parameter detected. + +### \-1102 MANDATORY\_PARAM\_EMPTY\_OR\_MALFORMED[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- A mandatory parameter was not sent, was empty/null, or malformed. +- Mandatory parameter '%s' was not sent, was empty/null, or malformed. +- Param '%s' or '%s' must be sent, but both were empty/null! +- Required tag '%s' missing. +- Field value was empty or malformed. +- '%s' contains unexpected value. Cannot be greater than %s. + +### \-1103 UNKNOWN\_PARAM[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- An unknown parameter was sent. +- Undefined Tag. + +### \-1104 UNREAD\_PARAMETERS[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- Not all sent parameters were read. +- Not all sent parameters were read; read '%s' parameter(s) but was sent '%s'. + +### \-1105 PARAM\_EMPTY[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- A parameter was empty. +- Parameter '%s' was empty. + +### \-1106 PARAM\_NOT\_REQUIRED[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- A parameter was sent when not required. +- Parameter '%s' sent when not required. +- A tag '%s' was sent when not required. + +### \-1108 PARAM\_OVERFLOW[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- Parameter '%s' overflowed. + +### \-1111 BAD\_PRECISION[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- Parameter '%s' has too much precision. + +### \-1112 NO\_DEPTH[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- No orders on book for symbol. + +### \-1114 TIF\_NOT\_REQUIRED[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- TimeInForce parameter sent when not required. + +### \-1115 INVALID\_TIF[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- Invalid timeInForce. + +### \-1116 INVALID\_ORDER\_TYPE[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- Invalid orderType. + +### \-1117 INVALID\_SIDE[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- Invalid side. + +### \-1118 EMPTY\_NEW\_CL\_ORD\_ID[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- New client order ID was empty. + +### \-1119 EMPTY\_ORG\_CL\_ORD\_ID[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- Original client order ID was empty. + +### \-1120 BAD\_INTERVAL[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- Invalid interval. + +### \-1121 BAD\_SYMBOL[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- Invalid symbol. + +### \-1122 INVALID\_SYMBOLSTATUS[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- Invalid symbolStatus. + +### \-1125 INVALID\_LISTEN\_KEY[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- This listenKey does not exist. + +### \-1127 MORE\_THAN\_XX\_HOURS[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- Lookup interval is too big. +- More than %s hours between startTime and endTime. + +### \-1128 OPTIONAL\_PARAMS\_BAD\_COMBO[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- Combination of optional parameters invalid. +- Combination of optional fields invalid. Recommendation: '%s' and '%s' must both be sent. +- Fields \[%s\] must be sent together or omitted entirely. +- Invalid `MDEntryType (269)` combination. BID and OFFER must be requested together. +- Conflicting fields: \['%s'...\] + +### \-1130 INVALID\_PARAMETER[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- Invalid data sent for a parameter. +- Data sent for parameter '%s' is not valid. + +### \-1134 BAD\_STRATEGY\_TYPE[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- `strategyType` was less than 1000000. +- `TargetStrategy (847)` was less than 1000000. + +### \-1135 INVALID\_JSON[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- Invalid JSON Request. +- JSON sent for parameter '%s' is not valid + +### \-1139 INVALID\_TICKER\_TYPE[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- Invalid ticker type. + +### \-1145 INVALID\_CANCEL\_RESTRICTIONS[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- `cancelRestrictions` has to be either `ONLY_NEW` or `ONLY_PARTIALLY_FILLED`. + +### \-1151 DUPLICATE\_SYMBOLS[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- Symbol is present multiple times in the list. + +### \-1152 INVALID\_SBE\_HEADER[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- Invalid `X-MBX-SBE` header; expected `:`. +- Invalid SBE message header. + +### \-1153 UNSUPPORTED\_SCHEMA\_ID[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- Unsupported SBE schema ID or version specified in the `X-MBX-SBE` header. +- Invalid SBE schema ID or version specified. + +### \-1155 SBE\_DISABLED[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- SBE is not enabled. + +### \-1158 OCO\_ORDER\_TYPE\_REJECTED[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- Order type not supported in OCO. +- If the order type provided in the `aboveType` and/or `belowType` is not supported. + +### \-1160 OCO\_ICEBERGQTY\_TIMEINFORCE[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- Parameter '%s' is not supported if `aboveTimeInForce`/`belowTimeInForce` is not GTC. +- If the order type for the above or below leg is `STOP_LOSS_LIMIT`, and `icebergQty` is provided for that leg, the `timeInForce` has to be `GTC` else it will throw an error. +- `TimeInForce (59)` must be `GTC (1)` when `MaxFloor (111)` is used. + +### \-1161 DEPRECATED\_SCHEMA[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- Unable to encode the response in SBE schema 'x'. Please use schema 'y' or higher. + +### \-1165 BUY\_OCO\_LIMIT\_MUST\_BE\_BELOW[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- A limit order in a buy OCO must be below. + +### \-1166 SELL\_OCO\_LIMIT\_MUST\_BE\_ABOVE[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- A limit order in a sell OCO must be above. + +### \-1168 BOTH\_OCO\_ORDERS\_CANNOT\_BE\_LIMIT[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- At least one OCO order must be contingent. + +### \-1169 INVALID\_TAG\_NUMBER[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- Invalid tag number. + +### \-1170 TAG\_NOT\_DEFINED\_IN\_MESSAGE[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- Tag '%s' not defined for this message type. + +### \-1171 TAG\_APPEARS\_MORE\_THAN\_ONCE[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- Tag '%s' appears more than once. + +### \-1172 TAG\_OUT\_OF\_ORDER[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- Tag '%s' specified out of required order. + +### \-1173 GROUP\_FIELDS\_OUT\_OF\_ORDER[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- Repeating group '%s' fields out of order. + +### \-1174 INVALID\_COMPONENT[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- Component '%s' is incorrectly populated on '%s' order. Recommendation: '%s' + +### \-1175 RESET\_SEQ\_NUM\_SUPPORT[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- Continuation of sequence numbers to new session is currently unsupported. Sequence numbers must be reset for each new session. + +### \-1176 ALREADY\_LOGGED\_IN[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- [Logon``](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) should only be sent once. + +### \-1177 GARBLED\_MESSAGE[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- `CheckSum(10)` contains an incorrect value. +- `BeginString (8)` is not the first tag in a message. +- `MsgType (35)` is not the third tag in a message. +- `BodyLength (9)` does not contain the correct byte count. +- Only printable ASCII characters and SOH (Start of Header) are allowed. +- Tag specified without a value. +- Invalid encodingType. + +### \-1178 BAD\_SENDER\_COMPID[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- `SenderCompId(49)` contains an incorrect value. The SenderCompID value should not change throughout the lifetime of a session. + +### \-1179 BAD\_SEQ\_NUM[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- `MsgSeqNum(34)` contains an unexpected value. Expected: '%d'. + +### \-1180 EXPECTED\_LOGON[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- [Logon``](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) must be the first message in the session. + +### \-1181 TOO\_MANY\_MESSAGES[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- Too many messages; current limit is '%d' messages per '%s'. + +### \-1182 PARAMS\_BAD\_COMBO[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- Conflicting fields: \[%s\] + +### \-1183 NOT\_ALLOWED\_IN\_DROP\_COPY\_SESSIONS[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- Requested operation is not allowed in DropCopy sessions. + +### \-1184 DROP\_COPY\_SESSION\_NOT\_ALLOWED[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- DropCopy sessions are not supported on this server. Please reconnect to a drop copy server. + +### \-1185 DROP\_COPY\_SESSION\_REQUIRED[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- Only DropCopy sessions are supported on this server. Either reconnect to order entry server or send `DropCopyFlag (9406)` field. + +### \-1186 NOT\_ALLOWED\_IN\_ORDER\_ENTRY\_SESSIONS[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- Requested operation is not allowed in order entry sessions. + +### \-1187 NOT\_ALLOWED\_IN\_MARKET\_DATA\_SESSIONS[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- Requested operation is not allowed in market data sessions. + +### \-1188 INCORRECT\_NUM\_IN\_GROUP\_COUNT[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- Incorrect NumInGroup count for repeating group '%s'. + +### \-1189 DUPLICATE\_ENTRIES\_IN\_A\_GROUP[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- Group '%s' contains duplicate entries. + +### \-1190 INVALID\_REQUEST\_ID[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- `MDReqID (262)` contains a subscription request id that is already in use on this connection. +- `MDReqID (262)` contains an unsubscription request id that does not match any active subscription. + +### \-1191 TOO\_MANY\_SUBSCRIPTIONS[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- Too many subscriptions. Connection may create up to '%s' subscriptions at a time. +- Similar subscription is already active on this connection. Symbol='%s', active subscription id: '%s'. + +### \-1194 INVALID\_TIME\_UNIT[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- Invalid value for time unit; expected either MICROSECOND or MILLISECOND. + +### \-1196 BUY\_OCO\_STOP\_LOSS\_MUST\_BE\_ABOVE[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- A stop loss order in a buy OCO must be above. + +### \-1197 SELL\_OCO\_STOP\_LOSS\_MUST\_BE\_BELOW[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- A stop loss order in a sell OCO must be below. + +### \-1198 BUY\_OCO\_TAKE\_PROFIT\_MUST\_BE\_BELOW[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- A take profit order in a buy OCO must be below. + +### \-1199 SELL\_OCO\_TAKE\_PROFIT\_MUST\_BE\_ABOVE[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- A take profit order in a sell OCO must be above. + +### \-1210 INVALID\_PEG\_PRICE\_TYPE[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- Invalid pegPriceType. + +### \-1211 INVALID\_PEG\_OFFSET\_TYPE[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- Invalid pegOffsetType. + +### \-1220 SYMBOL\_DOES\_NOT\_MATCH\_STATUS[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- The symbol's status does not match the requested symbolStatus. + +### \-1221 INVALID\_SBE\_MESSAGE\_FIELD[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- Invalid/missing field(s) in SBE message. + +### \-1222 OPO\_WORKING\_MUST\_BE\_BUY[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- Working order in an OPO list must be a bid. + +### \-1223 OPO\_PENDING\_MUST\_BE\_SELL[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- Pending orders in an OPO list must be asks. + +### \-1224 WORKING\_PARAM\_REQUIRED[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- Working order must include the '{param}' tag. + +### \-1225 PENDING\_PARAM\_NOT\_REQUIRED[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- Pending orders should not include the '%s' tag. + +### \-2010 NEW\_ORDER\_REJECTED[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- NEW\_ORDER\_REJECTED + +### \-2011 CANCEL\_REJECTED[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- CANCEL\_REJECTED + +### \-2013 NO\_SUCH\_ORDER[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- Order does not exist. + +### \-2014 BAD\_API\_KEY\_FMT[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- API-key format invalid. + +### \-2015 REJECTED\_MBX\_KEY[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- Invalid API-key, IP, or permissions for action. + +### \-2016 NO\_TRADING\_WINDOW[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- No trading window could be found for the symbol. Try ticker/24hrs instead. + +### \-2026 ORDER\_ARCHIVED[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- Order was canceled or expired with no executed qty over 90 days ago and has been archived. + +### \-2035 SUBSCRIPTION\_ACTIVE[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- User Data Stream subscription already active. + +### \-2036 SUBSCRIPTION\_INACTIVE[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- User Data Stream subscription not active. + +### \-2039 CLIENT\_ORDER\_ID\_INVALID[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- Client order ID is not correct for this order ID. + +### \-2042 MAXIMUM\_SUBSCRIPTION\_IDS[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- Maximum subscription ID reached for this connection. + +## Messages for -1010 ERROR\_MSG\_RECEIVED, -2010 NEW\_ORDER\_REJECTED, -2011 CANCEL\_REJECTED, and -2038 ORDER\_AMEND\_REJECTED[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +This code is sent when an error has been returned by the matching engine. The following messages which will indicate the specific error: + +Error message + +Description + +"Unknown order sent." + +The order (by either `orderId`, `clOrdId`, `origClOrdId`) could not be found. + +"Duplicate order sent." + +The `clOrdId` is already in use. + +"Market is closed." + +The symbol is not trading. + +"Account has insufficient balance for requested action." + +Not enough funds to complete the action. + +"Market orders are not supported for this symbol." + +`MARKET` is not enabled on the symbol. + +"Iceberg orders are not supported for this symbol." + +`icebergQty` is not enabled on the symbol. + +"Stop loss orders are not supported for this symbol." + +`STOP_LOSS` is not enabled on the symbol. + +"Stop loss limit orders are not supported for this symbol." + +`STOP_LOSS_LIMIT` is not enabled on the symbol. + +"Take profit orders are not supported for this symbol." + +`TAKE_PROFIT` is not enabled on the symbol. + +"Take profit limit orders are not supported for this symbol." + +`TAKE_PROFIT_LIMIT` is not enabled on the symbol. + +"Order amend is not supported for this symbol." + +Order amend keep priority is not enabled on the symbol. + +"Price \* QTY is zero or less." + +`price` \* `quantity` is too low. + +"IcebergQty exceeds QTY." + +`icebergQty` must be less than the order quantity. + +"This action is disabled on this account." + +Contact customer support; some actions have been disabled on the account. + +"This account may not place or cancel orders." + +Contact customer support; the account has trading ability disabled. + +"Unsupported order combination" + +The `orderType`, `timeInForce`, `stopPrice`, and/or `icebergQty` combination isn't allowed. + +"Order would trigger immediately." + +The order's stop price is not valid when compared to the last traded price. + +"Cancel order is invalid. Check origClOrdId and orderId." + +No `origClOrdId` or `orderId` was sent in. + +"Order would immediately match and take." + +`LIMIT_MAKER` order type would immediately match and trade, and not be a pure maker order. + +"The relationship of the prices for the orders is not correct." + +The prices set in the `OCO` is breaking the Price restrictions. +If the `aboveType` is `LIMIT_MAKER` and the `belowType` is either a `STOP_LOSS` or `STOP_LOSS_LIMIT`: +`abovePrice` > Last Traded Price > `belowStopPrice`. +If the `aboveType` is `STOP_LOSS` or `STOP_LOSS_LIMIT`, and the `belowType` is `LIMIT_MAKER`: +`aboveStopPrice` > Last Traded Price > `belowPrice`. + +"OCO orders are not supported for this symbol" + +`OCO` is not enabled on the symbol. + +"Quote order qty market orders are not support for this symbol." + +`MARKET` orders using the parameter `quoteOrderQty` are not enabled on the symbol. + +"Trailing stop orders are not supported for this symbol." + +Orders using `trailingDelta` are not enabled on the symbol. + +"Order cancel-replace is not supported for this symbol." + +`POST /api/v3/order/cancelReplace` (REST API) or `order.cancelReplace` (WebSocket API) is not enabled on the symbol. + +"This symbol is not permitted for this account." + +Account and symbol do not have the same permissions. (e.g. `SPOT`, `MARGIN`, etc) + +"This symbol is restricted for this account." + +Account is unable to trade on that symbol. (e.g. An `ISOLATED_MARGIN` account cannot place `SPOT` orders.) + +"Order was not canceled due to cancel restrictions." + +Either `cancelRestrictions` was set to `ONLY_NEW` but the order status was not `NEW` +or +`cancelRestrictions` was set to `ONLY_PARTIALLY_FILLED` but the order status was not `PARTIALLY_FILLED`. + +"Rest API trading is not enabled." / "WebSocket API trading is not enabled." + +Order is being placed or a server that is not configured to allow access to `TRADE` endpoints. + +"FIX API trading is not enabled. + +Order is placed on a FIX server that is not TRADE enabled. + +"Order book liquidity is less than `LOT_SIZE` filter minimum quantity." + +Quote quantity market orders cannot be placed when the order book liquidity is less than minimum quantity configured for the `LOT_SIZE` filter. + +"Order book liquidity is less than `MARKET_LOT_SIZE` filter minimum quantity." + +Quote quantity market orders cannot be placed when the order book liquidity is less than the minimum quantity for `MARKET_LOT_SIZE` filter. + +"Order book liquidity is less than symbol minimum quantity." + +Quote quantity market orders cannot be placed when there are no orders on the book. + +"Order amend (quantity increase) is not supported." + +`newQty` must be less than the order quantity. + +"The requested action would change no state; rejecting". + +The request sent would not have changed the status quo. + +(e.g. `newQty` cannot equal the order quantity.) + +"Pegged orders are not supported for this symbol." + +`pegInstructionsAllowed` has not been enabled. + +"This order type may not use pegged price." + +You are using parameter `pegPriceType` with an unsupported order type. (e.g. `MARKET`) + +"This price peg cannot be used with this order type." + +You are using `pegPriceType`\=`MARKET_PEG` for a `LIMIT_MAKER` order. + +"Order book liquidity is too low for this pegged order." + +The order book doesn’t have the best price level to peg the price to. + +OPO orders are not supported for this symbol. + +Order amend (pending OPO order) is not supported. + +You cannot amend the pending quantity of an OPO order + +## Errors regarding placing orders via cancelReplace[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +### \-2021 Order cancel-replace partially failed[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- This code is sent when either the cancellation of the order failed or the new order placement failed but not both. + +### \-2022 Order cancel-replace failed.[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +- This code is sent when both the cancellation of the order failed and the new order placement failed. + +## Filter failures[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +Error message + +Description + +"Filter failure: PRICE\_FILTER" + +`price` is too high, too low, and/or not following the tick size rule for the symbol. + +"Filter failure: PERCENT\_PRICE" + +`price` is X% too high or X% too low from the average weighted price over the last Y minutes. + +"Filter failure: LOT\_SIZE" + +`quantity` is too high, too low, and/or not following the step size rule for the symbol. + +"Filter failure: MIN\_NOTIONAL" + +`price` \* `quantity` is too low to be a valid order for the symbol. + +"Filter failure: NOTIONAL" + +`price` \* `quantity` is not within range of the `minNotional` and `maxNotional` + +"Filter failure: ICEBERG\_PARTS" + +`ICEBERG` order would break into too many parts; icebergQty is too small. + +"Filter failure: MARKET\_LOT\_SIZE" + +`MARKET` order's `quantity` is too high, too low, and/or not following the step size rule for the symbol. + +"Filter failure: MAX\_POSITION" + +The account's position has reached the maximum defined limit. +This is composed of the sum of the balance of the base asset, and the sum of the quantity of all open `BUY` orders. + +"Filter failure: MAX\_NUM\_ORDERS" + +Account has too many open orders on the symbol. + +"Filter failure: MAX\_NUM\_ALGO\_ORDERS" + +Account has too many open stop loss and/or take profit orders on the symbol. + +"Filter failure: MAX\_NUM\_ICEBERG\_ORDERS" + +Account has too many open iceberg orders on the symbol. + +"Filter failure: MAX\_NUM\_ORDER\_AMENDS" + +Account has made too many amendments to a single order on the symbol. + +"Filter failure: MAX\_NUM\_ORDER\_LISTS" + +Account has too many open order lists on the symbol. + +"Filter failure: TRAILING\_DELTA" + +`trailingDelta` is not within the defined range of the filter for that order type. + +"Filter failure: EXCHANGE\_MAX\_NUM\_ORDERS" + +Account has too many open orders on the exchange. + +"Filter failure: EXCHANGE\_MAX\_NUM\_ALGO\_ORDERS" + +Account has too many open stop loss and/or take profit orders on the exchange. + +"Filter failure: EXCHANGE\_MAX\_NUM\_ICEBERG\_ORDERS" + +Account has too many open iceberg orders on the exchange. + +"Filter failure: EXCHANGE\_MAX\_NUM\_ORDER\_LISTS" + +Account has too many open order lists on the exchange. + +- [10xx - General Server or Network issues](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1000 UNKNOWN](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1001 DISCONNECTED](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1002 UNAUTHORIZED](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1003 TOO\_MANY\_REQUESTS](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1006 UNEXPECTED\_RESP](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1007 TIMEOUT](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1008 SERVER\_BUSY](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1013 INVALID\_MESSAGE](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1014 UNKNOWN\_ORDER\_COMPOSITION](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1015 TOO\_MANY\_ORDERS](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1016 SERVICE\_SHUTTING\_DOWN](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1020 UNSUPPORTED\_OPERATION](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1021 INVALID\_TIMESTAMP](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1022 INVALID\_SIGNATURE](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1033 COMP\_ID\_IN\_USE](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1034 TOO\_MANY\_CONNECTIONS](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1035 LOGGED\_OUT](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) +- [11xx - Request issues](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1100 ILLEGAL\_CHARS](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1101 TOO\_MANY\_PARAMETERS](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1102 MANDATORY\_PARAM\_EMPTY\_OR\_MALFORMED](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1103 UNKNOWN\_PARAM](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1104 UNREAD\_PARAMETERS](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1105 PARAM\_EMPTY](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1106 PARAM\_NOT\_REQUIRED](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1108 PARAM\_OVERFLOW](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1111 BAD\_PRECISION](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1112 NO\_DEPTH](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1114 TIF\_NOT\_REQUIRED](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1115 INVALID\_TIF](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1116 INVALID\_ORDER\_TYPE](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1117 INVALID\_SIDE](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1118 EMPTY\_NEW\_CL\_ORD\_ID](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1119 EMPTY\_ORG\_CL\_ORD\_ID](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1120 BAD\_INTERVAL](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1121 BAD\_SYMBOL](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1122 INVALID\_SYMBOLSTATUS](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1125 INVALID\_LISTEN\_KEY](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1127 MORE\_THAN\_XX\_HOURS](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1128 OPTIONAL\_PARAMS\_BAD\_COMBO](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1130 INVALID\_PARAMETER](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1134 BAD\_STRATEGY\_TYPE](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1135 INVALID\_JSON](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1139 INVALID\_TICKER\_TYPE](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1145 INVALID\_CANCEL\_RESTRICTIONS](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1151 DUPLICATE\_SYMBOLS](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1152 INVALID\_SBE\_HEADER](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1153 UNSUPPORTED\_SCHEMA\_ID](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1155 SBE\_DISABLED](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1158 OCO\_ORDER\_TYPE\_REJECTED](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1160 OCO\_ICEBERGQTY\_TIMEINFORCE](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1161 DEPRECATED\_SCHEMA](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1165 BUY\_OCO\_LIMIT\_MUST\_BE\_BELOW](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1166 SELL\_OCO\_LIMIT\_MUST\_BE\_ABOVE](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1168 BOTH\_OCO\_ORDERS\_CANNOT\_BE\_LIMIT](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1169 INVALID\_TAG\_NUMBER](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1170 TAG\_NOT\_DEFINED\_IN\_MESSAGE](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1171 TAG\_APPEARS\_MORE\_THAN\_ONCE](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1172 TAG\_OUT\_OF\_ORDER](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1173 GROUP\_FIELDS\_OUT\_OF\_ORDER](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1174 INVALID\_COMPONENT](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1175 RESET\_SEQ\_NUM\_SUPPORT](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1176 ALREADY\_LOGGED\_IN](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1177 GARBLED\_MESSAGE](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1178 BAD\_SENDER\_COMPID](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1179 BAD\_SEQ\_NUM](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1180 EXPECTED\_LOGON](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1181 TOO\_MANY\_MESSAGES](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1182 PARAMS\_BAD\_COMBO](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1183 NOT\_ALLOWED\_IN\_DROP\_COPY\_SESSIONS](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1184 DROP\_COPY\_SESSION\_NOT\_ALLOWED](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1185 DROP\_COPY\_SESSION\_REQUIRED](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1186 NOT\_ALLOWED\_IN\_ORDER\_ENTRY\_SESSIONS](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1187 NOT\_ALLOWED\_IN\_MARKET\_DATA\_SESSIONS](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1188 INCORRECT\_NUM\_IN\_GROUP\_COUNT](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1189 DUPLICATE\_ENTRIES\_IN\_A\_GROUP](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1190 INVALID\_REQUEST\_ID](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1191 TOO\_MANY\_SUBSCRIPTIONS](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1194 INVALID\_TIME\_UNIT](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1196 BUY\_OCO\_STOP\_LOSS\_MUST\_BE\_ABOVE](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1197 SELL\_OCO\_STOP\_LOSS\_MUST\_BE\_BELOW](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1198 BUY\_OCO\_TAKE\_PROFIT\_MUST\_BE\_BELOW](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1199 SELL\_OCO\_TAKE\_PROFIT\_MUST\_BE\_ABOVE](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1210 INVALID\_PEG\_PRICE\_TYPE](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1211 INVALID\_PEG\_OFFSET\_TYPE](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1220 SYMBOL\_DOES\_NOT\_MATCH\_STATUS](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1221 INVALID\_SBE\_MESSAGE\_FIELD](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1222 OPO\_WORKING\_MUST\_BE\_BUY](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1223 OPO\_PENDING\_MUST\_BE\_SELL](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1224 WORKING\_PARAM\_REQUIRED](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-1225 PENDING\_PARAM\_NOT\_REQUIRED](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-2010 NEW\_ORDER\_REJECTED](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-2011 CANCEL\_REJECTED](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-2013 NO\_SUCH\_ORDER](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-2014 BAD\_API\_KEY\_FMT](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-2015 REJECTED\_MBX\_KEY](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-2016 NO\_TRADING\_WINDOW](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-2026 ORDER\_ARCHIVED](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-2035 SUBSCRIPTION\_ACTIVE](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-2036 SUBSCRIPTION\_INACTIVE](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-2039 CLIENT\_ORDER\_ID\_INVALID](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-2042 MAXIMUM\_SUBSCRIPTION\_IDS](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) +- [Messages for -1010 ERROR\_MSG\_RECEIVED, -2010 NEW\_ORDER\_REJECTED, -2011 CANCEL\_REJECTED, and -2038 ORDER\_AMEND\_REJECTED](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) +- [Errors regarding placing orders via cancelReplace](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-2021 Order cancel-replace partially failed](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - [\-2022 Order cancel-replace failed.](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) +- [Filter failures](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) diff --git a/docs/binance/binance-spot/testnet_filters.md b/docs/binance/binance-spot/testnet_filters.md new file mode 100644 index 0000000..eef11b7 --- /dev/null +++ b/docs/binance/binance-spot/testnet_filters.md @@ -0,0 +1,324 @@ +--- +title: "Filters | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs/testnet/filters" +fetched_at: "2026-02-26T10:38:09.944Z" +--- +# Filters + +Filters define trading rules on a symbol or an exchange. Filters come in three forms: `symbol filters`, `exchange filters` and `asset filters`. + +## Symbol filters[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/filters) + +### PRICE\_FILTER[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/filters) + +The `PRICE_FILTER` defines the `price` rules for a symbol. There are 3 parts: + +- `minPrice` defines the minimum `price`/`stopPrice` allowed; disabled on `minPrice` == 0. +- `maxPrice` defines the maximum `price`/`stopPrice` allowed; disabled on `maxPrice` == 0. +- `tickSize` defines the intervals that a `price`/`stopPrice` can be increased/decreased by; disabled on `tickSize` == 0. + +Any of the above variables can be set to 0, which disables that rule in the `price filter`. In order to pass the `price filter`, the following must be true for `price`/`stopPrice` of the enabled rules: + +- `price` >= `minPrice` +- `price` <= `maxPrice` +- `price` % `tickSize` == 0 + +**/exchangeInfo format:** + +``` +{ "filterType": "PRICE_FILTER", "minPrice": "0.00000100", "maxPrice": "100000.00000000", "tickSize": "0.00000100"} +``` + +### PERCENT\_PRICE[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/filters) + +The `PERCENT_PRICE` filter defines the valid range for the price based on the average of the previous trades. `avgPriceMins` is the number of minutes the average price is calculated over. 0 means the last price is used. + +In order to pass the `percent price`, the following must be true for `price`: + +- `price` <= `weightedAveragePrice` \* `multiplierUp` +- `price` >= `weightedAveragePrice` \* `multiplierDown` + +**/exchangeInfo format:** + +``` +{ "filterType": "PERCENT_PRICE", "multiplierUp": "1.3000", "multiplierDown": "0.7000", "avgPriceMins": 5} +``` + +### PERCENT\_PRICE\_BY\_SIDE[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/filters) + +The `PERCENT_PRICE_BY_SIDE` filter defines the valid range for the price based on the average of the previous trades. +`avgPriceMins` is the number of minutes the average price is calculated over. 0 means the last price is used. +There is a different range depending on whether the order is placed on the `BUY` side or the `SELL` side. + +Buy orders will succeed on this filter if: + +- `Order price` <= `weightedAveragePrice` \* `bidMultiplierUp` +- `Order price` >= `weightedAveragePrice` \* `bidMultiplierDown` + +Sell orders will succeed on this filter if: + +- `Order Price` <= `weightedAveragePrice` \* `askMultiplierUp` +- `Order Price` >= `weightedAveragePrice` \* `askMultiplierDown` + +**/exchangeInfo format:** + +``` +{ "filterType": "PERCENT_PRICE_BY_SIDE", "bidMultiplierUp": "1.2", "bidMultiplierDown": "0.2", "askMultiplierUp": "5", "askMultiplierDown": "0.8", "avgPriceMins": 1} +``` + +### LOT\_SIZE[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/filters) + +The `LOT_SIZE` filter defines the `quantity` (aka "lots" in auction terms) rules for a symbol. There are 3 parts: + +- `minQty` defines the minimum `quantity`/`icebergQty` allowed. +- `maxQty` defines the maximum `quantity`/`icebergQty` allowed. +- `stepSize` defines the intervals that a `quantity`/`icebergQty` can be increased/decreased by. + +In order to pass the `lot size`, the following must be true for `quantity`/`icebergQty`: + +- `quantity` >= `minQty` +- `quantity` <= `maxQty` +- `quantity` % `stepSize` == 0 + +**/exchangeInfo format:** + +``` +{ "filterType": "LOT_SIZE", "minQty": "0.00100000", "maxQty": "100000.00000000", "stepSize": "0.00100000"} +``` + +### MIN\_NOTIONAL[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/filters) + +The `MIN_NOTIONAL` filter defines the minimum notional value allowed for an order on a symbol. An order's notional value is the `price` \* `quantity`. `applyToMarket` determines whether or not the `MIN_NOTIONAL` filter will also be applied to `MARKET` orders. Since `MARKET` orders have no price, the average price is used over the last `avgPriceMins` minutes. `avgPriceMins` is the number of minutes the average price is calculated over. 0 means the last price is used. + +**/exchangeInfo format:** + +``` +{ "filterType": "MIN_NOTIONAL", "minNotional": "0.00100000", "applyToMarket": true, "avgPriceMins": 5} +``` + +### NOTIONAL[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/filters) + +The `NOTIONAL` filter defines the acceptable notional range allowed for an order on a symbol. + +`applyMinToMarket` determines whether the `minNotional` will be applied to `MARKET` orders. +`applyMaxToMarket` determines whether the `maxNotional` will be applied to `MARKET` orders. + +In order to pass this filter, the notional (`price * quantity`) has to pass the following conditions: + +- `price * quantity` <= `maxNotional` +- `price * quantity` >= `minNotional` + +For `MARKET` orders, the average price used over the last `avgPriceMins` minutes will be used for calculation. +If the `avgPriceMins` is 0, then the last price will be used. + +**/exchangeInfo format:** + +``` +{ "filterType": "NOTIONAL", "minNotional": "10.00000000", "applyMinToMarket": false, "maxNotional": "10000.00000000", "applyMaxToMarket": false, "avgPriceMins": 5} +``` + +### ICEBERG\_PARTS[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/filters) + +The `ICEBERG_PARTS` filter defines the maximum parts an iceberg order can have. The number of `ICEBERG_PARTS` is defined as `CEIL(qty / icebergQty)`. + +**/exchangeInfo format:** + +``` +{ "filterType": "ICEBERG_PARTS", "limit": 10} +``` + +### MARKET\_LOT\_SIZE[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/filters) + +The `MARKET_LOT_SIZE` filter defines the `quantity` (aka "lots" in auction terms) rules for `MARKET` orders on a symbol. There are 3 parts: + +- `minQty` defines the minimum `quantity` allowed. +- `maxQty` defines the maximum `quantity` allowed. +- `stepSize` defines the intervals that a `quantity` can be increased/decreased by. + +In order to pass the `market lot size`, the following must be true for `quantity`: + +- `quantity` >= `minQty` +- `quantity` <= `maxQty` +- `quantity` % `stepSize` == 0 + +**/exchangeInfo format:** + +``` +{ "filterType": "MARKET_LOT_SIZE", "minQty": "0.00100000", "maxQty": "100000.00000000", "stepSize": "0.00100000"} +``` + +### MAX\_NUM\_ORDERS[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/filters) + +The `MAX_NUM_ORDERS` filter defines the maximum number of orders an account is allowed to have open on a symbol. Note that both "algo" orders and normal orders are counted for this filter. + +**/exchangeInfo format:** + +``` +{ "filterType": "MAX_NUM_ORDERS", "maxNumOrders": 25} +``` + +### MAX\_NUM\_ALGO\_ORDERS[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/filters) + +The `MAX_NUM_ALGO_ORDERS` filter defines the maximum number of "algo" orders an account is allowed to have open on a symbol. "Algo" orders are `STOP_LOSS`, `STOP_LOSS_LIMIT`, `TAKE_PROFIT`, and `TAKE_PROFIT_LIMIT` orders. + +**/exchangeInfo format:** + +``` +{ "filterType": "MAX_NUM_ALGO_ORDERS", "maxNumAlgoOrders": 5} +``` + +### MAX\_NUM\_ICEBERG\_ORDERS[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/filters) + +The `MAX_NUM_ICEBERG_ORDERS` filter defines the maximum number of `ICEBERG` orders an account is allowed to have open on a symbol. An `ICEBERG` order is any order where the `icebergQty` is > 0. + +**/exchangeInfo format:** + +``` +{ "filterType": "MAX_NUM_ICEBERG_ORDERS", "maxNumIcebergOrders": 5} +``` + +### MAX\_POSITION[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/filters) + +The `MAX_POSITION` filter defines the allowed maximum position an account can have on the base asset of a symbol. An account's position defined as the sum of the account's: + +1. free balance of the base asset +2. locked balance of the base asset +3. sum of the qty of all open BUY orders + +`BUY` orders will be rejected if the account's position is greater than the maximum position allowed. + +If an order's `quantity` can cause the position to overflow, this will also fail the `MAX_POSITION` filter. + +**/exchangeInfo format:** + +``` +{ "filterType": "MAX_POSITION", "maxPosition": "10.00000000"} +``` + +### TRAILING\_DELTA[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/filters) + +The `TRAILING_DELTA` filter defines the minimum and maximum value for the parameter [`trailingDelta`](https://developers.binance.com/docs/binance-spot-api-docs/faqs/trailing-stop-faq). + +In order for a trailing stop order to pass this filter, the following must be true: + +For `STOP_LOSS BUY`, `STOP_LOSS_LIMIT_BUY`,`TAKE_PROFIT SELL` and `TAKE_PROFIT_LIMIT SELL` orders: + +- `trailingDelta` >= `minTrailingAboveDelta` +- `trailingDelta` <= `maxTrailingAboveDelta` + +For `STOP_LOSS SELL`, `STOP_LOSS_LIMIT SELL`, `TAKE_PROFIT BUY`, and `TAKE_PROFIT_LIMIT BUY` orders: + +- `trailingDelta` >= `minTrailingBelowDelta` +- `trailingDelta` <= `maxTrailingBelowDelta` + +**/exchangeInfo format:** + +``` +{ "filterType": "TRAILING_DELTA", "minTrailingAboveDelta": 10, "maxTrailingAboveDelta": 2000, "minTrailingBelowDelta": 10, "maxTrailingBelowDelta": 2000} +``` + +### MAX\_NUM\_ORDER\_AMENDS[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/filters) + +The `MAX_NUM_ORDER_AMENDS` filter defines the maximum number of times an order can be [amended](https://developers.binance.com/docs/binance-spot-api-docs/faqs/order_amend_keep_priority) on the given symbol. + +If there are too many order amendments made on a single order, you will receive the `-2038` error code. + +**/exchangeInfo format:** + +``` +{ "filterType": "MAX_NUM_ORDER_AMENDS", "maxNumOrderAmends": 10} +``` + +### MAX\_NUM\_ORDER\_LISTS[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/filters) + +The `MAX_NUM_ORDER_LISTS` filter defines the maximum number of open order lists an account can have on a symbol. Note that OTOCOs count as one order list. + +**/exchangeInfo format:** + +``` +{ "filterType": "MAX_NUM_ORDER_LISTS", "maxNumOrderLists": 20} +``` + +## Exchange Filters[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/filters) + +### EXCHANGE\_MAX\_NUM\_ORDERS[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/filters) + +The `EXCHANGE_MAX_NUM_ORDERS` filter defines the maximum number of orders an account is allowed to have open on the exchange. Note that both "algo" orders and normal orders are counted for this filter. + +**/exchangeInfo format:** + +``` +{ "filterType": "EXCHANGE_MAX_NUM_ORDERS", "maxNumOrders": 1000} +``` + +### EXCHANGE\_MAX\_NUM\_ALGO\_ORDERS[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/filters) + +The `EXCHANGE_MAX_NUM_ALGO_ORDERS` filter defines the maximum number of "algo" orders an account is allowed to have open on the exchange. "Algo" orders are `STOP_LOSS`, `STOP_LOSS_LIMIT`, `TAKE_PROFIT`, and `TAKE_PROFIT_LIMIT` orders. + +**/exchangeInfo format:** + +``` +{ "filterType": "EXCHANGE_MAX_NUM_ALGO_ORDERS", "maxNumAlgoOrders": 200} +``` + +### EXCHANGE\_MAX\_NUM\_ICEBERG\_ORDERS[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/filters) + +The `EXCHANGE_MAX_NUM_ICEBERG_ORDERS` filter defines the maximum number of iceberg orders an account is allowed to have open on the exchange. + +**/exchangeInfo format:** + +``` +{ "filterType": "EXCHANGE_MAX_NUM_ICEBERG_ORDERS", "maxNumIcebergOrders": 10000} +``` + +### EXCHANGE\_MAX\_NUM\_ORDER\_LISTS[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/filters) + +The `EXCHANGE_MAX_NUM_ORDERS` filter defines the maximum number of order lists an account is allowed to have open on the exchange. Note that OTOCOs count as one order list. + +**/exchangeInfo format:** + +``` +{ "filterType": "EXCHANGE_MAX_NUM_ORDER_LISTS", "maxNumOrderLists": 20} +``` + +## Asset Filters[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/filters) + +### MAX\_ASSET[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/filters) + +The `MAX_ASSET` filter defines the maximum quantity of an asset that an account is allowed to transact in a single order. + +- When the asset is a symbol's base asset, the limit applies to the order's quantity. +- When the asset is a symbol's quote asset, the limit applies to the order's notional value. +- For example, a MAX\_ASSET filter for USDC applies to all symbols that have USDC as either a base or quote asset, such as: + - USDCBNB + - BNBUSDC + +**/myFilters format:** + +``` +{ "filterType": "MAX_ASSET", "asset": "USDC", "limit": "42.00000000"} +``` + +- [Symbol filters](https://developers.binance.com/docs/binance-spot-api-docs/testnet/filters) + - [PRICE\_FILTER](https://developers.binance.com/docs/binance-spot-api-docs/testnet/filters) + - [PERCENT\_PRICE](https://developers.binance.com/docs/binance-spot-api-docs/testnet/filters) + - [PERCENT\_PRICE\_BY\_SIDE](https://developers.binance.com/docs/binance-spot-api-docs/testnet/filters) + - [LOT\_SIZE](https://developers.binance.com/docs/binance-spot-api-docs/testnet/filters) + - [MIN\_NOTIONAL](https://developers.binance.com/docs/binance-spot-api-docs/testnet/filters) + - [NOTIONAL](https://developers.binance.com/docs/binance-spot-api-docs/testnet/filters) + - [ICEBERG\_PARTS](https://developers.binance.com/docs/binance-spot-api-docs/testnet/filters) + - [MARKET\_LOT\_SIZE](https://developers.binance.com/docs/binance-spot-api-docs/testnet/filters) + - [MAX\_NUM\_ORDERS](https://developers.binance.com/docs/binance-spot-api-docs/testnet/filters) + - [MAX\_NUM\_ALGO\_ORDERS](https://developers.binance.com/docs/binance-spot-api-docs/testnet/filters) + - [MAX\_NUM\_ICEBERG\_ORDERS](https://developers.binance.com/docs/binance-spot-api-docs/testnet/filters) + - [MAX\_POSITION](https://developers.binance.com/docs/binance-spot-api-docs/testnet/filters) + - [TRAILING\_DELTA](https://developers.binance.com/docs/binance-spot-api-docs/testnet/filters) + - [MAX\_NUM\_ORDER\_AMENDS](https://developers.binance.com/docs/binance-spot-api-docs/testnet/filters) + - [MAX\_NUM\_ORDER\_LISTS](https://developers.binance.com/docs/binance-spot-api-docs/testnet/filters) +- [Exchange Filters](https://developers.binance.com/docs/binance-spot-api-docs/testnet/filters) + - [EXCHANGE\_MAX\_NUM\_ORDERS](https://developers.binance.com/docs/binance-spot-api-docs/testnet/filters) + - [EXCHANGE\_MAX\_NUM\_ALGO\_ORDERS](https://developers.binance.com/docs/binance-spot-api-docs/testnet/filters) + - [EXCHANGE\_MAX\_NUM\_ICEBERG\_ORDERS](https://developers.binance.com/docs/binance-spot-api-docs/testnet/filters) + - [EXCHANGE\_MAX\_NUM\_ORDER\_LISTS](https://developers.binance.com/docs/binance-spot-api-docs/testnet/filters) +- [Asset Filters](https://developers.binance.com/docs/binance-spot-api-docs/testnet/filters) + - [MAX\_ASSET](https://developers.binance.com/docs/binance-spot-api-docs/testnet/filters) diff --git a/docs/binance/binance-spot/testnet_fix-api.md b/docs/binance/binance-spot/testnet_fix-api.md new file mode 100644 index 0000000..0ff05a0 --- /dev/null +++ b/docs/binance/binance-spot/testnet_fix-api.md @@ -0,0 +1,5582 @@ +--- +title: "FIX API | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api" +fetched_at: "2026-02-26T10:38:09.926Z" +--- +# FIX API + +> \[!NOTE\] This API can only be used with the SPOT Exchange. + +## General API Information[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +- FIX connections require TLS encryption. Please either use native TCP+TLS connection or set up a local proxy such as [stunnel](https://www.stunnel.org/) to handle TLS encryption. +- APIs have a timeout of 10 seconds when processing a request. If a response from the Matching Engine takes longer than this, the API responds with "Timeout waiting for response from backend server. Send status unknown; execution status unknown." [(-1007 TIMEOUT)](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - This does not always mean that the request failed in the Matching Engine. + - If the status of the request has not appeared in [User Data Stream](https://developers.binance.com/docs/binance-spot-api-docs/testnet/user-data-stream), please perform an API query for its status. +- If your request contains a symbol name containing non-ASCII characters, then the response may contain non-ASCII characters encoded in UTF-8. + +**FIX sessions only support Ed25519 keys.** +You can setup and configure your API key permissions on [Spot Test Network](https://testnet.binance.vision/). + +### FIX API Order Entry sessions[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +- Endpoint is: `tcp+tls://fix-oe.testnet.binance.vision:9000` +- Supports placing orders, canceling orders, and querying current limit usage. +- Supports receiving all of the account's [ExecutionReport`<8>`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) and [List Status``](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api). +- Only API keys with `FIX_API` are allowed to connect. +- QuickFIX Schema can be found [here](https://github.com/binance/binance-spot-api-docs/blob/master/fix/schemas/spot-fix-oe.xml). + +### FIX API Drop Copy sessions[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +- Endpoint is: `tcp+tls://fix-dc.testnet.binance.vision:9000` +- Supports receiving all of the account's [ExecutionReport`<8>`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) and [List Status``](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api). +- Only API keys with `FIX_API` or `FIX_API_READ_ONLY` are allowed to connect. +- QuickFIX Schema can be found [here](https://github.com/binance/binance-spot-api-docs/blob/master/fix/schemas/spot-fix-oe.xml). +- Data in Drop Copy sessions is delayed by 1 second. + +### FIX API Market Data sessions[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +- Endpoint is: `tcp+tls://fix-md.testnet.binance.vision:9000` +- Supports market data streams and active instruments queries. +- Does not support placing or canceling orders. +- Only API keys with `FIX_API` or `FIX_API_READ_ONLY` are allowed to connect. +- QuickFIX Schema can be found [here](https://github.com/binance/binance-spot-api-docs/blob/master/fix/schemas/spot-fix-md.xml). + +### FIX Connection Lifecycle[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +- All FIX API sessions will remain open for as long as possible, on a best-effort basis. +- There is no minimum connection time guarantee; a server can enter maintenance at any time. + - When a server enters maintenance, a [News ``](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) message will be sent to clients **every 10 seconds for 10 minutes**, prompting clients to reconnect. Upon receiving this message, a client is expected to establish a new session and close the old one. If the client does not close the old session within the time frame, the server will proceed to log it out and close the session. +- After connecting, the client must send a Logon `` request. For more information please refer to [How to sign a Logon request](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api). +- The client should send a Logout `<5>` message to close the session before disconnecting. Failure to send the logout message will result in the session’s `SenderCompID (49)` being unusable for new session establishment for a duration of 2x the `HeartInt (108)` interval. +- The system allows negotiation of the `HeartInt (108)` value during the logon process. Accepted values range between 5 and 60 seconds. + - If the server has not sent any messages within a `HeartInt (108)` interval, a [HeartBeat `<0>`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) will be sent. + - If the server has not received any messages within a `HeartInt (108)` interval, a [TestRequest `<1>`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) will be sent. If the server does not receive a HeartBeat `<0>` containing the expected `TestReqID (112)` from the client within `HeartInt (108)` seconds, the server will send a Logout `<5>` message and close the connection. + - If the client has not received any messages within a `HeartInt (108)` interval, the client is responsible for sending a TestRequest `<1>` to ensure the connection is healthy. Upon receiving such a TestRequest `<1>`, the server will respond with a Heartbeat `<0>` containing the expected `TestReqID (112)`. If the client does not receive the server’s response within a `HeartInt (108)` interval, the client should close the session and connection and establish new ones. + +### API Key Permissions[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +To access the FIX API order entry sessions, your API key must be configured with the `FIX_API` permission. + +To access the FIX Drop Copy sessions, your API key must be configured with either `FIX_API_READ_ONLY` or `FIX_API` permission. + +To access the FIX Market Data sessions, your API key must be configured with either `FIX_API` or `FIX_API_READ_ONLY` permission. + +**FIX sessions only support Ed25519 keys.** + +### On message processing order[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +The `MessageHandling (25035)` field required in the initial [Logon``](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) message controls whether messages from the client may be reordered before they are processed by the Matching Engine. + +Mode + +Description + +`UNORDERED(1)` + +Messages from the client are allowed to be sent to the matching engine in any order. + +`SEQUENTIAL(2)` + +Messages from the client are always sent to the matching engine in `MsgSeqNum (34)` order. + +In all modes, the client's `MsgSeqNum (34)` must increase monotonically, with each subsequent message having a sequence number that is exactly 1 greater than the previous message. + +> \[!TIP\] `UNORDERED(1)` should offer better performance when there are multiple messages in flight from the client to the server. + +### Response Mode[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +By default, all concurrent order entry sessions receive all of the account's successful [ExecutionReport`<8>`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) and [ListStatus``](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) messages, including those in response to orders placed from other FIX sessions and via non-FIX APIs. + +Use the `ResponseMode (25036)` field in the initial [Logon``](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) message to change this behavior. + +- `EVERYTHING(1)`: The default mode. +- `ONLY_ACKS(2)`: Receive only ACK messages whether operation succeeded or failed. Disables ExecutionReport push. + +### Timing Security[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +- All requests require a `SendingTime(52)` field which should be the current timestamp. +- An additional optional field, `RecvWindow(25000)`, specifies for how long the request stays valid in milliseconds. + - `RecvWindow(25000)` supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + - If `RecvWindow(25000)` is not specified, it defaults to 5000 milliseconds only for the Logon`` request. For other requests if unset, the RecvWindow check is not executed. + - Maximum `RecvWindow(25000)` is 60000 milliseconds. +- Request processing logic is as follows: + +``` +serverTime = getCurrentTime()if (SendingTime < (serverTime + 1 second) && (serverTime - SendingTime) <= RecvWindow) { // begin processing request serverTime = getCurrentTime() if (serverTime - SendingTime) <= RecvWindow { // forward request to Matching Engine } else { // reject request } // finish processing request} else { // reject request} +``` + +### How to sign Logon `` request[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +The [Logon``](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) message authenticates your connection to the FIX API. This must be the first message sent by the client. + +- The `Username (553)` field is required to contain the API key. +- The `RawData (96)` field is required to contain a valid signature made with the API key. + +The signature payload is a text string constructed by concatenating the values of the following fields in this exact order, separated by the SOH character: + +1. `MsgType (35)` +2. `SenderCompId (49)` +3. `TargetCompId (56)` +4. `MsgSeqNum (34)` +5. `SendingTime (52)` + +Sign the payload using your private key. Encode the signature with **base64**. The resulting text string is the value of the `RawData (96)` field. + +Here is a sample Python code implementing the signature algorithm: + +``` +import base64from cryptography.hazmat.primitives.asymmetric.ed25519 import Ed25519PrivateKeyfrom cryptography.hazmat.primitives.serialization import load_pem_private_keydef logon_raw_data(private_key: Ed25519PrivateKey, sender_comp_id: str, target_comp_id: str, msg_seq_num: str, sending_time: str): """ Computes the value of RawData (96) field in Logon message. """ payload = chr(1).join([ 'A', sender_comp_id, target_comp_id, msg_seq_num, sending_time, ]) signature = private_key.sign(payload.encode('ASCII')) return base64.b64encode(signature).decode('ASCII')with open('private_key.pem', 'rb') as f: private_key = load_pem_private_key(data=f.read(), password=None)raw_data = logon_raw_data(private_key, sender_comp_id='5JQmUOsm', target_comp_id='SPOT', msg_seq_num='1', sending_time='20240612-08:52:21.613') +``` + +The values presented below can be used to validate the correctness of the signature computation implementation: + +Field + +Value + +MsgType (35) + +`A` + +SenderCompID (49) + +`EXAMPLE` + +TargetCompID (56) + +`SPOT` + +MsgSeqNum (34) + +`1` + +SendingTime (52) + +`20240627-11:17:25.223` + +The Ed25519 private key used in the example computation is shown below: + +> \[!CAUTION\] The following secret key is provided solely for illustrative purposes. Do not use this key in any real-world application as it is not secure and may compromise your cryptographic implementation. Always generate your own unique and secure keys for actual use. + +``` +-----BEGIN PRIVATE KEY-----MC4CAQAwBQYDK2VwBCIEIIJEYWtGBrhACmb9Dvy+qa8WEf0lQOl1s4CLIAB9m89u-----END PRIVATE KEY----- +``` + +Computed signature: + +``` +4MHXelVVcpkdwuLbl6n73HQUXUf1dse2PCgT1DYqW9w8AVZ1RACFGM+5UdlGPrQHrgtS3CvsRURC1oj73j8gCA== +``` + +Resulting Logon `` message: + +``` +8=FIX.4.4|9=247|35=A|34=1|49=EXAMPLE|52=20240627-11:17:25.223|56=SPOT|95=88|96=4MHXelVVcpkdwuLbl6n73HQUXUf1dse2PCgT1DYqW9w8AVZ1RACFGM+5UdlGPrQHrgtS3CvsRURC1oj73j8gCA==|98=0|108=30|141=Y|553=sBRXrJx2DsOraMXOaUovEhgVRcjOvCtQwnWj8VxkOh1xqboS02SPGfKi2h8spZJb|25035=2|10=227| +``` + +## Limits[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +### Message Limits[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +- Each connection has a limit on **how many messages can be sent to the exchange**. +- The message limit **does not count the messages sent in response to the client**. +- Breaching the message limit results in immediate [Logout `<5>`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) and disconnection. +- To understand current limits and usage, please send a [LimitQuery``](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) message. A [LimitResponse``](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) message will be sent in response, containing information about Order Rate Limits and Message Limits. +- FIX Order entry sessions have a limit of 10,000 messages every 10 seconds. +- FIX Drop Copy sessions have a limit of 60 messages every 60 seconds. +- FIX Market Data sessions have a limit of 2000 messages every 60 seconds. + +### Connection Limits[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +- Each Account has a limit on how many TCP connections can be established at the same time. +- The limit is reduced when the TCP connection is closed. If the reduction of connections is not immediate, please wait up to twice the value of `HeartBtInt (108)` for the change to take effect. For example, if the current value of `HeartBtInt` is 5, please wait up to 10 seconds. +- Upon breaching the limit a [Reject `<3>`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) will be sent containing information about the connection limit breach and the current limit. +- FIX Order Entry limits: + - 15 connection attempts within 30 seconds + - Maximum of 10 concurrent TCP connections per account +- FIX Drop Copy limits: + - 15 connection attempts within 30 seconds + - Maximum of 10 concurrent TCP connections per account +- FIX Market Data limits + - 300 connection attempts within 300 seconds + - Maximum of 100 concurrent TCP connections per account + - A single connection can listen to a maximum of 1000 streams. + +### Unfilled Order Count[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +- To understand how many orders you have placed within a certain time interval, please send a [LimitQuery``](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) message. A [LimitResponse``](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) message will be sent in response, containing information about Unfilled Order Count and Message Limits. +- **Please note that if your orders are consistently filled by trades, you can continuously place orders on the API**. For more information, please see [Spot Unfilled Order Count Rules](https://developers.binance.com/docs/binance-spot-api-docs/faqs/order_count_decrement). +- If you exceed the unfilled order count your message will be rejected, and information will be transferred back to you in a reject message specific to that endpoint. +- **The number of unfilled orders is tracked for each account.** + +## Error Handling[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +Client messages that contain syntax errors, missing required fields, or refer to unknown symbols will be rejected by the server with a [Reject `<3>`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) message. + +If a valid message cannot be processed and is rejected, an appropriate reject response will be sent. Please refer to the individual message documentation for possible responses. + +Please refer to the `Text (58)` and `ErrorCode (25016)` fields in responses for the reject reason. + +The list of error codes can be found on the [Error codes](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) page. + +## Types[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +Only printable ASCII characters and SOH are supported. + +Type + +Description + +`BOOLEAN` + +Enum: `Y` or `N`. + +`CHAR` + +Single character. + +`INT` + +Signed 64-bit integer. + +`LENGTH` + +Unsigned 64-bit integer. + +`NUMINGROUP` + +Unsigned 64-bit integer. + +`PRICE` + +Fixed-point number. Precision depends on the symbol definition. + +`QTY` + +Fixed-point number. Precision depends on the symbol definition. + +`SEQNUM` + +Unsigned 32-bit integer. Rolls over to 0 after reaching its maximum value of 4,294,967,295. + +`STRING` + +Sequence of printable ASCII characters. + +`UTCTIMESTAMP` + +String representing datetime in UTC. + +Supported `UTCTIMESTAMP` formats: + +- `20011217-09:30:47` - seconds +- `20011217-09:30:47.123` - milliseconds +- `20011217-09:30:47.123456` - microseconds (always used in messages from the exchange) + +Client order ID fields must conform to the regex `^[a-zA-Z0-9-_]{1,36}$`: + +- `ClOrdID (11)` +- `OrigClOrdID (41)` +- `MDReqID (262)` +- `ClListID (25014)` +- `OrigClListID (25015)` +- `CancelClOrdID (25034)` + +## Message Components[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +> \[!NOTE\] In example messages, the `|` character is used to represent SOH character: + +``` +8=FIX.4.4|9=113|35=A|34=1|49=SPOT|52=20240612-08:52:21.636837|56=5JQmUOsm|98=0|108=30|25037=4392a152-3481-4499-921a-6d42c50702e2|10=051| +``` + +### Header[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +Appears at the start of every message. + +Tag + +Name + +Type + +Required + +Description + +8 + +BeginString + +STRING + +Y + +Always `FIX.4.4`. + +Must be the first field the message. + +9 + +BodyLength + +LENGTH + +Y + +Message length in bytes. + +Must be the second field in the message. + +35 + +MsgType + +STRING + +Y + +Must be the third field in the message. + +Possible values: + +`0` - [HEARTBEAT](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +`1` - [TEST\_REQUEST](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +`3` - [REJECT](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +`5` - [LOGOUT](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +`8` - [EXECUTION\_REPORT](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +`9` - [ORDER\_CANCEL\_REJECT](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +`A` - [LOGON](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +`D` - [NEW\_ORDER\_SINGLE](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +`E` - [NEW\_ORDER\_LIST](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +`F` - [ORDER\_CANCEL\_REQUEST](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +`N` - [LIST\_STATUS](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +`q` - [ORDER\_MASS\_CANCEL\_REQUEST](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +`r` - [ORDER\_MASS\_CANCEL\_REPORT](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +`XCN` - [ORDER\_CANCEL\_REQUEST\_AND\_NEW\_ORDER\_SINGLE](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +`XLQ` - [LIMIT\_QUERY](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +`XLR` - [LIMIT\_RESPONSE](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +`B` - [NEWS](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +`x`\- [INSTRUMENT\_LIST\_REQUEST](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +`y` - [INSTRUMENT\_LIST](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +`V` - [MARKET\_DATA\_REQUEST](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +`Y` - [MARKET\_DATA\_REQUEST\_REJECT](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +`W` - [MARKET\_DATA\_SNAPSHOT](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +`X` - [MARKET\_DATA\_INCREMENTAL\_REFRESH](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +`XAK` - [ORDER\_AMEND\_KEEP\_PRIORITY\_REQUEST](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +`XAR` - [ORDER\_AMEND\_REJECT](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +49 + +SenderCompID + +STRING + +Y + +Must be unique across an account's active sessions. + +Must obey regex: `^[a-zA-Z0-9-_]{1,8}$` + +56 + +TargetCompID + +STRING + +Y + +A string identifying this TCP connection. + +On messages from client required to be set to `SPOT`. + +Must be unique across TCP connections. + +Must conform to the regex: `^[a-zA-Z0-9-_]{1,8}$` + +34 + +MsgSeqNum + +SEQNUM + +Y + +Integer message sequence number. + +Values that will cause a gap will be rejected. + +52 + +SendingTime + +UTCTIMESTAMP + +Y + +Time of message transmission (always expressed in UTC). + +25000 + +RecvWindow + +FLOAT + +N + +Number of milliseconds after `SendingTime (52)` the request is valid for. + +Defaults to `5000` milliseconds in [Logon``](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) and has a max value of `60000` milliseconds. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +### Trailer[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +Appears at the end of every message. + +Tag + +Name + +Type + +Required + +Description + +10 + +CheckSum + +STRING + +Y + +Always three-character numeric string, calculated by summing the ASCII values of each preceding character in the message, including start-of-header (SOH) characters. + +The resultant sum is divided by 256, with the remainder forming the CheckSum value. + +To maintain a fixed length, the CheckSum field is right-justified and zero-padded as needed. + +## Administrative Messages[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +### Heartbeat `<0>`[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +Sent by the server if there is no outgoing traffic during the heartbeat interval (`HeartBtInt (108)` in [Logon``](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api)). + +Sent by the client to indicate that the session is healthy. + +Sent by the client or the server in response to a [TestRequest`<1>`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) message. + +Tag + +Name + +Type + +Required + +Description + +112 + +TestReqID + +STRING + +N + +When Heartbeat`<35>` is sent in response to TestRequest`<1>`, must mirror the value in TestRequest`<1>`. + +### TestRequest `<1>`[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +Sent by the server if there is no incoming traffic during the heartbeat interval (`HeartBtInt (108)` in [Logon``](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api)). + +Sent by the client to request a [Heartbeat`<0>`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) response. + +> \[!NOTE\] If the client does not respond to TestRequest`<1>` with Heartbeat`<0>` with a correct `TestReqID (112)` within timeout, the connection will be dropped. + +Tag + +Name + +Type + +Required + +Description + +112 + +TestReqID + +STRING + +Y + +Arbitrary string that must be included in the Heartbeat`<0>` response. + +### Reject `<3>`[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +Sent by the server in response to an invalid message that cannot be processed. + +Sent by the server if a new connection cannot be accepted. Please refer to [Connection Limits](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api). + +Please refer to the `Text (58)` and `ErrorCode (25016)` fields for the reject reason. + +Tag + +Name + +Type + +Required + +Description + +45 + +RefSeqNum + +INT + +N + +The `MsgSeqNum (34)` of the rejected message that caused issuance of this Reject`<3>`. + +371 + +RefTagID + +INT + +N + +When present, identifies the field that directly caused the issuance of this Reject`<3>` message. + +372 + +RefMsgType + +STRING + +N + +The `MsgType (35)` of the rejected message that caused issuance of this Reject`<3>`. + +373 + +SessionRejectReason + +INT + +N + +A reason for the reject, can be one of the values below. + +Usually accompanied by additional Text description + +Possible values: + +`0`\- INVALID\_TAG\_NUMBER + +`1` - REQUIRED\_TAG\_MISSING + +`2` - TAG\_NOT\_DEFINED\_FOR\_THIS\_MESSAGE\_TYPE + +`3` - UNDEFINED\_TAG + +`5` - VALUE\_IS\_INCORRECT + +`6` - INCORRECT\_DATA\_FORMAT\_FOR\_VALUE + +`8` - SIGNATURE\_PROBLEM + +`10` - SENDINGTIME\_ACCURACY\_PROBLEM + +`12` - XML\_VALIDATION\_ERROR + +`13` - TAG\_APPEARS\_MORE\_THAN\_ONCE + +`14` - TAG\_SPECIFIED\_OUT\_OF\_REQUIRED\_ORDER + +`15` - REPEATING\_GROUP\_FIELDS\_OUT\_OF\_ORDER + +`16` - INCORRECT\_NUMINGROUP\_COUNT\_FOR\_REPEATING\_GROUP + +`99` - OTHER + +25016 + +ErrorCode + +INT + +N + +API error code (see [Error Codes](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors)). + +58 + +Text + +STRING + +N + +Human-readable error message. + +### Logon ``[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +Sent by the client to authenticate the connection. Logon`` must be the first message sent by the client. + +Sent by the server in response to a successful logon. + +> \[!NOTE\] Logon`` can only be sent once for the entirety of the session. + +#### Logon Request[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +Tag + +Name + +Type + +Required + +Description + +98 + +EncryptMethod + +INT + +Y + +Required to be `0`. + +108 + +HeartBtInt + +INT + +Y + +Required to be within range \[5, 60\]. Heartbeat interval in seconds. + +95 + +RawDataLength + +LENGTH + +Y + +Length of the `RawData (96)` field that comes strictly after this field. + +96 + +RawData + +DATA + +Y + +Signature. [How to sign Logon`` request](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api). + +141 + +ResetSeqNumFlag + +BOOLEAN + +Y + +Required to be `Y`. + +553 + +Username + +STRING + +Y + +API key. **Only Ed25519 API keys are supported.** + +25035 + +MessageHandling + +INT + +Y + +Possible values: + +`1` - UNORDERED + +`2` - SEQUENTIAL + +Please refer to [On message order processing](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) for more information. + +25036 + +ResponseMode + +INT + +N + +Please refer to [Response Mode](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api). + +9406 + +DropCopyFlag + +BOOLEAN + +N + +Must be set to 'Y' when logging into Drop Copy sessions. + +**Sample message:** + +``` +8=FIX.4.4|9=248|35=A|34=1|49=5JQmUOsm|52=20240612-08:52:21.613|56=SPOT|95=88|96=KhJLbZqADWknfTAcp0ZjyNz36Kxa4ffvpNf9nTIc+K5l35h+vA1vzDRvLAEQckyl6VDOwJ53NOBnmmRYxQvQBQ==|98=0|108=30|141=Y|553=W5rcOD30c0gT4jHK8oX5d5NbzWoa0k4SFVoTHIFNJVZ3NuRpYb6ZyJznj8THyx5d|25035=1|10=000| +``` + +#### Logon Response[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +Tag + +Name + +Type + +Required + +Description + +98 + +EncryptMethod + +INT + +Y + +Always `0`. + +108 + +HeartBtInt + +INT + +Y + +Mirrors value from the Logon request. + +25037 + +UUID + +STRING + +Y + +UUID of the FIX API serving the requests. + +**Sample message:** + +``` +8=FIX.4.4|9=113|35=A|34=1|49=SPOT|52=20240612-08:52:21.636837|56=5JQmUOsm|98=0|108=30|25037=4392a152-3481-4499-921a-6d42c50702e2|10=051| +``` + +### Logout `<5>`[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +Sent to initiate the process of closing the connection, and also when responding to Logout. + +Tag + +Name + +Type + +Required + +Description + +58 + +Text + +STRING + +N + +**Sample messages:** + +Logout Request + +``` +8=FIX.4.4|9=55|35=5|34=3|49=GhQHzrLR|52=20240611-09:44:25.543|56=SPOT|10=249| +``` + +Logout Response + +``` +8=FIX.4.4|9=84|35=5|34=4|49=SPOT|52=20240611-09:44:25.544001|56=GhQHzrLR|58=Logout acknowledgment.|10=212| +``` + +### News ``[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +When the server enters maintenance, a `News` message will be sent to clients **every 10 seconds for 10 minutes**. After this period, clients will be logged out and their sessions will be closed. + +Upon receiving this message, clients are expected to establish a new session and close the old one. + +The countdown message sent will be: + +``` +You'll be disconnected in %d seconds. Please reconnect. +``` + +When there are 10 seconds remaining, the following message will be sent: + +``` +Your connection is about to be closed. Please reconnect. +``` + +If the client does not close the old session within 10 seconds of receiving the above message, the server will log it out and close the session. + +Tag + +Name + +Type + +Required + +Description + +148 + +Headline + +STRING + +Y + +**Sample message:** + +``` +8=FIX.4.4|9=0000113|35=B|49=SPOT|56=OE|34=4|52=20240924-21:07:35.773537|148=Your connection is about to be closed. Please reconnect.|10=165| +``` + +### Resend Request `<2>`[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +Resend requests are currently not supported. + +## Application Messages[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +### Order Entry Messages[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +> \[!NOTE\] The messages below can only be used for the FIX Order Entry and FIX Drop Copy Sessions. + +#### NewOrderSingle ``[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +Sent by the client to submit a new order for execution. + +This adds 1 order to the `EXCHANGE_MAX_ORDERS` filter and the `MAX_NUM_ORDERS` filter. + +**Unfilled Order Count:** 1 + +Please refer to [Supported Order Types](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) for supported field combinations. + +> \[!NOTE\] Many fields become required based on the order type. Please refer to [Supported Order Types](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api). + +Tag + +Name + +Type + +Required + +Description + +11 + +ClOrdID + +STRING + +Y + +`ClOrdID` to be assigned to the order. + +38 + +OrderQty + +QTY + +N + +Quantity of the order + +40 + +OrdType + +CHAR + +Y + +See the [table](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) to understand supported order types and the required fields to use them. + +Possible values: + +`1` - MARKET + +`2` - LIMIT + +`3` - STOP + +`4` - STOP\_LIMIT + +`P`\- PEGGED + +18 + +ExecInst + +CHAR + +N + +Possible values: + +`6` - PARTICIPATE\_DONT\_INITIATE + +44 + +Price + +PRICE + +N + +Price of the order + +54 + +Side + +CHAR + +Y + +Side of the order. + +Possible values: + +`1` - BUY + +`2` - SELL + +55 + +Symbol + +STRING + +Y + +Symbol to place the order on. + +59 + +TimeInForce + +CHAR + +N + +Possible values: + +`1` - GOOD\_TILL\_CANCEL + +`3` - IMMEDIATE\_OR\_CANCEL + +`4` - FILL\_OR\_KILL + +111 + +MaxFloor + +QTY + +N + +Used for iceberg orders, this specifies the visible quantity of the order on the book. + +152 + +CashOrderQty + +QTY + +N + +Quantity of the order specified in the quote asset units, for reverse market orders. + +847 + +TargetStrategy + +INT + +N + +The value cannot be less than `1000000`. + +7940 + +StrategyID + +INT + +N + +25001 + +SelfTradePreventionMode + +CHAR + +N + +Possible values: + +`1` - NONE + +`2` - EXPIRE\_TAKER + +`3` - EXPIRE\_MAKER + +`4` - EXPIRE\_BOTH + +`5` - DECREMENT +`6` - TRANSFER + +211 + +PegOffsetValue + +FLOAT + +N + +Amount added to the peg in the context of the PegOffsetType + +1094 + +PegPriceType + +CHAR + +N + +Defines the type of peg +Possible values: +`4` - MARKET\_PEG +`5` - PRIMARY\_PEG + +835 + +PegMoveType + +CHAR + +N + +Describes whether peg is fixed or floats. Required for Pegged Orders and must be set to `1` (FIXED) + +836 + +PegOffsetType + +CHAR + +N + +Type of price peg offset. +Possible values: + +`3` - PRICE\_TIER + +1100 + +TriggerType + +CHAR + +N + +Possible values: `4` - PRICE\_MOVEMENT + +1101 + +TriggerAction + +CHAR + +N + +Possible values: + +`1` - ACTIVATE + +1102 + +TriggerPrice + +PRICE + +N + +Activation price for contingent orders. See [table](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +1107 + +TriggerPriceType + +CHAR + +N + +Possible values: + +`2` - LAST\_TRADE + +1109 + +TriggerPriceDirection + +CHAR + +N + +Used to differentiate between StopLoss and TakeProfit orders. See [table](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api). + +Possible values: + +`U` - TRIGGER\_IF\_THE\_PRICE\_OF\_THE\_SPECIFIED\_TYPE\_GOES\_UP\_TO\_OR\_THROUGH\_THE\_SPECIFIED\_TRIGGER\_PRICE + +`D` - TRIGGER\_IF\_THE\_PRICE\_OF\_THE\_SPECIFIED\_TYPE\_GOES\_DOWN\_TO\_OR\_THROUGH\_THE\_SPECIFIED\_TRIGGER\_PRICE + +25009 + +TriggerTrailingDeltaBips + +INT + +N + +Provide to create trailing orders. + +25032 + +SOR + +BOOLEAN + +N + +Whether to activate SOR for this order. + +**Sample message:** + +``` +8=FIX.4.4|9=114|35=D|34=2|49=qNXO12fH|52=20240611-09:01:46.228|56=SPOT|11=1718096506197867067|38=5|40=2|44=10|54=1|55=LTCBNB|59=4|10=016| +``` + +**Response:** + +- [ExecutionReport`<8>`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) with `ExecType (150)` value `NEW (0)` if the order was accepted. +- [ExecutionReport`<8>`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) with `ExecType (150)` value `REJECTED (8)` if the order was rejected. +- [Reject`<3>`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) if the message is rejected. + +##### Supported Order Types[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +Order name + +Binance OrderType + +Side + +required field values + +required fields with user values + +Market order + +`MARKET` + +BUY or SELL + +`40=1|` + +Limit order + +`LIMIT` + +BUY or SELL + +`40=2|` + +Limit maker order + +`LIMIT_MAKER` + +BUY or SELL + +`40=2|18=6|` + +Buy stop loss order + +`STOP_LOSS` + +BUY + +`40=3|1100=4|1101=1|1107=2|1109=U|` + +1102 + +Buy trailing stop loss order + +`STOP_LOSS` + +BUY + +`40=3|1100=4|1101=1|1107=2|1109=U|` + +1102,25009 + +Buy stop loss limit order + +`STOP_LOSS_LIMIT` + +BUY + +`40=4|1100=4|1101=1|1107=2|1109=U|` + +1102 + +Buy trailing stop loss limit order + +`STOP_LOSS_LIMIT` + +BUY + +`40=4|1100=4|1101=1|1107=2|1109=U|` + +1102,25009 + +Sell stop loss order + +`STOP_LOSS` + +SELL + +`40=3|1100=4|1101=1|1107=2|1109=D|` + +1102 + +Sell trailing stop loss order + +`STOP_LOSS` + +SELL + +`40=3|1100=4|1101=1|1107=2|1109=D|` + +1102,25009 + +Sell stop loss limit order + +`STOP_LOSS_LIMIT` + +SELL + +`40=4|1100=4|1101=1|1107=2|1109=D|` + +1102 + +Sell trailing stop loss limit order + +`STOP_LOSS_LIMIT` + +SELL + +`40=4|1100=4|1101=1|1107=2|1109=D|` + +1102,25009 + +Buy take profit order + +`TAKE_PROFIT` + +BUY + +`40=3|1100=4|1101=1|1107=2|1109=D|` + +1102 + +Buy trailing take profit order + +`TAKE_PROFIT` + +BUY + +`40=3|1100=4|1101=1|1107=2|1109=D|` + +1102,25009 + +Buy trailing take profit order + +`TAKE_PROFIT` + +BUY + +`40=3|1100=4|1101=1|1107=2|` + +25009 + +Buy take profit order + +`TAKE_PROFIT_LIMIT` + +BUY + +`40=4|1100=4|1101=1|1107=2|1109=D|` + +1102 + +Buy trailing take profit limit order + +`TAKE_PROFIT_LIMIT` + +BUY + +`40=4|1100=4|1101=1|1107=2|1109=D|` + +1102,25009 + +Buy trailing take profit limit order + +`TAKE_PROFIT_LIMIT` + +BUY + +`40=4|1100=4|1101=1|1107=2|` + +25009 + +Sell take profit order + +`TAKE_PROFIT` + +SELL + +`40=3|1100=4|1101=1|1107=2|1109=U|` + +1102 + +Sell trailing take profit order + +`TAKE_PROFIT` + +SELL + +`40=3|1100=4|1101=1|1107=2|1109=U|` + +1102,25009 + +Sell trailing take profit order + +`TAKE_PROFIT` + +SELL + +`40=3|1100=4|1101=1|1107=2|` + +25009 + +Sell take profit limit order + +`TAKE_PROFIT_LIMIT` + +SELL + +`40=4|1100=4|1101=1|1107=2|1109=U|` + +1102 + +Sell trailing take profit limit order + +`TAKE_PROFIT_LIMIT` + +SELL + +`40=4|1100=4|1101=1|1107=2|1109=U|` + +1102,25009 + +Sell trailing take profit limit order + +`TAKE_PROFIT_LIMIT` + +SELL + +`40=4|1100=4|1101=1|1107=2|` + +25009 + +Required fields based on Binance OrderType: + +Binance OrderType + +Additional mandatory parameters + +Additional Information + +`LIMIT` + +38, 44, 59 + +`MARKET` + +38 OR 152 + +`MARKET` orders using the `OrderQty (38)` field specifies the amount of the `base asset` the user wants to buy or sell at the market price. +E.g. `MARKET` order on BTCUSDT will specify how much BTC the user is buying or selling. + +`MARKET` orders using `quoteOrderQty` specifies the amount the user wants to spend (when buying) or receive (when selling) the `quote` asset; the correct `quantity` will be determined based on the market liquidity and `quoteOrderQty`. +E.g. Using the symbol BTCUSDT: +`BUY` side, the order will buy as many BTC as `quoteOrderQty` USDT can. +`SELL` side, the order will sell as much BTC needed to receive `CashOrderQty (152)` USDT. + +`STOP_LOSS` + +38, 1102 or 25009 + +This will execute a `MARKET` order when the conditions are met. (e.g. `TriggerPrice (1102)` is met or `TriggerTrailingDeltaBips (25009)` is activated) + +`STOP_LOSS_LIMIT` + +38, 44, 59, 1102 or 25009 + +`TAKE_PROFIT` + +38, 1102 or 25009 + +This will execute a `MARKET` order when the conditions are met. (e.g. `TriggerPrice (1102)` is met or `TriggerTrailingDeltaBips (25009)` is activated) + +`TAKE_PROFIT_LIMIT` + +38, 44, 59, 1102 or 25009 + +`LIMIT_MAKER` + +38, 44 + +This is a `LIMIT` order that will be rejected if the order immediately matches and trades as a taker. +This is also known as a POST-ONLY order. + +#### ExecutionReport `<8>`[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +Sent by the server whenever an order state changes. + +> \[!NOTE\] +> +> - By default, ExecutionReport`<8>` is sent for all orders of an account, including those submitted in different connections. Please see [Response Mode](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) for other behavior options. +> - FIX API should give better performance for ExecutionReport`<8>` push. + +Tag + +Name + +Type + +Required + +Description + +17 + +ExecID + +STRING + +N + +Omitted on rejected orders. + +11 + +ClOrdID + +STRING + +N + +`ClOrdID` of the list as assigned on the request. + +41 + +OrigClOrdID + +STRING + +N + +Original `ClOrdID` of the order. + +37 + +OrderID + +INT + +N + +Assigned by exchange. + +38 + +OrderQty + +QTY + +N + +Quantity of the order. + +40 + +OrdType + +CHAR + +Y + +Possible values: + +`1` - MARKET + +`2` - LIMIT + +`3` - STOP\_LOSS + +`4` - STOP\_LIMIT + +`P` - PEGGED + +54 + +Side + +CHAR + +Y + +Possible values: + +`1` - BUY + +`2` - SELL + +55 + +Symbol + +STRING + +Y + +Symbol of the order. + +18 + +ExecInst + +CHAR + +N + +Possible values: + +`6` - PARTICIPATE\_DONT\_INITIATE + +44 + +Price + +PRICE + +N + +Price of the order. + +59 + +TimeInForce + +CHAR + +N + +Possible values: + +`1` - GOOD\_TILL\_CANCEL + +`3` - IMMEDIATE\_OR\_CANCEL + +`4` - FILL\_OR\_KILL + +60 + +TransactTime + +UTCTIMESTAMP + +N + +Timestamp when this event occurred. + +25018 + +OrderCreationTime + +INT + +N + +111 + +MaxFloor + +QTY + +N + +Appears on iceberg orders. + +66 + +ListID + +STRING + +N + +Appears on list orders. + +152 + +CashOrderQty + +QTY + +N + +OrderQty specified in the quote asset units. + +847 + +TargetStrategy + +INT + +N + +`TargetStrategy (847)` from the order placement request. + +7940 + +StrategyID + +INT + +N + +`StrategyID (7940)` from the order placement request. + +25001 + +SelfTradePreventionMode + +CHAR + +N + +Possible values: + +`1` - NONE + +`2` - EXPIRE\_TAKER + +`3` - EXPIRE\_MAKER + +`4` - EXPIRE\_BOTH + +`5` - DECREMENT +`6` - TRANSFER + +150 + +ExecType + +CHAR + +Y + +**Note:** Field `PreventedMatchID(25024)` will be present if order has expired due to `SelfTradePreventionMode(25013)` + +Possible values: + +`0` - NEW + +`4` - CANCELED + +`5` - REPLACED + +`8` - REJECTED + +`F` - TRADE + +`C` - EXPIRED + +14 + +CumQty + +QTY + +Y + +Total number of base asset traded on this order. + +151 + +LeavesQty + +QTY + +N + +Quantity remaining for further execution. + +25017 + +CumQuoteQty + +QTY + +N + +Total number of quote asset traded on this order. + +1057 + +AggressorIndicator + +BOOLEAN + +N + +Appears on trade execution reports. + +Indicates whether the order was a taker in the trade. + +1003 + +TradeID + +STRING + +N + +Appears on trade execution reports. + +31 + +LastPx + +PRICE + +N + +The price of the last execution. + +32 + +LastQty + +QTY + +Y + +The quantity of the last execution. + +39 + +OrdStatus + +CHAR + +Y + +Possible values: + +`0` - NEW + +`1` - PARTIALLY\_FILLED + +`2` - FILLED + +`4` - CANCELED `6` - PENDING\_CANCEL + +`8` - REJECTED + +`A` - PENDING\_NEW + +`C` - EXPIRED + +Note that FIX does not support `EXPIRED_IN_MATCH` status, and get converted to `EXPIRED` in FIX. + +70 + +AllocID + +INT + +N + +Allocation ID as assigned by the exchange. + +574 + +MatchType + +INT + +N + +Possible values: + +`1` - ONE\_PARTY\_TRADE\_REPORT + +`4` - AUTO\_MATCH + +25021 + +WorkingFloor + +INT + +N + +Appears for orders that potentially have allocations. + +25022 + +TrailingTime + +UTCTIMESTAMP + +N + +Appears only for trailing stop orders. + +636 + +WorkingIndicator + +BOOLEAN + +N + +Set to `Y` when this order enters order book. + +25023 + +WorkingTime + +UTCTIMESTAMP + +N + +When this order appeared on the order book. + +25024 + +PreventedMatchID + +INT + +N + +Appears only for orders that expired due to STP. + +25025 + +PreventedExecutionPrice + +PRICE + +N + +Appears only for orders that expired due to STP. + +25026 + +PreventedExecutionQty + +QTY + +N + +Appears only for orders that expired due to STP. + +25027 + +TradeGroupID + +INT + +N + +Appears only for orders that expired due to STP. + +25028 + +CounterSymbol + +STRING + +N + +Appears only for orders that expired due to STP. + +25029 + +CounterOrderID + +INT + +N + +Appears only for orders that expired due to STP. + +25030 + +PreventedQty + +QTY + +N + +Appears only for orders that expired due to STP. + +25031 + +LastPreventedQty + +QTY + +N + +Appears only for orders that expired due to STP. + +25032 + +SOR + +BOOLEAN + +N + +Appears for orders that used SOR. + +25016 + +ErrorCode + +INT + +N + +API error code (see [Error Codes](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors)). + +58 + +Text + +STRING + +N + +Human-readable error message. + +136 + +NoMiscFees + +NUMINGROUP + +N + +Number of repeating groups of miscellaneous fees. + +\=>137 + +MiscFeeAmt + +QTY + +Y + +Amount of fees denominated in `MiscFeeCurr(138)` asset + +\=>138 + +MiscFeeCurr + +STRING + +Y + +Currency of miscellaneous fee. + +\=>139 + +MiscFeeType + +INT + +Y + +Possible values: + +`4` - EXCHANGE\_FEES + +1100 + +TriggerType + +CHAR + +N + +Possible values: + +`4` - PRICE\_MOVEMENT + +1101 + +TriggerAction + +CHAR + +N + +Possible values: + +`1` - ACTIVATE + +1102 + +TriggerPrice + +PRICE + +N + +Activation price for contingent orders. See [table](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +1107 + +TriggerPriceType + +CHAR + +N + +Possible values: + +`2` - LAST\_TRADE + +1109 + +TriggerPriceDirection + +CHAR + +N + +Used to differentiate between StopLoss and TakeProfit orders. See [table](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api). + +Possible values: + +`U` - TRIGGER\_IF\_THE\_PRICE\_OF\_THE\_SPECIFIED\_TYPE\_GOES\_UP\_TO\_OR\_THROUGH\_THE\_SPECIFIED\_TRIGGER\_PRICE + +`D` - TRIGGER\_IF\_THE\_PRICE\_OF\_THE\_SPECIFIED\_TYPE\_GOES\_DOWN\_TO\_OR\_THROUGH\_THE\_SPECIFIED\_TRIGGER\_PRICE + +25009 + +TriggerTrailingDeltaBips + +INT + +N + +Appears only for trailing stop orders. + +211 + +PegOffsetValue + +FLOAT + +N + +Amount added to the peg in the context of the PegOffsetType + +1094 + +PegPriceType + +CHAR + +N + +Defines the type of peg +Possible values: +`4` - MARKET\_PEG +`5` - PRIMARY\_PEG + +835 + +PegMoveType + +CHAR + +N + +Describes whether peg is fixed or floats. Required for Pegged Orders and must be set to `1` (FIXED) + +836 + +PegOffsetType + +CHAR + +N + +Type of price peg offset. +Possible values: + +`3` - PRICE\_TIER + +839 + +PeggedPrice + +PRICE + +N + +Current price the order is pegged at + +**Sample message:** + +``` +8=FIX.4.4|9=330|35=8|34=2|49=SPOT|52=20240611-09:01:46.228950|56=qNXO12fH|11=1718096506197867067|14=0.00000000|17=144|32=0.00000000|37=76|38=5.00000000|39=0|40=2|44=10.00000000|54=1|55=LTCBNB|59=4|60=20240611-09:01:46.228000|150=0|151=5.00000000|636=Y|1057=Y|25001=1|25017=0.00000000|25018=20240611-09:01:46.228000|25023=20240611-09:01:46.228000|10=095| +``` + +#### OrderCancelRequest ``[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +Sent by the client to cancel an order or an order list. + +- To cancel an order either `OrderID (11)` or `OrigClOrdID (41)` are required. + - If both `OrderID (37)` and `OrigClOrdID (41)` are provided, the `OrderID` is searched first, then the `OrigClOrdID` from that result is checked against that order. If both conditions are not met the request will be rejected. +- To cancel an order list either `ListID (66)` or `OrigClListID (25015)` are required. + - If both `ListID (66)` and `OrigClListID (25015)` are provided, the `ListID` is searched first, then the `OrigClListID` from that result is checked against that order. If both conditions are not met the request will be rejected. + +If the canceled order is part of an order list, the entire list will be canceled. + +**Note:** + +- The performance for canceling an order (single cancel or as part of a cancel-replace) is always better when only `orderId` is sent. Sending `origClientOrderId` or both `orderId` + `origClientOrderId` will be slower. + +Tag + +Name + +Type + +Required + +Description + +11 + +ClOrdID + +STRING + +Y + +`ClOrdID` of this request. + +41 + +OrigClOrdID + +STRING + +N + +`ClOrdID (11)` of the order to cancel. + +37 + +OrderID + +INT + +N + +`OrderID (37)` of the order to cancel. + +25015 + +OrigClListID + +STRING + +N + +`ClListID (25014)` of the order list to cancel. + +66 + +ListID + +STRING + +N + +`ListID (66)` of the order list to cancel. + +55 + +Symbol + +STRING + +Y + +Symbol on which to cancel order. + +25002 + +CancelRestrictions + +INT + +N + +Restrictions on the cancel. Possible values: + +`1` - ONLY\_NEW + +`2` - ONLY\_PARTIALLY\_FILLED + +**Sample message:** + +``` +8=FIX.4.4|9=93|35=F|34=2|49=ieBwvCKy|52=20240613-01:11:13.784|56=SPOT|11=1718241073695674483|37=2|55=LTCBNB|10=210| +``` + +**Response:** + +- [ExecutionReport`<8>`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) with `ExecType (150)` value `CANCELED (4)` for each canceled order. +- [ListStatus``](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) if orders in an order list were canceled. +- [OrderCancelReject`<9>`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) if cancellation was rejected. +- [Reject`<3>`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) if the message is rejected. + +#### OrderCancelReject `<9>`[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +Sent by the server when [OrderCancelRequest``](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) has failed. + +Tag + +Name + +Type + +Required + +Description + +11 + +ClOrdID + +STRING + +Y + +`ClOrdID (11)` of the cancel request. + +41 + +OrigClOrdID + +STRING + +N + +`OrigClOrdID (41)` from the cancel request. + +37 + +OrderID + +INT + +N + +`OrderID (37)` from the cancel request. + +25015 + +OrigClListID + +STRING + +N + +`OrigClListID (25015)` from the cancel request. + +66 + +ListID + +STRING + +N + +`ListID (66)` from the cancel request. + +55 + +Symbol + +STRING + +Y + +`Symbol (55)` from the cancel request. + +25002 + +CancelRestrictions + +INT + +N + +`CancelRestrictions (25002)` from the cancel request. + +434 + +CxlRejResponseTo + +CHAR + +Y + +Type of request that this OrderCancelReject`<9>` is in response to. + +Possible values: + +`1` - ORDER\_CANCEL\_REQUEST + +25016 + +ErrorCode + +INT + +Y + +API error code (see [Error Codes](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors)). + +58 + +Text + +STRING + +Y + +Human-readable error message. + +**Sample message:** + +``` +8=FIX.4.4|9=137|35=9|34=2|49=SPOT|52=20240613-01:12:41.320869|56=OlZb8ht8|11=1718241161272843932|37=2|55=LTCBNB|58=Unknown order sent.|434=1|25016=-1013|10=087| +``` + +#### OrderCancelRequestAndNewOrderSingle ``[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +Sent by the client to cancel an order and submit a new one for execution. + +- To cancel an order either `OrderID (11)` or `OrigClOrdId (41)` are required. +- If both `OrderID (37)` and `OrigClOrdID (41)` are provided, the `OrderID` is searched first, then the `OrigClOrdID` from that result is checked against that order. If both conditions are not met the request will be rejected. + +Filters and Order Count are evaluated before the processing of the cancellation and order placement occurs. + +A new order that was not attempted (i.e. when `newOrderResult: NOT_ATTEMPTED`), will still increase the unfilled order count by 1. + +**Unfilled Order Count:** 1 + +Please refer to [Supported Order Types](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) for supported field combinations when describing the new order. + +> \[!NOTE\] Cancel is always processed first. Then immediately after that the new order is submitted. + +Tag + +Name + +Type + +Required + +Description + +25033 + +OrderCancelRequestAndNewOrderSingleMode + +INT + +Y + +What action should be taken if cancel fails. + +Possible values: + +`1` - STOP\_ON\_FAILURE + +`2` - ALLOW\_FAILURE + +25038 + +OrderRateLimitExceededMode + +INT + +N + +What should be done to the cancellation request if you exceed the unfilled order rate limit. + +Possible values: `1` - DO\_NOTHING + +`2` - CANCEL\_ONLY + +37 + +OrderID + +INT + +N + +`OrderID` of the order to cancel. + +25034 + +CancelClOrdID + +STRING + +N + +`ClOrdID` of the cancel. + +41 + +OrigClOrdID + +STRING + +N + +`ClOrdID` of the order to cancel. + +11 + +ClOrdID + +STRING + +Y + +`ClOrdID` to be assigned to the new order. + +25002 + +CancelRestrictions + +INT + +N + +Restrictions on the cancel. Possible values: + +`1` - ONLY\_NEW + +`2` - ONLY\_PARTIALLY\_FILLED + +38 + +OrderQty + +QTY + +N + +Quantity of the new order + +40 + +OrdType + +CHAR + +Y + +See the [table](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) to understand supported order types and the required fields to use them. + +Possible values: + +`1` - MARKET + +`2` - LIMIT + +`3` - STOP + +`4` - STOP\_LIMIT + +`P` - PEGGED + +18 + +ExecInst + +CHAR + +N + +Possible values: + +`6` - PARTICIPATE\_DONT\_INITIATE + +44 + +Price + +PRICE + +N + +Price of the new order + +54 + +Side + +CHAR + +Y + +Side of the order. + +Possible values: + +`1` - BUY + +`2` - SELL + +55 + +Symbol + +STRING + +Y + +Symbol to cancel and place the order on. + +59 + +TimeInForce + +CHAR + +N + +Possible values: + +`1` - GOOD\_TILL\_CANCEL + +`3` - IMMEDIATE\_OR\_CANCEL + +`4` - FILL\_OR\_KILL + +111 + +MaxFloor + +QTY + +N + +Used for iceberg orders, this specifies the visible quantity of the order on the book. + +152 + +CashOrderQty + +QTY + +N + +Quantity of the order specified in the quote asset units, for reverse market orders. + +847 + +TargetStrategy + +INT + +N + +The value cannot be less than `1000000`. + +7940 + +StrategyID + +INT + +N + +25001 + +SelfTradePreventionMode + +CHAR + +N + +Possible values: + +`1` - NONE + +`2` - EXPIRE\_TAKER + +`3` - EXPIRE\_MAKER + +`4` - EXPIRE\_BOTH + +`5` - DECREMENT +`6` - TRANSFER + +211 + +PegOffsetValue + +FLOAT + +N + +Amount added to the peg in the context of the PegOffsetType + +1094 + +PegPriceType + +CHAR + +N + +Defines the type of peg +Possible values: +`4` - MARKET\_PEG +`5` - PRIMARY\_PEG + +835 + +PegMoveType + +CHAR + +N + +Describes whether peg is fixed or floats. Required for Pegged Orders and must be set to `1` (FIXED) + +836 + +PegOffsetType + +CHAR + +N + +Type of price peg offset. +Possible values: + +`3` - PRICE\_TIER + +1100 + +TriggerType + +CHAR + +N + +Possible values: `4` - PRICE\_MOVEMENT + +1101 + +TriggerAction + +CHAR + +N + +Possible values: + +`1` - ACTIVATE + +1102 + +TriggerPrice + +PRICE + +N + +Activation price for contingent orders. See [table](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +1107 + +TriggerPriceType + +CHAR + +N + +Possible values: + +`2` - LAST\_TRADE + +1109 + +TriggerPriceDirection + +CHAR + +N + +Used to differentiate between StopLoss and TakeProfit orders. See [table](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api). + +Possible values: + +`U` - TRIGGER\_IF\_THE\_PRICE\_OF\_THE\_SPECIFIED\_TYPE\_GOES\_UP\_TO\_OR\_THROUGH\_THE\_SPECIFIED\_TRIGGER\_PRICE + +`D` - TRIGGER\_IF\_THE\_PRICE\_OF\_THE\_SPECIFIED\_TYPE\_GOES\_DOWN\_TO\_OR\_THROUGH\_THE\_SPECIFIED\_TRIGGER\_PRICE + +25009 + +TriggerTrailingDeltaBips + +INT + +N + +Provide to create trailing orders. + +**Sample message:** + +``` +8=FIX.4.4|9=160|35=XCN|34=2|49=JS8iiXK6|52=20240613-02:31:53.753|56=SPOT|11=1718245913721036458|37=8|38=5|40=2|44=4|54=1|55=LTCBNB|59=1|111=1|25033=1|25034=1718245913721036819|10=229| +``` + +**Response:** + +- [ExecutionReport`<8>`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) with `ExecType (150)` value `CANCELED (4)` for the canceled order. +- [ExecutionReport`<8>`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) with `ExecType (150)` value `NEW (0)` for the new order. +- [ExecutionReport`<8>`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) with `ExecType (150)` value `REJECTED (8)` if the new order was rejected. +- [OrderCancelReject`<9>`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) if the cancellation was rejected. +- [Reject`<3>`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) if the message is rejected. + +#### OrderMassCancelRequest ``[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +Sent by the client to cancel all open orders on a symbol. + +> \[!NOTE\] All orders of the account will be canceled, including those placed in different connections. + +Tag + +Name + +Type + +Required + +Description + +11 + +ClOrdID + +STRING + +Y + +`ClOrdId` of this mass cancel request. + +55 + +Symbol + +STRING + +Y + +Symbol on which to cancel orders. + +530 + +MassCancelRequestType + +CHAR + +Y + +Possible values: + +`1` - CANCEL\_SYMBOL\_ORDERS + +**Sample message:** + +``` +8=FIX.4.4|9=95|35=q|34=2|49=dpYPesqv|52=20240613-01:24:36.948|56=SPOT|11=1718241876901971671|55=BTCUSDT|530=1|10=243| +``` + +**Responses:** + +- [ExecutionReport`<8>`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) with `ExecType (150)` value `CANCELED (4)` for the every order canceled. +- [OrderMassCancelReport``](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) with `MassCancelResponse (531)` field indicating whether the message is accepted or rejected. +- [Reject`<3>`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) if the message is rejected. + +#### OrderMassCancelReport ``[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +Sent by the server in response to [OrderMassCancelRequest``](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api). + +Tag + +Name + +Type + +Required + +Description + +55 + +Symbol + +STRING + +Y + +`Symbol (55)` from the cancel request. + +11 + +ClOrdID + +STRING + +Y + +`ClOrdID (11)` of the cancel request. + +530 + +MassCancelRequestType + +CHAR + +Y + +`MassCancelRequestType (530)` from the cancel request. + +531 + +MassCancelResponse + +CHAR + +Y + +Possible values: + +`0` - CANCEL\_REQUEST\_REJECTED + +`1` - CANCEL\_SYMBOL\_ORDERS + +532 + +MassCancelRejectReason + +INT + +N + +Possible values: + +`99` - OTHER + +533 + +TotalAffectedOrders + +INT + +N + +How many orders were canceled. + +25016 + +ErrorCode + +INT + +N + +API error code (see [Error Codes](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors)). + +58 + +Text + +STRING + +N + +Human-readable error message. + +**Sample message:** + +``` +8=FIX.4.4|9=109|35=r|34=2|49=SPOT|52=20240613-01:24:36.949763|56=dpYPesqv|11=1718241876901971671|55=LTCBNB|530=1|531=1|533=5|10=083| +``` + +#### NewOrderList ``[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +Sent by the client to submit a list of orders for execution. + +- OCOs or OTOs add **2 orders** to the `EXCHANGE_MAX_ORDERS` filter and the `MAX_NUM_ORDERS` filter. +- OTOCOs add **3 orders** to the `EXCHANGE_MAX_NUM_ORDERS` filter and `MAX_NUM_ORDERS` filter. + +**Unfilled Order Count:** + +- OCO: 2 +- OTO: 2 +- OTOCO: 3 + +Orders in an order list are contingent on one another. Please refer to [Supported Order List Types](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) for supported order types and triggering instructions. + +Tag + +Name + +Type + +Required + +Description + +25014 + +ClListID + +STRING + +Y + +`ClListID` to be assigned to the order list. + +1385 + +ContingencyType + +INT + +N + +Possible values: + +`1` - ONE\_CANCELS\_THE\_OTHER + +`2` - ONE\_TRIGGERS\_THE\_OTHER + +25046 + +OPO + +BOOLEAN + +N + +Sets this order list as an [OPO](https://developers.binance.com/docs/binance-spot-api-docs/faqs/opo) when set to `true`. + +73 + +NoOrders + +NUMINGROUP + +N + +The length of the array for Orders. Only 2 or 3 are allowed. + +\=>11 + +ClOrdID + +STRING + +Y + +`ClOrdID` to be assigned to the order + +\=>38 + +OrderQty + +QTY + +N + +Quantity of the order + +\=>40 + +OrdType + +CHAR + +Y + +See the [table](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) to understand supported order types and the required fields to use them. + +Possible values: + +`1` - MARKET + +`2` - LIMIT + +`3` - STOP + +`4` - STOP\_LIMIT + +`P`\- PEGGED + +\=>18 + +ExecInst + +CHAR + +N + +Possible values: + +`6` - PARTICIPATE\_DONT\_INITIATE + +\=>44 + +Price + +PRICE + +N + +Price of the order + +\=>54 + +Side + +CHAR + +Y + +Side of the order. Possible values: + +`1` - BUY + +`2` - SELL + +\=>55 + +Symbol + +STRING + +Y + +Symbol to place the order on. + +\=>59 + +TimeInForce + +CHAR + +N + +Possible values: + +`1` - GOOD\_TILL\_CANCEL + +`3` - IMMEDIATE\_OR\_CANCEL + +`4` - FILL\_OR\_KILL + +\=>111 + +MaxFloor + +QTY + +N + +Used for iceberg orders, this specifies the visible quantity of the order on the book. + +\=>152 + +CashOrderQty + +QTY + +N + +Quantity of the order specified in the quote asset units, for reverse market orders. + +\=>847 + +TargetStrategy + +INT + +N + +The value cannot be less than `1000000`. + +\=>7940 + +StrategyID + +INT + +N + +\=>25001 + +SelfTradePreventionMode + +CHAR + +N + +Possible values: + +`1` - NONE + +`2` - EXPIRE\_TAKER + +`3` - EXPIRE\_MAKER + +`4` - EXPIRE\_BOTH + +`5` - DECREMENT +`6` - TRANSFER + +\=> 211 + +PegOffsetValue + +FLOAT + +N + +Amount added to the peg in the context of the PegOffsetType + +\=>1094 + +PegPriceType + +CHAR + +N + +Defines the type of peg +Possible values: +`4` - MARKET\_PEG +`5` - PRIMARY\_PEG + +\=>835 + +PegMoveType + +CHAR + +N + +Describes whether peg is fixed or floats. Required for Pegged Orders and must be set to `1` (FIXED) + +\=>836 + +PegOffsetType + +CHAR + +N + +Type of price peg offset. +Possible values: + +`3` - PRICE\_TIER + +\=>1100 + +TriggerType + +CHAR + +N + +Possible values: + +`4` - PRICE\_MOVEMENT + +\=>1101 + +TriggerAction + +CHAR + +N + +Possible values: + +`1` - ACTIVATE + +\=>1102 + +TriggerPrice + +PRICE + +N + +Activation price for contingent orders. See [table](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +\=>1107 + +TriggerPriceType + +CHAR + +N + +Possible values: + +`2` - LAST\_TRADE + +\=>1109 + +TriggerPriceDirection + +CHAR + +N + +Used to differentiate between StopLoss and TakeProfit orders. See [table](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api). + +Possible values: + +`U` - TRIGGER\_IF\_THE\_PRICE\_OF\_THE\_SPECIFIED\_TYPE\_GOES\_UP\_TO\_OR\_THROUGH\_THE\_SPECIFIED\_TRIGGER\_PRICE + +`D` - TRIGGER\_IF\_THE\_PRICE\_OF\_THE\_SPECIFIED\_TYPE\_GOES\_DOWN\_TO\_OR\_THROUGH\_THE\_SPECIFIED\_TRIGGER\_PRICE + +\=>25009 + +TriggerTrailingDeltaBips + +INT + +N + +Provide to create trailing orders. + +\=>25010 + +NoListTriggeringInstructions + +NUMINGROUP + +N + +The length of the array for ListTriggeringInstructions. + +\==>25011 + +ListTriggerType + +CHAR + +N + +What needs to happen to the order pointed to by ListTriggerTriggerIndex in order for the action to take place. + +Possible values: + +`1` - ACTIVATED + +`2` - PARTIALLY\_FILLED + +`3` - FILLED + +\==>25012 + +ListTriggerTriggerIndex + +INT + +N + +Index of the trigger order: 0-indexed. + +\==>25013 + +ListTriggerAction + +CHAR + +N + +Action to take place on this order after the ListTriggerType has been fulfilled. + +Possible values: + +`1` - RELEASE + +`2` - CANCEL + +**Sample message:** + +``` +8=FIX.4.4|9=236|35=E|34=2|49=Eg13pOvN|52=20240607-02:19:07.836|56=SPOT|73=2|11=w1717726747805308656|55=LTCBNB|54=2|38=1|40=2|44=0.25|59=1|11=p1717726747805308656|55=LTCBNB|54=2|38=1|40=1|25010=1|25011=3|25012=0|25013=1|1385=2|25014=1717726747805308656|10=171| +``` + +#### Supported Order List Types[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +> \[!NOTE\] Orders must be specified in the sequence indicated in the _Order Names_ column in the table below. + +Order list name + +Contingency Type (1385) + +Order names + +Order sides + +Allowed Binance order types + +List Triggering Instructions + +OCO + +`1` + +1\. below order + + + +2\. above order + +1\. below order=`SELL` + + + +2\. above order=`SELL` + +1\. below order=`STOP_LOSS` or `STOP_LOSS_LIMIT` + + + +2\. above order=`LIMIT_MAKER` + +1\. below order: + +`25010=1|25011=2|25012=1|25013=2|` + + + +2\. above order: + +`25010=1|25011=1|25012=0|25013=2|` + +OCO + +`1` + +1\. below order + + + +2\. above order + +1\. below order=`BUY` + + + +2\. above order=`BUY` + +1\. below order=`LIMIT_MAKER` + + + +2\. above order=`STOP_LOSS` or `STOP_LOSS_LIMIT` + +1\. below order: + +`25010=1|25011=1|25012=1|25013=2|` + + + +2\. above order: + +`25010=1|25011=2|25012=0|25013=2|` + +OCO + +`1` + +1\. below order + + + +2\. above order + +1\. below order=`SELL` + + + +2\. above order=`SELL` + +1\. below order=`STOP_LOSS` or `STOP_LOSS_LIMIT` + + + +2\. above order= `TAKE_PROFIT` + +1\. below order: + +`25010=1|25011=1|25012=1|25013=2|` + + + +2\. above order: + +`25010=1|25011=1|25012=0|25013=2|` + +OCO + +`1` + +1\. below order + + + +2\. above order + +1\. below order=`BUY` + + + +2\. above order=`BUY` + +1\. below order=`TAKE_PROFIT` + + + +2\. above order = `STOP_LOSS` or `STOP_LOSS_LIMIT` + +1\. below order: + +`25010=1|25011=1|25012=1|25013=2|` + + + +2\. above order: + +`25010=1|25011=1|25012=0|25013=2|` + +OTO + +`2` + +1\. working order + + + +2\. pending order + +1\. working order=`SELL` or `BUY` + + + +2\. pending order=`SELL` or `BUY` + +1\. working order=`LIMIT` or `LIMIT_MAKER` + + + +2\. pending order=ANY + +1\. working order: + +NONE + + + +2\. pending order: + +`25010=1|25011=3|25012=0|25013=1|` + +OTOCO + +`2` + +1\. working order + + + +2\. pending below order + + + +3\. pending above order + +1\. working order=`SELL` or `BUY` + + + +2\. pending below order=`SELL` + + + +3\. pending above order=`SELL` + +1\. working order=`LIMIT` or `LIMIT_MAKER` + + + +2\. pending below order=`STOP_LOSS` or `STOP_LOSS_LIMIT` + + + +3\. pending above order=`LIMIT_MAKER` + +1\. working order: + +NONE + + + +2\. pending below order: + +`25010=2|25011=3|25012=0|25013=2|25011=2|25012=2|25013=2|` + + + +3\. pending above order: + +`25010=2|25011=3|25012=0|25013=2|25011=1|25012=1|25013=2|` + +OTOCO + +`2` + +1\. working order + + + +2\. pending below order + + + +3\. pending above order + +1\. working order=`SELL` or `BUY` + + + +2\. pending below order=`BUY` + + + +3\. pending above order=`BUY` + +1\. working order=`LIMIT` or `LIMIT_MAKER` + + + +2\. pending below order=`LIMIT_MAKER` + + + +3\. pending above order=`STOP_LOSS` or `STOP_LOSS_LIMIT` + +1\. working order: + +NONE + + + +2\. pending below order: + +`25010=2|25011=3|25012=0|25013=2|25011=1|25012=2|25013=2|` + + + +3\. pending above order: + +`25010=2|25011=3|25012=0|25013=2|25011=2|25012=1|25013=2|` + +OTOCO + +`2` + +1\. working order + + + +2\. pending below order + + + +3\. pending above order + +1\. working order=`SELL` or `BUY` + + + +2\. pending below order=`SELL` + + + +3\. pending above order=`SELL` + +1\. working order=`LIMIT` or `LIMIT_MAKER` + + + +2\. pending below order=`STOP_LOSS` or `STOP_LOSS_LIMIT` + + + +3\. pending above order=`TAKE_PROFIT` + +1\. working order: + +NONE + + + +2\. pending below order: + +`25010=2|25011=3|25012=0|25013=2|25011=1|25012=2|25013=2|` + + + +3\. pending above order: + +`25010=2|25011=3|25012=0|25013=2|25011=1|25012=1|25013=2|` + +OTOCO + +`2` + +1\. working order + + + +2\. pending below order + + + +3\. pending above order + +1\. working order=`SELL` or `BUY` + + + +2\. pending below order=`BUY` + + + +3\. pending above order=`BUY` + +1\. working order=`LIMIT` or `LIMIT_MAKER` + + + +2\. pending below order=`TAKE_PROFIT` + + + +3\. pending above order=`STOP_LOSS` or `STOP_LOSS_LIMIT` + +1\. working order: + +NONE + + + +2\. pending below order: + +`25010=2|25011=3|25012=0|25013=2|25011=1|25012=2|25013=2|` + + + +3\. pending above order: + +`25010=2|25011=3|25012=0|25013=2|25011=1|25012=1|25013=2|` + +OPO + +`2` + +1\. working order + + + +2\. pending order + +1\. working order=`BUY` + + + +2\. pending order=`SELL` + +1\. working order=`LIMIT` or `LIMIT_MAKER` + + + +2\. pending order=ANY + +1\. working order: + +NONE + + + +2\. pending order: + +`25010=1|25011=3|25012=0|25013=1|` + +OPOCO + +`2` + +1\. working order + + + +2\. pending below order + + + +3\. pending above order + +1\. working order=`BUY` + + + +2\. pending below order=`SELL` + + + +3\. pending above order=`SELL` + +1\. working order=`LIMIT` or `LIMIT_MAKER` + + + +2\. pending below order=`STOP_LOSS` or `STOP_LOSS_LIMIT` + + + +3\. pending above order=`LIMIT_MAKER` + +1\. working order: + +NONE + + + +2\. pending below order: + +`25010=2|25011=3|25012=0|25013=2|25011=2|25012=2|25013=2|` + + + +3\. pending above order: + +`25010=2|25011=3|25012=0|25013=2|25011=1|25012=1|25013=2|` + +OPOCO + +`2` + +1\. working order + + + +2\. pending below order + + + +3\. pending above order + +1\. working order=`BUY` + +2\. pending below order=`SELL` + + + +3\. pending above order=`SELL` + +1\. working order=`LIMIT` or `LIMIT_MAKER` + + + +2\. pending below order=`STOP_LOSS` or `STOP_LOSS_LIMIT` + + + +3\. pending above order=`TAKE_PROFIT` or `TAKE_PROFIT_LIMIT` + +1\. working order: + +NONE + + + +2\. pending below order: + +`25010=2|25011=3|25012=0|25013=2|25011=1|25012=2|25013=2|` + + + +3\. pending above order: + +`25010=2|25011=3|25012=0|25013=2|25011=1|25012=1|25013=2|` + +#### ListStatus ``[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +Sent by the server whenever an order list state changes. + +> \[!NOTE\] By default, ListStatus`` is sent for all order lists of an account, including those submitted in different connections. Please see [Response Mode](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) for other behavior options. + +Tag + +Name + +Type + +Required + +Description + +55 + +Symbol + +STRING + +N + +Symbol of the order list. + +66 + +ListID + +STRING + +N + +`ListID` of the list as assigned by the exchange. + +25014 + +ClListID + +STRING + +N + +`ClListID` of the list as assigned on the request. + +25015 + +OrigClListID + +STRING + +N + +1385 + +ContingencyType + +INT + +N + +Possible values: + +`1` - ONE\_CANCELS\_THE\_OTHER + +`2` - ONE\_TRIGGERS\_THE\_OTHER + +429 + +ListStatusType + +INT + +Y + +Possible values: + +`2` - RESPONSE + +`4` - EXEC\_STARTED + +`5` - ALL\_DONE + +`100` - UPDATED + +431 + +ListOrderStatus + +INT + +Y + +Possible values: + +`3` - EXECUTING + +`6` - ALL\_DONE + +`7` - REJECT + +1386 + +ListRejectReason + +INT + +N + +Possible values: + +`99` - OTHER + +103 + +OrdRejReason + +INT + +N + +Possible values: + +`99` - OTHER + +60 + +TransactTime + +UTCTIMESTAMP + +N + +Timestamp when this event occurred. + +25016 + +ErrorCode + +INT + +N + +API error code (see [Error Codes](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors)). + +58 + +Text + +STRING + +N + +Human-readable error message. + +73 + +NoOrders + +NUMINGROUP + +N + +The length of the array for Orders. + +\=>55 + +Symbol + +STRING + +Y + +Symbol of the order. + +\=>37 + +OrderID + +INT + +Y + +`OrderID` of the order as assigned by the exchange. + +\=>11 + +ClOrdID + +STRING + +Y + +`ClOrdID` of the order as assigned on the request. + +\=>25010 + +NoListTriggeringInstructions + +NUMINGROUP + +N + +The length of the array for ListTriggeringInstructions. + +\==>25011 + +ListTriggerType + +CHAR + +N + +Possible values: + +`1` - ACTIVATED + +`2` - PARTIALLY\_FILLED + +`3` - FILLED + +\==>25012 + +ListTriggerTriggerIndex + +INT + +N + +\==>25013 + +ListTriggerAction + +CHAR + +N + +Possible values: + +`1` - RELEASE + +`2` - CANCEL + +**Sample message:** + +``` +8=FIX.4.4|9=293|35=N|34=2|49=SPOT|52=20240607-02:19:07.837191|56=Eg13pOvN|55=BTCUSDT|60=20240607-02:19:07.836000|66=25|73=2|55=BTCUSDT|37=52|11=w1717726747805308656|55=BTCUSDT|37=53|11=p1717726747805308656|25010=1|25011=3|25012=0|25013=1|429=4|431=3|1385=2|25014=1717726747805308656|25015=1717726747805308656|10=162| +``` + +#### OrderAmendKeepPriorityRequest ``[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +Sent by the client to reduce the original quantity of their order. + +This adds 0 orders to the `EXCHANGE_MAX_ORDERS` filter and the `MAX_NUM_ORDERS` filter. + +**Unfilled Order Count:** 0 + +Read [Order Amend Keep Priority FAQ](https://developers.binance.com/docs/binance-spot-api-docs/testnet/faqs/order_amend_keep_priority.md) to learn more. + +**Notes:** + +- The `ClOrdID (11)` is not required to be different from the `ClOrdID` of the order. When the `ClOrdID` of the request is the same as the `ClOrdID` of the order being amended, the `ClOrdID` will remain unchanged. +- If both `OrderID (37)` and `OrigClOrdID (41)` are provided, the `OrderID` is searched first, then the `OrigClOrdID (41)` from that result is checked against that order. If both conditions are not met the request will be rejected. + +Tag + +Name + +Type + +Required + +Description + +11 + +ClOrdID + +STRING + +Y + +The ClOrdID of this request. + +41 + +OrigClOrdID + +STRING + +N + +`ClOrdID (11)` of the order to amend. Either `OrigClOrdID (41)` or `OrderId (37)` have to be specified. + +37 + +OrderID + +INT + +N + +`OrderID (37)` of the order to amend. Either `OrigClOrdID (41)` or `OrderId (37)` have to be specified. + +55 + +Symbol + +STRING + +Y + +Symbol on which to amend the order. + +38 + +OrderQty + +QTY + +N + +New quantity of the order. Required to be smaller than the original OrderQty of the order. + +**Sample message:** + +``` +8=FIX.4.4|9=103|35=XAK|34=2|49=EXAMPLE|52=20250319-12:35:21.087|56=SPOT|11=O2EIAS01742387721086|37=0|38=0.9|55=BTCUSDT|10=254| +``` + +**Response:** + +- [Reject `<3>`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) if the incoming request is invalid either due to missing required fields, invalid fields, refers to an invalid symbol, or exceeds the message limit. +- [OrderAmendReject ``](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) if failed due to insufficient order rate limits, pointing to a non-existent order, quantity is invalid, etc. +- [ExecutionReport `<8>`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) if the request succeeded for amending a single order. +- [ExecutionReport `<8>`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + [ListStatus ``](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) if the request succeeded for amending an order which is part of an Order list. + +### OrderAmendReject ``[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +Sent by the server when the OrderAmendKeepPriorityRequest `` has failed. + +Tag + +Name + +Type + +Required + +Description + +11 + +ClOrdID + +STRING + +Y + +`ClOrdId` of the amend request. + +41 + +OrigClOrdID + +STRING + +N + +`OrigClOrdId` (41) from the amend request. + +37 + +OrderID + +INT + +N + +`OrderId (37)` from the amend request. + +55 + +Symbol + +STRING + +Y + +`Symbol (55)` from the amend request. + +38 + +OrderQty + +QTY + +Y + +25016 + +ErrorCode + +INT + +Y + +API error code (see [Error Codes](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors)). + +58 + +Text + +STRING + +Y + +Human-readable error message. + +**Sample message:** + +``` +8=FIX.4.4|9=0000176|35=XAR|49=SPOT|56=OE|34=2|52=20250319-14:27:32.751074|11=1WRGW5J1742394452749|37=0|55=BTCUSDT|38=1.000000|25016=-2038|58=The requested action would change no state; rejecting.|10=235| +``` + +### Limit Messages[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +#### LimitQuery ``[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +Sent by the client to query current limits. + +Tag + +Name + +Type + +Required + +Description + +6136 + +ReqID + +STRING + +Y + +ID of this request + +**Sample message:** + +``` +8=FIX.4.4|9=82|35=XLQ|34=2|49=7buKHZxZ|52=20240614-05:35:35.357|56=SPOT|6136=1718343335357229749|10=170| +``` + +#### LimitResponse ``[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +Sent by the server in response to [LimitQuery``](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api). + +Tag + +Name + +Type + +Required + +Description + +6136 + +ReqID + +STRING + +Y + +`ReqID` from the request. + +25003 + +NoLimitIndicators + +NUMINGROUP + +Y + +The length of the array for LimitIndicators. + +\=>25004 + +LimitType + +CHAR + +Y + +Possible values: + +`1` - ORDER\_LIMIT + +`2` - MESSAGE\_LIMIT + +\=>25005 + +LimitCount + +INT + +Y + +The current use of this limit. + +\=>25006 + +LimitMax + +INT + +Y + +The maximum allowed for this limit. + +\=>25007 + +LimitResetInterval + +INT + +N + +How often the limit resets. + +\=>25008 + +LimitResetIntervalResolution + +CHAR + +N + +Time unit of `LimitResetInterval`. Possible values: + +`s` - SECOND + +`m` - MINUTE + +`h` - HOUR + +`d` - DAY + +**Sample message:** + +``` +8=FIX.4.4|9=225|35=XLR|34=2|49=SPOT|52=20240614-05:42:42.724057|56=uGnG0ef8|6136=1718343762723730315|25003=3|25004=2|25005=1|25006=1000|25007=10|25008=s|25004=1|25005=0|25006=200|25007=10|25008=s|25004=1|25005=0|25006=200000|25007=1|25008=d|10=241| +``` + +### Market Data Messages[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +> \[!NOTE\] The messages below can only be used for the FIX Market Data. + +#### InstrumentListRequest ``[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +Sent by the client to query information about instruments. + +Tag + +Name + +Type + +Required + +Description + +320 + +InstrumentReqID + +STRING + +Y + +ID of this request + +559 + +InstrumentListRequestType + +INT + +Y + +Possible values: + +`0` - SINGLE\_INSTRUMENT + +`4` - ALL\_INSTRUMENTS + +55 + +Symbol + +STRING + +N + +Required when the `InstrumentListRequestType` is set to `SINGLE_INSTRUMENT(0)` + +**Sample message:** + +``` +8=FIX.4.4|9=92|35=x|49=BMDWATCH|56=SPOT|34=2|52=20250114-08:46:56.096691|320=BTCUSDT_INFO|559=0|55=BTCUSDT|10=164| +``` + +#### InstrumentList ``[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +Sent by the server in a response to the [InstrumentListRequest``](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api). + +> \[!NOTE\] More detailed symbol information is available through the [exchangeInfo](https://github.com/binance/binance-spot-api-docs/blob/master/testnet/rest-api/general-endpoints.md) endpoint. + +Tag + +Name + +Type + +Required + +Description + +320 + +InstrumentReqID + +STRING + +Y + +`InstrumentReqID` from the request. + +146 + +NoRelatedSym + +NUMINGROUP + +Y + +Number of symbols + +\=>55 + +Symbol + +STRING + +Y + +\=>15 + +Currency + +STRING + +Y + +Quote asset of this symbol + +\=>562 + +MinTradeVol + +QTY + +N + +Corresponds to the [LOT\_SIZE](https://developers.binance.com/docs/binance-spot-api-docs/testnet/filters) filter + +\=>1140 + +MaxTradeVol + +QTY + +N + +Corresponds to the [LOT\_SIZE](https://developers.binance.com/docs/binance-spot-api-docs/testnet/filters) filter + +\=>25039 + +MinQtyIncrement + +QTY + +N + +Corresponds to the [LOT\_SIZE](https://developers.binance.com/docs/binance-spot-api-docs/testnet/filters) filter + +\=>25040 + +MarketMinTradeVol + +QTY + +N + +Corresponds to the [MARKET\_LOT\_SIZE](https://developers.binance.com/docs/binance-spot-api-docs/testnet/filters) filter + +\=>25041 + +MarketMaxTradeVol + +QTY + +N + +Corresponds to the [MARKET\_LOT\_SIZE](https://developers.binance.com/docs/binance-spot-api-docs/testnet/filters) filter + +\=>25042 + +MarketMinQtyIncrement + +QTY + +N + +Corresponds to the [MARKET\_LOT\_SIZE](https://developers.binance.com/docs/binance-spot-api-docs/testnet/filters) filter + +\=>969 + +MinPriceIncrement + +PRICE + +N + +Corresponds to the [PRICE](https://developers.binance.com/docs/binance-spot-api-docs/testnet/filters) filter + +\=>2551 + +StartPriceRange + +PRICE + +N + +Corresponds to the [PRICE](https://developers.binance.com/docs/binance-spot-api-docs/testnet/filters) filter + +\=>2552 + +EndPriceRange + +PRICE + +N + +Corresponds to the [PRICE](https://developers.binance.com/docs/binance-spot-api-docs/testnet/filters) filter + +**Sample message:** + +``` +8=FIX.4.4|9=218|35=y|49=SPOT|56=BMDWATCH|34=2|52=20250114-08:46:56.100147|320=BTCUSDT_INFO|146=1|55=BTCUSDT|15=USDT|562=0.00001000|1140=9000.00000000|25039=0.00001000|25040=0.00000001|25041=76.79001236|25042=0.00000001|969=0.01000000|10=093| +``` + +#### MarketDataRequest ``[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +Sent by the client to subscribe to or unsubscribe from market data stream. + +**Trade Stream** + +The Trade Streams push raw trade information; each trade has a unique buyer and seller. + +**Fields required to subscribe:** + +- `SubscriptionRequestType` present with value `SUBSCRIBE(1)` +- `MDEntryType` present with value `TRADE(2)` + +**Update Speed:** Real-time + +**Individual Symbol Book Ticker Stream** + +Pushes any update to the best bid or offers price or quantity in real-time for a specified symbol. + +**Fields required to subscribe:** + +- `SubscriptionRequestType` with value `SUBSCRIBE(1)` +- `MDEntryType` with value `BID(0)` +- `MDEntryType` with value `OFFER(1)` +- `MarketDepth` with value `1` + +**Update Speed:** Real-time + +> \[!NOTE\] In the [Individual Symbol Book Ticker Stream](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api), when `MDUpdateAction` is set to `CHANGE(1)` in a [MarketDataIncrementalRefresh``](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) message sent from the server, it replaces the previous best quote. + +**Diff. Depth Stream** + +Order book price and quantity depth updates used to locally manage an order book. + +**Fields required to subscribe:** + +- `SubscriptionRequestType` with value `SUBSCRIBE(1)` +- `MDEntryType` with value `BID(0)` +- `MDEntryType` with value `OFFER(1)` +- `MarketDepth` with a value between `2` and `5000`, which controls the size of the initial snapshot and has no effect on subsequent [MarketDataIncrementalRefresh``](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) messages + +**Update Speed:** 100ms + +> \[!NOTE\] Since the [MarketDataSnapshot``](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) have a limit on the number of price levels (5000 on each side maximum), you won't learn the quantities for the levels outside of the initial snapshot unless they change. So be careful when using the information for those levels, since they might not reflect the full view of the order book. However, for most use cases, seeing 5000 levels on each side is enough to understand the market and trade effectively. + +Tag + +Name + +Type + +Required + +Description + +262 + +MDReqID + +STRING + +Y + +ID of this request + +263 + +SubscriptionRequestType + +CHAR + +Y + +Subscription Request Type. Possible values: + +`1` - SUBSCRIBE + +`2` - UNSUBSCRIBE + +264 + +MarketDepth + +INT + +N + +Subscription depth. + +Possible values: + +`1` - Book Ticker subscription + +`2`\-`5000` - Diff. Depth Stream + +266 + +AggregatedBook + +NUMINGROUP + +N + +Possible values: + +`Y` - one book entry per side per price + +146 + +NoRelatedSym + +NUMINGROUP + +N + +Number of symbols + +\=>55 + +Symbol + +STRING + +Y + +267 + +NoMDEntryTypes + +NUMINGROUP + +N + +Number of entry types + +\=>269 + +MDEntryType + +CHAR + +Y + +Possible values: + +`0` - BID + +`1` - OFFER + +`2` - TRADE + +**Sample message:** + +``` +# Subscriptions# BOOK TICKER Stream8=FIX.4.4|9=132|35=V|49=TRADER1|56=SPOT|34=4|52=20241122-06:17:14.183428|262=BOOK_TICKER_STREAM|263=1|264=1|266=Y|146=1|55=BTCUSDT|267=2|269=0|269=1|10=010|# DEPTH Stream8=FIX.4.4|9=127|35=V|49=TRADER1|56=SPOT|34=7|52=20241122-06:17:14.443822|262=DEPTH_STREAM|263=1|264=10|266=Y|146=1|55=BTCUSDT|267=2|269=0|269=1|10=111|# TRADE Stream8=FIX.4.4|9=120|35=V|49=TRADER1|56=SPOT|34=3|52=20241122-06:34:14.775606|262=TRADE_STREAM|263=1|264=1|266=Y|146=1|55=BTCUSDT|267=1|269=2|10=040|# Unsubscription from TRADE Stream8=FIX.4.4|9=79|35=V|49=TRADER1|56=SPOT|34=7|52=20241122-06:41:56.966969|262=TRADE_STREAM|263=2|264=1|10=113| +``` + +### MarketDataRequestReject ``[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +Sent by the server in a response to an invalid MarketDataRequest ``. + +Tag + +Name + +Type + +Required + +Description + +262 + +MDReqID + +STRING + +Y + +ID of the invalid [MarketDataRequest``](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +281 + +MDReqRejReason + +CHAR + +N + +Possible values: + +`1` - DUPLICATE\_MDREQID + +`2` - TOO\_MANY\_SUBSCRIPTIONS + +25016 + +ErrorCode + +INT + +N + +API Error code. See [Errors](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + +58 + +Text + +STRING + +N + +Human-readable error message. + +**Sample message:** + +``` +8=FIX.4.4|9=0000218|35=Y|49=SPOT|56=EXAMPLE|34=5|52=20241019-05:39:36.688964|262=BOOK_TICKER_2|281=2|25016=-1191|58=Similar subscription is already active on this connection. Symbol='BNBBUSD', active subscription id: 'BOOK_TICKER_1'.|10=137| +``` + +### MarketDataSnapshot ``[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +Sent by the server in response to a [MarketDataRequest``](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api), activating [Individual Symbol Book Ticker Stream](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) or [Diff. Depth Stream](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) subscriptions. + +Tag + +Name + +Type + +Required + +Description + +262 + +MDReqID + +STRING + +Y + +ID of the [MarketDataRequest``](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) that activated this subscription + +55 + +Symbol + +STRING + +Y + +25044 + +LastBookUpdateID + +INT + +N + +268 + +NoMDEntries + +NUMINGROUP + +Y + +Number of entries + +\=>269 + +MDEntryType + +CHAR + +Y + +Possible values: + +`0` - BID + +`1` - OFFER + +`2` - TRADE + +\=>270 + +MDEntryPx + +PRICE + +Y + +Price + +\=>271 + +MDEntrySize + +QTY + +Y + +Quantity + +**Sample message:** + +``` +8=FIX.4.4|9=0000107|35=W|49=SPOT|56=EXAMPLE|34=34|52=20241019-05:41:52.867164|262=BOOK_TICKER_1_2|55=BNBBUSD|25044=0|268=0|10=151| +``` + +### MarketDataIncrementalRefresh ``[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +Sent by the server when there is a change in a subscribed stream. + +Tag + +Name + +Type + +Required + +Description + +262 + +MDReqID + +STRING + +Y + +ID of the [MarketDataRequest``](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) that activated this subscription + +893 + +LastFragment + +BOOLEAN + +N + +When present, this indicates that the message was fragmented. Fragmentation may occur when `NoMDEntry` would exceed 10000 in a single [MarketDataIncrementalRefresh``](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api), in order to limit it to 10000. The fragments of a fragmented message are guaranteed to be consecutive in the stream. It can only appear in the [Trade Stream](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) and [Diff. Depth Stream](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api). + +268 + +NoMDEntries + +NUMINGROUP + +Y + +Number of entries + +\=>279 + +MDUpdateAction + +CHAR + +Y + +Possible values: + +`0` - NEW + +`1` - CHANGE + +`2` - DELETE + +\=>270 + +MDEntryPx + +PRICE + +Y + +Price + +\=>271 + +MDEntrySize + +QTY + +N + +Quantity + +\=>269 + +MDEntryType + +CHAR + +Y + +Possible values: + +`0` - BID + +`1` - OFFER + +`2` - TRADE + +\=>55 + +Symbol + +STRING + +N + +Market Data Entry will default to the same `Symbol` of the previous Market Data Entry in the same Market Data message if `Symbol` is not specified + +\=>60 + +TransactTime + +UTCTIMESTAMP + +N + +\=>1003 + +TradeID + +INT + +N + +\=>2446 + +AggressorSide + +CHAR + +N + +Possible values: + +`1` - BUY + +`2` - SELL + +\=>25043 + +FirstBookUpdateID + +INT + +N + +Only present in [Diff. Depth Stream](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api). + +Market Data Entry will default to the same `FirstBookUpdateID` of the previous Market Data Entry in the same Market Data message if `FirstBookUpdateID` is not specified + +\=>25044 + +LastBookUpdateID + +INT + +N + +Only present in [Diff. Depth Stream](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) and [Individual Symbol Book Ticker Stream](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api). + +Market Data Entry will default to the same `LastBookUpdateID` of the previous Market Data Entry in the same Market Data message if `LastBookUpdateID` is not specified + +**Sample message:** + +``` +8=FIX.4.4|9=0000313|35=X|49=SPOT|56=EXAMPLE|34=16|52=20241019-05:40:11.466313|262=TRADE_3|893=N|268=3|279=0|269=2|270=10.00000|271=0.01000|55=BNBBUSD|1003=0|60=20241019-05:40:11.464000|279=0|269=2|270=10.00000|271=0.01000|1003=1|60=20241019-05:40:11.464000|279=0|269=2|270=10.00000|271=0.01000|1003=2|60=20241019-05:40:11.464000|10=125| +``` + +**Sample fragmented messages:** + +> \[!NOTE\] Below are example messages, with `NoMDEntry` limited to _2_, In the real streams, the `NoMDEntry` is limited to _10000_. + +[Trade Stream](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +``` +8=FIX.4.4|9=237|35=X|34=114|49=SPOT|52=20250116-19:36:44.544549|56=EXAMPLE|262=id|268=2|279=0|270=240.00|271=3.00000000|269=2|55=BNBBUSD|60=20250116-19:36:44.196569|1003=67|279=0|270=238.00|271=2.00000000|269=2|60=20250116-19:36:44.196569|1003=68|893=N|10=180|8=FIX.4.4|9=163|35=X|34=115|49=SPOT|52=20250116-19:36:44.544659|56=EXAMPLE|262=id|268=1|279=0|270=233.00|271=1.00000000|269=2|55=BNBBUSD|60=20250116-19:36:44.196569|1003=69|893=Y|10=243| +``` + +[Diff. Depth Stream](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +``` +8=FIX.4.4|9=156|35=X|34=12|49=SPOT|52=20250116-19:45:31.774162|56=EXAMPLE|262=id|268=2|279=2|270=362.00|269=0|55=BNBBUSD|25043=1143|25044=1145|279=2|270=313.00|269=0|893=N|10=047|8=FIX.4.4|9=171|35=X|34=13|49=SPOT|52=20250116-19:45:31.774263|56=EXAMPLE|262=id|268=2|279=2|270=284.00|269=0|55=BNBBUSD|25043=1143|25044=1145|279=1|270=264.00|271=3.00000000|269=0|893=N|10=239|8=FIX.4.4|9=149|35=X|34=14|49=SPOT|52=20250116-19:45:31.774281|56=EXAMPLE|262=id|268=1|279=1|270=395.00|271=19.00000000|269=1|55=BNBBUSD|25043=1143|25044=1145|893=Y|10=024| +``` + +## FIX SBE[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +FIX SBE (Simple Binary Encoding) can be used instead of FIX with the [spot\_fix\_testnet\_latest.xml](https://github.com/binance/binance-spot-api-docs/blob/master/sbe/schemas/spot_fix_testnet_latest.xml) schema file. + +### SBE[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +Read the [SBE FAQ](https://developers.binance.com/docs/binance-spot-api-docs/faqs/sbe_faq) for important information about using SBE with Binance APIs. + +- Please review and understand the [SBE specification](https://www.fixtrading.org/standards/sbe-online) before attempting to use FIX SBE +- When encoding and decoding SBE payloads, it is recommended to use code generated by [`SbeTool`](https://github.com/aeron-io/simple-binary-encoding) to ensure compliance with the FIX SBE specification. + +### Endpoints[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +In addition to FIX encoding available on port 9000, two request/response encoding schemes are supported on additional TCP ports. See below endpoints for each API. + +#### Order Entry[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +- `tcp+tls://fix-oe.testnet.binance.vision:9001`: Send FIX requests; receive FIX SBE responses + - FIX `SbeSchemaId` tag (=25050) must be set to the FIX SBE schema ID (=1) + - The FIX `SbeSchemaVersion` tag (=25051) must be set to the FIX SBE schema version (=0) +- `tcp+tls://fix-oe.testnet.binance.vision:9002`: Send FIX SBE requests; receive FIX SBE responses + +#### Drop Copy[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +- `tcp+tls://fix-dc.testnet.binance.vision:9001`: Send FIX requests; receive FIX SBE responses + - FIX `SbeSchemaId` tag (=25050) must be set to the FIX SBE schema ID (=1) + - The FIX `SbeSchemaVersion` tag (=25051) must be set to the FIX SBE schema version (=0) +- `tcp+tls://fix-dc.testnet.binance.vision:9002`: Send FIX SBE requests; receive FIX SBE responses + +#### Market data[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +- `tcp+tls://fix-md.testnet.binance.vision:9001`: Send FIX requests; receive FIX SBE responses + - FIX `SbeSchemaId` tag (=25050) must be set to the FIX SBE schema ID (=1) + - The FIX `SbeSchemaVersion` tag (=25051) must be set to the FIX SBE schema version (=0) +- `tcp+tls://fix-md.testnet.binance.vision:9002`: Send FIX SBE requests; receive FIX SBE responses + +### FIX SBE encoding layout[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +FIX SBE request/response messages always come with a SOFH (Simple Open Framing Header) and message header. A given FIX SBE message of N bytes has the following wire format: + +` ` + +SOFH: This corresponds to the "sofh" composite type in the schema file. This acts as a framing header so that the FIX SBE servers/clients can know the length of SBE messages and ensure messages have been fully received prior to deserializing them + +Notes: + +- The two fields within the SOFH MUST be encoded in little-endian +- The FIX servers only support `0xEB50` for the encodingType field, i.e. only little-endian is supported for all fields + +Message header: This corresponds to the "messageHeader" composite type in the schema file. + +### Logon[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +The logon signature (RawData) is computed as documented in the [signature computation](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) section. + +#### Sample FIX SBE `Logon` request message[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +Please see below the hexdump of a sample FIX SBE `Logon` message obtained by following the above instructions. + +Bytes + +Description + +0xd1, 0x00, 0x00, 0x00 + +sofh.messageLength + +0x50, 0xeb + +sofh.encodingType + +0x0e, 0x00 + +messageHeader.blockLength + +0x28, 0x4e + +messageHeader.templateId + +0x01, 0x00 + +messageHeader.schemaId + +0x00, 0x00 + +messageHeader.version + +0x01, 0x00, 0x00, 0x00 + +messageHeader.seqNum + +0x58, 0x7a, 0x5f, 0x99, 0xdb, 0x1b, 0x06, 0x00 + +messageHeader.sendingTime + +0x00 + +Logon.EncryptMethod + +0x1e, 0x00, 0x00, 0x00 + +Logon.HeartBtInt + +0x01 + +Logon.ResetSeqNumFlag + +0x02 + +Logon.MessageHandling + +0xff + +Logon.ResponseMode + +0xff + +Logon.ExecutionReportType + +0xff + +Logon.DropCopyFlag + +0xff, 0xff, 0xff, 0xff + +Logon.RecvWindow + +0x07 + +Logon.SenderCompId.length + +0x45, 0x58, 0x41, 0x4d, 0x50, 0x4c, 0x45 + +Logon.SenderCompId.varData + +0x04 + +Logon.TargetCompId.length + +0x53, 0x50, 0x4f, 0x54 + +Logon.TargetCompId.varData + +0x58, 0x00 + +Logon.RawData.length + +0x34, 0x4d, 0x48, 0x58, 0x65, 0x6c, 0x56, 0x56 + +Logon.RawData.varData + +0x63, 0x70, 0x6b, 0x64, 0x77, 0x75, 0x4c, 0x62 + +Logon.RawData.varData + +0x6c, 0x36, 0x6e, 0x37, 0x33, 0x48, 0x51, 0x55 + +Logon.RawData.varData + +0x58, 0x55, 0x66, 0x31, 0x64, 0x73, 0x65, 0x32 + +Logon.RawData.varData + +0x50, 0x43, 0x67, 0x54, 0x31, 0x44, 0x59, 0x71 + +Logon.RawData.varData + +0x57, 0x39, 0x77, 0x38, 0x41, 0x56, 0x5a, 0x31 + +Logon.RawData.varData + +0x52, 0x41, 0x43, 0x46, 0x47, 0x4d, 0x2b, 0x35 + +Logon.RawData.varData + +0x55, 0x64, 0x6c, 0x47, 0x50, 0x72, 0x51, 0x48 + +Logon.RawData.varData + +0x72, 0x67, 0x74, 0x53, 0x33, 0x43, 0x76, 0x73 + +Logon.RawData.varData + +0x52, 0x55, 0x52, 0x43, 0x31, 0x6f, 0x6a, 0x37 + +Logon.RawData.varData + +0x33, 0x6a, 0x38, 0x67, 0x43, 0x41, 0x3d, 0x3d + +Logon.RawData.varData + +0x40, 0x00 + +Logon.Username.length + +0x73, 0x42, 0x52, 0x58, 0x72, 0x4a, 0x78, 0x32 + +Logon.Username.varData + +0x44, 0x73, 0x4f, 0x72, 0x61, 0x4d, 0x58, 0x4f + +Logon.Username.varData + +0x61, 0x55, 0x6f, 0x76, 0x45, 0x68, 0x67, 0x56 + +Logon.Username.varData + +0x52, 0x63, 0x6a, 0x4f, 0x76, 0x43, 0x74, 0x51 + +Logon.Username.varData + +0x77, 0x6e, 0x57, 0x6a, 0x38, 0x56, 0x78, 0x6b + +Logon.Username.varData + +0x4f, 0x68, 0x31, 0x78, 0x71, 0x62, 0x6f, 0x53 + +Logon.Username.varData + +0x30, 0x32, 0x53, 0x50, 0x47, 0x66, 0x4b, 0x69 + +Logon.Username.varData + +0x32, 0x68, 0x38, 0x73, 0x70, 0x5a, 0x4a, 0x62 + +Logon.Username.varData + +### FIX vs. FIX SBE[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +General: + +- The `sofh.messageLength` field _must_ include the size of the SOFH (6 bytes) +- FIX SBE has no `Checksum` field +- When sending FIX SBE requests on port 9002 + - All fields must be set in the payload + - Optional fields that are not present must be set to the corresponding `nullValue` + - The encoders generated by `SbeTool` handle this correctly + - Please refer to the definition of `nullValue` in the [SBE specification](https://www.fixtrading.org/standards/sbe-online) if encoding payloads manually + +Decimal encoding: + +- In request messages, the values for `PriceExponent` and `QtyExponent` must be no more precise than the precision of the symbol being transacted. Symbol precision can be retrieved from the `InstrumentList` response. + +**Logon** message: + +- The `SenderCompID`, `TargetCompID` and `RecvWindow` fields are provided in the `Logon` FIX SBE message instead of the message header + - The `RecvWindow` field set in the `Logon` message applies to all trading request messages within the FIX SBE session + - When set, the `RecvWindow` field is in microseconds +- When the `ResponseMode` field is set to `OnlyAcks`, the `ExecutionReportType` field can be set to `Mini` to receive `ExecutionReportAck` messages instead of `ExecutionReport` + - Note: The `ExecutionReportType` field is only supported on port 9001 and port 9002 for the Order Entry and Drop Copy endpoints + +**MarketDataIncrementalRefresh** message: + +- This single message in the FIX schema is split into the following FIX SBE messages: `MarketDataIncrementalTrade`, `MarketDataIncrementalBookTicker` and `MarketDataIncrementalDepth` +- The `MDReqID` field is omitted from the market data snapshot and refresh messages as these messages can be tied to the subscription request using the `Symbol` field and the message's template ID + - `MDReqID` is required in the `MarketDataRequest` message so that it may appear in `MarketDataRequestReject` + - The value of `MDReqID` must be unique across subscriptions + +**MarketDataIncrementalTrade** message: + +- The MDUpdateAction field available in the FIX schema is omitted in FIX SBE since the value is always `NEW`. + +**MarketDataIncrementalBookTicker** message: + +- FIX SBE book ticker subscriptions use **auto-culling**: when the system is under high load, it may drop outdated events instead of queuing all events and delivering them with a delay. + - For example, if a best bid/ask event is generated at time T2 when there is still an undelivered event queued at time T1 (where T1 < T2), the event for T1 is dropped, and the system will deliver only the event for T2. This is done on a per-symbol basis. +- The `MDUpdateAction` field available in the FIX schema is omitted in FIX SBE as its value may be derived from `MDEntrySize`. + - When `MDEntrySize` is unset (`NullVal`), `MDUpdateAction` is `DELETE`. + - When `MDEntrySize` is set, + - if the price level exists in your local order book, `MDUpdateAction` is `CHANGE` + - else `MDUpdateAction` is `NEW`. + +**MarketDataIncrementalDepth** message: + +- FIX SBE depth update speed: 50ms +- The `MDUpdateAction` field available in the FIX schema is omitted in FIX SBE as its value may be derived from `MDEntrySize`. + - When `MDEntrySize` is unset (`NullVal`), `MDUpdateAction` is `DELETE`. + - When `MDEntrySize` is set, + - if the price level exists in your local order book, `MDUpdateAction` is `CHANGE` + - else `MDUpdateAction` is `NEW`. + +### Limits[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +Connection limits are shared between FIX and FIX SBE. + +### Errors[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +The following FIX SBE-specific errors may be returned: + +Code + +Message + +Description + +\-1152 + +Invalid SBE message header. + +Error when decoding `messageHeader` in FIX SBE request + +\-1153 + +Invalid SBE schema ID or version specified. + +Error when parsing/decoding FIX SBE schema ID/version + +\-1177 + +Invalid encodingType. + +Error when decoding `encodingType` field in sofh composite type + +\-1221 + +Invalid/missing field(s) in SBE message. + +Invalid/missing field when decoding FIX SBE request + +Note: Error codes returned for semantically equivalent FIX and FIX SBE requests may not be identical. + +### FAQ[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + +See the [SBE FAQ](https://developers.binance.com/docs/binance-spot-api-docs/faqs/sbe_faq) for more information on generating SBE decoders and handling schema updates. + +- [General API Information](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + - [FIX API Order Entry sessions](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + - [FIX API Drop Copy sessions](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + - [FIX API Market Data sessions](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + - [FIX Connection Lifecycle](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + - [API Key Permissions](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + - [On message processing order](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + - [Response Mode](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + - [Timing Security](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + - [How to sign Logon `` request](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) +- [Limits](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + - [Message Limits](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + - [Connection Limits](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + - [Unfilled Order Count](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) +- [Error Handling](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) +- [Types](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) +- [Message Components](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + - [Header](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + - [Trailer](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) +- [Administrative Messages](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + - [Heartbeat `<0>`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + - [TestRequest `<1>`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + - [Reject `<3>`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + - [Logon ``](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + - [Logout `<5>`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + - [News ``](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + - [Resend Request `<2>`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) +- [Application Messages](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + - [Order Entry Messages](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + - [OrderAmendReject ``](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + - [Limit Messages](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + - [Market Data Messages](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + - [MarketDataRequestReject ``](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + - [MarketDataSnapshot ``](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + - [MarketDataIncrementalRefresh ``](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) +- [FIX SBE](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + - [SBE](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + - [Endpoints](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + - [FIX SBE encoding layout](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + - [Logon](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + - [FIX vs. FIX SBE](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + - [Limits](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + - [Errors](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) + - [FAQ](https://developers.binance.com/docs/binance-spot-api-docs/testnet/fix-api) diff --git a/docs/binance/binance-spot/testnet_general-info.md b/docs/binance/binance-spot/testnet_general-info.md new file mode 100644 index 0000000..f8c48a5 --- /dev/null +++ b/docs/binance/binance-spot/testnet_general-info.md @@ -0,0 +1,235 @@ +--- +title: "General Info | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs/testnet/general-info" +fetched_at: "2026-02-26T10:38:09.806Z" +--- +### How can I use the Spot Test Network? [​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/general-info) + +Step 1: Log in on this [website](https://testnet.binance.vision/), and generate an API Key. + +Step 2: Follow the [official documentation of the Spot API](https://developers.binance.com/docs/binance-spot-api-docs/CHANGELOG), replacing the URLs of the endpoints with the following values: + +Spot API URLs + +Spot Test Network URLs + +- https://api.binance.com/api +- https://api-gcp.binance.com/api +- https://api1.binance.com/api +- https://api2.binance.com/api +- https://api3.binance.com/api +- https://api4.binance.com/api + +- **https://testnet.binance.vision/api** +- **https://api1.testnet.binance.vision/api** + +- wss://ws-api.binance.com/ws-api/v3 +- wss://ws-api.binance.com:9443/ws-api/v3 + +- **wss://ws-api.testnet.binance.vision/ws-api/v3** +- **wss://ws-api.testnet.binance.vision:9443/ws-api/v3** + +- wss://stream.binance.com/ws +- wss://stream.binance.com:9443/ws + +- **wss://stream.testnet.binance.vision/stream** +- **wss://stream.testnet.binance.vision:9443/stream** + +- wss://stream.binance.com/stream +- wss://stream.binance.com:9443/stream + +- **wss://stream.testnet.binance.vision/stream** +- **wss://stream.testnet.binance.vision:9443/stream** + +- wss://stream-sbe.binance.com/ws +- wss://stream-sbe.binance.com:9443/ws + +- **wss://stream-sbe.testnet.binance.vision/ws** +- **wss://stream-sbe.testnet.binance.vision:9443/ws** + +- wss://stream-sbe.binance.com/stream +- wss://stream-sbe.binance.com:9443/stream + +- **wss://stream-sbe.testnet.binance.vision/stream** +- **wss://stream-sbe.testnet.binance.vision:9443/stream** + +- tcp+tls://fix-oe.binance.com:9000 + +- **tcp+tls://fix-oe.testnet.binance.vision:9000** + +- tcp+tls://fix-dc.binance.com:9000 + +- **tcp+tls://fix-dc.testnet.binance.vision:9000** + +- tcp+tls://fix-md.binance.com:9000 + +- **tcp+tls://fix-md.testnet.binance.vision:9000** + +--- + +### Can I use the `/sapi` endpoints on the Spot Test Network? [​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/general-info) + +No, only the `/api` endpoints are available on the Spot Test Network: + +- [Market Data Endpoints (REST API)](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints) +- [Market Data Requests (WebSocket API)](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests) +- [Websocket Market Streams](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) +- [Trading Endpoints (REST API)](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints) +- [Account Endpoints (REST API)](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints) +- [Trading Requests (WebSocket API)](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests) +- [Account Requests (WebSocket API)](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests) +- [User Data Streams](https://developers.binance.com/docs/binance-spot-api-docs/user-data-stream) + +--- + +### How to get funds in/out of the Spot Test Network? [​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/general-info) + +All users registering on the Spot Test Network automatically receive a balance in many different assets. Please note that these are not real assets and can be used only on the Spot Test Network itself. + +All funds on the Spot Test Network are virtual, and can not be transferred in/out of the Spot Test Network. + +--- + +### What are the restrictions on the Spot Test Network? [​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/general-info) + +**IP Limits**, **Order Rate Limits**, **Exchange Filters** and **Symbol Filters** on the Spot Test Network are generally the same as on the Spot API. + +All users are encouraged to regularly query the API to get the most up-to-date rate limits & filters, for example by doing: + +curl "https://testnet.binance.vision/api/v3/exchangeInfo" + +--- + +### All my data has disappeared! What happened? [​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/general-info) + +The Spot Test Network is periodically reset to a blank state. That includes all pending and executed orders. During that reset procedure, all users automatically receive a fresh allowance of all assets. + +These resets happen approximately **once per month**, and we do not offer prior notification for them. + +Starting from August 2020, API Keys are preserved during resets. Users no longer need to re-register new API Keys after a reset. + +--- + +### What is the difference between `klines` and `uiKlines`? [​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/general-info) + +On the Spot Test Network, these 2 requests always return the same data. + +--- + +### What are RSA API Keys? [​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/general-info) + +RSA API Keys are an alternative to the typical HMAC-SHA-256 API Keys that are used to authenticate your requests on the Spot API. + +Unlike HMAC-SHA-256 API Keys where we generate the secret signing key for you, with RSA API Keys, \*you\* generate a pair of public+private RSA keys, send us the public key, and sign your requests with your private key. + +--- + +### What type of RSA keys are supported? [​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/general-info) + +We support RSA keys of any length from 2048 bits up to 4096 bits. We recommend **2048 bits keys** as a good balance between security and signature speed. + +When generating the RSA signature, use the **PKCS#1 v1.5** signature scheme. This is the default when using OpenSSL. We currently do not support the PSS signature scheme. + +--- + +### How can I use RSA API Keys? [​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/general-info) + +Step 1: Generate the private key `test-prv-key.pem`. **Do not share this file with anyone!** + +openssl genrsa -out test-prv-key.pem 2048 + +Step 2: Generate the public key `test-pub-key.pem` from the private key. + +openssl rsa -in test-prv-key.pem -pubout -outform PEM -out test-pub-key.pem + +The public key should look something like this: + +``` +-----BEGIN PUBLIC KEY-----bL4DUXwR3ijFSXzcecQtVFU1zVWcSQd0Meztl3DLX42l/8EALJx3LSz9YKS0PMQWMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAv9ij99RAJM4JLl8Rg47bdJXMrv84WL1OK/gid4hCnxo083LYLXUpIqMmL+O6fmXAvsvkyMyT520Cw0ZNCrUkWoCjGE4JZZGF4wOkWdF37JFWbDnE/GF5mAykKj+OMaECBlZ207KleQqgVzHjKuCbhPMuBVVD3IhjBfIc7EEM438LbtayMDx4dviPWwm127jwn8qd9H3kv5JBoDfsdYMB3k39r724CljqlAfX33GpbV2LvEkL6Da3OFk+grfN98X2pCBRz5+1N95I2cRD7o+jwtCr+65E+Gqjo4OI60F9Gq5GDcrnudnUw13a4zwlU6W+Cy8gJ4R0CcKTc4+VhYVX5wW2tzLVnDqvjIN8hjhgtmUv8hr19Wn+42ev+5sNtO5QAS6sJMJG5D+cpxCNhei1Xm+1zXliaA1fvVYRqon2MdHcedFeAjzVtX38+Xweytowydcq2V/9pUUNZIzUqX7tZr3F+Ao3QOb/CuWbUBpUcbXfGv7AI1ozP8LRByyu6O8Z1dZNdkdjWVt83maUrIJHjjc7jlZY9JbH6EyYV5TenjJaupvdlx72vA7Fcgevx87seog2JALAJqZQNT+t9/tmrTUSEp3t4aINKUC1QC0CYKECAwEAAQ==-----END PUBLIC KEY----- +``` + +Step 3: Register your public key on the Spot Test Network. + +During registration, we will generate an API Key for you that you will have to put in the `X-MBX-APIKEY` header of your requests, exactly the same way as you would do for HMAC-SHA-256 API Keys. + +Step 4: When you send a request to the Spot Test Network, sign the payload using your private key. + +Here is an example Bash script to post a new order and sign the request using OpenSSL. You can adapt it to your favorite programming language: + +``` +#!/usr/bin/env bash# Set up authentication:API_KEY="put your own API Key here"PRIVATE_KEY_PATH="test-prv-key.pem"# Set up the request:API_METHOD="POST"API_CALL="api/v3/order"API_PARAMS="symbol=BTCUSDT&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2"# Sign the request:timestamp=$(date +%s000)api_params_with_timestamp="$API_PARAMS×tamp=$timestamp"signature=$(echo -n "$api_params_with_timestamp" \ | openssl dgst -sha256 -sign "$PRIVATE_KEY_PATH" \ | openssl enc -base64 -A)# Send the request:curl -H "X-MBX-APIKEY: $API_KEY" -X "$API_METHOD" \ "https://testnet.binance.vision/$API_CALL?$api_params_with_timestamp" \ --data-urlencode "signature=$signature" +``` + +--- + +### What are Ed25519 API keys? [​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/general-info) + +Ed25519 API keys are an alternative to [RSA API keys](https://developers.binance.com/docs/binance-spot-api-docs/testnet/general-info), using asymmetric cryptography to authenticate your requests on the Spot API. + +Like RSA API keys, Ed25519 keys are _asymmetric_: you generate a keypair, share the public key with Binance, and use your private key to sign requests. + +--- + +### Why use Ed25519 instead of RSA API keys? [​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/general-info) + +Ed25519 digital signature scheme provides security comparable to 3072-bit RSA keys, while having much smaller signatures that are faster to compute: + +API key type + +Signature size + +Signature operation + +HMAC-SHA-256 + +64 bytes + +0.00 ms + +Ed25519 + +88 bytes + +0.03 ms + +RSA (2048-bit) + +344 bytes + +0.55 ms + +RSA (4096-bit) + +684 bytes + +3.42 ms + +--- + +### How can I use Ed25519 API keys? [​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/general-info) + +Step 1: Generate the private key `test-prv-key.pem`. **Do not share this file with anyone!** + +openssl genpkey -algorithm ed25519 -out test-prv-key.pem + +Step 2: Compute the public key `test-pub-key.pem` from the private key. + +openssl pkey -pubout -in test-prv-key.pem -out test-pub-key.pem + +The public key should look something like this: + +``` +-----BEGIN PUBLIC KEY-----MCowBQYDK2VwAyEACeCSz7VJkh3Bb+NF794hLMU8fLB9Zr+/tGMdVKCC2eo=-----END PUBLIC KEY----- +``` + +Step 3: Register your public key on the Spot Test Network. + +During registration, we will generate an API key for you. Please put it in the `X-MBX-APIKEY` header of your requests, exactly the same way as with other API key types. + +Step 4: When you send a request to the Spot Test Network, sign the payload using your private key. + +Here is an example in Python that posts a new order signed with Ed25519 key. You can adapt it to your favorite programming language. + +``` +#!/usr/bin/env python3import base64import requestsimport timefrom cryptography.hazmat.primitives.serialization import load_pem_private_key# Set up authenticationAPI_KEY='put your own API Key here'PRIVATE_KEY_PATH='test-prv-key.pem'# Load the private key.# In this example the key is expected to be stored without encryption,# but we recommend using a strong password for improved security.with open(PRIVATE_KEY_PATH, 'rb') as f: private_key = load_pem_private_key(data=f.read(), password=None)# Set up the request parametersparams = { 'symbol': 'BTCUSDT', 'side': 'SELL', 'type': 'LIMIT', 'timeInForce': 'GTC', 'quantity': '1.0000000', 'price': '0.20',}# Timestamp the requesttimestamp = int(time.time() * 1000) # UNIX timestamp in millisecondsparams['timestamp'] = timestamp# Sign the requestpayload = '&'.join([f'{param}={value}' for param, value in params.items()])signature = base64.b64encode(private_key.sign(payload.encode('ASCII')))params['signature'] = signature# Send the requestheaders = { 'X-MBX-APIKEY': API_KEY,}response = requests.post( 'https://testnet.binance.vision/api/v3/order', headers=headers, data=params,)print(response.json()) +``` diff --git a/docs/binance/binance-spot/testnet_rest-api_account-endpoints.md b/docs/binance/binance-spot/testnet_rest-api_account-endpoints.md new file mode 100644 index 0000000..4d9b342 --- /dev/null +++ b/docs/binance/binance-spot/testnet_rest-api_account-endpoints.md @@ -0,0 +1,910 @@ +--- +title: "Account Endpoints | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/account-endpoints" +fetched_at: "2026-02-26T10:38:10.082Z" +--- +### Account information (USER\_DATA)[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/account-endpoints) + +``` +GET /api/v3/account +``` + +Get current account information. + +**Weight:** 20 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +omitZeroBalances + +BOOLEAN + +NO + +When set to `true`, emits only the non-zero balances of an account. +Default value: `false` + +recvWindow + +DECIMAL + +NO + +The value cannot be greater than `60000`. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +timestamp + +LONG + +YES + +**Data Source:** Memory => Database + +**Response:** + +``` +{ "makerCommission": 15, "takerCommission": 15, "buyerCommission": 0, "sellerCommission": 0, "commissionRates": { "maker": "0.00150000", "taker": "0.00150000", "buyer": "0.00000000", "seller": "0.00000000" }, "canTrade": true, "canWithdraw": true, "canDeposit": true, "brokered": false, "requireSelfTradePrevention": false, "preventSor": false, "updateTime": 123456789, "accountType": "SPOT", "balances": [ { "asset": "BTC", "free": "4723846.89208129", "locked": "0.00000000" }, { "asset": "LTC", "free": "4763368.68006011", "locked": "0.00000000" } ], "permissions": ["SPOT"], "uid": 354937868} +``` + +### Current open orders (USER\_DATA)[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/account-endpoints) + +``` +GET /api/v3/openOrders +``` + +Get all open orders on a symbol. **Careful** when accessing this with no symbol. + +**Weight:** 6 for a single symbol; **80** when the symbol parameter is omitted + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +NO + +recvWindow + +DECIMAL + +NO + +The value cannot be greater than `60000`. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +timestamp + +LONG + +YES + +- If the symbol is not sent, orders for all symbols will be returned in an array. + +**Data Source:** Memory => Database + +**Response:** + +``` +[ { "symbol": "LTCBTC", "orderId": 1, "orderListId": -1, // Unless it's part of an order list, value will be -1 "clientOrderId": "myOrder1", "price": "0.1", "origQty": "1.0", "executedQty": "0.0", "cummulativeQuoteQty": "0.0", "status": "NEW", "timeInForce": "GTC", "type": "LIMIT", "side": "BUY", "stopPrice": "0.0", "icebergQty": "0.0", "time": 1499827319559, "updateTime": 1499827319559, "isWorking": true, "origQuoteOrderQty": "0.000000", "workingTime": 1499827319559, "selfTradePreventionMode": "NONE" }] +``` + +**Note:** The payload above does not show all fields that can appear. Please refer to [Conditional fields in Order Responses](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/trading-endpoints). + +### All orders (USER\_DATA)[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/account-endpoints) + +``` +GET /api/v3/allOrders +``` + +Get all account orders; active, canceled, or filled. + +**Weight:** 20 + +**Data Source:** Database + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +orderId + +LONG + +NO + +startTime + +LONG + +NO + +endTime + +LONG + +NO + +limit + +INT + +NO + +Default 500; Maximum: 1000. + +recvWindow + +DECIMAL + +NO + +The value cannot be greater than `60000`. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +timestamp + +LONG + +YES + +**Notes:** + +- If `orderId` is set, it will get orders >= that `orderId`. Otherwise most recent orders are returned. +- For some historical orders `cummulativeQuoteQty` will be < 0, meaning the data is not available at this time. +- If `startTime` and/or `endTime` provided, `orderId` is not required. +- The time between `startTime` and `endTime` can't be longer than 24 hours. + +**Response:** + +``` +[ { "symbol": "LTCBTC", "orderId": 1, "orderListId": -1, // Unless it's part of an order list, value will be -1 "clientOrderId": "myOrder1", "price": "0.1", "origQty": "1.0", "executedQty": "0.0", "cummulativeQuoteQty": "0.0", "status": "NEW", "timeInForce": "GTC", "type": "LIMIT", "side": "BUY", "stopPrice": "0.0", "icebergQty": "0.0", "time": 1499827319559, "updateTime": 1499827319559, "isWorking": true, "origQuoteOrderQty": "0.000000", "workingTime": 1499827319559, "selfTradePreventionMode": "NONE" }] +``` + +**Note:** The payload above does not show all fields that can appear. Please refer to [Conditional fields in Order Responses](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/trading-endpoints). + +### Query Order list (USER\_DATA)[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/account-endpoints) + +``` +GET /api/v3/orderList +``` + +Retrieves a specific order list based on provided optional parameters. + +**Weight:** + +4 + +**Parameters**: + +Name + +Type + +Mandatory + +Description + +orderListId + +LONG + +NO\* + +Query order list by `orderListId`. +`orderListId` or `origClientOrderId` must be provided. + +origClientOrderId + +STRING + +NO\* + +Query order list by `listClientOrderId`. +`orderListId` or `origClientOrderId` must be provided. + +recvWindow + +DECIMAL + +NO + +The value cannot be greater than `60000`. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +timestamp + +LONG + +YES + +**Data Source:** Database + +**Response:** + +``` +{ "orderListId": 27, "contingencyType": "OCO", "listStatusType": "EXEC_STARTED", "listOrderStatus": "EXECUTING", "listClientOrderId": "h2USkA5YQpaXHPIrkd96xE", "transactionTime": 1565245656253, "symbol": "LTCBTC", "orders": [ { "symbol": "LTCBTC", "orderId": 4, "clientOrderId": "qD1gy3kc3Gx0rihm9Y3xwS" }, { "symbol": "LTCBTC", "orderId": 5, "clientOrderId": "ARzZ9I00CPM8i3NhmU9Ega" } ]} +``` + +### Query all Order lists (USER\_DATA)[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/account-endpoints) + +``` +GET /api/v3/allOrderList +``` + +Retrieves all order lists based on provided optional parameters + +Note that the time between `startTime` and `endTime` can't be longer than 24 hours. + +**Weight:** + +20 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +fromId + +LONG + +NO + +If supplied, neither `startTime` or `endTime` can be provided + +startTime + +LONG + +NO + +endTime + +LONG + +NO + +limit + +INT + +NO + +Default: 500; Maximum: 1000 + +recvWindow + +DECIMAL + +NO + +The value cannot be greater than `60000`. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +timestamp + +LONG + +YES + +**Data Source:** Database + +**Response:** + +``` +[ { "orderListId": 29, "contingencyType": "OCO", "listStatusType": "EXEC_STARTED", "listOrderStatus": "EXECUTING", "listClientOrderId": "amEEAXryFzFwYF1FeRpUoZ", "transactionTime": 1565245913483, "symbol": "LTCBTC", "orders": [ { "symbol": "LTCBTC", "orderId": 4, "clientOrderId": "oD7aesZqjEGlZrbtRpy5zB" }, { "symbol": "LTCBTC", "orderId": 5, "clientOrderId": "Jr1h6xirOxgeJOUuYQS7V3" } ] }, { "orderListId": 28, "contingencyType": "OCO", "listStatusType": "EXEC_STARTED", "listOrderStatus": "EXECUTING", "listClientOrderId": "hG7hFNxJV6cZy3Ze4AUT4d", "transactionTime": 1565245913407, "symbol": "LTCBTC", "orders": [ { "symbol": "LTCBTC", "orderId": 2, "clientOrderId": "j6lFOfbmFMRjTYA7rRJ0LP" }, { "symbol": "LTCBTC", "orderId": 3, "clientOrderId": "z0KCjOdditiLS5ekAFtK81" } ] }] +``` + +### Query Open Order lists (USER\_DATA)[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/account-endpoints) + +``` +GET /api/v3/openOrderList +``` + +**Weight**: 6 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +recvWindow + +DECIMAL + +NO + +The value cannot be greater than `60000`. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +timestamp + +LONG + +YES + +**Data Source:** Database + +**Response:** + +``` +[ { "orderListId": 31, "contingencyType": "OCO", "listStatusType": "EXEC_STARTED", "listOrderStatus": "EXECUTING", "listClientOrderId": "wuB13fmulKj3YjdqWEcsnp", "transactionTime": 1565246080644, "symbol": "LTCBTC", "orders": [ { "symbol": "LTCBTC", "orderId": 4, "clientOrderId": "r3EH2N76dHfLoSZWIUw1bT" }, { "symbol": "LTCBTC", "orderId": 5, "clientOrderId": "Cv1SnyPD3qhqpbjpYEHbd2" } ] }] +``` + +### Account trade list (USER\_DATA)[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/account-endpoints) + +``` +GET /api/v3/myTrades +``` + +Get trades for a specific account and symbol. + +**Weight:** + +Condition + +Weight + +Without orderId + +20 + +With orderId + +5 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +orderId + +LONG + +NO + +This can only be used in combination with `symbol`. + +startTime + +LONG + +NO + +endTime + +LONG + +NO + +fromId + +LONG + +NO + +TradeId to fetch from. Default gets most recent trades. + +limit + +INT + +NO + +Default: 500; Maximum: 1000. + +recvWindow + +DECIMAL + +NO + +The value cannot be greater than `60000`. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +timestamp + +LONG + +YES + +**Notes:** + +- If `fromId` is set, it will get trades >= that `fromId`. Otherwise most recent trades are returned. +- The time between `startTime` and `endTime` can't be longer than 24 hours. +- These are the supported combinations of all parameters: + - `symbol` + - `symbol` + `orderId` + - `symbol` + `startTime` + - `symbol` + `endTime` + - `symbol` + `fromId` + - `symbol` + `startTime` + `endTime` + - `symbol`\+ `orderId` + `fromId` + +**Data Source:** Memory => Database + +**Response:** + +``` +[ { "symbol": "BNBBTC", "id": 28457, "orderId": 100234, "orderListId": -1, "price": "4.00000100", "qty": "12.00000000", "quoteQty": "48.000012", "commission": "10.10000000", "commissionAsset": "BNB", "time": 1499865549590, "isBuyer": true, "isMaker": false, "isBestMatch": true }] +``` + +### Query Unfilled Order Count (USER\_DATA)[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/account-endpoints) + +``` +GET /api/v3/rateLimit/order +``` + +Displays the user's unfilled order count for all intervals. + +**Weight:** 40 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +recvWindow + +DECIMAL + +NO + +The value cannot be greater than `60000`. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +timestamp + +LONG + +YES + +**Data Source:** Memory + +**Response:** + +``` +[ { "rateLimitType": "ORDERS", "interval": "SECOND", "intervalNum": 10, "limit": 50, "count": 0 }, { "rateLimitType": "ORDERS", "interval": "DAY", "intervalNum": 1, "limit": 160000, "count": 0 }] +``` + +### Query Prevented Matches (USER\_DATA)[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/account-endpoints) + +``` +GET /api/v3/myPreventedMatches +``` + +Displays the list of orders that were expired due to STP. + +These are the combinations supported: + +- `symbol` + `preventedMatchId` +- `symbol` + `orderId` +- `symbol` + `orderId` + `fromPreventedMatchId` (`limit` will default to 500) +- `symbol` + `orderId` + `fromPreventedMatchId` + `limit` + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +preventedMatchId + +LONG + +NO + +orderId + +LONG + +NO + +fromPreventedMatchId + +LONG + +NO + +limit + +INT + +NO + +Default: `500`; Maximum: `1000` + +recvWindow + +DECIMAL + +NO + +The value cannot be greater than `60000`. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +timestamp + +LONG + +YES + +**Weight:** + +Case + +Weight + +If `symbol` is invalid + +2 + +Querying by `preventedMatchId` + +2 + +Querying by `orderId` + +20 + +**Data Source:** + +Database + +**Response:** + +``` +[ { "symbol": "BTCUSDT", "preventedMatchId": 1, "takerOrderId": 5, "makerSymbol": "BTCUSDT", "makerOrderId": 3, "tradeGroupId": 1, "selfTradePreventionMode": "EXPIRE_MAKER", "price": "1.100000", "makerPreventedQuantity": "1.300000", "transactTime": 1669101687094 }] +``` + +### Query Allocations (USER\_DATA)[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/account-endpoints) + +``` +GET /api/v3/myAllocations +``` + +Retrieves allocations resulting from SOR order placement. + +**Weight:** 20 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +Yes + +startTime + +LONG + +No + +endTime + +LONG + +No + +fromAllocationId + +INT + +No + +limit + +INT + +No + +Default: 500; Maximum: 1000 + +orderId + +LONG + +No + +recvWindow + +DECIMAL + +No + +The value cannot be greater than `60000`. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +timestamp + +LONG + +No + +Supported parameter combinations: + +Parameters + +Response + +`symbol` + +allocations from oldest to newest + +`symbol` + `startTime` + +oldest allocations since `startTime` + +`symbol` + `endTime` + +newest allocations until `endTime` + +`symbol` + `startTime` + `endTime` + +allocations within the time range + +`symbol` + `fromAllocationId` + +allocations by allocation ID + +`symbol` + `orderId` + +allocations related to an order starting with oldest + +`symbol` + `orderId` + `fromAllocationId` + +allocations related to an order by allocation ID + +**Note:** The time between `startTime` and `endTime` can't be longer than 24 hours. + +**Data Source:** Database + +**Response:** + +``` +[ { "symbol": "BTCUSDT", "allocationId": 0, "allocationType": "SOR", "orderId": 1, "orderListId": -1, "price": "1.00000000", "qty": "5.00000000", "quoteQty": "5.00000000", "commission": "0.00000000", "commissionAsset": "BTC", "time": 1687506878118, "isBuyer": true, "isMaker": false, "isAllocator": false }] +``` + +### Query Commission Rates (USER\_DATA)[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/account-endpoints) + +``` +GET /api/v3/account/commission +``` + +Get current account commission rates. + +**Weight:** 20 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +**Data Source:** Database + +**Response:** + +``` +{ "symbol": "BTCUSDT", "standardCommission": { // Commission rates on trades from the order. "maker": "0.00000010", "taker": "0.00000020", "buyer": "0.00000030", "seller": "0.00000040" }, "specialCommission": { // Special commission rates from the order. "maker": "0.01000000", "taker": "0.02000000", "buyer": "0.03000000", "seller": "0.04000000" }, "taxCommission": { // Tax commission rates for trades from the order. "maker": "0.00000112", "taker": "0.00000114", "buyer": "0.00000118", "seller": "0.00000116" }, "discount": { // Discount commission when paying in BNB "enabledForAccount": true, "enabledForSymbol": true, "discountAsset": "BNB", "discount": "0.75000000" // Standard commission is reduced by this rate when paying commission in BNB. }} +``` + +### Query Order Amendments (USER\_DATA)[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/account-endpoints) + +``` +GET /api/v3/order/amendments +``` + +Queries all amendments of a single order. + +**Weight**: 4 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +orderId + +LONG + +YES + +fromExecutionId + +LONG + +NO + +limit + +LONG + +NO + +Default:500; Maximum: 1000 + +recvWindow + +DECIMAL + +NO + +The value cannot be greater than `60000`. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +timestamp + +LONG + +YES + +**Data Source:** + +Database + +**Response:** + +``` +[ { "symbol": "BTCUSDT", "orderId": 9, "executionId": 22, "origClientOrderId": "W0fJ9fiLKHOJutovPK3oJp", "newClientOrderId": "UQ1Np3bmQ71jJzsSDW9Vpi", "origQty": "5.00000000", "newQty": "4.00000000", "time": 1741669661670 }, { "symbol": "BTCUDST", "orderId": 9, "executionId": 25, "origClientOrderId": "UQ1Np3bmQ71jJzsSDW9Vpi", "newClientOrderId": "5uS0r35ohuQyDlCzZuYXq2", "origQty": "4.00000000", "newQty": "3.00000000", "time": 1741672924895 }] +``` + +### Query relevant filters (USER\_DATA)[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/account-endpoints) + +``` +GET /api/v3/myFilters +``` + +Retrieves the list of [filters](https://developers.binance.com/docs/binance-spot-api-docs/testnet/filters) relevant to an account on a given symbol. This is the only endpoint that shows if an account has [`MAX_ASSET`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/filters) filters applied to it. + +**Weight:** 40 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +recvWindow + +DECIMAL + +NO + +The value cannot be greater than `60000`. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +timestamp + +LONG + +YES + +**Data Source:** Memory + +**Response:** + +``` +{ "exchangeFilters": [ { "filterType": "EXCHANGE_MAX_NUM_ORDERS", "maxNumOrders": 1000 } ], "symbolFilters": [ { "filterType": "MAX_NUM_ORDER_LISTS", "maxNumOrderLists": 20 } ], "assetFilters": [ { "filterType": "MAX_ASSET", "asset": "JPY", "limit": "1000000.00000000" } ]} +``` + +- [Account information (USER\_DATA)](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/account-endpoints) +- [Current open orders (USER\_DATA)](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/account-endpoints) +- [All orders (USER\_DATA)](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/account-endpoints) +- [Query Order list (USER\_DATA)](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/account-endpoints) +- [Query all Order lists (USER\_DATA)](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/account-endpoints) +- [Query Open Order lists (USER\_DATA)](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/account-endpoints) +- [Account trade list (USER\_DATA)](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/account-endpoints) +- [Query Unfilled Order Count (USER\_DATA)](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/account-endpoints) +- [Query Prevented Matches (USER\_DATA)](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/account-endpoints) +- [Query Allocations (USER\_DATA)](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/account-endpoints) +- [Query Commission Rates (USER\_DATA)](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/account-endpoints) +- [Query Order Amendments (USER\_DATA)](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/account-endpoints) +- [Query relevant filters (USER\_DATA)](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/account-endpoints) diff --git a/docs/binance/binance-spot/testnet_rest-api_data-sources.md b/docs/binance/binance-spot/testnet_rest-api_data-sources.md new file mode 100644 index 0000000..9cb3e66 --- /dev/null +++ b/docs/binance/binance-spot/testnet_rest-api_data-sources.md @@ -0,0 +1,15 @@ +--- +title: "Data Sources | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/data-sources" +fetched_at: "2026-02-26T10:38:10.185Z" +--- +- The API system is asynchronous, so some delay in the response is normal and expected. +- Each endpoint has a data source indicating where the data is being retrieved, and thus which endpoints have the most up-to-date response. + +These are the three sources, ordered by least to most potential for delays in data updates. + +- **Matching Engine** - the data is from the Matching Engine +- **Memory** - the data is from a server's local or external memory +- **Database** - the data is taken directly from a database + +Some endpoints can have more than 1 data source. (e.g. Memory => Database) This means that the endpoint will check the first Data Source, and if it cannot find the value it's looking for it will check the next one. diff --git a/docs/binance/binance-spot/testnet_rest-api_error-codes.md b/docs/binance/binance-spot/testnet_rest-api_error-codes.md new file mode 100644 index 0000000..7adc7f0 --- /dev/null +++ b/docs/binance/binance-spot/testnet_rest-api_error-codes.md @@ -0,0 +1,14 @@ +--- +title: "Error Codes | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/error-codes" +fetched_at: "2026-02-26T10:38:10.206Z" +--- +- Any endpoint can return an ERROR + +Sample Payload below: + +``` +{ "code": -1121, "msg": "Invalid symbol."} +``` + +- Specific error codes and messages are defined in [Errors Codes](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors). diff --git a/docs/binance/binance-spot/testnet_rest-api_general-api-information.md b/docs/binance/binance-spot/testnet_rest-api_general-api-information.md new file mode 100644 index 0000000..94bca80 --- /dev/null +++ b/docs/binance/binance-spot/testnet_rest-api_general-api-information.md @@ -0,0 +1,22 @@ +--- +title: "General API Information | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/general-api-information" +fetched_at: "2026-02-26T10:38:10.432Z" +--- +- The base endpoint is **[https://testnet.binance.vision/api](https://testnet.binance.vision/api)** +- Responses are in JSON by default. To receive responses in SBE, refer to the [SBE FAQ](https://developers.binance.com/docs/binance-spot-api-docs/faqs/sbe_faq) page. +- Data is returned in **chronological order**, unless noted otherwise. + - Without `startTime` or `endTime`, returns the most recent items up to the limit. + - With `startTime`, returns oldest items from `startTime` up to the limit. + - With `endTime`, returns most recent items up to `endTime` and the limit. + - With both, behaves like `startTime` but does not exceed `endTime`. +- All time and timestamp related fields in the JSON responses are in **milliseconds by default.** To receive the information in microseconds, please add the header `X-MBX-TIME-UNIT:MICROSECOND` or `X-MBX-TIME-UNIT:microsecond`. +- We support HMAC, RSA, and Ed25519 keys. For more information, please see [API Key types](https://developers.binance.com/docs/binance-spot-api-docs/faqs/api_key_types). +- Timestamp parameters (e.g. `startTime`, `endTime`, `timestamp`) can be passed in milliseconds or microseconds. +- If there are enums or terms you want clarification on, please see the [SPOT Glossary](https://developers.binance.com/docs/binance-spot-api-docs/faqs/spot_glossary) for more information. +- APIs have a timeout of 10 seconds when processing a request. If a response from the Matching Engine takes longer than this, the API responds with "Timeout waiting for response from backend server. Send status unknown; execution status unknown." [(-1007 TIMEOUT)](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - This does not always mean that the request failed in the Matching Engine. + - If the status of the request has not appeared in [User Data Stream](https://developers.binance.com/docs/binance-spot-api-docs/testnet/user-data-stream), please perform an API query for its status. +- **Please avoid SQL keywords in requests** as they may trigger a security block by a WAF (Web Application Firewall) rule. See [https://www.binance.com/en/support/faq/detail/360004492232](https://www.binance.com/en/support/faq/detail/360004492232) for more details. +- If your request contains a symbol name containing non-ASCII characters, then the response may contain non-ASCII characters encoded in UTF-8. +- Some endpoints may return asset and/or symbol names containing non-ASCII characters encoded in UTF-8 even if the request did not contain non-ASCII characters. diff --git a/docs/binance/binance-spot/testnet_rest-api_general-endpoints.md b/docs/binance/binance-spot/testnet_rest-api_general-endpoints.md new file mode 100644 index 0000000..1eca1e4 --- /dev/null +++ b/docs/binance/binance-spot/testnet_rest-api_general-endpoints.md @@ -0,0 +1,138 @@ +--- +title: "General endpoints | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/general-endpoints" +fetched_at: "2026-02-26T10:38:10.484Z" +--- +### Test connectivity[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/general-endpoints) + +``` +GET /api/v3/ping +``` + +Test connectivity to the Rest API. + +**Weight:** 1 + +**Parameters:** NONE + +**Data Source:** Memory + +**Response:** + +``` +{} +``` + +### Check server time[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/general-endpoints) + +``` +GET /api/v3/time +``` + +Test connectivity to the Rest API and get the current server time. + +**Weight:** 1 + +**Parameters:** NONE + +**Data Source:** Memory + +**Response:** + +``` +{ "serverTime": 1499827319559} +``` + +### Exchange information[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/general-endpoints) + +``` +GET /api/v3/exchangeInfo +``` + +Current exchange trading rules and symbol information + +**Weight:** 20 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +No + +Example: curl -X GET "[https://api.binance.com/api/v3/exchangeInfo?symbol=BNBBTC](https://api.binance.com/api/v3/exchangeInfo?symbol=BNBBTC)" + +symbols + +ARRAY OF STRING + +No + +Examples: curl -X GET "[https://api.binance.com/api/v3/exchangeInfo?symbols=%5B%22BNBBTC%22,%22BTCUSDT%22%5D](https://api.binance.com/api/v3/exchangeInfo?symbols=%5B%22BNBBTC%22,%22BTCUSDT%22%5D)" +or +curl -g -X GET '[https://api.binance.com/api/v3/exchangeInfo?symbols=\["BTCUSDT","BNBBTC](https://api.binance.com/api/v3/exchangeInfo?symbols=%5B%22BTCUSDT%22,%22BNBBTC)"\]' + +permissions + +ENUM + +No + +Examples: curl -X GET "[https://api.binance.com/api/v3/exchangeInfo?permissions=SPOT](https://api.binance.com/api/v3/exchangeInfo?permissions=SPOT)" +or +curl -X GET "[https://api.binance.com/api/v3/exchangeInfo?permissions=%5B%22MARGIN%22%2C%22LEVERAGED%22%5D](https://api.binance.com/api/v3/exchangeInfo?permissions=%5B%22MARGIN%22%2C%22LEVERAGED%22%5D)" +or +curl -g -X GET '[https://api.binance.com/api/v3/exchangeInfo?permissions=\["MARGIN","LEVERAGED](https://api.binance.com/api/v3/exchangeInfo?permissions=%5B%22MARGIN%22,%22LEVERAGED)"\]' + +showPermissionSets + +BOOLEAN + +No + +Controls whether the content of the `permissionSets` field is populated or not. Defaults to `true` + +symbolStatus + +ENUM + +No + +Filters for symbols that have this `tradingStatus`. +Valid values: `TRADING`, `HALT`, `BREAK` +Cannot be used in combination with `symbols` or `symbol`. + +**Notes:** + +- If the value provided to `symbol` or `symbols` do not exist, the endpoint will throw an error saying the symbol is invalid. +- All parameters are optional. +- `permissions` can support single or multiple values (e.g. `SPOT`, `["MARGIN","LEVERAGED"]`). This cannot be used in combination with `symbol` or `symbols`. +- If `permissions` parameter not provided, all symbols that have either `SPOT`, `MARGIN`, or `LEVERAGED` permission will be exposed. + - To display symbols with any permission you need to specify them explicitly in `permissions`: (e.g. `["SPOT","MARGIN",...]`.). See [Account and Symbol Permissions](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums) for the full list. + +**Examples of Symbol Permissions Interpretation from the Response:** + +- `[["A","B"]]` means you may place an order if your account has either permission "A" **or** permission "B". +- `[["A"],["B"]]` means you can place an order if your account has permission "A" **and** permission "B". +- `[["A"],["B","C"]]` means you can place an order if your account has permission "A" **and** permission "B" or permission "C". (Inclusive or is applied here, not exclusive or, so your account may have both permission "B" and permission "C".) + +**Data Source:** Memory + +**Response:** + +``` +{ "timezone": "UTC", "serverTime": 1565246363776, "rateLimits": [ { // These are defined in the `ENUM definitions` section under `Rate Limiters (rateLimitType)`. // All limits are optional } ], "exchangeFilters": [ // These are the defined filters in the `Filters` section. // All filters are optional. ], "symbols": [ { "symbol": "ETHBTC", "status": "TRADING", "baseAsset": "ETH", "baseAssetPrecision": 8, "quoteAsset": "BTC", "quotePrecision": 8, // will be removed in future api versions (v4+) "quoteAssetPrecision": 8, "baseCommissionPrecision": 8, "quoteCommissionPrecision": 8, "orderTypes": [ "LIMIT", "LIMIT_MAKER", "MARKET", "STOP_LOSS", "STOP_LOSS_LIMIT", "TAKE_PROFIT", "TAKE_PROFIT_LIMIT" ], "icebergAllowed": true, "ocoAllowed": true, "otoAllowed": true, "opoAllowed": true, "quoteOrderQtyMarketAllowed": true, "allowTrailingStop": false, "cancelReplaceAllowed": false, "amendAllowed": false, "pegInstructionsAllowed": true, "isSpotTradingAllowed": true, "isMarginTradingAllowed": true, "filters": [ // These are defined in the Filters section. // All filters are optional ], "permissions": [], "permissionSets": [["SPOT", "MARGIN"]], "defaultSelfTradePreventionMode": "NONE", "allowedSelfTradePreventionModes": ["NONE"] } ], // Optional field. Present only when SOR is available. // https://github.com/binance/binance-spot-api-docs/blob/master/faqs/sor_faq.md "sors": [ { "baseAsset": "BTC", "symbols": ["BTCUSDT", "BTCUSDC"] } ]} +``` + +- [Test connectivity](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/general-endpoints) +- [Check server time](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/general-endpoints) +- [Exchange information](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/general-endpoints) diff --git a/docs/binance/binance-spot/testnet_rest-api_general-information-on-endpoints.md b/docs/binance/binance-spot/testnet_rest-api_general-information-on-endpoints.md new file mode 100644 index 0000000..f21f818 --- /dev/null +++ b/docs/binance/binance-spot/testnet_rest-api_general-information-on-endpoints.md @@ -0,0 +1,9 @@ +--- +title: "General Information on Endpoints | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/general-information-on-endpoints" +fetched_at: "2026-02-26T10:38:10.575Z" +--- +- For `GET` endpoints, parameters must be sent as a `query string`. +- For `POST`, `PUT`, and `DELETE` endpoints, the parameters may be sent as a `query string` or in the `request body` with content type `application/x-www-form-urlencoded`. You may mix parameters between both the `query string` and `request body` if you wish to do so. +- Parameters may be sent in any order. +- If a parameter sent in both the `query string` and `request body`, the `query string` parameter will be used. diff --git a/docs/binance/binance-spot/testnet_rest-api_http-return-codes.md b/docs/binance/binance-spot/testnet_rest-api_http-return-codes.md new file mode 100644 index 0000000..63038f4 --- /dev/null +++ b/docs/binance/binance-spot/testnet_rest-api_http-return-codes.md @@ -0,0 +1,11 @@ +--- +title: "HTTP Return Codes | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/http-return-codes" +fetched_at: "2026-02-26T10:38:10.463Z" +--- +- HTTP `4XX` return codes are used for malformed requests; the issue is on the sender's side. +- HTTP `403` return code is used when a WAF (Web Application Firewall) rule has been violated. This can indicate a rate limit violation or a security block. See [https://www.binance.com/en/support/faq/detail/360004492232](https://www.binance.com/en/support/faq/detail/360004492232) for more details. +- HTTP `409` return code is used when a cancelReplace order partially succeeds. (i.e. if the cancellation of the order fails but the new order placement succeeds.) +- HTTP `429` return code is used when breaking a request rate limit. +- HTTP `418` return code is used when an IP has been auto-banned for continuing to send requests after receiving `429` codes. +- HTTP `5XX` return codes are used for internal errors; the issue is on Binance's side. It is important to **NOT** treat this as a failure operation; the execution status is **UNKNOWN** and could have been a success. diff --git a/docs/binance/binance-spot/testnet_rest-api_limits.md b/docs/binance/binance-spot/testnet_rest-api_limits.md new file mode 100644 index 0000000..d640cb5 --- /dev/null +++ b/docs/binance/binance-spot/testnet_rest-api_limits.md @@ -0,0 +1,39 @@ +--- +title: "LIMITS | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/limits" +fetched_at: "2026-02-26T10:38:10.693Z" +--- +### General Info on Limits[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/limits) + +- The following `intervalLetter` values for headers: + - SECOND => S + - MINUTE => M + - HOUR => H + - DAY => D +- `intervalNum` describes the amount of the interval. For example, `intervalNum` 5 with `intervalLetter` M means "Every 5 minutes". +- The `/api/v3/exchangeInfo` `rateLimits` array contains objects related to the exchange's `RAW_REQUESTS`, `REQUEST_WEIGHT`, and `ORDERS` rate limits. These are further defined in the `ENUM definitions` section under `Rate limiters (rateLimitType)`. +- Requests fail with HTTP status code 429 when you exceed the request rate limit. + +### IP Limits[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/limits) + +- Every request will contain `X-MBX-USED-WEIGHT-(intervalNum)(intervalLetter)` in the response headers which has the current used weight for the IP for all request rate limiters defined. +- Each route has a `weight` which determines for the number of requests each endpoint counts for. Heavier endpoints and endpoints that do operations on multiple symbols will have a heavier `weight`. +- When a 429 is received, it's your obligation as an API to back off and not spam the API. +- **Repeatedly violating rate limits and/or failing to back off after receiving 429s will result in an automated IP ban (HTTP status 418).** +- IP bans are tracked and **scale in duration** for repeat offenders, **from 2 minutes to 3 days**. +- A `Retry-After` header is sent with a 418 or 429 responses and will give the **number of seconds** required to wait, in the case of a 429, to prevent a ban, or, in the case of a 418, until the ban is over. +- **The limits on the API are based on the IPs, not the API keys.** + +### Unfilled Order Count[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/limits) + +- Every successful order response will contain a `X-MBX-ORDER-COUNT-(intervalNum)(intervalLetter)` header indicating how many orders you have placed for that interval. + + To monitor this, refer to [`GET api/v3/rateLimit/order`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/account-endpoints). +- Rejected/unsuccessful orders are not guaranteed to have `X-MBX-ORDER-COUNT-**` headers in the response. +- If you have exceeded this, you will receive a 429 error with the `Retry-After` header. +- **Please note that if your orders are consistently filled by trades, you can continuously place orders on the API**. For more information, please see [Spot Unfilled Order Count Rules](https://developers.binance.com/docs/binance-spot-api-docs/faqs/order_count_decrement). +- **The number of unfilled orders is tracked for each account.** + +- [General Info on Limits](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/limits) +- [IP Limits](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/limits) +- [Unfilled Order Count](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/limits) diff --git a/docs/binance/binance-spot/testnet_rest-api_market-data-endpoints.md b/docs/binance/binance-spot/testnet_rest-api_market-data-endpoints.md new file mode 100644 index 0000000..524adf3 --- /dev/null +++ b/docs/binance/binance-spot/testnet_rest-api_market-data-endpoints.md @@ -0,0 +1,981 @@ +--- +title: "Market Data endpoints | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/market-data-endpoints" +fetched_at: "2026-02-26T10:38:10.755Z" +--- +### Order book[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/market-data-endpoints) + +``` +GET /api/v3/depth +``` + +**Weight:** Adjusted based on the limit: + +Limit + +Request Weight + +1-100 + +5 + +101-500 + +25 + +501-1000 + +50 + +1001-5000 + +250 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +limit + +INT + +NO + +Default: 100; Maximum: 5000. +If limit > 5000, only 5000 entries will be returned. + +symbolStatus + +ENUM + +NO + +Filters for symbols that have this `tradingStatus`. +A status mismatch returns error `-1220 SYMBOL_DOES_NOT_MATCH_STATUS`. +Valid values: `TRADING`, `HALT`, `BREAK` + +**Data Source:** Memory + +**Response:** + +``` +{ "lastUpdateId": 1027024, "bids": [ [ "4.00000000", // PRICE "431.00000000" // QTY ] ], "asks": [["4.00000200", "12.00000000"]]} +``` + +### Recent trades list[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/market-data-endpoints) + +``` +GET /api/v3/trades +``` + +Get recent trades. + +**Weight:** 25 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +limit + +INT + +NO + +Default: 500; Maximum: 1000. + +**Data Source:** Memory + +**Response:** + +``` +[ { "id": 28457, "price": "4.00000100", "qty": "12.00000000", "quoteQty": "48.000012", "time": 1499865549590, "isBuyerMaker": true, "isBestMatch": true }] +``` + +### Old trade lookup[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/market-data-endpoints) + +``` +GET /api/v3/historicalTrades +``` + +Get older trades. + +**Weight:** 25 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +limit + +INT + +NO + +Default: 500; Maximum: 1000. + +fromId + +LONG + +NO + +TradeId to fetch from. Default gets most recent trades. + +**Data Source:** Database + +**Response:** + +``` +[ { "id": 28457, "price": "4.00000100", "qty": "12.00000000", "quoteQty": "48.000012", "time": 1499865549590, "isBuyerMaker": true, "isBestMatch": true }] +``` + +### Compressed/Aggregate trades list[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/market-data-endpoints) + +``` +GET /api/v3/aggTrades +``` + +Get compressed, aggregate trades. Trades that fill at the time, from the same taker order, with the same price will have the quantity aggregated. + +**Weight:** 4 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +fromId + +LONG + +NO + +ID to get aggregate trades from INCLUSIVE. + +startTime + +LONG + +NO + +Timestamp in ms to get aggregate trades from INCLUSIVE. + +endTime + +LONG + +NO + +Timestamp in ms to get aggregate trades until INCLUSIVE. + +limit + +INT + +NO + +Default: 500; Maximum: 1000. + +- If fromId, startTime, and endTime are not sent, the most recent aggregate trades will be returned. + +**Data Source:** Database + +**Response:** + +``` +[ { "a": 26129, // Aggregate tradeId "p": "0.01633102", // Price "q": "4.70443515", // Quantity "f": 27781, // First tradeId "l": 27781, // Last tradeId "T": 1498793709153, // Timestamp "m": true, // Was the buyer the maker? "M": true // Was the trade the best price match? }] +``` + +### Kline/Candlestick data[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/market-data-endpoints) + +``` +GET /api/v3/klines +``` + +Kline/candlestick bars for a symbol. Klines are uniquely identified by their open time. + +**Weight:** 2 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +interval + +ENUM + +YES + +startTime + +LONG + +NO + +endTime + +LONG + +NO + +timeZone + +STRING + +NO + +Default: 0 (UTC) + +limit + +INT + +NO + +Default: 500; Maximum: 1000. + +Supported kline intervals (case-sensitive): + +Interval + +`interval` value + +seconds + +`1s` + +minutes + +`1m`, `3m`, `5m`, `15m`, `30m` + +hours + +`1h`, `2h`, `4h`, `6h`, `8h`, `12h` + +days + +`1d`, `3d` + +weeks + +`1w` + +months + +`1M` + +**Notes:** + +- If `startTime` and `endTime` are not sent, the most recent klines are returned. +- Supported values for `timeZone`: + - Hours and minutes (e.g. `-1:00`, `05:45`) + - Only hours (e.g. `0`, `8`, `4`) + - Accepted range is strictly \[-12:00 to +14:00\] inclusive +- If `timeZone` provided, kline intervals are interpreted in that timezone instead of UTC. +- Note that `startTime` and `endTime` are always interpreted in UTC, regardless of `timeZone`. + +**Data Source:** Database + +**Response:** + +``` +[ [ 1499040000000, // Kline open time "0.01634790", // Open price "0.80000000", // High price "0.01575800", // Low price "0.01577100", // Close price "148976.11427815", // Volume 1499644799999, // Kline Close time "2434.19055334", // Quote asset volume 308, // Number of trades "1756.87402397", // Taker buy base asset volume "28.46694368", // Taker buy quote asset volume "0" // Unused field, ignore. ]] +``` + +### UIKlines[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/market-data-endpoints) + +``` +GET /api/v3/uiKlines +``` + +The request is similar to klines having the same parameters and response. + +`uiKlines` return modified kline data, optimized for presentation of candlestick charts. + +**Weight:** 2 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +interval + +ENUM + +YES + +See [`klines`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/market-data-endpoints) + +startTime + +LONG + +NO + +endTime + +LONG + +NO + +timeZone + +STRING + +NO + +Default: 0 (UTC) + +limit + +INT + +NO + +Default: 500; Maximum: 1000. + +- If `startTime` and `endTime` are not sent, the most recent klines are returned. +- Supported values for `timeZone`: + - Hours and minutes (e.g. `-1:00`, `05:45`) + - Only hours (e.g. `0`, `8`, `4`) + - Accepted range is strictly \[-12:00 to +14:00\] inclusive +- If `timeZone` provided, kline intervals are interpreted in that timezone instead of UTC. +- Note that `startTime` and `endTime` are always interpreted in UTC, regardless of `timeZone`. + +**Data Source:** Database + +**Response:** + +``` +[ [ 1499040000000, // Kline open time "0.01634790", // Open price "0.80000000", // High price "0.01575800", // Low price "0.01577100", // Close price "148976.11427815", // Volume 1499644799999, // Kline close time "2434.19055334", // Quote asset volume 308, // Number of trades "1756.87402397", // Taker buy base asset volume "28.46694368", // Taker buy quote asset volume "0" // Unused field. Ignore. ]] +``` + +### Current average price[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/market-data-endpoints) + +``` +GET /api/v3/avgPrice +``` + +Current average price for a symbol. + +**Weight:** 2 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +**Data Source:** Memory + +**Response:** + +``` +{ "mins": 5, // Average price interval (in minutes) "price": "9.35751834", // Average price "closeTime": 1694061154503 // Last trade time} +``` + +### 24hr ticker price change statistics[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/market-data-endpoints) + +``` +GET /api/v3/ticker/24hr +``` + +24 hour rolling window price change statistics. **Careful** when accessing this with no symbol. + +**Weight:** + +Parameter + +Symbols Provided + +Weight + +symbol + +1 + +2 + +symbol parameter is omitted + +80 + +symbols + +1-20 + +2 + +21-100 + +40 + +101 or more + +80 + +symbols parameter is omitted + +80 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +NO + +Parameter symbol and symbols cannot be used in combination. +If neither parameter is sent, tickers for all symbols will be returned in an array. + +Examples of accepted format for the symbols parameter: \["BTCUSDT","BNBUSDT"\] +or +%5B%22BTCUSDT%22,%22BNBUSDT%22%5D + +symbols + +STRING + +NO + +type + +ENUM + +NO + +Supported values: FULL or MINI. +If none provided, the default is FULL + +symbolStatus + +ENUM + +NO + +Filters for symbols that have this `tradingStatus`. +For a single symbol, a status mismatch returns error `-1220 SYMBOL_DOES_NOT_MATCH_STATUS`. +For multiple or all symbols, non-matching ones are simply excluded from the response. +Valid values: `TRADING`, `HALT`, `BREAK` + +**Data Source:** Memory + +**Response - FULL:** + +``` +{ "symbol": "BNBBTC", "priceChange": "-94.99999800", "priceChangePercent": "-95.960", "weightedAvgPrice": "0.29628482", "prevClosePrice": "0.10002000", "lastPrice": "4.00000200", "lastQty": "200.00000000", "bidPrice": "4.00000000", "bidQty": "100.00000000", "askPrice": "4.00000200", "askQty": "100.00000000", "openPrice": "99.00000000", "highPrice": "100.00000000", "lowPrice": "0.10000000", "volume": "8913.30000000", "quoteVolume": "15.30000000", "openTime": 1499783499040, "closeTime": 1499869899040, "firstId": 28385, // First tradeId "lastId": 28460, // Last tradeId "count": 76 // Trade count} +``` + +OR + +``` +[ { "symbol": "BNBBTC", "priceChange": "-94.99999800", "priceChangePercent": "-95.960", "weightedAvgPrice": "0.29628482", "prevClosePrice": "0.10002000", "lastPrice": "4.00000200", "lastQty": "200.00000000", "bidPrice": "4.00000000", "bidQty": "100.00000000", "askPrice": "4.00000200", "askQty": "100.00000000", "openPrice": "99.00000000", "highPrice": "100.00000000", "lowPrice": "0.10000000", "volume": "8913.30000000", "quoteVolume": "15.30000000", "openTime": 1499783499040, "closeTime": 1499869899040, "firstId": 28385, // First tradeId "lastId": 28460, // Last tradeId "count": 76 // Trade count }] +``` + +**Response - MINI:** + +``` +{ "symbol": "BNBBTC", // Symbol Name "openPrice": "99.00000000", // Opening price of the Interval "highPrice": "100.00000000", // Highest price in the interval "lowPrice": "0.10000000", // Lowest price in the interval "lastPrice": "4.00000200", // Closing price of the interval "volume": "8913.30000000", // Total trade volume (in base asset) "quoteVolume": "15.30000000", // Total trade volume (in quote asset) "openTime": 1499783499040, // Start of the ticker interval "closeTime": 1499869899040, // End of the ticker interval "firstId": 28385, // First tradeId considered "lastId": 28460, // Last tradeId considered "count": 76 // Total trade count} +``` + +OR + +``` +[ { "symbol": "BNBBTC", "openPrice": "99.00000000", "highPrice": "100.00000000", "lowPrice": "0.10000000", "lastPrice": "4.00000200", "volume": "8913.30000000", "quoteVolume": "15.30000000", "openTime": 1499783499040, "closeTime": 1499869899040, "firstId": 28385, "lastId": 28460, "count": 76 }, { "symbol": "LTCBTC", "openPrice": "0.07000000", "highPrice": "0.07000000", "lowPrice": "0.07000000", "lastPrice": "0.07000000", "volume": "11.00000000", "quoteVolume": "0.77000000", "openTime": 1656908192899, "closeTime": 1656994592899, "firstId": 0, "lastId": 10, "count": 11 }] +``` + +### Trading Day Ticker[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/market-data-endpoints) + +``` +GET /api/v3/ticker/tradingDay +``` + +Price change statistics for a trading day. + +**Weight:** + +4 for each requested symbol. + +The weight for this request will cap at 200 once the number of `symbols` in the request is more than 50. + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +Either symbol or symbols must be provided + +Examples of accepted format for the symbols parameter: +\["BTCUSDT","BNBUSDT"\] +or +%5B%22BTCUSDT%22,%22BNBUSDT%22%5D + +The maximum number of symbols allowed in a request is 100. + +symbols + +timeZone + +STRING + +NO + +Default: 0 (UTC) + +type + +ENUM + +NO + +Supported values: FULL or MINI. +If none provided, the default is FULL + +symbolStatus + +ENUM + +NO + +Filters for symbols that have this `tradingStatus`. +For a single symbol, a status mismatch returns error `-1220 SYMBOL_DOES_NOT_MATCH_STATUS`. +For multiple symbols, non-matching ones are simply excluded from the response. +Valid values: `TRADING`, `HALT`, `BREAK` + +**Notes:** + +- Supported values for `timeZone`: + - Hours and minutes (e.g. `-1:00`, `05:45`) + - Only hours (e.g. `0`, `8`, `4`) + +**Data Source:** Database + +**Response - FULL:** + +With `symbol`: + +``` +{ "symbol": "BTCUSDT", "priceChange": "-83.13000000", // Absolute price change "priceChangePercent": "-0.317", // Relative price change in percent "weightedAvgPrice": "26234.58803036", // quoteVolume / volume "openPrice": "26304.80000000", "highPrice": "26397.46000000", "lowPrice": "26088.34000000", "lastPrice": "26221.67000000", "volume": "18495.35066000", // Volume in base asset "quoteVolume": "485217905.04210480", // Volume in quote asset "openTime": 1695686400000, "closeTime": 1695772799999, "firstId": 3220151555, // Trade ID of the first trade in the interval "lastId": 3220849281, // Trade ID of the last trade in the interval "count": 697727 // Number of trades in the interval} +``` + +With `symbols`: + +``` +[ { "symbol": "BTCUSDT", "priceChange": "-83.13000000", "priceChangePercent": "-0.317", "weightedAvgPrice": "26234.58803036", "openPrice": "26304.80000000", "highPrice": "26397.46000000", "lowPrice": "26088.34000000", "lastPrice": "26221.67000000", "volume": "18495.35066000", "quoteVolume": "485217905.04210480", "openTime": 1695686400000, "closeTime": 1695772799999, "firstId": 3220151555, "lastId": 3220849281, "count": 697727 }, { "symbol": "BNBUSDT", "priceChange": "2.60000000", "priceChangePercent": "1.238", "weightedAvgPrice": "211.92276958", "openPrice": "210.00000000", "highPrice": "213.70000000", "lowPrice": "209.70000000", "lastPrice": "212.60000000", "volume": "280709.58900000", "quoteVolume": "59488753.54750000", "openTime": 1695686400000, "closeTime": 1695772799999, "firstId": 672397461, "lastId": 672496158, "count": 98698 }] +``` + +**Response - MINI:** + +With `symbol`: + +``` +{ "symbol": "BTCUSDT", "openPrice": "26304.80000000", "highPrice": "26397.46000000", "lowPrice": "26088.34000000", "lastPrice": "26221.67000000", "volume": "18495.35066000", // Volume in base asset "quoteVolume": "485217905.04210480", // Volume in quote asset "openTime": 1695686400000, "closeTime": 1695772799999, "firstId": 3220151555, // Trade ID of the first trade in the interval "lastId": 3220849281, // Trade ID of the last trade in the interval "count": 697727 // Number of trades in the interval} +``` + +With `symbols`: + +``` +[ { "symbol": "BTCUSDT", "openPrice": "26304.80000000", "highPrice": "26397.46000000", "lowPrice": "26088.34000000", "lastPrice": "26221.67000000", "volume": "18495.35066000", "quoteVolume": "485217905.04210480", "openTime": 1695686400000, "closeTime": 1695772799999, "firstId": 3220151555, "lastId": 3220849281, "count": 697727 }, { "symbol": "BNBUSDT", "openPrice": "210.00000000", "highPrice": "213.70000000", "lowPrice": "209.70000000", "lastPrice": "212.60000000", "volume": "280709.58900000", "quoteVolume": "59488753.54750000", "openTime": 1695686400000, "closeTime": 1695772799999, "firstId": 672397461, "lastId": 672496158, "count": 98698 }] +``` + +### Symbol price ticker[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/market-data-endpoints) + +``` +GET /api/v3/ticker/price +``` + +Latest price for a symbol or symbols. + +**Weight:** + +Parameter + +Symbols Provided + +Weight + +symbol + +1 + +2 + +symbol parameter is omitted + +4 + +symbols + +Any + +4 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +NO + +Parameter symbol and symbols cannot be used in combination. +If neither parameter is sent, prices for all symbols will be returned in an array. + +Examples of accepted format for the symbols parameter: \["BTCUSDT","BNBUSDT"\] +or +%5B%22BTCUSDT%22,%22BNBUSDT%22%5D + +symbols + +STRING + +NO + +symbolStatus + +ENUM + +NO + +Filters for symbols that have this `tradingStatus`. +For a single symbol, a status mismatch returns error `-1220 SYMBOL_DOES_NOT_MATCH_STATUS`. +For multiple or all symbols, non-matching ones are simply excluded from the response. +Valid values: `TRADING`, `HALT`, `BREAK` + +**Data Source:** Memory + +**Response:** + +``` +{ "symbol": "LTCBTC", "price": "4.00000200"} +``` + +OR + +``` +[ { "symbol": "LTCBTC", "price": "4.00000200" }, { "symbol": "ETHBTC", "price": "0.07946600" }] +``` + +### Symbol order book ticker[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/market-data-endpoints) + +``` +GET /api/v3/ticker/bookTicker +``` + +Best price/qty on the order book for a symbol or symbols. + +**Weight:** + +Parameter + +Symbols Provided + +Weight + +symbol + +1 + +2 + +symbol parameter is omitted + +4 + +symbols + +Any + +4 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +NO + +Parameter symbol and symbols cannot be used in combination. +If neither parameter is sent, bookTickers for all symbols will be returned in an array. + +Examples of accepted format for the symbols parameter: \["BTCUSDT","BNBUSDT"\] +or +%5B%22BTCUSDT%22,%22BNBUSDT%22%5D + +symbols + +STRING + +NO + +symbolStatus + +ENUM + +NO + +Filters for symbols that have this `tradingStatus`. +For a single symbol, a status mismatch returns error `-1220 SYMBOL_DOES_NOT_MATCH_STATUS`. +For multiple or all symbols, non-matching ones are simply excluded from the response. +Valid values: `TRADING`, `HALT`, `BREAK` + +**Data Source:** Memory + +**Response:** + +``` +{ "symbol": "LTCBTC", "bidPrice": "4.00000000", "bidQty": "431.00000000", "askPrice": "4.00000200", "askQty": "9.00000000"} +``` + +OR + +``` +[ { "symbol": "LTCBTC", "bidPrice": "4.00000000", "bidQty": "431.00000000", "askPrice": "4.00000200", "askQty": "9.00000000" }, { "symbol": "ETHBTC", "bidPrice": "0.07946700", "bidQty": "9.00000000", "askPrice": "100000.00000000", "askQty": "1000.00000000" }] +``` + +### Rolling window price change statistics[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/market-data-endpoints) + +``` +GET /api/v3/ticker +``` + +**Note:** This endpoint is different from the `GET /api/v3/ticker/24hr` endpoint. + +The window used to compute statistics will be no more than 59999ms from the requested `windowSize`. + +`openTime` for `/api/v3/ticker` always starts on a minute, while the `closeTime` is the current time of the request. As such, the effective window will be up to 59999ms wider than `windowSize`. + +E.g. If the `closeTime` is 1641287867099 (January 04, 2022 09:17:47:099 UTC) , and the `windowSize` is `1d`. the `openTime` will be: 1641201420000 (January 3, 2022, 09:17:00) + +**Weight:** + +4 for each requested symbol regardless of windowSize. + +The weight for this request will cap at 200 once the number of `symbols` in the request is more than 50. + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +Either symbol or symbols must be provided + +Examples of accepted format for the symbols parameter: +\["BTCUSDT","BNBUSDT"\] +or +%5B%22BTCUSDT%22,%22BNBUSDT%22%5D + +The maximum number of symbols allowed in a request is 100. + +symbols + +windowSize + +ENUM + +NO + +Defaults to 1d if no parameter provided +Supported windowSize values: +1m,2m....59m for minutes +1h, 2h....23h - for hours +1d...7d - for days + +Units cannot be combined (e.g. 1d2h is not allowed) + +type + +ENUM + +NO + +Supported values: FULL or MINI. +If none provided, the default is FULL + +symbolStatus + +ENUM + +NO + +Filters for symbols that have this `tradingStatus`. +For a single symbol, a status mismatch returns error `-1220 SYMBOL_DOES_NOT_MATCH_STATUS`. +For multiple symbols, non-matching ones are simply excluded from the response. +Valid values: `TRADING`, `HALT`, `BREAK` + +**Data Source:** Database + +**Response - FULL:** + +When using `symbol`: + +``` +{ "symbol": "BNBBTC", "priceChange": "-8.00000000", // Absolute price change "priceChangePercent": "-88.889", // Relative price change in percent "weightedAvgPrice": "2.60427807", // QuoteVolume / Volume "openPrice": "9.00000000", "highPrice": "9.00000000", "lowPrice": "1.00000000", "lastPrice": "1.00000000", "volume": "187.00000000", "quoteVolume": "487.00000000", // Sum of (price * volume) for all trades "openTime": 1641859200000, // Open time for ticker window "closeTime": 1642031999999, // Close time for ticker window "firstId": 0, // Trade IDs "lastId": 60, "count": 61 // Number of trades in the interval} +``` + +or + +When using `symbols`: + +``` +[ { "symbol": "BTCUSDT", "priceChange": "-154.13000000", // Absolute price change "priceChangePercent": "-0.740", // Relative price change in percent "weightedAvgPrice": "20677.46305250", // QuoteVolume / Volume "openPrice": "20825.27000000", "highPrice": "20972.46000000", "lowPrice": "20327.92000000", "lastPrice": "20671.14000000", "volume": "72.65112300", "quoteVolume": "1502240.91155513", // Sum of (price * volume) for all trades "openTime": 1655432400000, // Open time for ticker window "closeTime": 1655446835460, // Close time for ticker window "firstId": 11147809, // Trade IDs "lastId": 11149775, "count": 1967 // Number of trades in the interval }, { "symbol": "BNBBTC", "priceChange": "0.00008530", "priceChangePercent": "0.823", "weightedAvgPrice": "0.01043129", "openPrice": "0.01036170", "highPrice": "0.01049850", "lowPrice": "0.01033870", "lastPrice": "0.01044700", "volume": "166.67000000", "quoteVolume": "1.73858301", "openTime": 1655432400000, "closeTime": 1655446835460, "firstId": 2351674, "lastId": 2352034, "count": 361 }] +``` + +**Response - MINI:** + +When using `symbol`: + +``` +{ "symbol": "LTCBTC", "openPrice": "0.10000000", "highPrice": "2.00000000", "lowPrice": "0.10000000", "lastPrice": "2.00000000", "volume": "39.00000000", "quoteVolume": "13.40000000", // Sum of (price * volume) for all trades "openTime": 1656986580000, // Open time for ticker window "closeTime": 1657001016795, // Close time for ticker window "firstId": 0, // Trade IDs "lastId": 34, "count": 35 // Number of trades in the interval} +``` + +OR + +When using `symbols`: + +``` +[ { "symbol": "BNBBTC", "openPrice": "0.10000000", "highPrice": "2.00000000", "lowPrice": "0.10000000", "lastPrice": "2.00000000", "volume": "39.00000000", "quoteVolume": "13.40000000", // Sum of (price * volume) for all trades "openTime": 1656986880000, // Open time for ticker window "closeTime": 1657001297799, // Close time for ticker window "firstId": 0, // Trade IDs "lastId": 34, "count": 35 // Number of trades in the interval }, { "symbol": "LTCBTC", "openPrice": "0.07000000", "highPrice": "0.07000000", "lowPrice": "0.07000000", "lastPrice": "0.07000000", "volume": "33.00000000", "quoteVolume": "2.31000000", "openTime": 1656986880000, "closeTime": 1657001297799, "firstId": 0, "lastId": 32, "count": 33 }] +``` + +- [Order book](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/market-data-endpoints) +- [Recent trades list](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/market-data-endpoints) +- [Old trade lookup](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/market-data-endpoints) +- [Compressed/Aggregate trades list](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/market-data-endpoints) +- [Kline/Candlestick data](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/market-data-endpoints) +- [UIKlines](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/market-data-endpoints) +- [Current average price](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/market-data-endpoints) +- [24hr ticker price change statistics](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/market-data-endpoints) +- [Trading Day Ticker](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/market-data-endpoints) +- [Symbol price ticker](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/market-data-endpoints) +- [Symbol order book ticker](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/market-data-endpoints) +- [Rolling window price change statistics](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/market-data-endpoints) diff --git a/docs/binance/binance-spot/testnet_rest-api_request-security.md b/docs/binance/binance-spot/testnet_rest-api_request-security.md new file mode 100644 index 0000000..c9278af --- /dev/null +++ b/docs/binance/binance-spot/testnet_rest-api_request-security.md @@ -0,0 +1,600 @@ +--- +title: "Request Security | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/request-security" +fetched_at: "2026-02-26T10:38:10.989Z" +--- +- Each endpoint has a security type indicating required API key permissions, shown next to the endpoint name (e.g., [New order (TRADE)](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/request-security)). +- If unspecified, the security type is `NONE`. +- Except for `NONE`, all endpoints with a security type are considered `SIGNED` requests (i.e. including a `signature`), except for [listenKey management](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/request-security). +- Secure endpoints require a valid API key to be specified and authenticated. + - API keys can be created on the [SPOT Test Network](https://testnet.binance.vision/) upon logging in with your Github account. + - **Both API key and secret key are sensitive.** Never share them with anyone. If you notice unusual activity in your account, immediately revoke all the keys and contact Binance support. +- API keys can be configured to allow access only to certain types of secure endpoints. + - For example, you can have an API key with `TRADE` permission for trading, while using a separate API key with `USER_DATA` permission to monitor your order status. + - By default, an API key cannot `TRADE`. You need to enable trading in API Management first. + +Security type + +Description + +`NONE` + +Public market data + +`TRADE` + +Trading on the exchange, placing and canceling orders + +`USER_DATA` + +Private account information, such as order status and your trading history + +`USER_STREAM` + +Managing User Data Stream subscriptions + +### SIGNED Endpoint security[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/request-security) + +- `SIGNED` endpoints require an additional parameter, `signature`, to be sent in the `query string` or `request body`. + +#### Signature Case Sensitivity[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/request-security) + +- **HMAC:** Signatures generated using HMAC are **not case-sensitive**. This means the signature string can be verified regardless of letter casing. +- **RSA:** Signatures generated using RSA are **case-sensitive**. +- **Ed25519:** Signatures generated using Ed25519 are also **case-sensitive** + +Please consult [SIGNED request example (HMAC)](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/request-security), [SIGNED request example (RSA)](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/request-security), and [SIGNED request example (Ed25519)](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/request-security) on how to compute signature, depending on which API key type you are using. + +### Timing security[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/request-security) + +- `SIGNED` requests also require a `timestamp` parameter which should be the current timestamp either in milliseconds or microseconds. (See [General API Information](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/request-security)) +- An additional optional parameter, `recvWindow`, specifies for how long the request stays valid and may only be specified in milliseconds. + - `recvWindow` supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + - If `recvWindow` is not sent, **it defaults to 5000 milliseconds**. + - Maximum `recvWindow` is 60000 milliseconds. +- Request processing logic is as follows: + +``` +serverTime = getCurrentTime()if (timestamp < (serverTime + 1 second) && (serverTime - timestamp) <= recvWindow) { // begin processing request serverTime = getCurrentTime() if (serverTime - timestamp) <= recvWindow { // forward request to Matching Engine } else { // reject request } // finish processing request} else { // reject request} +``` + +**Serious trading is about timing.** Networks can be unstable and unreliable, which can lead to requests taking varying amounts of time to reach the servers. With `recvWindow`, you can specify that the request must be processed within a certain number of milliseconds or be rejected by the server. + +**It is recommended to use a small recvWindow of 5000 or less! The max cannot go beyond 60,000!** + +### SIGNED Endpoint Examples for POST /api/v3/order[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/request-security) + +#### HMAC Keys[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/request-security) + +The signature payload of your request is the query string concatenated without separator to the HTTP body. Any non-ASCII character must be percent-encoded before signing. + +Here is a step-by-step example of how to send a valid signed payload from the Linux command line using `echo`, `openssl`, and `curl`. There is one example with a symbol name comprised entirely of ASCII characters and one example with a symbol name containing non-ASCII characters. + +Example API key and secret key: + +Key + +Value + +`apiKey` + +vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A + +`secretKey` + +NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j + +**WARNING: DO NOT SHARE YOUR API KEY AND SECRET KEY WITH ANYONE.** + +The example keys are provided here only for illustrative purposes. + +Example of request with a symbol name comprised entirely of ASCII characters: + +Parameter + +Value + +`symbol` + +LTCBTC + +`side` + +BUY + +`type` + +LIMIT + +`timeInForce` + +GTC + +`quantity` + +1 + +`price` + +0.1 + +`recvWindow` + +5000 + +`timestamp` + +1499827319559 + +Example of a request with a symbol name containing non-ASCII characters: + +Parameter + +Value + +`symbol` + +123456 + +`side` + +BUY + +`type` + +LIMIT + +`timeInForce` + +GTC + +`quantity` + +1 + +`price` + +0.1 + +`recvWindow` + +5000 + +`timestamp` + +1499827319559 + +**Step 1: Construct the signature payload** + +1. Format parameters as `parameter=value` pairs separated by `&`. +2. Percent-encode the string. + +For the first set of example parameters (ASCII only), the `parameter=value` string should look like this: + +``` +symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559 +``` + +After percent-encoding, the signature payload should look like this: + +``` +symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559 +``` + +For the second set of example parameters (some non-ASCII characters), the `parameter=value` string should look like this: + +``` +symbol=123456&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559 +``` + +After percent-encoding, the signature payload should look like this: + +``` +symbol=%EF%BC%91%EF%BC%92%EF%BC%93%EF%BC%94%EF%BC%95%EF%BC%96&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559 +``` + +**Step 2: Compute the signature** + +1. Use the `secretKey` of your API key as the signing key for the HMAC-SHA-256 algorithm. +2. Sign the signature payload constructed in Step 1. +3. Encode the HMAC-SHA-256 output as a hex string. + +Note that `secretKey` and the payload are **case-sensitive**, while the resulting signature value is case-insensitive. + +**Example commands** + +For the first set of example parameters (ASCII only): + +``` +$ echo -n "symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559" | openssl dgst -sha256 -hmac "NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j"c8db56825ae71d6d79447849e617115f4a920fa2acdcab2b053c4b2838bd6b71 +``` + +For the second set of example parameters (some non-ASCII characters): + +``` +$ echo -n "symbol=%EF%BC%91%EF%BC%92%EF%BC%93%EF%BC%94%EF%BC%95%EF%BC%96&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559" | openssl dgst -sha256 -hmac "NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j"e1353ec6b14d888f1164ae9af8228a3dbd508bc82eb867db8ab6046442f33ef3 +``` + +**Step 3: Add signature to the request** + +Complete the request by adding the `signature` parameter to the query string. + +For the first set of example parameters (ASCII only): + +``` +curl -s -v -H "X-MBX-APIKEY: $apiKey" -X POST "https://testnet.binance.vision/api/v3/order?symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559&signature=c8db56825ae71d6d79447849e617115f4a920fa2acdcab2b053c4b2838bd6b71" +``` + +For the second set of example parameters (some non-ASCII characters) + +``` +curl -s -v -H "X-MBX-APIKEY: $apiKey" -X POST "https://testnet.binance.vision/api/v3/order?symbol=%EF%BC%91%EF%BC%92%EF%BC%93%EF%BC%94%EF%BC%95%EF%BC%96&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559&signature=e1353ec6b14d888f1164ae9af8228a3dbd508bc82eb867db8ab6046442f33ef3" +``` + +Here is a sample Bash script performing all the steps above: + +``` +apiKey="vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A"secretKey="NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j"payload="symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559"# Sign the requestsignature=$(echo -n "$payload" | openssl dgst -sha256 -hmac "$secretKey")signature=${signature#*= } # Keep only the part after the "= "# Send the requestcurl -H "X-MBX-APIKEY: $apiKey" -X POST "https://testnet.binance.vision/api/v3/order?$payload&signature=$signature" +``` + +#### RSA Keys[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/request-security) + +The signature payload of your request is the query string concatenated without separator to the HTTP body. Any non-ASCII character must be percent-encoded before signing. + +To get your API key, you need to upload your RSA Public Key to your account and a corresponding API key will be provided for you. + +Only `PKCS#8` keys are supported. + +There is one example with a symbol name comprised entirely of ASCII characters and one example with a symbol name containing non-ASCII characters. + +These examples assume the private key is stored in the file `./test-prv-key.pem`. + +Key + +Value + +`apiKey` + +CAvIjXy3F44yW6Pou5k8Dy1swsYDWJZLeoK2r8G4cFDnE9nosRppc2eKc1T8TRTQ + +Example of request with a symbol name comprised entirely of ASCII characters: + +Parameter + +Value + +`symbol` + +BTCUSDT + +`side` + +SELL + +`type` + +LIMIT + +`timeInForce` + +GTC + +`quantity` + +1 + +`price` + +0.2 + +`timestamp` + +1668481559918 + +`recvWindow` + +5000 + +Example of a request with a symbol name containing non-ASCII characters: + +Parameter + +Value + +`symbol` + +123456 + +`side` + +SELL + +`type` + +LIMIT + +`timeInForce` + +GTC + +`quantity` + +1 + +`price` + +0.2 + +`timestamp` + +1668481559918 + +`recvWindow` + +5000 + +**Step 1: Construct the signature payload** + +1. Format parameters as `parameter=value` pairs separated by `&`. +2. Percent-encode the string. + +For the first set of example parameters (ASCII only), the `parameter=value` string should look like this: + +``` +symbol=BTCUSDT&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000 +``` + +After percent-encoding, the signature payload should look like this: + +``` +symbol=BTCUSDT&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000 +``` + +For the second set of example parameters (some non-ASCII characters), the `parameter=value` string should look like this: + +``` +symbol=123456=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000 +``` + +After percent-encoding, the signature payload should look like this: + +``` +symbol=%EF%BC%91%EF%BC%92%EF%BC%93%EF%BC%94%EF%BC%95%EF%BC%96&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000 +``` + +**Step 2: Compute the signature** + +1. Sign the signature payload constructed in Step 1 using the RSASSA-PKCS1-v1\_5 algorithm with SHA-256 hash function. +2. Encode the output in base64. + +Note that the payload and the resulting `signature` are **case-sensitive**. + +For the first set of example parameters (ASCII only): + +``` +$ echo -n 'symbol=BTCUSDT&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000' | openssl dgst -sha256 -sign ./test-prv-key.pem | openssl enc -base64 -A | tr -d '\n'HZ8HOjiJ1s/igS9JA+n7+7Ti/ihtkRF5BIWcPIEluJP6tlbFM/Bf44LfZka/iemtahZAZzcO9TnI5uaXh3++lrqtNonCwp6/245UFWkiW1elpgtVAmJPbogcAv6rSlokztAfWk296ZJXzRDYAtzGH0gq7CgSJKfH+XxaCmR0WcvlKjNQnp12/eKXJYO4tDap8UCBLuyxDnR7oJKLHQHJLP0r0EAVOOSIbrFang/1WOq+Jaq4Efc4XpnTgnwlBbWTmhWDR1pvS9iVEzcSYLHT/fNnMRxFc7u+j3qI//5yuGuu14KR0MuQKKCSpViieD+fIti46sxPTsjSemoUKp0oXA== +``` + +For the second set of example parameters (some non-ASCII characters): + +``` +$ echo -n 'symbol=%EF%BC%91%EF%BC%92%EF%BC%93%EF%BC%94%EF%BC%95%EF%BC%96&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000' | openssl dgst -sha256 -sign ./test-prv-key.pem | openssl enc -base64 -A | tr -d '\n'qJtv66wyp/1mZE+mIFAAMUoTe8xkmLN7/eAZjuC9x1ocxovItHLl/sNK7Wq8QjgiHqGn0bb8P7yVvGBEd1gFe71NQ8aM0M+JNIMz5UFxfeA53rXjFlvsyH1Sig+OuO9Nz5nhCaJ6bEfj2iuv7w27pB3L8MVqmoCi6D9C/QMiLxtPaR70CxtnvoOlIgPmpv2bQy029A31NEK19ieVLkoyp1EUkXRaX3v0mohx8yMnUG1dhX9nUg3Oy8TYZ03DQy7kHDGkMKisNX7rt/GuGx1HIgjFclDGLsbAFIodvSLjm9FbseasMELoxlAJDlwRnW8zo5sQmL0Fz7ao935QBynrng== +``` + +3. Percent-encode the base64 string. + +For the first set of example parameters (ASCII only): + +``` +HZ8HOjiJ1s%2FigS9JA%2Bn7%2B7Ti%2FihtkRF5BIWcPIEluJP6tlbFM%2FBf44LfZka%2FiemtahZAZzcO9TnI5uaXh3%2B%2BlrqtNonCwp6%2F245UFWkiW1elpgtVAmJPbogcAv6rSlokztAfWk296ZJXzRDYAtzGH0gq7CgSJKfH%2BXxaCmR0WcvlKjNQnp12%2FeKXJYO4tDap8UCBLuyxDnR7oJKLHQHJLP0r0EAVOOSIbrFang%2F1WOq%2BJaq4Efc4XpnTgnwlBbWTmhWDR1pvS9iVEzcSYLHT%2FfNnMRxFc7u%2Bj3qI%2F%2F5yuGuu14KR0MuQKKCSpViieD%2BfIti46sxPTsjSemoUKp0oXA%3D%3D +``` + +For the second set of example parameters (some non-ASCII characters): + +``` +qJtv66wyp%2F1mZE%2BmIFAAMUoTe8xkmLN7%2FeAZjuC9x1ocxovItHLl%2FsNK7Wq8QjgiHqGn0bb8P7yVvGBEd1gFe71NQ8aM0M%2BJNIMz5UFxfeA53rXjFlvsyH1Sig%2BOuO9Nz5nhCaJ6bEfj2iuv7w27pB3L8MVqmoCi6D9C%2FQMiLxtPaR70CxtnvoOlIgPmpv2bQy029A31NEK19ieVLkoyp1EUkXRaX3v0mohx8yMnUG1dhX9nUg3Oy8TYZ03DQy7kHDGkMKisNX7rt%2FGuGx1HIgjFclDGLsbAFIodvSLjm9FbseasMELoxlAJDlwRnW8zo5sQmL0Fz7ao935QBynrng%3D%3D +``` + +**Step 3: Add signature to the request** + +Complete the request by adding the `signature` parameter to the query string. + +For the first set of example parameters (ASCII only): + +``` +curl -H "X-MBX-APIKEY: CAvIjXy3F44yW6Pou5k8Dy1swsYDWJZLeoK2r8G4cFDnE9nosRppc2eKc1T8TRTQ" -X POST 'https://testnet.binance.vision/api/v3/order?symbol=BTCUSDT&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000&signature=HZ8HOjiJ1s%2FigS9JA%2Bn7%2B7Ti%2FihtkRF5BIWcPIEluJP6tlbFM%2FBf44LfZka%2FiemtahZAZzcO9TnI5uaXh3%2B%2BlrqtNonCwp6%2F245UFWkiW1elpgtVAmJPbogcAv6rSlokztAfWk296ZJXzRDYAtzGH0gq7CgSJKfH%2BXxaCmR0WcvlKjNQnp12%2FeKXJYO4tDap8UCBLuyxDnR7oJKLHQHJLP0r0EAVOOSIbrFang%2F1WOq%2BJaq4Efc4XpnTgnwlBbWTmhWDR1pvS9iVEzcSYLHT%2FfNnMRxFc7u%2Bj3qI%2F%2F5yuGuu14KR0MuQKKCSpViieD%2BfIti46sxPTsjSemoUKp0oXA%3D%3D' +``` + +For the second set of example parameters (some non-ASCII characters): + +``` +curl -H "X-MBX-APIKEY: CAvIjXy3F44yW6Pou5k8Dy1swsYDWJZLeoK2r8G4cFDnE9nosRppc2eKc1T8TRTQ" -X POST 'https://testnet.binance.vision/api/v3/order?symbol=%EF%BC%91%EF%BC%92%EF%BC%93%EF%BC%94%EF%BC%95%EF%BC%96&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000&signature=qJtv66wyp%2F1mZE%2BmIFAAMUoTe8xkmLN7%2FeAZjuC9x1ocxovItHLl%2FsNK7Wq8QjgiHqGn0bb8P7yVvGBEd1gFe71NQ8aM0M%2BJNIMz5UFxfeA53rXjFlvsyH1Sig%2BOuO9Nz5nhCaJ6bEfj2iuv7w27pB3L8MVqmoCi6D9C%2FQMiLxtPaR70CxtnvoOlIgPmpv2bQy029A31NEK19ieVLkoyp1EUkXRaX3v0mohx8yMnUG1dhX9nUg3Oy8TYZ03DQy7kHDGkMKisNX7rt%2FGuGx1HIgjFclDGLsbAFIodvSLjm9FbseasMELoxlAJDlwRnW8zo5sQmL0Fz7ao935QBynrng%3D%3D' +``` + +Here is a sample Bash script performing all the steps above: + +``` +function rawurlencode { local string="${1}" local strlen=${#string} local encoded="" local pos c o for (( pos=0 ; pos Database + +**Response:** + +``` +{ "symbol": "LTCBTC", "orderId": 1, "orderListId": -1, // This field will always have a value of -1 if not an order list. "clientOrderId": "myOrder1", "price": "0.1", "origQty": "1.0", "executedQty": "0.0", "cummulativeQuoteQty": "0.0", "status": "NEW", "timeInForce": "GTC", "type": "LIMIT", "side": "BUY", "stopPrice": "0.0", "icebergQty": "0.0", "time": 1499827319559, "updateTime": 1499827319559, "isWorking": true, "workingTime": 1499827319559, "origQuoteOrderQty": "0.000000", "selfTradePreventionMode": "NONE"} +``` + +**Note:** The payload above does not show all fields that can appear. Please refer to [Conditional fields in Order Responses](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/trading-endpoints). + +### Cancel order (TRADE)[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/trading-endpoints) + +``` +DELETE /api/v3/order +``` + +Cancel an active order. + +**Weight:** 1 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +orderId + +LONG + +NO + +origClientOrderId + +STRING + +NO + +newClientOrderId + +STRING + +NO + +Used to uniquely identify this cancel. Automatically generated by default. + +cancelRestrictions + +ENUM + +NO + +Supported values: +`ONLY_NEW` - Cancel will succeed if the order status is `NEW`. +`ONLY_PARTIALLY_FILLED` \- Cancel will succeed if order status is `PARTIALLY_FILLED`. + +recvWindow + +DECIMAL + +NO + +The value cannot be greater than `60000`. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +timestamp + +LONG + +YES + +Notes: + +- Either `orderId` or `origClientOrderId` must be sent. +- If both `orderId` and `origClientOrderId` are provided, the `orderId` is searched first, then the `origClientOrderId` from that result is checked against that order. If both conditions are not met the request will be rejected. + +**Data Source:** Matching Engine + +**Response:** + +``` +{ "symbol": "LTCBTC", "origClientOrderId": "myOrder1", "orderId": 4, "orderListId": -1, // Unless it's part of an order list, value will be -1 "clientOrderId": "cancelMyOrder1", "transactTime": 1684804350068, "price": "2.00000000", "origQty": "1.00000000", "executedQty": "0.00000000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "0.00000000", "status": "CANCELED", "timeInForce": "GTC", "type": "LIMIT", "side": "BUY", "selfTradePreventionMode": "NONE"} +``` + +**Notes:** + +- The payload above does not show all fields that can appear in the order response. Please refer to [Conditional fields in Order Responses](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/trading-endpoints). +- The performance for canceling an order (single cancel or as part of a cancel-replace) is always better when only `orderId` is sent. Sending `origClientOrderId` or both `orderId` + `origClientOrderId` will be slower. + +**Regarding `cancelRestrictions`** + +- If the `cancelRestrictions` value is not any of the supported values, the error will be: + +``` +{ "code": -1145, "msg": "Invalid cancelRestrictions"} +``` + +- If the order did not pass the conditions for `cancelRestrictions`, the error will be: + +``` +{ "code": -2011, "msg": "Order was not canceled due to cancel restrictions."} +``` + +### Cancel All Open Orders on a Symbol (TRADE)[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/trading-endpoints) + +``` +DELETE /api/v3/openOrders +``` + +Cancels all active orders on a symbol. This includes orders that are part of an order list. + +**Weight:** 1 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +recvWindow + +DECIMAL + +NO + +The value cannot be greater than `60000`. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +timestamp + +LONG + +YES + +**Data Source:** Matching Engine + +**Response:** + +``` +[ { "symbol": "BTCUSDT", "origClientOrderId": "E6APeyTJvkMvLMYMqu1KQ4", "orderId": 11, "orderListId": -1, "clientOrderId": "pXLV6Hz6mprAcVYpVMTGgx", "transactTime": 1684804350068, "price": "0.089853", "origQty": "0.178622", "executedQty": "0.000000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "0.000000", "status": "CANCELED", "timeInForce": "GTC", "type": "LIMIT", "side": "BUY", "selfTradePreventionMode": "NONE" }, { "symbol": "BTCUSDT", "origClientOrderId": "A3EF2HCwxgZPFMrfwbgrhv", "orderId": 13, "orderListId": -1, "clientOrderId": "pXLV6Hz6mprAcVYpVMTGgx", "transactTime": 1684804350069, "price": "0.090430", "origQty": "0.178622", "executedQty": "0.000000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "0.000000", "status": "CANCELED", "timeInForce": "GTC", "type": "LIMIT", "side": "BUY", "selfTradePreventionMode": "NONE" }, { "orderListId": 1929, "contingencyType": "OCO", "listStatusType": "ALL_DONE", "listOrderStatus": "ALL_DONE", "listClientOrderId": "2inzWQdDvZLHbbAmAozX2N", "transactionTime": 1585230948299, "symbol": "BTCUSDT", "orders": [ { "symbol": "BTCUSDT", "orderId": 20, "clientOrderId": "CwOOIPHSmYywx6jZX77TdL" }, { "symbol": "BTCUSDT", "orderId": 21, "clientOrderId": "461cPg51vQjV3zIMOXNz39" } ], "orderReports": [ { "symbol": "BTCUSDT", "origClientOrderId": "CwOOIPHSmYywx6jZX77TdL", "orderId": 20, "orderListId": 1929, "clientOrderId": "pXLV6Hz6mprAcVYpVMTGgx", "transactTime": 1688005070874, "price": "0.668611", "origQty": "0.690354", "executedQty": "0.000000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "0.000000", "status": "CANCELED", "timeInForce": "GTC", "type": "STOP_LOSS_LIMIT", "side": "BUY", "stopPrice": "0.378131", "icebergQty": "0.017083", "selfTradePreventionMode": "NONE" }, { "symbol": "BTCUSDT", "origClientOrderId": "461cPg51vQjV3zIMOXNz39", "orderId": 21, "orderListId": 1929, "clientOrderId": "pXLV6Hz6mprAcVYpVMTGgx", "transactTime": 1688005070874, "price": "0.008791", "origQty": "0.690354", "executedQty": "0.000000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "0.000000", "status": "CANCELED", "timeInForce": "GTC", "type": "LIMIT_MAKER", "side": "BUY", "icebergQty": "0.639962", "selfTradePreventionMode": "NONE" } ] }] +``` + +### Cancel an Existing Order and Send a New Order (TRADE)[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/trading-endpoints) + +``` +POST /api/v3/order/cancelReplace +``` + +Cancels an existing order and places a new order on the same symbol. + +Filters and Order Count are evaluated before the processing of the cancellation and order placement occurs. + +A new order that was not attempted (i.e. when `newOrderResult: NOT_ATTEMPTED`), will still increase the unfilled order count by 1. + +**Weight:** 1 + +**Unfilled Order Count:** 1 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +side + +ENUM + +YES + +type + +ENUM + +YES + +cancelReplaceMode + +ENUM + +YES + +The allowed values are: +`STOP_ON_FAILURE` - If the cancel request fails, the new order placement will not be attempted. +`ALLOW_FAILURE` - new order placement will be attempted even if cancel request fails. + +timeInForce + +ENUM + +NO + +quantity + +DECIMAL + +NO + +quoteOrderQty + +DECIMAL + +NO + +price + +DECIMAL + +NO + +cancelNewClientOrderId + +STRING + +NO + +Used to uniquely identify this cancel. Automatically generated by default. + +cancelOrigClientOrderId + +STRING + +NO + +Either `cancelOrderId` or `cancelOrigClientOrderId` must be sent. + +If both `cancelOrderId` and `cancelOrigClientOrderId` parameters are provided, the `cancelOrderId` is searched first, then the `cancelOrigClientOrderId` from that result is checked against that order. + +If both conditions are not met the request will be rejected. + +cancelOrderId + +LONG + +NO + +Either `cancelOrderId` or `cancelOrigClientOrderId` must be sent. + +If both `cancelOrderId` and `cancelOrigClientOrderId` parameters are provided, the `cancelOrderId` is searched first, then the `cancelOrigClientOrderId` from that result is checked against that order. + +If both conditions are not met the request will be rejected. + +newClientOrderId + +STRING + +NO + +Used to identify the new order. + +strategyId + +LONG + +NO + +strategyType + +INT + +NO + +The value cannot be less than `1000000`. + +stopPrice + +DECIMAL + +NO + +trailingDelta + +LONG + +NO + +See [Trailing Stop order FAQ](https://developers.binance.com/docs/binance-spot-api-docs/faqs/trailing-stop-faq) + +icebergQty + +DECIMAL + +NO + +newOrderRespType + +ENUM + +NO + +Allowed values: +`ACK`, `RESULT`, `FULL` +`MARKET` and `LIMIT` orders types default to `FULL`; all other orders default to `ACK` + +selfTradePreventionMode + +ENUM + +NO + +The allowed enums is dependent on what is configured on the symbol. The possible supported values are: [STP Modes](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums). + +cancelRestrictions + +ENUM + +NO + +Supported values: +`ONLY_NEW` - Cancel will succeed if the order status is `NEW`. +`ONLY_PARTIALLY_FILLED` \- Cancel will succeed if order status is `PARTIALLY_FILLED`. For more information please refer to [Regarding `cancelRestrictions`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/trading-endpoints) + +orderRateLimitExceededMode + +ENUM + +No + +Supported values: +`DO_NOTHING` (default)- will only attempt to cancel the order if account has not exceeded the unfilled order rate limit +`CANCEL_ONLY` - will always cancel the order + +pegPriceType + +ENUM + +NO + +`PRIMARY_PEG` or `MARKET_PEG` +See [Pegged Orders](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/trading-endpoints) + +pegOffsetValue + +INT + +NO + +Price level to peg the price to (max: 100) +See [Pegged Orders](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/trading-endpoints) + +pegOffsetType + +ENUM + +NO + +Only `PRICE_LEVEL` is supported +See [Pegged Orders](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/trading-endpoints) + +recvWindow + +DECIMAL + +NO + +The value cannot be greater than `60000`. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +timestamp + +LONG + +YES + +Similar to `POST /api/v3/order`, additional mandatory parameters are determined by `type`. + +Response format varies depending on whether the processing of the message succeeded, partially succeeded, or failed. + +**Data Source:** Matching Engine + +Request + +Response + +`cancelReplaceMode` + +`orderRateLimitExceededMode` + +Unfilled Order Count + +`cancelResult` + +`newOrderResult` + +`status` + +`STOP_ON_FAILURE` + +`DO_NOTHING` + +Within Limits + +✅ `SUCCESS` + +✅ `SUCCESS` + +`200` + +❌ `FAILURE` + +➖ `NOT_ATTEMPTED` + +`400` + +✅ `SUCCESS` + +❌ `FAILURE` + +`409` + +Exceeds Limits + +✅ `SUCCESS` + +✅ `SUCCESS` + +N/A + +❌ `FAILURE` + +➖ `NOT_ATTEMPTED` + +N/A + +✅ `SUCCESS` + +❌ `FAILURE` + +N/A + +`CANCEL_ONLY` + +Within Limits + +✅ `SUCCESS` + +✅ `SUCCESS` + +`200` + +❌ `FAILURE` + +➖ `NOT_ATTEMPTED` + +`400` + +✅ `SUCCESS` + +❌ `FAILURE` + +`409` + +Exceeds Limits + +❌ `FAILURE` + +➖ `NOT_ATTEMPTED` + +`429` + +✅ `SUCCESS` + +❌ `FAILURE` + +`429` + +`ALLOW_FAILURE` + +`DO_NOTHING` + +Within Limits + +✅ `SUCCESS` + +✅ `SUCCESS` + +`200` + +❌ `FAILURE` + +❌ `FAILURE` + +`400` + +❌ `FAILURE` + +✅ `SUCCESS` + +`409` + +✅ `SUCCESS` + +❌ `FAILURE` + +`409` + +Exceeds Limits + +✅ `SUCCESS` + +✅ `SUCCESS` + +N/A + +❌ `FAILURE` + +❌ `FAILURE` + +N/A + +❌ `FAILURE` + +✅ `SUCCESS` + +N/A + +✅ `SUCCESS` + +❌ `FAILURE` + +N/A + +`CANCEL_ONLY` + +Within Limits + +✅ `SUCCESS` + +✅ `SUCCESS` + +`200` + +❌ `FAILURE` + +❌ `FAILURE` + +`400` + +❌ `FAILURE` + +✅ `SUCCESS` + +`409` + +✅ `SUCCESS` + +❌ `FAILURE` + +`409` + +Exceeds Limits + +✅ `SUCCESS` + +✅ `SUCCESS` + +`N/A` + +❌ `FAILURE` + +❌ `FAILURE` + +`400` + +❌ `FAILURE` + +✅ `SUCCESS` + +N/A + +✅ `SUCCESS` + +❌ `FAILURE` + +`409` + +**Response SUCCESS and account has not exceeded the unfilled order count:** + +``` +// Both the cancel order placement and new order placement succeeded.{ "cancelResult": "SUCCESS", "newOrderResult": "SUCCESS", "cancelResponse": { "symbol": "BTCUSDT", "origClientOrderId": "DnLo3vTAQcjha43lAZhZ0y", "orderId": 9, "orderListId": -1, "clientOrderId": "osxN3JXAtJvKvCqGeMWMVR", "transactTime": 1684804350068, "price": "0.01000000", "origQty": "0.000100", "executedQty": "0.00000000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "0.00000000", "status": "CANCELED", "timeInForce": "GTC", "type": "LIMIT", "side": "SELL", "selfTradePreventionMode": "NONE" }, "newOrderResponse": { "symbol": "BTCUSDT", "orderId": 10, "orderListId": -1, "clientOrderId": "wOceeeOzNORyLiQfw7jd8S", "transactTime": 1652928801803, "price": "0.02000000", "origQty": "0.040000", "executedQty": "0.00000000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "0.00000000", "status": "NEW", "timeInForce": "GTC", "type": "LIMIT", "side": "BUY", "workingTime": 1669277163808, "fills": [], "selfTradePreventionMode": "NONE" }} +``` + +**Response when Cancel Order Fails with STOP\_ON FAILURE and account has not exceeded their unfilled order count:** + +``` +{ "code": -2022, "msg": "Order cancel-replace failed.", "data": { "cancelResult": "FAILURE", "newOrderResult": "NOT_ATTEMPTED", "cancelResponse": { "code": -2011, "msg": "Unknown order sent." }, "newOrderResponse": null }} +``` + +**Response when Cancel Order Succeeds but New Order Placement Fails and account has not exceeded their unfilled order count:** + +``` +{ "code": -2021, "msg": "Order cancel-replace partially failed.", "data": { "cancelResult": "SUCCESS", "newOrderResult": "FAILURE", "cancelResponse": { "symbol": "BTCUSDT", "origClientOrderId": "86M8erehfExV8z2RC8Zo8k", "orderId": 3, "orderListId": -1, "clientOrderId": "G1kLo6aDv2KGNTFcjfTSFq", "transactTime": 1684804350068, "price": "0.006123", "origQty": "10000.000000", "executedQty": "0.000000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "0.000000", "status": "CANCELED", "timeInForce": "GTC", "type": "LIMIT_MAKER", "side": "SELL", "selfTradePreventionMode": "NONE" }, "newOrderResponse": { "code": -2010, "msg": "Order would immediately match and take." } }} +``` + +**Response when Cancel Order fails with ALLOW\_FAILURE and account has not exceeded their unfilled order count:** + +``` +{ "code": -2021, "msg": "Order cancel-replace partially failed.", "data": { "cancelResult": "FAILURE", "newOrderResult": "SUCCESS", "cancelResponse": { "code": -2011, "msg": "Unknown order sent." }, "newOrderResponse": { "symbol": "BTCUSDT", "orderId": 11, "orderListId": -1, "clientOrderId": "pfojJMg6IMNDKuJqDxvoxN", "transactTime": 1648540168818 } }} +``` + +**Response when both Cancel Order and New Order Placement fail using `cancelReplaceMode=ALLOW_FAILURE` and account has not exceeded their unfilled order count:** + +``` +{ "code": -2022, "msg": "Order cancel-replace failed.", "data": { "cancelResult": "FAILURE", "newOrderResult": "FAILURE", "cancelResponse": { "code": -2011, "msg": "Unknown order sent." }, "newOrderResponse": { "code": -2010, "msg": "Order would immediately match and take." } }} +``` + +**Response when using `orderRateLimitExceededMode=DO_NOTHING` and account's unfilled order count has been exceeded:** + +``` +{ "code": -1015, "msg": "Too many new orders; current limit is 1 orders per 10 SECOND."} +``` + +**Response when using `orderRateLimitExceededMode=CANCEL_ONLY` and account's unfilled order count has been exceeded:** + +``` +{ "code": -2021, "msg": "Order cancel-replace partially failed.", "data": { "cancelResult": "SUCCESS", "newOrderResult": "FAILURE", "cancelResponse": { "symbol": "LTCBNB", "origClientOrderId": "GKt5zzfOxRDSQLveDYCTkc", "orderId": 64, "orderListId": -1, "clientOrderId": "loehOJF3FjoreUBDmv739R", "transactTime": 1715779007228, "price": "1.00", "origQty": "10.00000000", "executedQty": "0.00000000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "0.00", "status": "CANCELED", "timeInForce": "GTC", "type": "LIMIT", "side": "SELL", "selfTradePreventionMode": "NONE" }, "newOrderResponse": { "code": -1015, "msg": "Too many new orders; current limit is 1 orders per 10 SECOND." } }} +``` + +**Notes:** + +- The payload above does not show all fields that can appear. Please refer to [Conditional fields in Order Responses](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/trading-endpoints). +- The performance for canceling an order (single cancel or as part of a cancel-replace) is always better when only `orderId` is sent. Sending `origClientOrderId` or both `orderId` + `origClientOrderId` will be slower. + +### Order Amend Keep Priority (TRADE)[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/trading-endpoints) + +``` +PUT /api/v3/order/amend/keepPriority +``` + +Reduce the quantity of an existing open order. + +This adds 0 orders to the `EXCHANGE_MAX_ORDERS` filter and the `MAX_NUM_ORDERS` filter. + +Read [Order Amend Keep Priority FAQ](https://developers.binance.com/docs/binance-spot-api-docs/faqs/order_amend_keep_priority) to learn more. + +**Weight**: 4 + +**Unfilled Order Count:** 0 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +orderId + +LONG + +NO\* + +`orderId` or `origClientOrderId` must be sent + +origClientOrderId + +STRING + +NO\* + +`orderId` or `origClientOrderId` must be sent + +newClientOrderId + +STRING + +NO\* + +The new client order ID for the order after being amended. +If not sent, one will be randomly generated. +It is possible to reuse the current clientOrderId by sending it as the `newClientOrderId`. + +newQty + +DECIMAL + +YES + +`newQty` must be greater than 0 and less than the order's quantity. + +recvWindow + +DECIMAL + +NO + +The value cannot be greater than `60000`. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +timestamp + +LONG + +YES + +**Data Source**: Matching Engine + +**Response:** Response for a single order: + +``` +{ "transactTime": 1741926410255, "executionId": 75, "amendedOrder": { "symbol": "BTCUSDT", "orderId": 33, "orderListId": -1, "origClientOrderId": "5xrgbMyg6z36NzBn2pbT8H", "clientOrderId": "PFaq6hIHxqFENGfdtn4J6Q", "price": "6.00000000", "qty": "5.00000000", "executedQty": "0.00000000", "preventedQty": "0.00000000", "quoteOrderQty": "0.00000000", "cumulativeQuoteQty": "0.00000000", "status": "NEW", "timeInForce": "GTC", "type": "LIMIT", "side": "SELL", "workingTime": 1741926410242, "selfTradePreventionMode": "NONE" }} +``` + +Response for an order that is part of an Order list: + +``` +{ "transactTime": 1741669661670, "executionId": 22, "amendedOrder": { "symbol": "BTCUSDT", "orderId": 9, "orderListId": 1, "origClientOrderId": "W0fJ9fiLKHOJutovPK3oJp", "clientOrderId": "UQ1Np3bmQ71jJzsSDW9Vpi", "price": "0.00000000", "qty": "4.00000000", "executedQty": "0.00000000", "preventedQty": "0.00000000", "quoteOrderQty": "0.00000000", "cumulativeQuoteQty": "0.00000000", "status": "PENDING_NEW", "timeInForce": "GTC", "type": "MARKET", "side": "BUY", "selfTradePreventionMode": "NONE" }, "listStatus": { "orderListId": 1, "contingencyType": "OTO", "listOrderStatus": "EXECUTING", "listClientOrderId": "AT7FTxZXylVSwRoZs52mt3", "symbol": "BTCUSDT", "orders": [ { "symbol": "BTCUSDT", "orderId": 8, "clientOrderId": "GkwwHZUUbFtZOoH1YsZk9Q" }, { "symbol": "BTCUSDT", "orderId": 9, "clientOrderId": "UQ1Np3bmQ71jJzsSDW9Vpi" } ] }} +``` + +**Note:** The payloads above do not show all fields that can appear. Please refer to [Conditional fields in Order Responses](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/trading-endpoints). + +### Order lists[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/trading-endpoints) + +#### New Order list - OCO (TRADE)[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/trading-endpoints) + +``` +POST /api/v3/orderList/oco +``` + +Send in an one-cancels-the-other (OCO) pair, where activation of one order immediately cancels the other. + +- An OCO has 2 orders called the **above order** and **below order**. +- One of the orders must be a `LIMIT_MAKER/TAKE_PROFIT/TAKE_PROFIT_LIMIT` order and the other must be `STOP_LOSS` or `STOP_LOSS_LIMIT` order. +- Price restrictions + - If the OCO is on the `SELL` side: + - `LIMIT_MAKER/TAKE_PROFIT_LIMIT` `price` > Last Traded Price > `STOP_LOSS/STOP_LOSS_LIMIT` `stopPrice` + - `TAKE_PROFIT stopPrice` \> Last Traded Price > `STOP_LOSS/STOP_LOSS_LIMIT stopPrice` + - If the OCO is on the `BUY` side: + - `LIMIT_MAKER/TAKE_PROFIT_LIMIT price` < Last Traded Price < `stopPrice` + - `TAKE_PROFIT stopPrice` < Last Traded Price < `STOP_LOSS/STOP_LOSS_LIMIT stopPrice` +- OCOs add **2 orders** to the `EXCHANGE_MAX_ORDERS` filter and the `MAX_NUM_ORDERS` filter. + +**Weight:** 1 + +**Unfilled Order Count:** 2 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +Yes + +listClientOrderId + +STRING + +No + +Arbitrary unique ID among open order lists. Automatically generated if not sent. +A new order list with the same `listClientOrderId` is accepted only when the previous one is filled or completely expired. +`listClientOrderId` is distinct from the `aboveClientOrderId` and the `belowCLientOrderId`. + +side + +ENUM + +Yes + +`BUY` or `SELL` + +quantity + +DECIMAL + +Yes + +Quantity for both orders of the order list. + +aboveType + +ENUM + +Yes + +Supported values: `STOP_LOSS_LIMIT`, `STOP_LOSS`, `LIMIT_MAKER`, `TAKE_PROFIT`, `TAKE_PROFIT_LIMIT` + +aboveClientOrderId + +STRING + +No + +Arbitrary unique ID among open orders for the above order. Automatically generated if not sent + +aboveIcebergQty + +LONG + +No + +Note that this can only be used if `aboveTimeInForce` is `GTC`. + +abovePrice + +DECIMAL + +No + +Can be used if `aboveType` is `STOP_LOSS_LIMIT` , `LIMIT_MAKER`, or `TAKE_PROFIT_LIMIT` to specify the limit price. + +aboveStopPrice + +DECIMAL + +No + +Can be used if `aboveType` is `STOP_LOSS`, `STOP_LOSS_LIMIT`, `TAKE_PROFIT`, `TAKE_PROFIT_LIMIT`. +Either `aboveStopPrice` or `aboveTrailingDelta` or both, must be specified. + +aboveTrailingDelta + +LONG + +No + +See [Trailing Stop order FAQ](https://developers.binance.com/docs/binance-spot-api-docs/faqs/trailing-stop-faq). + +aboveTimeInForce + +ENUM + +No + +Required if `aboveType` is `STOP_LOSS_LIMIT` or `TAKE_PROFIT_LIMIT`. + +aboveStrategyId + +LONG + +No + +Arbitrary numeric value identifying the above order within an order strategy. + +aboveStrategyType + +INT + +No + +Arbitrary numeric value identifying the above order strategy. +Values smaller than 1000000 are reserved and cannot be used. + +abovePegPriceType + +ENUM + +NO + +See [Pegged Orders](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/trading-endpoints) + +abovePegOffsetType + +ENUM + +NO + +abovePegOffsetValue + +INT + +NO + +belowType + +ENUM + +Yes + +Supported values: `STOP_LOSS`, `STOP_LOSS_LIMIT`, `TAKE_PROFIT`,`TAKE_PROFIT_LIMIT` + +belowClientOrderId + +STRING + +No + +Arbitrary unique ID among open orders for the below order. Automatically generated if not sent + +belowIcebergQty + +LONG + +No + +Note that this can only be used if `belowTimeInForce` is `GTC`. + +belowPrice + +DECIMAL + +No + +Can be used if `belowType` is `STOP_LOSS_LIMIT`, `TAKE_PROFIT_LIMIT`, or `LIMIT_MAKER` to specify the limit price. + +belowStopPrice + +DECIMAL + +No + +Can be used if `belowType` is `STOP_LOSS`, `STOP_LOSS_LIMIT`, `TAKE_PROFIT` or `TAKE_PROFIT_LIMIT`. Either `belowStopPrice` or `belowTrailingDelta` or both, must be specified. +Either `belowStopPrice` or `belowTrailingDelta` or both, must be specified. + +belowTrailingDelta + +LONG + +No + +See [Trailing Stop order FAQ](https://developers.binance.com/docs/binance-spot-api-docs/faqs/trailing-stop-faq). + +belowTimeInForce + +ENUM + +No + +Required if `belowType` is `STOP_LOSS_LIMIT` or `TAKE_PROFIT_LIMIT`. + +belowStrategyId + +LONG + +No + +Arbitrary numeric value identifying the below order within an order strategy. + +belowStrategyType + +INT + +No + +Arbitrary numeric value identifying the below order strategy. +Values smaller than 1000000 are reserved and cannot be used. + +belowPegPriceType + +ENUM + +NO + +belowPegOffsetType + +ENUM + +NO + +belowPegOffsetValue + +INT + +NO + +newOrderRespType + +ENUM + +No + +Select response format: `ACK`, `RESULT`, `FULL` + +selfTradePreventionMode + +ENUM + +No + +The allowed enums is dependent on what is configured on the symbol. Supported values: [STP Modes](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums) + +recvWindow + +DECIMAL + +No + +The value cannot be greater than `60000`. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +timestamp + +LONG + +Yes + +**Data Source:** Matching Engine + +**Response:** + +Response format for `orderReports` is selected using the `newOrderRespType` parameter. The following example is for the `RESULT` response type. See [`POST /api/v3/order`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/trading-endpoints) for more examples. + +``` +{ "orderListId": 1, "contingencyType": "OCO", "listStatusType": "EXEC_STARTED", "listOrderStatus": "EXECUTING", "listClientOrderId": "lH1YDkuQKWiXVXHPSKYEIp", "transactionTime": 1710485608839, "symbol": "LTCBTC", "orders": [ { "symbol": "LTCBTC", "orderId": 10, "clientOrderId": "44nZvqpemY7sVYgPYbvPih" }, { "symbol": "LTCBTC", "orderId": 11, "clientOrderId": "NuMp0nVYnciDiFmVqfpBqK" } ], "orderReports": [ { "symbol": "LTCBTC", "orderId": 10, "orderListId": 1, "clientOrderId": "44nZvqpemY7sVYgPYbvPih", "transactTime": 1710485608839, "price": "1.00000000", "origQty": "5.00000000", "executedQty": "0.00000000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "0.00000000", "status": "NEW", "timeInForce": "GTC", "type": "STOP_LOSS_LIMIT", "side": "SELL", "stopPrice": "1.00000000", "workingTime": -1, "icebergQty": "1.00000000", "selfTradePreventionMode": "NONE" }, { "symbol": "LTCBTC", "orderId": 11, "orderListId": 1, "clientOrderId": "NuMp0nVYnciDiFmVqfpBqK", "transactTime": 1710485608839, "price": "3.00000000", "origQty": "5.00000000", "executedQty": "0.00000000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "0.00000000", "status": "NEW", "timeInForce": "GTC", "type": "LIMIT_MAKER", "side": "SELL", "workingTime": 1710485608839, "selfTradePreventionMode": "NONE" } ]} +``` + +#### New Order list - OTO (TRADE)[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/trading-endpoints) + +``` +POST /api/v3/orderList/oto +``` + +Place an OTO. + +- 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 `EXCHANGE_MAX_NUM_ORDERS` filter and `MAX_NUM_ORDERS` filter. + +**Weight:** 1 + +**Unfilled Order Count:** 2 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +listClientOrderId + +STRING + +NO + +Arbitrary unique ID among open order lists. Automatically generated if not sent. +A new order list with the same listClientOrderId is accepted only when the previous one is filled or completely expired. +`listClientOrderId` is distinct from the `workingClientOrderId` and the `pendingClientOrderId`. + +newOrderRespType + +ENUM + +NO + +Format of the JSON response. Supported values: [Order Response Type](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums) + +selfTradePreventionMode + +ENUM + +NO + +The allowed values are dependent on what is configured on the symbol. Supported values: [STP Modes](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums) + +workingType + +ENUM + +YES + +Supported values: `LIMIT`,`LIMIT_MAKER` + +workingSide + +ENUM + +YES + +Supported values: [Order Side](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums) + +workingClientOrderId + +STRING + +NO + +Arbitrary unique ID among open orders for the working order. +Automatically generated if not sent. + +workingPrice + +DECIMAL + +YES + +workingQuantity + +DECIMAL + +YES + +Sets the quantity for the working order. + +workingIcebergQty + +DECIMAL + +NO + +This can only be used if `workingTimeInForce` is `GTC`, or if `workingType` is `LIMIT_MAKER`. + +workingTimeInForce + +ENUM + +NO + +Supported values: [Time In Force](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums) + +workingStrategyId + +LONG + +NO + +Arbitrary numeric value identifying the working order within an order strategy. + +workingStrategyType + +INT + +NO + +Arbitrary numeric value identifying the working order strategy. +Values smaller than 1000000 are reserved and cannot be used. + +workingPegPriceType + +ENUM + +NO + +See [Pegged Orders](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/trading-endpoints) + +workingPegOffsetType + +ENUM + +NO + +workingPegOffsetValue + +INT + +NO + +pendingType + +ENUM + +YES + +Supported values: [Order Types](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/trading-endpoints) +Note that `MARKET` orders using `quoteOrderQty` are not supported. + +pendingSide + +ENUM + +YES + +Supported values: [Order Side](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums) + +pendingClientOrderId + +STRING + +NO + +Arbitrary unique ID among open orders for the pending order. +Automatically generated if not sent. + +pendingPrice + +DECIMAL + +NO + +pendingStopPrice + +DECIMAL + +NO + +pendingTrailingDelta + +DECIMAL + +NO + +pendingQuantity + +DECIMAL + +YES + +Sets the quantity for the pending order. + +pendingIcebergQty + +DECIMAL + +NO + +This can only be used if `pendingTimeInForce` is `GTC` or if `pendingType` is `LIMIT_MAKER`. + +pendingTimeInForce + +ENUM + +NO + +Supported values: [Time In Force](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums) + +pendingStrategyId + +LONG + +NO + +Arbitrary numeric value identifying the pending order within an order strategy. + +pendingStrategyType + +INT + +NO + +Arbitrary numeric value identifying the pending order strategy. +Values smaller than 1000000 are reserved and cannot be used. + +pendingPegPriceType + +ENUM + +NO + +See [Pegged Orders](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/trading-endpoints) + +pendingPegOffsetType + +ENUM + +NO + +pendingPegOffsetValue + +INT + +NO + +recvWindow + +DECIMAL + +NO + +The value cannot be greater than `60000`. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +timestamp + +LONG + +YES + +**Mandatory parameters based on `pendingType` or `workingType`** + +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` + +**Data Source:** + +Matching Engine + +**Response:** + +``` +{ "orderListId": 0, "contingencyType": "OTO", "listStatusType": "EXEC_STARTED", "listOrderStatus": "EXECUTING", "listClientOrderId": "yl2ERtcar1o25zcWtqVBTC", "transactionTime": 1712289389158, "symbol": "LTCBTC", "orders": [ { "symbol": "LTCBTC", "orderId": 4, "clientOrderId": "Bq17mn9fP6vyCn75Jw1xya" }, { "symbol": "LTCBTC", "orderId": 5, "clientOrderId": "arLFo0zGJVDE69cvGBaU0d" } ], "orderReports": [ { "symbol": "LTCBTC", "orderId": 4, "orderListId": 0, "clientOrderId": "Bq17mn9fP6vyCn75Jw1xya", "transactTime": 1712289389158, "price": "1.00000000", "origQty": "1.00000000", "executedQty": "0.00000000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "0.00000000", "status": "NEW", "timeInForce": "GTC", "type": "LIMIT", "side": "SELL", "workingTime": 1712289389158, "selfTradePreventionMode": "NONE" }, { "symbol": "LTCBTC", "orderId": 5, "orderListId": 0, "clientOrderId": "arLFo0zGJVDE69cvGBaU0d", "transactTime": 1712289389158, "price": "0.00000000", "origQty": "5.00000000", "executedQty": "0.00000000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "0.00000000", "status": "PENDING_NEW", "timeInForce": "GTC", "type": "MARKET", "side": "BUY", "workingTime": -1, "selfTradePreventionMode": "NONE" } ]} +``` + +**Note:** The payload above does not show all fields that can appear. Please refer to [Conditional fields in Order Responses](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/trading-endpoints). + +#### New Order list - OTOCO (TRADE)[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/trading-endpoints) + +``` +POST /api/v3/orderList/otoco +``` + +Place an OTOCO. + +- 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](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/trading-endpoints). +- 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](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/trading-endpoints). +- OTOCOs add **3 orders** to the `EXCHANGE_MAX_NUM_ORDERS` filter and `MAX_NUM_ORDERS` filter. + +**Weight:** 1 + +**Unfilled Order Count:** 3 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +listClientOrderId + +STRING + +NO + +Arbitrary unique ID among open order lists. Automatically generated if not sent. +A new order list with the same listClientOrderId is accepted only when the previous one is filled or completely expired. +`listClientOrderId` is distinct from the `workingClientOrderId`, `pendingAboveClientOrderId`, and the `pendingBelowClientOrderId`. + +newOrderRespType + +ENUM + +NO + +Format of the JSON response. Supported values: [Order Response Type](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums) + +selfTradePreventionMode + +ENUM + +NO + +The allowed values are dependent on what is configured on the symbol. Supported values: [STP Modes](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums) + +workingType + +ENUM + +YES + +Supported values: `LIMIT`, `LIMIT_MAKER` + +workingSide + +ENUM + +YES + +Supported values: [Order side](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums) + +workingClientOrderId + +STRING + +NO + +Arbitrary unique ID among open orders for the working order. +Automatically generated if not sent. + +workingPrice + +DECIMAL + +YES + +workingQuantity + +DECIMAL + +YES + +workingIcebergQty + +DECIMAL + +NO + +This can only be used if `workingTimeInForce` is `GTC` or if `workingType` is `LIMIT_MAKER`. + +workingTimeInForce + +ENUM + +NO + +Supported values: [Time In Force](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums) + +workingStrategyId + +LONG + +NO + +Arbitrary numeric value identifying the working order within an order strategy. + +workingStrategyType + +INT + +NO + +Arbitrary numeric value identifying the working order strategy. +Values smaller than 1000000 are reserved and cannot be used. + +workingPegPriceType + +ENUM + +NO + +See [Pegged Orders](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/trading-endpoints) + +workingPegOffsetType + +ENUM + +NO + +workingPegOffsetValue + +INT + +NO + +pendingSide + +ENUM + +YES + +Supported values: [Order side](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums) + +pendingQuantity + +DECIMAL + +YES + +pendingAboveType + +ENUM + +YES + +Supported values: `STOP_LOSS_LIMIT`, `STOP_LOSS`, `LIMIT_MAKER`, `TAKE_PROFIT`, `TAKE_PROFIT_LIMIT` + +pendingAboveClientOrderId + +STRING + +NO + +Arbitrary unique ID among open orders for the pending above order. +Automatically generated if not sent. + +pendingAbovePrice + +DECIMAL + +NO + +Can be used if `pendingAboveType` is `STOP_LOSS_LIMIT` , `LIMIT_MAKER`, or `TAKE_PROFIT_LIMIT` to specify the limit price. + +pendingAboveStopPrice + +DECIMAL + +NO + +Can be used if `pendingAboveType` is `STOP_LOSS`, `STOP_LOSS_LIMIT`, `TAKE_PROFIT`, or `TAKE_PROFIT_LIMIT` + +pendingAboveTrailingDelta + +DECIMAL + +NO + +See [Trailing Stop FAQ](https://developers.binance.com/docs/binance-spot-api-docs/faqs/trailing-stop-faq) + +pendingAboveIcebergQty + +DECIMAL + +NO + +This can only be used if `pendingAboveTimeInForce` is `GTC` or if `pendingAboveType` is `LIMIT_MAKER`. + +pendingAboveTimeInForce + +ENUM + +NO + +pendingAboveStrategyId + +LONG + +NO + +Arbitrary numeric value identifying the pending above order within an order strategy. + +pendingAboveStrategyType + +INT + +NO + +Arbitrary numeric value identifying the pending above order strategy. +Values smaller than 1000000 are reserved and cannot be used. + +pendingAbovePegPriceType + +ENUM + +NO + +See [Pegged Orders](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/trading-endpoints) + +pendingAbovePegOffsetType + +ENUM + +NO + +pendingAbovePegOffsetValue + +INT + +NO + +pendingBelowType + +ENUM + +NO + +Supported values: `STOP_LOSS`, `STOP_LOSS_LIMIT`, `TAKE_PROFIT`,`TAKE_PROFIT_LIMIT` + +pendingBelowClientOrderId + +STRING + +NO + +Arbitrary unique ID among open orders for the pending below order. +Automatically generated if not sent. + +pendingBelowPrice + +DECIMAL + +NO + +Can be used if `pendingBelowType` is `STOP_LOSS_LIMIT` or `TAKE_PROFIT_LIMIT` to specify limit price. + +pendingBelowStopPrice + +DECIMAL + +NO + +Can be used if `pendingBelowType` is `STOP_LOSS`, `STOP_LOSS_LIMIT`, `TAKE_PROFIT`, or `TAKE_PROFIT_LIMIT`. +Either `pendingBelowStopPrice` or `pendingBelowTrailingDelta` or both, must be specified. + +pendingBelowTrailingDelta + +DECIMAL + +NO + +pendingBelowIcebergQty + +DECIMAL + +NO + +This can only be used if `pendingBelowTimeInForce` is `GTC` or if `pendingBelowType` is `LIMIT_MAKER`. + +pendingBelowTimeInForce + +ENUM + +NO + +Supported values: [Time In Force](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums) + +pendingBelowStrategyId + +LONG + +NO + +Arbitrary numeric value identifying the pending below order within an order strategy. + +pendingBelowStrategyType + +INT + +NO + +Arbitrary numeric value identifying the pending below order strategy. +Values smaller than 1000000 are reserved and cannot be used. + +pendingBelowPegPriceType + +ENUM + +NO + +See [Pegged Orders](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/trading-endpoints) + +pendingBelowPegOffsetType + +ENUM + +NO + +pendingBelowPegOffsetValue + +INT + +NO + +recvWindow + +DECIMAL + +NO + +The value cannot be greater than `60000`. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +timestamp + +LONG + +YES + +**Mandatory parameters based on `pendingAboveType`, `pendingBelowType` or `workingType`** + +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/TAKE_PROFIT` + +`pendingAboveStopPrice` and/or `pendingAboveTrailingDelta` + +`pendingAboveType=STOP_LOSS_LIMIT/TAKE_PROFIT_LIMIT` + +`pendingAbovePrice`, `pendingAboveStopPrice` and/or `pendingAboveTrailingDelta`, `pendingAboveTimeInForce` + +`pendingBelowType`\= `LIMIT_MAKER` + +`pendingBelowPrice` + +`pendingBelowType= STOP_LOSS/TAKE_PROFIT` + +`pendingBelowStopPrice` and/or `pendingBelowTrailingDelta` + +`pendingBelowType=STOP_LOSS_LIMIT/TAKE_PROFIT_LIMIT` + +`pendingBelowPrice`, `pendingBelowStopPrice` and/or `pendingBelowTrailingDelta`, `pendingBelowTimeInForce` + +**Data Source:** + +Matching Engine + +**Response:** + +``` +{ "orderListId": 1, "contingencyType": "OTO", "listStatusType": "EXEC_STARTED", "listOrderStatus": "EXECUTING", "listClientOrderId": "RumwQpBaDctlUu5jyG5rs0", "transactionTime": 1712291372842, "symbol": "LTCBTC", "orders": [ { "symbol": "LTCBTC", "orderId": 6, "clientOrderId": "fM9Y4m23IFJVCQmIrlUmMK" }, { "symbol": "LTCBTC", "orderId": 7, "clientOrderId": "6pcQbFIzTXGZQ1e2MkGDq4" }, { "symbol": "LTCBTC", "orderId": 8, "clientOrderId": "r4JMv9cwAYYUwwBZfbussx" } ], "orderReports": [ { "symbol": "LTCBTC", "orderId": 6, "orderListId": 1, "clientOrderId": "fM9Y4m23IFJVCQmIrlUmMK", "transactTime": 1712291372842, "price": "1.00000000", "origQty": "1.00000000", "executedQty": "0.00000000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "0.00000000", "status": "NEW", "timeInForce": "GTC", "type": "LIMIT", "side": "SELL", "workingTime": 1712291372842, "selfTradePreventionMode": "NONE" }, { "symbol": "LTCBTC", "orderId": 7, "orderListId": 1, "clientOrderId": "6pcQbFIzTXGZQ1e2MkGDq4", "transactTime": 1712291372842, "price": "1.00000000", "origQty": "5.00000000", "executedQty": "0.00000000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "0.00000000", "status": "PENDING_NEW", "timeInForce": "IOC", "type": "STOP_LOSS_LIMIT", "side": "BUY", "stopPrice": "6.00000000", "workingTime": -1, "selfTradePreventionMode": "NONE" }, { "symbol": "LTCBTC", "orderId": 8, "orderListId": 1, "clientOrderId": "r4JMv9cwAYYUwwBZfbussx", "transactTime": 1712291372842, "price": "3.00000000", "origQty": "5.00000000", "executedQty": "0.00000000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "0.00000000", "status": "PENDING_NEW", "timeInForce": "GTC", "type": "LIMIT_MAKER", "side": "BUY", "workingTime": -1, "selfTradePreventionMode": "NONE" } ]} +``` + +**Note:** The payload above does not show all fields that can appear. Please refer to [Conditional fields in Order Responses](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/trading-endpoints). + +#### New Order List - OPO (TRADE)[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/trading-endpoints) + +``` +POST /api/v3/orderList/opo +``` + +Place an [OPO](https://developers.binance.com/docs/binance-spot-api-docs/faqs/opo). + +- OPOs add 2 orders to the EXCHANGE\_MAX\_NUM\_ORDERS filter and MAX\_NUM\_ORDERS filter. + +**Weight:** 1 + +**Unfilled Order Count:** 2 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +listClientOrderId + +STRING + +NO + +Arbitrary unique ID among open order lists. Automatically generated if not sent. A new order list with the same listClientOrderId is accepted only when the previous one is filled or completely expired. `listClientOrderId` is distinct from the `workingClientOrderId` and the `pendingClientOrderId`. + +newOrderRespType + +ENUM + +NO + +Format of the JSON response. Supported values: [Order Response Type](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums) + +selfTradePreventionMode + +ENUM + +NO + +The allowed values are dependent on what is configured on the symbol. Supported values: [STP Modes](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums) + +workingType + +ENUM + +YES + +Supported values: `LIMIT`,`LIMIT_MAKER` + +workingSide + +ENUM + +YES + +Supported values: [Order Side](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums) + +workingClientOrderId + +STRING + +NO + +Arbitrary unique ID among open orders for the working order. Automatically generated if not sent. + +workingPrice + +DECIMAL + +YES + +workingQuantity + +DECIMAL + +YES + +Sets the quantity for the working order. + +workingIcebergQty + +DECIMAL + +NO + +This can only be used if `workingTimeInForce` is `GTC`, or if `workingType` is `LIMIT_MAKER`. + +workingTimeInForce + +ENUM + +NO + +Supported values: [Time In Force](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums) + +workingStrategyId + +LONG + +NO + +Arbitrary numeric value identifying the working order within an order strategy. + +workingStrategyType + +INT + +NO + +Arbitrary numeric value identifying the working order strategy. Values smaller than 1000000 are reserved and cannot be used. + +workingPegPriceType + +ENUM + +NO + +See [Pegged Orders](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/trading-endpoints) + +workingPegOffsetType + +ENUM + +NO + +workingPegOffsetValue + +INT + +NO + +pendingType + +ENUM + +YES + +Supported values: [Order Types](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/trading-endpoints) Note that `MARKET` orders using `quoteOrderQty` are not supported. + +pendingSide + +ENUM + +YES + +Supported values: [Order Side](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums) + +pendingClientOrderId + +STRING + +NO + +Arbitrary unique ID among open orders for the pending order. Automatically generated if not sent. + +pendingPrice + +DECIMAL + +NO + +pendingStopPrice + +DECIMAL + +NO + +pendingTrailingDelta + +DECIMAL + +NO + +pendingIcebergQty + +DECIMAL + +NO + +This can only be used if `pendingTimeInForce` is `GTC` or if `pendingType` is `LIMIT_MAKER`. + +pendingTimeInForce + +ENUM + +NO + +Supported values: [Time In Force](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums) + +pendingStrategyId + +LONG + +NO + +Arbitrary numeric value identifying the pending order within an order strategy. + +pendingStrategyType + +INT + +NO + +Arbitrary numeric value identifying the pending order strategy. Values smaller than 1000000 are reserved and cannot be used. + +pendingPegPriceType + +ENUM + +NO + +See [Pegged Orders](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/trading-endpoints) + +pendingPegOffsetType + +ENUM + +NO + +pendingPegOffsetValue + +INT + +NO + +recvWindow + +DECIMAL + +NO + +The value cannot be greater than `60000`. Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +timestamp + +LONG + +YES + +**Data Source**: Matching Engine + +**Response:** + +``` +{ "orderListId": 0, "contingencyType": "OTO", "listStatusType": "EXEC_STARTED", "listOrderStatus": "EXECUTING", "listClientOrderId": "H94qCqO27P74OEiO4X8HOG", "transactionTime": 1762998011671, "symbol": "BTCUSDT", "orders": [ { "symbol": "BTCUSDT", "orderId": 2, "clientOrderId": "JX6xfdjo0wysiGumfHNmPu" }, { "symbol": "BTCUSDT", "orderId": 3, "clientOrderId": "2ZJCY0IjOhuYIMLGN8kU8S" } ], "orderReports": [ { "symbol": "BTCUSDT", "orderId": 2, "orderListId": 0, "clientOrderId": "JX6xfdjo0wysiGumfHNmPu", "transactTime": 1762998011671, "price": "102264.00000000", "origQty": "0.00060000", "executedQty": "0.00000000", "origQuoteOrderQty": "0.00000000", "cummulativeQuoteQty": "0.00000000", "status": "NEW", "timeInForce": "GTC", "type": "LIMIT", "side": "BUY", "workingTime": 1762998011671, "selfTradePreventionMode": "NONE" }, { "symbol": "BTCUSDT", "orderId": 3, "orderListId": 0, "clientOrderId": "2ZJCY0IjOhuYIMLGN8kU8S", "transactTime": 1762998011671, "price": "0.00000000", "executedQty": "0.00000000", "origQuoteOrderQty": "0.00000000", "cummulativeQuoteQty": "0.00000000", "status": "PENDING_NEW", "timeInForce": "GTC", "type": "MARKET", "side": "SELL", "workingTime": -1, "selfTradePreventionMode": "NONE" } ]} +``` + +**Note:** The payload above does not show all fields that can appear. Please refer to [Conditional fields in Order Responses](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/trading-endpoints). + +#### New Order List - OPOCO (TRADE)[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/trading-endpoints) + +``` +POST /api/v3/orderList/opoco +``` + +Place an [OPOCO](https://developers.binance.com/docs/binance-spot-api-docs/faqs/opo). + +**Weight**: 1 + +**Unfilled Order Count:** 3 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +listClientOrderId + +STRING + +NO + +Arbitrary unique ID among open order lists. Automatically generated if not sent. A new order list with the same listClientOrderId is accepted only when the previous one is filled or completely expired. `listClientOrderId` is distinct from the `workingClientOrderId`, `pendingAboveClientOrderId`, and the `pendingBelowClientOrderId`. + +newOrderRespType + +ENUM + +NO + +Format of the JSON response. Supported values: [Order Response Type](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums) + +selfTradePreventionMode + +ENUM + +NO + +The allowed values are dependent on what is configured on the symbol. Supported values: [STP Modes](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums) + +workingType + +ENUM + +YES + +Supported values: `LIMIT`, `LIMIT_MAKER` + +workingSide + +ENUM + +YES + +Supported values: [Order side](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums) + +workingClientOrderId + +STRING + +NO + +Arbitrary unique ID among open orders for the working order. Automatically generated if not sent. + +workingPrice + +DECIMAL + +YES + +workingQuantity + +DECIMAL + +YES + +workingIcebergQty + +DECIMAL + +NO + +This can only be used if `workingTimeInForce` is `GTC` or if `workingType` is `LIMIT_MAKER`. + +workingTimeInForce + +ENUM + +NO + +Supported values: [Time In Force](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums) + +workingStrategyId + +LONG + +NO + +Arbitrary numeric value identifying the working order within an order strategy. + +workingStrategyType + +INT + +NO + +Arbitrary numeric value identifying the working order strategy. Values smaller than 1000000 are reserved and cannot be used. + +workingPegPriceType + +ENUM + +NO + +See [Pegged Orders](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/trading-endpoints) + +workingPegOffsetType + +ENUM + +NO + +workingPegOffsetValue + +INT + +NO + +pendingSide + +ENUM + +YES + +Supported values: [Order side](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums) + +pendingAboveType + +ENUM + +YES + +Supported values: `STOP_LOSS_LIMIT`, `STOP_LOSS`, `LIMIT_MAKER`, `TAKE_PROFIT`, `TAKE_PROFIT_LIMIT` + +pendingAboveClientOrderId + +STRING + +NO + +Arbitrary unique ID among open orders for the pending above order. Automatically generated if not sent. + +pendingAbovePrice + +DECIMAL + +NO + +Can be used if `pendingAboveType` is `STOP_LOSS_LIMIT` , `LIMIT_MAKER`, or `TAKE_PROFIT_LIMIT` to specify the limit price. + +pendingAboveStopPrice + +DECIMAL + +NO + +Can be used if `pendingAboveType` is `STOP_LOSS`, `STOP_LOSS_LIMIT`, `TAKE_PROFIT`, `TAKE_PROFIT_LIMIT` + +pendingAboveTrailingDelta + +DECIMAL + +NO + +See [Trailing Stop FAQ](https://developers.binance.com/docs/binance-spot-api-docs/faqs/trailing-stop-faq) + +pendingAboveIcebergQty + +DECIMAL + +NO + +This can only be used if `pendingAboveTimeInForce` is `GTC` or if `pendingAboveType` is `LIMIT_MAKER`. + +pendingAboveTimeInForce + +ENUM + +NO + +pendingAboveStrategyId + +LONG + +NO + +Arbitrary numeric value identifying the pending above order within an order strategy. + +pendingAboveStrategyType + +INT + +NO + +Arbitrary numeric value identifying the pending above order strategy. Values smaller than 1000000 are reserved and cannot be used. + +pendingAbovePegPriceType + +ENUM + +NO + +See [Pegged Orders](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/trading-endpoints) + +pendingAbovePegOffsetType + +ENUM + +NO + +pendingAbovePegOffsetValue + +INT + +NO + +pendingBelowType + +ENUM + +NO + +Supported values: `STOP_LOSS`, `STOP_LOSS_LIMIT`, `TAKE_PROFIT`,`TAKE_PROFIT_LIMIT` + +pendingBelowClientOrderId + +STRING + +NO + +Arbitrary unique ID among open orders for the pending below order. Automatically generated if not sent. + +pendingBelowPrice + +DECIMAL + +NO + +Can be used if `pendingBelowType` is `STOP_LOSS_LIMIT` or `TAKE_PROFIT_LIMIT` to specify limit price + +pendingBelowStopPrice + +DECIMAL + +NO + +Can be used if `pendingBelowType` is `STOP_LOSS`, `STOP_LOSS_LIMIT, TAKE_PROFIT or TAKE_PROFIT_LIMIT`. Either `pendingBelowStopPrice` or `pendingBelowTrailingDelta` or both, must be specified. + +pendingBelowTrailingDelta + +DECIMAL + +NO + +pendingBelowIcebergQty + +DECIMAL + +NO + +This can only be used if `pendingBelowTimeInForce` is `GTC`, or if `pendingBelowType` is `LIMIT_MAKER`. + +pendingBelowTimeInForce + +ENUM + +NO + +Supported values: [Time In Force](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums) + +pendingBelowStrategyId + +LONG + +NO + +Arbitrary numeric value identifying the pending below order within an order strategy. + +pendingBelowStrategyType + +INT + +NO + +Arbitrary numeric value identifying the pending below order strategy. Values smaller than 1000000 are reserved and cannot be used. + +pendingBelowPegPriceType + +ENUM + +NO + +See [Pegged Orders](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/trading-endpoints) + +pendingBelowPegOffsetType + +ENUM + +NO + +pendingBelowPegOffsetValue + +INT + +NO + +recvWindow + +DECIMAL + +NO + +The value cannot be greater than `60000`. Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +timestamp + +LONG + +YES + +**Response** + +``` +{ "orderListId": 2, "contingencyType": "OTO", "listStatusType": "EXEC_STARTED", "listOrderStatus": "EXECUTING", "listClientOrderId": "bcedxMpQG6nFrZUPQyshoL", "transactionTime": 1763000506354, "symbol": "BTCUSDT", "orders": [ { "symbol": "BTCUSDT", "orderId": 9, "clientOrderId": "OLSBhMWaIlLSzZ9Zm7fnKB" }, { "symbol": "BTCUSDT", "orderId": 10, "clientOrderId": "mfif39yPTHsB3C0FIXznR2" }, { "symbol": "BTCUSDT", "orderId": 11, "clientOrderId": "yINkaXSJeoi3bU5vWMY8Z8" } ], "orderReports": [ { "symbol": "BTCUSDT", "orderId": 9, "orderListId": 2, "clientOrderId": "OLSBhMWaIlLSzZ9Zm7fnKB", "transactTime": 1763000506354, "price": "102496.00000000", "origQty": "0.00170000", "executedQty": "0.00000000", "origQuoteOrderQty": "0.00000000", "cummulativeQuoteQty": "0.00000000", "status": "NEW", "timeInForce": "GTC", "type": "LIMIT", "side": "BUY", "workingTime": 1763000506354, "selfTradePreventionMode": "NONE" }, { "symbol": "BTCUSDT", "orderId": 10, "orderListId": 2, "clientOrderId": "mfif39yPTHsB3C0FIXznR2", "transactTime": 1763000506354, "price": "101613.00000000", "executedQty": "0.00000000", "origQuoteOrderQty": "0.00000000", "cummulativeQuoteQty": "0.00000000", "status": "PENDING_NEW", "timeInForce": "GTC", "type": "STOP_LOSS_LIMIT", "side": "SELL", "stopPrice": "10100.00000000", "workingTime": -1, "selfTradePreventionMode": "NONE" }, { "symbol": "BTCUSDT", "orderId": 11, "orderListId": 2, "clientOrderId": "yINkaXSJeoi3bU5vWMY8Z8", "transactTime": 1763000506354, "price": "104261.00000000", "executedQty": "0.00000000", "origQuoteOrderQty": "0.00000000", "cummulativeQuoteQty": "0.00000000", "status": "PENDING_NEW", "timeInForce": "GTC", "type": "LIMIT_MAKER", "side": "SELL", "workingTime": -1, "selfTradePreventionMode": "NONE" } ]} +``` + +**Note:** The payload above does not show all fields that can appear. Please refer to [Conditional fields in Order Responses](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/trading-endpoints). + +#### Cancel Order list (TRADE)[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/trading-endpoints) + +``` +DELETE /api/v3/orderList +``` + +Cancel an entire Order list + +**Weight:** 1 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +orderListId + +LONG + +NO + +Either `orderListId` or `listClientOrderId` must be provided + +listClientOrderId + +STRING + +NO + +Either `orderListId` or `listClientOrderId` must be provided + +newClientOrderId + +STRING + +NO + +Used to uniquely identify this cancel. Automatically generated by default + +recvWindow + +DECIMAL + +NO + +The value cannot be greater than `60000`. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +timestamp + +LONG + +YES + +**Notes:** + +- Canceling an individual order from an order list will cancel the entire order list. +- If both `orderListId` and `listClientOrderId` parameters are provided, the `orderListId` is searched first, then the `listClientOrderId` from that result is checked against that order. If both conditions are not met the request will be rejected. + +**Data Source:** Matching Engine + +**Response:** + +``` +{ "orderListId": 0, "contingencyType": "OCO", "listStatusType": "ALL_DONE", "listOrderStatus": "ALL_DONE", "listClientOrderId": "C3wyj4WVEktd7u9aVBRXcN", "transactionTime": 1574040868128, "symbol": "LTCBTC", "orders": [ { "symbol": "LTCBTC", "orderId": 2, "clientOrderId": "pO9ufTiFGg3nw2fOdgeOXa" }, { "symbol": "LTCBTC", "orderId": 3, "clientOrderId": "TXOvglzXuaubXAaENpaRCB" } ], "orderReports": [ { "symbol": "LTCBTC", "origClientOrderId": "pO9ufTiFGg3nw2fOdgeOXa", "orderId": 2, "orderListId": 0, "clientOrderId": "unfWT8ig8i0uj6lPuYLez6", "transactTime": 1688005070874, "price": "1.00000000", "origQty": "10.00000000", "executedQty": "0.00000000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "0.00000000", "status": "CANCELED", "timeInForce": "GTC", "type": "STOP_LOSS_LIMIT", "side": "SELL", "stopPrice": "1.00000000", "selfTradePreventionMode": "NONE" }, { "symbol": "LTCBTC", "origClientOrderId": "TXOvglzXuaubXAaENpaRCB", "orderId": 3, "orderListId": 0, "clientOrderId": "unfWT8ig8i0uj6lPuYLez6", "transactTime": 1688005070874, "price": "3.00000000", "origQty": "10.00000000", "executedQty": "0.00000000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "0.00000000", "status": "CANCELED", "timeInForce": "GTC", "type": "LIMIT_MAKER", "side": "SELL", "selfTradePreventionMode": "NONE" } ]} +``` + +### SOR[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/trading-endpoints) + +#### New order using SOR (TRADE)[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/trading-endpoints) + +``` +POST /api/v3/sor/order +``` + +Places an order using smart order routing (SOR). + +This adds 1 order to the `EXCHANGE_MAX_ORDERS` filter and the `MAX_NUM_ORDERS` filter. + +Read [SOR FAQ](https://developers.binance.com/docs/binance-spot-api-docs/faqs/sor_faq) to learn more. + +**Weight:** 1 + +**Unfilled Order Count:** 1 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +side + +ENUM + +YES + +type + +ENUM + +YES + +timeInForce + +ENUM + +NO + +quantity + +DECIMAL + +YES + +price + +DECIMAL + +NO + +newClientOrderId + +STRING + +NO + +A unique id among open orders. Automatically generated if not sent. +Orders with the same `newClientOrderID` can be accepted only when the previous one is filled, otherwise the order will be rejected. + +strategyId + +LONG + +NO + +strategyType + +INT + +NO + +The value cannot be less than `1000000`. + +icebergQty + +DECIMAL + +NO + +Used with `LIMIT` to create an iceberg order. + +newOrderRespType + +ENUM + +NO + +Set the response JSON. `ACK`, `RESULT`, or `FULL`. Default to `FULL` + +selfTradePreventionMode + +ENUM + +NO + +The allowed enums is dependent on what is configured on the symbol. The possible supported values are: [STP Modes](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums). + +recvWindow + +DECIMAL + +NO + +The value cannot be greater than `60000`. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +timestamp + +LONG + +YES + +**Note:** `POST /api/v3/sor/order` only supports `LIMIT` and `MARKET` orders. `quoteOrderQty` is not supported. + +**Data Source:** Matching Engine + +**Response:** + +``` +{ "symbol": "BTCUSDT", "orderId": 2, "orderListId": -1, "clientOrderId": "sBI1KM6nNtOfj5tccZSKly", "transactTime": 1689149087774, "price": "31000.00000000", "origQty": "0.50000000", "executedQty": "0.50000000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "14000.00000000", "status": "FILLED", "timeInForce": "GTC", "type": "LIMIT", "side": "BUY", "workingTime": 1689149087774, "fills": [ { "matchType": "ONE_PARTY_TRADE_REPORT", "price": "28000.00000000", "qty": "0.50000000", "commission": "0.00000000", "commissionAsset": "BTC", "tradeId": -1, "allocId": 0 } ], "workingFloor": "SOR", "selfTradePreventionMode": "NONE", "usedSor": true} +``` + +#### Test new order using SOR (TRADE)[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/trading-endpoints) + +``` +POST /api/v3/sor/order/test +``` + +Test new order creation and signature/recvWindow using smart order routing (SOR). Creates and validates a new order but does not send it into the matching engine. + +**Weight:** + +Condition + +Request Weight + +Without `computeCommissionRates` + +1 + +With `computeCommissionRates` + +20 + +**Parameters:** + +In addition to all parameters accepted by [`POST /api/v3/sor/order`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/trading-endpoints), the following optional parameters are also accepted: + +Name + +Type + +Mandatory + +Description + +computeCommissionRates + +BOOLEAN + +NO + +Default: `false` + +**Data Source:** Memory + +**Response:** + +Without `computeCommissionRates` + +``` +{} +``` + +With `computeCommissionRates` + +``` +{ "standardCommissionForOrder": { // Standard commission rates on trades from the order. "maker": "0.00000112", "taker": "0.00000114" }, "taxCommissionForOrder": { // Tax commission rates for trades from the order "maker": "0.00000112", "taker": "0.00000114" }, "discount": { // Discount on standard commissions when paying in BNB. "enabledForAccount": true, "enabledForSymbol": true, "discountAsset": "BNB", "discount": "0.25000000" // Standard commission is reduced by this rate when paying commission in BNB. }} +``` + +- [New order (TRADE)](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/trading-endpoints) +- [Test new order (TRADE)](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/trading-endpoints) +- [Query order (USER\_DATA)](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/trading-endpoints) +- [Cancel order (TRADE)](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/trading-endpoints) +- [Cancel All Open Orders on a Symbol (TRADE)](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/trading-endpoints) +- [Cancel an Existing Order and Send a New Order (TRADE)](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/trading-endpoints) +- [Order Amend Keep Priority (TRADE)](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/trading-endpoints) +- [Order lists](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/trading-endpoints) +- [SOR](https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/trading-endpoints) diff --git a/docs/binance/binance-spot/testnet_sbe-market-data-streams.md b/docs/binance/binance-spot/testnet_sbe-market-data-streams.md new file mode 100644 index 0000000..f5aa4db --- /dev/null +++ b/docs/binance/binance-spot/testnet_sbe-market-data-streams.md @@ -0,0 +1,99 @@ +--- +title: "SBE Market Data | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs/testnet/sbe-market-data-streams" +fetched_at: "2026-02-26T10:38:10.990Z" +--- +# SBE Market Data Streams + +## General Information[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/sbe-market-data-streams) + +- The base endpoint is **stream-sbe.testnet.binance.vision** or **stream-sbe.testnet.binance.vision:9443**. +- To retrieve market data in JSON format, please refer to [this page](https://developers.binance.com/docs/binance-spot-api-docs/testnet/web-socket-streams). +- SBE schema used for decoding the streams can be found [here](https://github.com/binance/binance-spot-api-docs/blob/master/sbe/schemas/stream_1_0.xml). +- All symbols in stream names are **lowercase**. +- You can subscribe to a single stream at **/ws/**. +- You can subscribe to multiple streams at **/stream?streams=//**. +- A single connection to **stream-sbe.testnet.binance.vision** is **only valid for 24 hours**; expect to be disconnected at the 24 hour mark. +- All time and timestamp fields are in **microseconds**. +- **An API Key is necessary for access**. + - Only Ed25519 keys are allowed. + - Please put your API Key in the `X-MBX-APIKEY` header when opening the connection. Timestamp and signature are not necessary. + - No extra API key permissions are necessary to access public market data. Symbol whitelist also does not affect access to SBE Market Data Streams. + - However, if you use an IP whitelist for the API key, only specified IP addresses are allowed to use the API key. +- The server sends a `ping frame` every 20 seconds. + - If the server does not receive a `pong frame` back from you within a minute, the connection will be closed. + - When you receive a ping, you must send a pong with a copy of ping's payload as soon as possible. + - Unsolicited `pong frames` are allowed, but will not prevent disconnection. **It is recommended that the payload for these pong frames are empty.** +- [Live Subscribing and Unsubscribing](https://developers.binance.com/docs/binance-spot-api-docs/testnet/web-socket-streams) is also supported. + - You must send the subscription requests in JSON, and will receive the subscription response also in JSON. + - You can differentiate subscription responses from market data events by looking at the WebSocket frame type: subscription responses are always sent in text frames (containing JSON), and events are always sent in binary frames (containing SBE). + +## WebSocket Limits[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/sbe-market-data-streams) + +- WebSocket connections have a rate limit of **5 requests per second**. + - Only messages from your client are considered: + - `PING frame` + - `PONG frame` + - `Text frame` with JSON control request + - Events pushed by the server are not rate-limited. + - Connections that go beyond the limit will be closed. Repeatedly disconnected IP addresses may be banned. +- A single connection can listen to a maximum of 1024 streams. +- There is a limit of **300 connection attempts every 5 minutes per IP address**. + +## Available Streams[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/sbe-market-data-streams) + +### Trades Streams[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/sbe-market-data-streams) + +Raw trade information, pushed in real-time. + +**SBE Message Name:** `TradesStreamEvent` + +**Stream Name**: @trade + +**Update Speed**: Real time + +### Best Bid/Ask Streams[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/sbe-market-data-streams) + +The best bid and ask price and quantity, pushed in real-time when the order book changes. + +> \[!NOTE\] Best bid/ask streams in SBE are the equivalent of bookTicker streams in JSON, except they support auto-culling, and also include the `eventTime` field. + +**SBE Message Name:** `BestBidAskStreamEvent` + +**Stream Name**: @bestBidAsk + +**Update Speed**: Real time + +SBE best bid/ask streams use **auto-culling**: when the system is under high load, it may drop outdated events instead of queuing all events and delivering them with a delay. + +For example, if a best bid/ask event is generated at time T2 when there is still an undelivered event queued at time T1 (where T1 < T2), the event for T1 is dropped, and the system will deliver only the event for T2. This is done on a per-symbol basis. + +### Diff. Depth Streams[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/sbe-market-data-streams) + +Incremental updates to the order book, pushed at regular intervals. Use this stream to maintain a local order book. + +[How to manage a local order book.](https://developers.binance.com/docs/binance-spot-api-docs/testnet/web-socket-streams) + +**SBE Message Name:** `DepthDiffStreamEvent` + +**Stream Name**: @depth + +**Update Speed:** 50ms + +### Partial Book Depth Streams[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/sbe-market-data-streams) + +Snapshots of the top 20 levels of the order book, pushed at regular intervals. + +**SBE Message Name:** `DepthSnapshotStreamEvent` + +**Stream Name**: @depth20 + +**Update Speed:** 50ms + +- [General Information](https://developers.binance.com/docs/binance-spot-api-docs/testnet/sbe-market-data-streams) +- [WebSocket Limits](https://developers.binance.com/docs/binance-spot-api-docs/testnet/sbe-market-data-streams) +- [Available Streams](https://developers.binance.com/docs/binance-spot-api-docs/testnet/sbe-market-data-streams) + - [Trades Streams](https://developers.binance.com/docs/binance-spot-api-docs/testnet/sbe-market-data-streams) + - [Best Bid/Ask Streams](https://developers.binance.com/docs/binance-spot-api-docs/testnet/sbe-market-data-streams) + - [Diff. Depth Streams](https://developers.binance.com/docs/binance-spot-api-docs/testnet/sbe-market-data-streams) + - [Partial Book Depth Streams](https://developers.binance.com/docs/binance-spot-api-docs/testnet/sbe-market-data-streams) diff --git a/docs/binance/binance-spot/testnet_user-data-stream.md b/docs/binance/binance-spot/testnet_user-data-stream.md new file mode 100644 index 0000000..e2225c9 --- /dev/null +++ b/docs/binance/binance-spot/testnet_user-data-stream.md @@ -0,0 +1,293 @@ +--- +title: "User Data Stream | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs/testnet/user-data-stream" +fetched_at: "2026-02-26T10:38:11.022Z" +--- +# User Data Streams for Binance Spot TESTNET + +## General information[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/user-data-stream) + +- Subscribe via the [WebSocket API](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/user-data-stream-requests) using an API Key. +- Both [SBE](https://developers.binance.com/docs/binance-spot-api-docs/faqs/sbe_faq) and JSON output are supported. +- Account events are pushed in **real-time**. +- All timestamps in JSON payloads are in **milliseconds by default**. +- Events may contain non-ASCII characters encoded in UTF-8 if you own or trade any assets or symbols whose names contain non-ASCII characters. + +## User Data Stream Events[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/user-data-stream) + +### Account Update[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/user-data-stream) + +`outboundAccountPosition` is sent any time an account balance has changed and contains the assets that were possibly changed by the event that generated the balance change. + +``` +{ "subscriptionId": 0, "event": { "e": "outboundAccountPosition", // Event type "E": 1564034571105, // Event Time "u": 1564034571073, // Time of last account update // Balances Array "B": [ { "a": "ETH", // Asset "f": "10000.000000", // Free "l": "0.000000" // Locked } ] }} +``` + +### Balance Update[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/user-data-stream) + +Balance Update occurs during the following: + +- Deposits or withdrawals from the account +- Transfer of funds between accounts (e.g. Spot to Margin) + +**Payload** + +``` +{ "subscriptionId": 0, "event": { "e": "balanceUpdate", // Event Type "E": 1573200697110, // Event Time "a": "BTC", // Asset "d": "100.00000000", // Balance Delta "T": 1573200697068 // Clear Time }} +``` + +### Order Update[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/user-data-stream) + +Orders are updated with the `executionReport` event. + +**Payload:** + +``` +{ "subscriptionId": 0, "event": { "e": "executionReport", // Event type "E": 1499405658658, // Event time "s": "ETHBTC", // Symbol "c": "mUvoqJxFIILMdfAW5iGSOW", // Client order ID "S": "BUY", // Side "o": "LIMIT", // Order type "f": "GTC", // Time in force "q": "1.00000000", // Order quantity "p": "0.10264410", // Order price "P": "0.00000000", // Stop price "F": "0.00000000", // Iceberg quantity "g": -1, // OrderListId "C": "", // Original client order ID; This is the ID of the order being canceled "x": "NEW", // Current execution type "X": "NEW", // Current order status "r": "NONE", // Order reject reason; Please see Order Reject Reason (below) for more information. "i": 4293153, // Order ID "l": "0.00000000", // Last executed quantity "z": "0.00000000", // Cumulative filled quantity "L": "0.00000000", // Last executed price "n": "0", // Commission amount "N": null, // Commission asset "T": 1499405658657, // Transaction time "t": -1, // Trade ID "v": 3, // Prevented Match Id; This is only visible if the order expired due to STP "I": 8641984, // Execution Id "w": true, // Is the order on the book? "m": false, // Is this trade the maker side? "M": false, // Ignore "O": 1499405658657, // Order creation time "Z": "0.00000000", // Cumulative quote asset transacted quantity "Y": "0.00000000", // Last quote asset transacted quantity (i.e. lastPrice * lastQty) "Q": "0.00000000", // Quote Order Quantity "W": 1499405658657, // Working Time; This is only visible if the order has been placed on the book. "V": "NONE" // SelfTradePreventionMode }} +``` + +**Note:** Average price can be found by doing `Z` divided by `z`. + +#### Conditional Fields in Execution Report[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/user-data-stream) + +These are fields that appear in the payload only if certain conditions are met. + +For additional information on these parameters, please refer to the [Spot Glossary](https://developers.binance.com/docs/binance-spot-api-docs/faqs/spot_glossary). + +Field + +Name + +Description + +Examples + +`d` + +Trailing Delta + +Appears only for trailing stop orders. + +`"d": 4` + +`D` + +Trailing Time + +`"D": 1668680518494` + +`j` + +Strategy Id + +Appears only if the `strategyId` parameter was provided upon order placement. + +`"j": 1` + +`J` + +Strategy Type + +Appears only if the `strategyType` parameter was provided upon order placement. + +`"J": 1000000` + +`v` + +Prevented Match Id + +Appears only for orders that expired due to STP. + +`"v": 3` + +`A` + +Prevented Quantity + +`"A":"3.000000"` + +`B` + +Last Prevented Quantity + +`"B":"3.000000"` + +`u` + +Trade Group Id + +`"u":1` + +`U` + +Counter Order Id + +`"U":37` + +`Cs` + +Counter Symbol + +`"Cs": "BTCUSDT"` + +`pl` + +Prevented Execution Quantity + +`"pl":"2.123456"` + +`pL` + +Prevented Execution Price + +`"pL":"0.10000001"` + +`pY` + +Prevented Execution Quote Qty + +`"pY":"0.21234562"` + +`W` + +Working Time + +Appears when the order is working on the book + +`"W": 1668683798379` + +`b` + +Match Type + +Appears for orders that have allocations + +`"b":"ONE_PARTY_TRADE_REPORT"` + +`a` + +Allocation ID + +`"a":1234` + +`k` + +Working Floor + +Appears for orders that potentially have allocations + +`"k":"SOR"` + +`uS` + +UsedSor + +Appears for orders that used SOR + +`"uS":true` + +`gP` + +Pegged Price Type + +Appears only for Pegged Orders + +`"gP": "PRIMARY_PEG"` + +`gOT` + +Pegged offset Type + +`"gOT": "PRICE_LEVEL"` + +`gOV` + +Pegged Offset Value + +`"gOV": 5` + +`gp` + +Pegged Price + +`"gp": "1.00000000"` + +#### Order Reject Reason[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/user-data-stream) + +For additional details, look up the Error Message in the [Errors](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) documentation. + +Rejection Reason (`r`) + +Error Message + +`NONE` + +N/A (i.e. The order was not rejected.) + +`INSUFFICIENT_BALANCES` + +"Account has insufficient balance for requested action." + +`STOP_PRICE_WOULD_TRIGGER_IMMEDIATELY` + +"Order would trigger immediately." + +`WOULD_MATCH_IMMEDIATELY` + +"Order would immediately match and take." + +`OCO_BAD_PRICES` + +"The relationship of the prices for the orders is not correct." + +If the order is an order list, an event named `ListStatus` will be sent in addition to the `executionReport` event. + +**Payload** + +``` +{ "subscriptionId": 0, "event": { "e": "listStatus", // Event Type "E": 1564035303637, // Event Time "s": "ETHBTC", // Symbol "g": 2, // OrderListId "c": "OCO", // Contingency Type "l": "EXEC_STARTED", // List Status Type "L": "EXECUTING", // List Order Status "r": "NONE", // List Reject Reason "C": "F4QN4G8DlFATFlIUQ0cjdD", // List Client Order ID "T": 1564035303625, // Transaction Time // An array of objects "O": [ { "s": "ETHBTC", // Symbol "i": 17, // OrderId "c": "AJYsMjErWJesZvqlJCTUgL" // ClientOrderId }, { "s": "ETHBTC", "i": 18, "c": "bfYPSQdLoqAJeNrOr9adzq" } ] }} +``` + +#### Execution types[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/user-data-stream) + +- `NEW` - The order has been accepted into the engine. +- `CANCELED` - The order has been canceled by the user. +- `REPLACED` - The order has been amended. +- `REJECTED` - The order has been rejected and was not processed. (e.g. Cancel Replace orders where the new order placement was rejected even if the cancel request succeeded.) +- `TRADE` - Part of the order or all of the order's quantity has filled. +- `EXPIRED` - The order was canceled according to the order type's rules (e.g. LIMIT FOK orders with no fill, LIMIT IOC or MARKET orders that partially fill) or by the exchange, (e.g. orders canceled during liquidation, orders canceled during maintenance). +- `TRADE_PREVENTION` - The order has expired due to STP. + +Check the [Enums Documentation](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums) for more relevant enum definitions. + +### Event Stream Terminated[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/user-data-stream) + +`eventStreamTerminated` is sent when: + +- [A listen token subscription](https://developers.binance.com/docs/margin_trading/trade-data-stream/Listen-Token-Websocket-API) expires due to token expiration. +- A [logon subscription](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/authentication-requests) ends after sending [`session.logout`](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests) method. +- The subscription is stopped via the [`userDataStream.unsubscribe`](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/user-data-stream-requests) method. + +**Payload:** + +``` +{ "subscriptionId": 0, "event": { "e": "eventStreamTerminated", // Event Type "E": 1728973001334 // Event Time }} +``` + +### External Lock Update[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/user-data-stream) + +`externalLockUpdate` is sent when part of your spot wallet balance is locked/unlocked by an external system, for example when used as margin collateral. + +**Payload:** + +``` +{ "subscriptionId": 0, "event": { "e": "externalLockUpdate", // Event Type "E": 1581557507324, // Event Time "a": "NEO", // Asset "d": "10.00000000", // Delta "T": 1581557507268 // Transaction Time }} +``` + +- [General information](https://developers.binance.com/docs/binance-spot-api-docs/testnet/user-data-stream) +- [User Data Stream Events](https://developers.binance.com/docs/binance-spot-api-docs/testnet/user-data-stream) + - [Account Update](https://developers.binance.com/docs/binance-spot-api-docs/testnet/user-data-stream) + - [Balance Update](https://developers.binance.com/docs/binance-spot-api-docs/testnet/user-data-stream) + - [Order Update](https://developers.binance.com/docs/binance-spot-api-docs/testnet/user-data-stream) + - [Event Stream Terminated](https://developers.binance.com/docs/binance-spot-api-docs/testnet/user-data-stream) + - [External Lock Update](https://developers.binance.com/docs/binance-spot-api-docs/testnet/user-data-stream) diff --git a/docs/binance/binance-spot/testnet_web-socket-streams.md b/docs/binance/binance-spot/testnet_web-socket-streams.md new file mode 100644 index 0000000..f3fea71 --- /dev/null +++ b/docs/binance/binance-spot/testnet_web-socket-streams.md @@ -0,0 +1,434 @@ +--- +title: "WebSocket Streams | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs/testnet/web-socket-streams" +fetched_at: "2026-02-26T10:38:11.267Z" +--- +# WebSocket Streams for Binance SPOT Testnet + +## General WSS information[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/web-socket-streams) + +- The base endpoint is: **wss://stream.testnet.binance.vision/ws**. +- Streams can be accessed either in a single raw stream or in a combined stream +- Raw streams are accessed at **/ws/** +- Combined streams are accessed at **/stream?streams=//** +- Combined stream events are wrapped as follows: **{"stream":"","data":}** +- All symbols for streams are **lowercase** +- All time and timestamp related fields are **milliseconds by default**. To receive the information in microseconds, please add the parameter `timeUnit=MICROSECOND` or `timeUnit=microsecond` in the URL. + - For example: `/stream?streams=btcusdt@trade&timeUnit=MICROSECOND` +- A single connection to **stream.binance.com** is only valid for 24 hours; expect to be disconnected at the 24 hour mark +- The WebSocket server will send a `ping frame` every 20 seconds. + - If the WebSocket server does not receive a `pong frame` back from the connection within a minute, the connection will be disconnected. + - When you receive a ping, you must send a pong with a copy of ping's payload as soon as possible. + - Unsolicited `pong frames` are allowed, but will not prevent disconnection. **It is recommended that the payload for these pong frames are empty.** +- The base endpoint **wss://data-stream.binance.vision** can be subscribed to receive **only** market data messages. + User data stream is **NOT** available from this URL. +- All time and timestamp related fields are **milliseconds by default**. To receive the information in microseconds, please add the parameter `timeUnit=MICROSECOND or timeUnit=microsecond` in the URL. + - For example: `/stream?streams=btcusdt@trade&timeUnit=MICROSECOND` +- If your request contains a symbol name containing non-ASCII characters, then the stream events may contain non-ASCII characters encoded in UTF-8. +- \[All Market Mini Tickers Stream\](#all-market-mini-tickers-stream and [All Market Rolling Window Statistics Streams](https://developers.binance.com/docs/binance-spot-api-docs/testnet/web-socket-streams) events may contain non-ASCII characters encoded in UTF-8. + +## WebSocket Limits[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/web-socket-streams) + +- WebSocket connections have a limit of 5 incoming messages per second. A message is considered: + - A PING frame + - A PONG frame + - A JSON controlled message (e.g. subscribe, unsubscribe) +- A connection that goes beyond the limit will be disconnected; IPs that are repeatedly disconnected may be banned. +- A single connection can listen to a maximum of 1024 streams. +- There is a limit of **300 connections per attempt every 5 minutes per IP**. + +## Live Subscribing/Unsubscribing to streams[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/web-socket-streams) + +- The following data can be sent through the WebSocket instance in order to subscribe/unsubscribe from streams. Examples can be seen below. +- The `id` is used as an identifier to uniquely identify the messages going back and forth. The following formats are accepted: + - 64-bit signed integer + - alphanumeric strings; max length 36 + - `null` +- In the response, if the `result` received is `null` this means the request sent was a success for non-query requests (e.g. Subscribing/Unsubscribing). + +### Subscribe to a stream[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/web-socket-streams) + +- Request + + ``` + { "method": "SUBSCRIBE", "params": ["btcusdt@aggTrade", "btcusdt@depth"], "id": 1} + ``` + +- Response + + ``` + { "result": null, "id": 1} + ``` + + +### Unsubscribe to a stream[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/web-socket-streams) + +- Request + + ``` + { "method": "UNSUBSCRIBE", "params": ["btcusdt@depth"], "id": 312} + ``` + +- Response + + ``` + { "result": null, "id": 312} + ``` + + +### Listing Subscriptions[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/web-socket-streams) + +- Request + + ``` + { "method": "LIST_SUBSCRIPTIONS", "id": 3} + ``` + +- Response + + ``` + { "result": ["btcusdt@aggTrade"], "id": 3} + ``` + + +### Setting Properties[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/web-socket-streams) + +Currently, the only property that can be set is whether `combined` stream payloads are enabled or not. The combined property is set to `false` when connecting using `/ws/` ("raw streams") and `true` when connecting using `/stream/`. + +- Request + + ``` + { "method": "SET_PROPERTY", "params": ["combined", true], "id": 5} + ``` + +- Response + + ``` + { "result": null, "id": 5} + ``` + + +### Retrieving Properties[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/web-socket-streams) + +- Request + + ``` + { "method": "GET_PROPERTY", "params": ["combined"], "id": 2} + ``` + +- Response + + ``` + { "result": true, // Indicates that combined is set to true. "id": 2} + ``` + + +### Error Messages[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/web-socket-streams) + +Error Message + +Description + +{"code": 0, "msg": "Unknown property","id": %s} + +Parameter used in the `SET_PROPERTY` or `GET_PROPERTY` was invalid + +{"code": 1, "msg": "Invalid value type: expected Boolean"} + +Value should only be `true` or `false` + +{"code": 2, "msg": "Invalid request: property name must be a string"} + +Property name provided was invalid + +{"code": 2, "msg": "Invalid request: request ID must be an unsigned integer"} + +Parameter `id` had to be provided or the value provided in the `id` parameter is an unsupported type + +{"code": 2, "msg": "Invalid request: unknown variant %s, expected one of `SUBSCRIBE`, `UNSUBSCRIBE`, `LIST_SUBSCRIPTIONS`, `SET_PROPERTY`, `GET_PROPERTY` at line 1 column 28"} + +Possible typo in the provided method or provided method was neither of the expected values + +{"code": 2, "msg": "Invalid request: too many parameters"} + +Unnecessary parameters provided in the data + +{"code": 2, "msg": "Invalid request: property name must be a string"} + +Property name was not provided + +{"code": 2, "msg": "Invalid request: missing field `method` at line 1 column 73"} + +`method` was not provided in the data + +{"code":3,"msg":"Invalid JSON: expected value at line %s column %s"} + +JSON data sent has incorrect syntax. + +# Detailed Stream information + +## Aggregate Trade Streams[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/web-socket-streams) + +The Aggregate Trade Streams push trade information that is aggregated for a single taker order. + +**Stream Name:** @aggTrade + +**Update Speed:** Real-time + +**Payload:** + +``` +{ "e": "aggTrade", // Event type "E": 1672515782136, // Event time "s": "BNBBTC", // Symbol "a": 12345, // Aggregate trade ID "p": "0.001", // Price "q": "100", // Quantity "f": 100, // First trade ID "l": 105, // Last trade ID "T": 1672515782136, // Trade time "m": true, // Is the buyer the market maker? "M": true // Ignore} +``` + +## Trade Streams[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/web-socket-streams) + +The Trade Streams push raw trade information; each trade has a unique buyer and seller. + +**Stream Name:** @trade + +**Update Speed:** Real-time + +**Payload:** + +``` +{ "e": "trade", // Event type "E": 1672515782136, // Event time "s": "BNBBTC", // Symbol "t": 12345, // Trade ID "p": "0.001", // Price "q": "100", // Quantity "T": 1672515782136, // Trade time "m": true, // Is the buyer the market maker? "M": true // Ignore} +``` + +## Kline/Candlestick Streams for UTC[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/web-socket-streams) + +The Kline/Candlestick Stream push updates to the current klines/candlestick every second in `UTC+0` timezone. + +**Kline/Candlestick chart intervals:** + +s-> seconds; m -> minutes; h -> hours; d -> days; w -> weeks; M -> months + +- 1s +- 1m +- 3m +- 5m +- 15m +- 30m +- 1h +- 2h +- 4h +- 6h +- 8h +- 12h +- 1d +- 3d +- 1w +- 1M + +**Stream Name:** @kline\_ + +**Update Speed:** 1000ms for `1s`, 2000ms for the other intervals + +**Payload:** + +``` +{ "e": "kline", // Event type "E": 1672515782136, // Event time "s": "BNBBTC", // Symbol "k": { "t": 1672515780000, // Kline start time "T": 1672515839999, // Kline close time "s": "BNBBTC", // Symbol "i": "1m", // Interval "f": 100, // First trade ID "L": 200, // Last trade ID "o": "0.0010", // Open price "c": "0.0020", // Close price "h": "0.0025", // High price "l": "0.0015", // Low price "v": "1000", // Base asset volume "n": 100, // Number of trades "x": false, // Is this kline closed? "q": "1.0000", // Quote asset volume "V": "500", // Taker buy base asset volume "Q": "0.500", // Taker buy quote asset volume "B": "123456" // Ignore }} +``` + +## Kline/Candlestick Streams with timezone offset[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/web-socket-streams) + +The Kline/Candlestick Stream push updates to the current klines/candlestick every second in `UTC+8` timezone. + +**Kline/Candlestick chart intervals:** Supported intervals: See [`Kline/Candlestick chart intervals`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/web-socket-streams) + +**UTC+8 timezone offset:** + +- Kline intervals open and close in the `UTC+8` timezone. For example the `1d` klines will open at the beginning of the `UTC+8` day, and close at the end of the `UTC+8` day. +- Note that `E` (event time), `t` (start time), and `T` (close time) in the payload are Unix timestamps, which are always interpreted in UTC. + +**Stream Name:** @kline\_@+08:00 + +**Update Speed:** 1000ms for `1s`, 2000ms for the other intervals + +**Payload:** + +``` +{ "e": "kline", // Event type "E": 1672515782136, // Event time "s": "BNBBTC", // Symbol "k": { "t": 1672515780000, // Kline start time "T": 1672515839999, // Kline close time "s": "BNBBTC", // Symbol "i": "1m", // Interval "f": 100, // First trade ID "L": 200, // Last trade ID "o": "0.0010", // Open price "c": "0.0020", // Close price "h": "0.0025", // High price "l": "0.0015", // Low price "v": "1000", // Base asset volume "n": 100, // Number of trades "x": false, // Is this kline closed? "q": "1.0000", // Quote asset volume "V": "500", // Taker buy base asset volume "Q": "0.500", // Taker buy quote asset volume "B": "123456" // Ignore }} +``` + +## Individual Symbol Mini Ticker Stream[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/web-socket-streams) + +24hr rolling window mini-ticker statistics. These are NOT the statistics of the UTC day, but a 24hr rolling window for the previous 24hrs. + +**Stream Name:** @miniTicker + +**Update Speed:** 1000ms + +**Payload:** + +``` +{ "e": "24hrMiniTicker", // Event type "E": 1672515782136, // Event time "s": "BNBBTC", // Symbol "c": "0.0025", // Close price "o": "0.0010", // Open price "h": "0.0025", // High price "l": "0.0010", // Low price "v": "10000", // Total traded base asset volume "q": "18" // Total traded quote asset volume} +``` + +## All Market Mini Tickers Stream[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/web-socket-streams) + +24hr rolling window mini-ticker statistics for all symbols that changed in an array. These are NOT the statistics of the UTC day, but a 24hr rolling window for the previous 24hrs. Note that only tickers that have changed will be present in the array. + +**Stream Name:** !miniTicker@arr + +**Update Speed:** 1000ms + +**Payload:** + +``` +[ { // Same as @miniTicker payload }] +``` + +## Individual Symbol Ticker Streams[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/web-socket-streams) + +24hr rolling window ticker statistics for a single symbol. These are NOT the statistics of the UTC day, but a 24hr rolling window for the previous 24hrs. + +**Stream Name:** @ticker + +**Update Speed:** 1000ms + +**Payload:** + +``` +{ "e": "24hrTicker", // Event type "E": 1672515782136, // Event time "s": "BNBBTC", // Symbol "p": "0.0015", // Price change "P": "250.00", // Price change percent "w": "0.0018", // Weighted average price "x": "0.0009", // First trade(F)-1 price (first trade before the 24hr rolling window) "c": "0.0025", // Last price "Q": "10", // Last quantity "b": "0.0024", // Best bid price "B": "10", // Best bid quantity "a": "0.0026", // Best ask price "A": "100", // Best ask quantity "o": "0.0010", // Open price "h": "0.0025", // High price "l": "0.0010", // Low price "v": "10000", // Total traded base asset volume "q": "18", // Total traded quote asset volume "O": 0, // Statistics open time "C": 86400000, // Statistics close time "F": 0, // First trade ID "L": 18150, // Last trade Id "n": 18151 // Total number of trades} +``` + +## Individual Symbol Rolling Window Statistics Streams[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/web-socket-streams) + +Rolling window ticker statistics for a single symbol, computed over multiple windows. + +**Stream Name:** @ticker\_ + +**Window Sizes:** 1h,4h,1d + +**Update Speed:** 1000ms + +**Note**: This stream is different from the @ticker stream. The open time `O` always starts on a minute, while the closing time `C` is the current time of the update. As such, the effective window might be up to 59999ms wider that . + +**Payload:** + +``` +{ "e": "1hTicker", // Event type "E": 1672515782136, // Event time "s": "BNBBTC", // Symbol "p": "0.0015", // Price change "P": "250.00", // Price change percent "o": "0.0010", // Open price "h": "0.0025", // High price "l": "0.0010", // Low price "c": "0.0025", // Last price "w": "0.0018", // Weighted average price "v": "10000", // Total traded base asset volume "q": "18", // Total traded quote asset volume "O": 0, // Statistics open time "C": 1675216573749, // Statistics close time "F": 0, // First trade ID "L": 18150, // Last trade Id "n": 18151 // Total number of trades} +``` + +## All Market Rolling Window Statistics Streams[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/web-socket-streams) + +Rolling window ticker statistics for all market symbols, computed over multiple windows. Note that only tickers that have changed will be present in the array. + +**Stream Name:** !ticker\_@arr + +**Window Size:** 1h,4h,1d + +**Update Speed:** 1000ms + +**Payload:** + +``` +[ { // Same as @ticker_ payload, // one for each symbol updated within the interval. }] +``` + +## Individual Symbol Book Ticker Streams[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/web-socket-streams) + +Pushes any update to the best bid or ask's price or quantity in real-time for a specified symbol. Multiple `@bookTicker` streams can be subscribed to over one connection. + +**Stream Name:** @bookTicker + +**Update Speed:** Real-time + +**Payload:** + +``` +{ "u": 400900217, // order book updateId "s": "BNBUSDT", // symbol "b": "25.35190000", // best bid price "B": "31.21000000", // best bid qty "a": "25.36520000", // best ask price "A": "40.66000000" // best ask qty} +``` + +## Average Price[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/web-socket-streams) + +Average price streams push changes in the average price over a fixed time interval. + +**Stream Name:** @avgPrice + +**Update Speed:** 1000ms + +**Payload:** + +``` +{ "e": "avgPrice", // Event type "E": 1693907033000, // Event time "s": "BTCUSDT", // Symbol "i": "5m", // Average price interval "w": "25776.86000000", // Average price "T": 1693907032213 // Last trade time} +``` + +## Partial Book Depth Streams[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/web-socket-streams) + +Top **** bids and asks, pushed every second. Valid **** are 5, 10, or 20. + +**Stream Names:** @depth OR @depth@100ms + +**Update Speed:** 1000ms or 100ms + +**Payload:** + +``` +{ "lastUpdateId": 160, // Last update ID "bids": [ // Bids to be updated [ "0.0024", // Price level to be updated "10" // Quantity ] ], "asks": [ // Asks to be updated [ "0.0026", // Price level to be updated "100" // Quantity ] ]} +``` + +## Diff. Depth Stream[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/web-socket-streams) + +Order book price and quantity depth updates used to locally manage an order book. + +**Stream Name:** @depth OR @depth@100ms + +**Update Speed:** 1000ms or 100ms + +**Payload:** + +``` +{ "e": "depthUpdate", // Event type "E": 1672515782136, // Event time "s": "BNBBTC", // Symbol "U": 157, // First update ID in event "u": 160, // Final update ID in event "b": [ // Bids to be updated [ "0.0024", // Price level to be updated "10" // Quantity ] ], "a": [ // Asks to be updated [ "0.0026", // Price level to be updated "100" // Quantity ] ]} +``` + +## How to manage a local order book correctly[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/web-socket-streams) + +1. Open a WebSocket connection to `wss://stream.testnet.binance.vision:9443/ws/bnbbtc@depth`. +2. Buffer the events received from the stream. Note the `U` of the first event you received. +3. Get a depth snapshot from `https://testnet.binance.vision/api/v3/depth?symbol=BNBBTC&limit=5000`. +4. If the `lastUpdateId` from the snapshot is strictly less than the `U` from step 2, go back to step 3. +5. In the buffered events, discard any event where `u` is <= `lastUpdateId` of the snapshot. The first buffered event should now have `lastUpdateId` within its `[U;u]` range. +6. Set your local order book to the snapshot. Its update ID is `lastUpdateId`. +7. Apply the update procedure below to all buffered events, and then to all subsequent events received. + +To apply an event to your local order book, follow this update procedure: + +1. Decide whether the update event can be applied: + - If the event last update ID (`u`) is less than the update ID of your local order book, ignore the event. + - If the event first update ID (`U`) is greater than the update ID of your local order book + 1, you have missed some events. + Discard your local order book and restart the process from the beginning. + - Normally, `U` of the next event is equal to `u + 1` of the previous event. +2. For each price level in bids (`b`) and asks (`a`), set the new quantity in the order book: + - If the price level does not exist in the order book, insert it with new quantity. + - If the quantity is zero, remove the price level from the order book. +3. Set the order book update ID to the last update ID (`u`) in the processed event. + +> \[!NOTE\] Since depth snapshots retrieved from the API have a limit on the number of price levels (5000 on each side maximum), you won't learn the quantities for the levels outside of the initial snapshot unless they change. +> So be careful when using the information for those levels, since they might not reflect the full view of the order book. +> However, for most use cases, seeing 5000 levels on each side is enough to understand the market and trade effectively. + +- [General WSS information](https://developers.binance.com/docs/binance-spot-api-docs/testnet/web-socket-streams) +- [WebSocket Limits](https://developers.binance.com/docs/binance-spot-api-docs/testnet/web-socket-streams) +- [Live Subscribing/Unsubscribing to streams](https://developers.binance.com/docs/binance-spot-api-docs/testnet/web-socket-streams) + - [Subscribe to a stream](https://developers.binance.com/docs/binance-spot-api-docs/testnet/web-socket-streams) + - [Unsubscribe to a stream](https://developers.binance.com/docs/binance-spot-api-docs/testnet/web-socket-streams) + - [Listing Subscriptions](https://developers.binance.com/docs/binance-spot-api-docs/testnet/web-socket-streams) + - [Setting Properties](https://developers.binance.com/docs/binance-spot-api-docs/testnet/web-socket-streams) + - [Retrieving Properties](https://developers.binance.com/docs/binance-spot-api-docs/testnet/web-socket-streams) + - [Error Messages](https://developers.binance.com/docs/binance-spot-api-docs/testnet/web-socket-streams) +- [Aggregate Trade Streams](https://developers.binance.com/docs/binance-spot-api-docs/testnet/web-socket-streams) +- [Trade Streams](https://developers.binance.com/docs/binance-spot-api-docs/testnet/web-socket-streams) +- [Kline/Candlestick Streams for UTC](https://developers.binance.com/docs/binance-spot-api-docs/testnet/web-socket-streams) +- [Kline/Candlestick Streams with timezone offset](https://developers.binance.com/docs/binance-spot-api-docs/testnet/web-socket-streams) +- [Individual Symbol Mini Ticker Stream](https://developers.binance.com/docs/binance-spot-api-docs/testnet/web-socket-streams) +- [All Market Mini Tickers Stream](https://developers.binance.com/docs/binance-spot-api-docs/testnet/web-socket-streams) +- [Individual Symbol Ticker Streams](https://developers.binance.com/docs/binance-spot-api-docs/testnet/web-socket-streams) +- [Individual Symbol Rolling Window Statistics Streams](https://developers.binance.com/docs/binance-spot-api-docs/testnet/web-socket-streams) +- [All Market Rolling Window Statistics Streams](https://developers.binance.com/docs/binance-spot-api-docs/testnet/web-socket-streams) +- [Individual Symbol Book Ticker Streams](https://developers.binance.com/docs/binance-spot-api-docs/testnet/web-socket-streams) +- [Average Price](https://developers.binance.com/docs/binance-spot-api-docs/testnet/web-socket-streams) +- [Partial Book Depth Streams](https://developers.binance.com/docs/binance-spot-api-docs/testnet/web-socket-streams) +- [Diff. Depth Stream](https://developers.binance.com/docs/binance-spot-api-docs/testnet/web-socket-streams) +- [How to manage a local order book correctly](https://developers.binance.com/docs/binance-spot-api-docs/testnet/web-socket-streams) diff --git a/docs/binance/binance-spot/testnet_websocket-api_account-requests.md b/docs/binance/binance-spot/testnet_websocket-api_account-requests.md new file mode 100644 index 0000000..dfbd16e --- /dev/null +++ b/docs/binance/binance-spot/testnet_websocket-api_account-requests.md @@ -0,0 +1,1149 @@ +--- +title: "Account requests | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/account-requests" +fetched_at: "2026-02-26T10:38:11.306Z" +--- +### Account information (USER\_DATA)[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/account-requests) + +``` +{ "id": "605a6d20-6588-4cb9-afa0-b0ab087507ba", "method": "account.status", "params": { "apiKey": "vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A", "signature": "83303b4a136ac1371795f465808367242685a9e3a42b22edb4d977d0696eb45c", "timestamp": 1660801839480 }} +``` + +Query information about your account. + +**Weight:** 20 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +`apiKey` + +STRING + +YES + +`omitZeroBalances` + +BOOLEAN + +NO + +When set to `true`, emits only the non-zero balances of an account. +Default value: false + +`recvWindow` + +DECIMAL + +NO + +The value cannot be greater than `60000`. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +`signature` + +STRING + +YES + +`timestamp` + +LONG + +YES + +**Data Source:** Memory => Database + +**Response:** + +``` +{ "id": "605a6d20-6588-4cb9-afa0-b0ab087507ba", "status": 200, "result": { "makerCommission": 15, "takerCommission": 15, "buyerCommission": 0, "sellerCommission": 0, "canTrade": true, "canWithdraw": true, "canDeposit": true, "commissionRates": { "maker": "0.00150000", "taker": "0.00150000", "buyer": "0.00000000", "seller": "0.00000000" }, "brokered": false, "requireSelfTradePrevention": false, "preventSor": false, "updateTime": 1660801833000, "accountType": "SPOT", "balances": [ { "asset": "BNB", "free": "0.00000000", "locked": "0.00000000" }, { "asset": "BTC", "free": "1.3447112", "locked": "0.08600000" }, { "asset": "USDT", "free": "1021.21000000", "locked": "0.00000000" } ], "permissions": ["SPOT"], "uid": 354937868 }, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 20 } ]} +``` + +### Query order (USER\_DATA)[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/account-requests) + +``` +{ "id": "aa62318a-5a97-4f3b-bdc7-640bbe33b291", "method": "order.status", "params": { "symbol": "BTCUSDT", "orderId": 12569099453, "apiKey": "vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A", "signature": "2c3aab5a078ee4ea465ecd95523b77289f61476c2f238ec10c55ea6cb11a6f35", "timestamp": 1660801720951 }} +``` + +Check execution status of an order. + +**Weight:** 4 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +`symbol` + +STRING + +YES + +`orderId` + +LONG + +YES + +Lookup order by `orderId` + +`origClientOrderId` + +STRING + +Lookup order by `clientOrderId` + +`apiKey` + +STRING + +YES + +`recvWindow` + +DECIMAL + +NO + +The value cannot be greater than 60000. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +`signature` + +STRING + +YES + +`timestamp` + +LONG + +YES + +Notes: + +- If both `orderId` and `origClientOrderId` are provided, the `orderId` is searched first, then the `origClientOrderId` from that result is checked against that order. If both conditions are not met the request will be rejected. + +- For some historical orders the `cummulativeQuoteQty` response field may be negative, meaning the data is not available at this time. + + +**Data Source:** Memory => Database + +**Response:** + +``` +{ "id": "aa62318a-5a97-4f3b-bdc7-640bbe33b291", "status": 200, "result": { "symbol": "BTCUSDT", "orderId": 12569099453, "orderListId": -1, // set only for orders of an order list "clientOrderId": "4d96324ff9d44481926157", "price": "23416.10000000", "origQty": "0.00847000", "executedQty": "0.00847000", "cummulativeQuoteQty": "198.33521500", "status": "FILLED", "timeInForce": "GTC", "type": "LIMIT", "side": "SELL", "stopPrice": "0.00000000", // always present, zero if order type does not use stopPrice "trailingDelta": 10, // present only if trailingDelta set for the order "trailingTime": -1, // present only if trailingDelta set for the order "icebergQty": "0.00000000", // always present, zero for non-iceberg orders "time": 1660801715639, // time when the order was placed "updateTime": 1660801717945, // time of the last update to the order "isWorking": true, "workingTime": 1660801715639, "origQuoteOrderQty": "0.00000000" // always present, zero if order type does not use quoteOrderQty "strategyId": 37463720, // present only if strategyId set for the order "strategyType": 1000000, // present only if strategyType set for the order "selfTradePreventionMode": "NONE", "preventedMatchId": 0, // present only if the order expired due to STP "preventedQuantity": "1.200000" // present only if the order expired due to STP }, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 4 } ]} +``` + +**Note:** The payload above does not show all fields that can appear. Please refer to [Conditional fields in Order Responses](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/trading-requests). + +### Current open orders (USER\_DATA)[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/account-requests) + +``` +{ "id": "55f07876-4f6f-4c47-87dc-43e5fff3f2e7", "method": "openOrders.status", "params": { "symbol": "BTCUSDT", "apiKey": "vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A", "signature": "d632b3fdb8a81dd44f82c7c901833309dd714fe508772a89b0a35b0ee0c48b89", "timestamp": 1660813156812 }} +``` + +Query execution status of all open orders. + +If you need to continuously monitor order status updates, please consider using WebSocket Streams: + +- [`userDataStream.start`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/account-requests) request +- [`executionReport`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/user-data-stream) user data stream event + +**Weight:** Adjusted based on the number of requested symbols: + +Parameter + +Weight + +`symbol` + +6 + +none + +80 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +`symbol` + +STRING + +NO + +If omitted, open orders for all symbols are returned + +`apiKey` + +STRING + +YES + +`recvWindow` + +DECIMAL + +NO + +The value cannot be greater than `60000`. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +`signature` + +STRING + +YES + +`timestamp` + +LONG + +YES + +**Data Source:** Memory => Database + +**Response:** + +Status reports for open orders are identical to [`order.status`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/account-requests). + +Note that some fields are optional and included only for orders that set them. + +Open orders are always returned as a flat list. If all symbols are requested, use the `symbol` field to tell which symbol the orders belong to. + +``` +{ "id": "55f07876-4f6f-4c47-87dc-43e5fff3f2e7", "status": 200, "result": [ { "symbol": "BTCUSDT", "orderId": 12569099453, "orderListId": -1, "clientOrderId": "4d96324ff9d44481926157", "price": "23416.10000000", "origQty": "0.00847000", "executedQty": "0.00720000", "cummulativeQuoteQty": "172.43931000", "status": "PARTIALLY_FILLED", "timeInForce": "GTC", "type": "LIMIT", "side": "SELL", "stopPrice": "0.00000000", "icebergQty": "0.00000000", "time": 1660801715639, "updateTime": 1660801717945, "isWorking": true, "workingTime": 1660801715639, "origQuoteOrderQty": "0.00000000", "selfTradePreventionMode": "NONE" } ], "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 6 } ]} +``` + +**Note:** The payload above does not show all fields that can appear. Please refer to [Conditional fields in Order Responses](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/trading-requests). + +### Account order history (USER\_DATA)[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/account-requests) + +``` +{ "id": "734235c2-13d2-4574-be68-723e818c08f3", "method": "allOrders", "params": { "symbol": "BTCUSDT", "startTime": 1660780800000, "endTime": 1660867200000, "limit": 5, "apiKey": "vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A", "signature": "f50a972ba7fad92842187643f6b930802d4e20bce1ba1e788e856e811577bd42", "timestamp": 1661955123341 }} +``` + +Query information about all your orders – active, canceled, filled – filtered by time range. + +**Weight:** 20 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +`symbol` + +STRING + +YES + +`orderId` + +LONG + +NO + +Order ID to begin at + +`startTime` + +LONG + +NO + +`endTime` + +LONG + +NO + +`limit` + +INT + +NO + +Default: 500; Maximum: 1000 + +`apiKey` + +STRING + +YES + +`recvWindow` + +DECIMAL + +NO + +The value cannot be greater than `60000`. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +`signature` + +STRING + +YES + +`timestamp` + +LONG + +YES + +Notes: + +- If `startTime` and/or `endTime` are specified, `orderId` is ignored. + + Orders are filtered by `time` of the last execution status update. + +- If `orderId` is specified, return orders with order ID >= `orderId`. + +- If no condition is specified, the most recent orders are returned. + +- For some historical orders the `cummulativeQuoteQty` response field may be negative, meaning the data is not available at this time. + +- The time between `startTime` and `endTime` can't be longer than 24 hours. + + +**Data Source:** Database + +**Response:** + +Status reports for orders are identical to [`order.status`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/account-requests). + +Note that some fields are optional and included only for orders that set them. + +``` +{ "id": "734235c2-13d2-4574-be68-723e818c08f3", "status": 200, "result": [ { "symbol": "BTCUSDT", "orderId": 12569099453, "orderListId": -1, "clientOrderId": "4d96324ff9d44481926157", "price": "23416.10000000", "origQty": "0.00847000", "executedQty": "0.00847000", "cummulativeQuoteQty": "198.33521500", "status": "FILLED", "timeInForce": "GTC", "type": "LIMIT", "side": "SELL", "stopPrice": "0.00000000", "icebergQty": "0.00000000", "time": 1660801715639, "updateTime": 1660801717945, "isWorking": true, "workingTime": 1660801715639, "origQuoteOrderQty": "0.00000000", "selfTradePreventionMode": "NONE", "preventedMatchId": 0, // This field only appears if the order expired due to STP. "preventedQuantity": "1.200000" // This field only appears if the order expired due to STP. } ], "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 20 } ]} +``` + +### Query Order list (USER\_DATA)[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/account-requests) + +``` +{ "id": "b53fd5ff-82c7-4a04-bd64-5f9dc42c2100", "method": "orderList.status", "params": { "origClientOrderId": "08985fedd9ea2cf6b28996" "apiKey": "vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A", "signature": "d12f4e8892d46c0ddfbd43d556ff6d818581b3be22a02810c2c20cb719aed6a4", "timestamp": 1660801713965 }} +``` + +Check execution status of an Order list. + +For execution status of individual orders, use [`order.status`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/account-requests). + +**Weight:** 4 + +**Parameters**: + +Name + +Type + +Mandatory + +Description + +`origClientOrderId` + +STRING + +NO\* + +Query order list by `listClientOrderId`. +`orderListId` or `origClientOrderId` must be provided. + +`orderListId` + +INT + +Query order list by `orderListId`. +`orderListId` or `origClientOrderId` must be provided. + +`apiKey` + +STRING + +YES + +`recvWindow` + +DECIMAL + +NO + +The value cannot be greater than 60000. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +`signature` + +STRING + +YES + +`timestamp` + +LONG + +YES + +Notes: + +- `origClientOrderId` refers to `listClientOrderId` of the order list itself. + +- If both `origClientOrderId` and `orderListId` parameters are specified, only `origClientOrderId` is used and `orderListId` is ignored. + + +**Data Source:** Database + +**Response:** + +``` +{ "id": "b53fd5ff-82c7-4a04-bd64-5f9dc42c2100", "status": 200, "result": { "orderListId": 1274512, "contingencyType": "OCO", "listStatusType": "EXEC_STARTED", "listOrderStatus": "EXECUTING", "listClientOrderId": "08985fedd9ea2cf6b28996", "transactionTime": 1660801713793, "symbol": "BTCUSDT", "orders": [ { "symbol": "BTCUSDT", "orderId": 12569138901, "clientOrderId": "BqtFCj5odMoWtSqGk2X9tU" }, { "symbol": "BTCUSDT", "orderId": 12569138902, "clientOrderId": "jLnZpj5enfMXTuhKB1d0us" } ] }, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 4 } ]} +``` + +### Current open order lists (USER\_DATA)[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/account-requests) + +``` +{ "id": "3a4437e2-41a3-4c19-897c-9cadc5dce8b6", "method": "openOrderLists.status", "params": { "apiKey": "vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A", "signature": "1bea8b157dd78c3da30359bddcd999e4049749fe50b828e620e12f64e8b433c9", "timestamp": 1660801713831 }} +``` + +Query execution status of all open order lists. + +If you need to continuously monitor order status updates, please consider using WebSocket Streams: + +- [`userDataStream.start`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/account-requests) request +- [`executionReport`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/user-data-stream) user data stream event + +**Weight**: 6 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +`apiKey` + +STRING + +YES + +`recvWindow` + +DECIMAL + +NO + +The value cannot be greater than `60000`. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +`signature` + +STRING + +YES + +`timestamp` + +LONG + +YES + +**Data Source:** Database + +**Response:** + +``` +{ "id": "3a4437e2-41a3-4c19-897c-9cadc5dce8b6", "status": 200, "result": [ { "orderListId": 0, "contingencyType": "OCO", "listStatusType": "EXEC_STARTED", "listOrderStatus": "EXECUTING", "listClientOrderId": "08985fedd9ea2cf6b28996", "transactionTime": 1660801713793, "symbol": "BTCUSDT", "orders": [ { "symbol": "BTCUSDT", "orderId": 4, "clientOrderId": "CUhLgTXnX5n2c0gWiLpV4d" }, { "symbol": "BTCUSDT", "orderId": 5, "clientOrderId": "1ZqG7bBuYwaF4SU8CwnwHm" } ] } ], "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 6 } ]} +``` + +### Account order list history (USER\_DATA)[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/account-requests) + +``` +{ "id": "8617b7b3-1b3d-4dec-94cd-eefd929b8ceb", "method": "allOrderLists", "params": { "startTime": 1660780800000, "endTime": 1660867200000, "limit": 5, "apiKey": "vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A", "signature": "c8e1484db4a4a02d0e84dfa627eb9b8298f07ebf12fcc4eaf86e4a565b2712c2", "timestamp": 1661955123341 }} +``` + +Query information about all your order lists, filtered by time range. + +**Weight:** 20 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +`fromId` + +INT + +NO + +Order list ID to begin at + +`startTime` + +LONG + +NO + +`endTime` + +LONG + +NO + +`limit` + +INT + +NO + +Default: 500; Maximum: 1000 + +`apiKey` + +STRING + +YES + +`recvWindow` + +DECIMAL + +NO + +The value cannot be greater than `60000`. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +`signature` + +STRING + +YES + +`timestamp` + +LONG + +YES + +Notes: + +- If `startTime` and/or `endTime` are specified, `fromId` is ignored. + + Order lists are filtered by `transactionTime` of the last order list execution status update. + +- If `fromId` is specified, return order lists with order list ID >= `fromId`. + +- If no condition is specified, the most recent order lists are returned. + +- The time between `startTime` and `endTime` can't be longer than 24 hours. + + +**Data Source:** Database + +**Response:** + +Status reports for order lists are identical to [`orderList.status`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/account-requests). + +``` +{ "id": "8617b7b3-1b3d-4dec-94cd-eefd929b8ceb", "status": 200, "result": [ { "orderListId": 1274512, "contingencyType": "OCO", "listStatusType": "EXEC_STARTED", "listOrderStatus": "EXECUTING", "listClientOrderId": "08985fedd9ea2cf6b28996", "transactionTime": 1660801713793, "symbol": "BTCUSDT", "orders": [ { "symbol": "BTCUSDT", "orderId": 12569138901, "clientOrderId": "BqtFCj5odMoWtSqGk2X9tU" }, { "symbol": "BTCUSDT", "orderId": 12569138902, "clientOrderId": "jLnZpj5enfMXTuhKB1d0us" } ] } ], "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 20 } ]} +``` + +### Account trade history (USER\_DATA)[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/account-requests) + +``` +{ "id": "f4ce6a53-a29d-4f70-823b-4ab59391d6e8", "method": "myTrades", "params": { "symbol": "BTCUSDT", "startTime": 1660780800000, "endTime": 1660867200000, "apiKey": "vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A", "signature": "c5a5ffb79fd4f2e10a92f895d488943a57954edf5933bde3338dfb6ea6d6eefc", "timestamp": 1661955125250 }} +``` + +Query information about all your trades, filtered by time range. + +**Weight:** + +Condition + +Weight + +Without orderId + +20 + +With orderId + +5 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +`symbol` + +STRING + +YES + +`orderId` + +LONG + +NO + +`startTime` + +LONG + +NO + +`endTime` + +LONG + +NO + +`fromId` + +INT + +NO + +First trade ID to query + +`limit` + +INT + +NO + +Default: 500; Maximum: 1000 + +`apiKey` + +STRING + +YES + +`recvWindow` + +DECIMAL + +NO + +The value cannot be greater than `60000`. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +`signature` + +STRING + +YES + +`timestamp` + +LONG + +YES + +Notes: + +- If `fromId` is specified, return trades with trade ID >= `fromId`. + +- If `startTime` and/or `endTime` are specified, trades are filtered by execution time (`time`). + + `fromId` cannot be used together with `startTime` and `endTime`. + +- If `orderId` is specified, only trades related to that order are returned. + + `startTime` and `endTime` cannot be used together with `orderId`. + +- If no condition is specified, the most recent trades are returned. + +- The time between `startTime` and `endTime` can't be longer than 24 hours. + + +**Data Source:** Memory => Database + +**Response:** + +``` +{ "id": "f4ce6a53-a29d-4f70-823b-4ab59391d6e8", "status": 200, "result": [ { "symbol": "BTCUSDT", "id": 1650422481, "orderId": 12569099453, "orderListId": -1, "price": "23416.10000000", "qty": "0.00635000", "quoteQty": "148.69223500", "commission": "0.00000000", "commissionAsset": "BNB", "time": 1660801715793, "isBuyer": false, "isMaker": true, "isBestMatch": true }, { "symbol": "BTCUSDT", "id": 1650422482, "orderId": 12569099453, "orderListId": -1, "price": "23416.50000000", "qty": "0.00212000", "quoteQty": "49.64298000", "commission": "0.00000000", "commissionAsset": "BNB", "time": 1660801715793, "isBuyer": false, "isMaker": true, "isBestMatch": true } ], "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 20 } ]} +``` + +### Account unfilled order count (USER\_DATA)[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/account-requests) + +``` +{ "id": "d3783d8d-f8d1-4d2c-b8a0-b7596af5a664", "method": "account.rateLimits.orders", "params": { "apiKey": "vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A", "signature": "76289424d6e288f4dc47d167ac824e859dabf78736f4348abbbac848d719eb94", "timestamp": 1660801839500 }} +``` + +Query your current unfilled order count for all intervals. + +**Weight:** 40 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +`apiKey` + +STRING + +YES + +`recvWindow` + +DECIMAL + +NO + +The value cannot be greater than `60000`. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +`signature` + +STRING + +YES + +`timestamp` + +LONG + +YES + +**Data Source:** Memory + +**Response:** + +``` +{ "id": "d3783d8d-f8d1-4d2c-b8a0-b7596af5a664", "status": 200, "result": [ { "rateLimitType": "ORDERS", "interval": "SECOND", "intervalNum": 10, "limit": 50, "count": 0 }, { "rateLimitType": "ORDERS", "interval": "DAY", "intervalNum": 1, "limit": 160000, "count": 0 } ], "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 40 } ]} +``` + +### Account prevented matches (USER\_DATA)[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/account-requests) + +``` +{ "id": "g4ce6a53-a39d-4f71-823b-4ab5r391d6y8", "method": "myPreventedMatches", "params": { "symbol": "BTCUSDT", "orderId": 35, "apiKey": "vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A", "signature": "c5a5ffb79fd4f2e10a92f895d488943a57954edf5933bde3338dfb6ea6d6eefc", "timestamp": 1673923281052 }} +``` + +Displays the list of orders that were expired due to STP. + +These are the combinations supported: + +- `symbol` + `preventedMatchId` +- `symbol` + `orderId` +- `symbol` + `orderId` + `fromPreventedMatchId` (`limit` will default to 500) +- `symbol` + `orderId` + `fromPreventedMatchId` + `limit` + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +preventedMatchId + +LONG + +NO + +orderId + +LONG + +NO + +fromPreventedMatchId + +LONG + +NO + +limit + +INT + +NO + +Default: `500`; Maximum: `1000` + +recvWindow + +DECIMAL + +NO + +The value cannot be greater than `60000`. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +timestamp + +LONG + +YES + +**Weight** + +Case + +Weight + +If `symbol` is invalid + +2 + +Querying by `preventedMatchId` + +2 + +Querying by `orderId` + +20 + +**Data Source:** + +Database + +**Response:** + +``` +{ "id": "g4ce6a53-a39d-4f71-823b-4ab5r391d6y8", "status": 200, "result": [ { "symbol": "BTCUSDT", "preventedMatchId": 1, "takerOrderId": 5, "makerSymbol": "BTCUSDT", "makerOrderId": 3, "tradeGroupId": 1, "selfTradePreventionMode": "EXPIRE_MAKER", "price": "1.100000", "makerPreventedQuantity": "1.300000", "transactTime": 1669101687094 } ], "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 20 } ]} +``` + +### Account allocations (USER\_DATA)[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/account-requests) + +``` +{ "id": "g4ce6a53-a39d-4f71-823b-4ab5r391d6y8", "method": "myAllocations", "params": { "symbol": "BTCUSDT", "orderId": 500, "apiKey": "vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A", "signature": "c5a5ffb79fd4f2e10a92f895d488943a57954edf5933bde3338dfb6ea6d6eefc", "timestamp": 1673923281052 }} +``` + +Retrieves allocations resulting from SOR order placement. + +**Weight:** 20 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +`symbol` + +STRING + +Yes + +`startTime` + +LONG + +No + +`endTime` + +LONG + +No + +`fromAllocationId` + +INT + +No + +`limit` + +INT + +No + +Default: 500; Maximum: 1000 + +`orderId` + +LONG + +No + +`recvWindow` + +DECIMAL + +No + +The value cannot be greater than `60000`. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +`timestamp` + +LONG + +No + +Supported parameter combinations: + +Parameters + +Response + +`symbol` + +allocations from oldest to newest + +`symbol` + `startTime` + +oldest allocations since `startTime` + +`symbol` + `endTime` + +newest allocations until `endTime` + +`symbol` + `startTime` + `endTime` + +allocations within the time range + +`symbol` + `fromAllocationId` + +allocations by allocation ID + +`symbol` + `orderId` + +allocations related to an order starting with oldest + +`symbol` + `orderId` + `fromAllocationId` + +allocations related to an order by allocation ID + +**Note:** The time between `startTime` and `endTime` can't be longer than 24 hours. + +**Data Source:** Database + +**Response:** + +``` +{ "id": "g4ce6a53-a39d-4f71-823b-4ab5r391d6y8", "status": 200, "result": [ { "symbol": "BTCUSDT", "allocationId": 0, "allocationType": "SOR", "orderId": 500, "orderListId": -1, "price": "1.00000000", "qty": "0.10000000", "quoteQty": "0.10000000", "commission": "0.00000000", "commissionAsset": "BTC", "time": 1687319487614, "isBuyer": false, "isMaker": false, "isAllocator": false } ], "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 20 } ]} +``` + +### Account Commission Rates (USER\_DATA)[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/account-requests) + +``` +{ "id": "d3df8a61-98ea-4fe0-8f4e-0fcea5d418b0", "method": "account.commission", "params": { "symbol": "BTCUSDT", "apiKey": "vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A", "signature": "c5a5ffb79fd4f2e10a92f895d488943a57954edf5933bde3338dfb6ea6d6eefc", "timestamp": 1673923281052 }} +``` + +Get current account commission rates. + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +`symbol` + +STRING + +YES + +**Weight:** 20 + +**Data Source:** Database + +**Response:** + +``` +{ "id": "d3df8a61-98ea-4fe0-8f4e-0fcea5d418b0", "status": 200, "result": { "symbol": "BTCUSDT", "standardCommission": { // Standard commission rates on trades from the order. "maker": "0.00000010", "taker": "0.00000020", "buyer": "0.00000030", "seller": "0.00000040" }, "specialCommission": { // Special commission rates from the order. "maker": "0.01000000", "taker": "0.02000000", "buyer": "0.03000000", "seller": "0.04000000" }, "taxCommission": { // Tax commission rates on trades from the order. "maker": "0.00000112", "taker": "0.00000114", "buyer": "0.00000118", "seller": "0.00000116" }, "discount": { // Discount on standard commissions when paying in BNB. "enabledForAccount": true, "enabledForSymbol": true, "discountAsset": "BNB", "discount": "0.75000000" // Standard commission is reduced by this rate when paying commission in BNB. } }, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 20 } ]} +``` + +### Query Order Amendments (USER\_DATA)[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/account-requests) + +``` +{ "id": "6f5ebe91-01d9-43ac-be99-57cf062e0e30", "method": "order.amendments", "params": { "orderId": "23", "recvWindow": 5000, "symbol": "BTCUSDT", "timestamp": 1741925524887, "apiKey": "N3Swv7WaBF7S2rzA12UkPunM3udJiDddbgv1W7CzFGnsQXH9H62zzSCST0CndjeE", "signature": "0eed2e9d95b6868ea5ec21da0d14538192ef344c30ecf9fe83d58631699334dc" }} +``` + +Queries all amendments of a single order. + +**Weight**: 4 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +orderId + +LONG + +YES + +fromExecutionId + +LONG + +NO + +limit + +INT + +NO + +Default:500; Maximum: 1000 + +recvWindow + +DECIMAL + +NO + +The value cannot be greater than `60000`. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +timestamp + +LONG + +YES + +**Data Source:** Database + +**Response:** + +``` +{ "id": "6f5ebe91-01d9-43ac-be99-57cf062e0e30", "status": 200, "result": [ { "symbol": "BTCUSDT", "orderId": 23, "executionId": 60, "origClientOrderId": "my_pending_order", "newClientOrderId": "xbxXh5SSwaHS7oUEOCI88B", "origQty": "7.00000000", "newQty": "5.00000000", "time": 1741924229819 } ], "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 4 } ]} +``` + +### Query Relevant Filters (USER\_DATA)[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/account-requests) + +``` +{ "id": "74R4febb-d142-46a2-977d-90533eb4d97g", "method": "myFilters", "params": { "recvWindow": 5000, "symbol": "BTCUSDT", "timestamp": 1758008841149, "apiKey": "nQ6kG5gDExDd5MZSO0MfOOWEVZmdkRllpNMfm1FjMjkMnmw1NUd3zPDfvcnDJlil", "signature": "7edc54dd0493dd5bc47adbab9b17bfc9b378d55c20511ae5a168456d3d37aa3a" }} +``` + +Retrieves the list of [filters](https://developers.binance.com/docs/binance-spot-api-docs/testnet/filters) relevant to an account on a given symbol. This is the only method that shows if an account has [`MAX_ASSET`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/filters) filters applied to it. + +**Weight:** 40 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +recvWindow + +DECIMAL + +NO + +The value cannot be greater than `60000`. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +timestamp + +LONG + +YES + +**Data Source:** Memory + +**Response:** + +``` +{ "id": "1758009606869", "status": 200, "result": { "exchangeFilters": [ { "filterType": "EXCHANGE_MAX_NUM_ORDERS", "maxNumOrders": 1000 } ], "symbolFilters": [ { "filterType": "MAX_NUM_ORDER_LISTS", "maxNumOrderLists": 20 } ], "assetFilters": [ { "filterType": "MAX_ASSET", "asset": "JPY", "limit": "1000000.00000000" } ] }} +``` + +- [Account information (USER\_DATA)](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/account-requests) +- [Query order (USER\_DATA)](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/account-requests) +- [Current open orders (USER\_DATA)](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/account-requests) +- [Account order history (USER\_DATA)](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/account-requests) +- [Query Order list (USER\_DATA)](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/account-requests) +- [Current open order lists (USER\_DATA)](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/account-requests) +- [Account order list history (USER\_DATA)](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/account-requests) +- [Account trade history (USER\_DATA)](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/account-requests) +- [Account unfilled order count (USER\_DATA)](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/account-requests) +- [Account prevented matches (USER\_DATA)](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/account-requests) +- [Account allocations (USER\_DATA)](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/account-requests) +- [Account Commission Rates (USER\_DATA)](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/account-requests) +- [Query Order Amendments (USER\_DATA)](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/account-requests) +- [Query Relevant Filters (USER\_DATA)](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/account-requests) diff --git a/docs/binance/binance-spot/testnet_websocket-api_authentication-requests.md b/docs/binance/binance-spot/testnet_websocket-api_authentication-requests.md new file mode 100644 index 0000000..9de4770 --- /dev/null +++ b/docs/binance/binance-spot/testnet_websocket-api_authentication-requests.md @@ -0,0 +1,111 @@ +--- +title: "Authentication requests | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/authentication-requests" +fetched_at: "2026-02-26T10:38:11.272Z" +--- +**Note:** Only _Ed25519_ keys are supported for this feature. + +### Log in with API key (SIGNED)[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/authentication-requests) + +``` +{ "id": "c174a2b1-3f51-4580-b200-8528bd237cb7", "method": "session.logon", "params": { "apiKey": "vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A", "signature": "1cf54395b336b0a9727ef27d5d98987962bc47aca6e13fe978612d0adee066ed", "timestamp": 1649729878532 }} +``` + +Authenticate WebSocket connection using the provided API key. + +After calling `session.logon`, you can omit `apiKey` and `signature` parameters for future requests that require them. + +Note that only one API key can be authenticated. Calling `session.logon` multiple times changes the current authenticated API key. + +**Weight:** 2 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +`apiKey` + +STRING + +YES + +`recvWindow` + +DECIMAL + +NO + +The value cannot be greater than `60000`. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +`signature` + +STRING + +YES + +`timestamp` + +LONG + +YES + +**Data Source:** Memory + +**Response:** + +``` +{ "id": "c174a2b1-3f51-4580-b200-8528bd237cb7", "status": 200, "result": { "apiKey": "vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A", "authorizedSince": 1649729878532, "connectedSince": 1649729873021, "returnRateLimits": false, "serverTime": 1649729878630, "userDataStream": false // is User Data Stream subscription active? }} +``` + +### Query session status[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/authentication-requests) + +``` +{ "id": "b50c16cd-62c9-4e29-89e4-37f10111f5bf", "method": "session.status"} +``` + +Query the status of the WebSocket connection, inspecting which API key (if any) is used to authorize requests. + +**Weight:** 2 + +**Parameters:** NONE + +**Data Source:** Memory + +**Response:** + +``` +{ "id": "b50c16cd-62c9-4e29-89e4-37f10111f5bf", "status": 200, "result": { // if the connection is not authenticated, "apiKey" and "authorizedSince" will be shown as null "apiKey": "vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A", "authorizedSince": 1649729878532, "connectedSince": 1649729873021, "returnRateLimits": false, "serverTime": 1649730611671, "userDataStream": true // is User Data Stream subscription active? }} +``` + +### Log out of the session[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/authentication-requests) + +``` +{ "id": "c174a2b1-3f51-4580-b200-8528bd237cb7", "method": "session.logout"} +``` + +Forget the API key previously authenticated. If the connection is not authenticated, this request does nothing. + +Note that the WebSocket connection stays open after `session.logout` request. You can continue using the connection, but now you will have to explicitly provide the `apiKey` and `signature` parameters where needed. + +**Weight:** 2 + +**Parameters:** NONE + +**Data Source:** Memory + +**Response:** + +``` +{ "id": "c174a2b1-3f51-4580-b200-8528bd237cb7", "status": 200, "result": { "apiKey": null, "authorizedSince": null, "connectedSince": 1649729873021, "returnRateLimits": false, "serverTime": 1649730611671, "userDataStream": false // is User Data Stream subscription active? }} +``` + +- [Log in with API key (SIGNED)](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/authentication-requests) +- [Query session status](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/authentication-requests) +- [Log out of the session](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/authentication-requests) diff --git a/docs/binance/binance-spot/testnet_websocket-api_data-sources.md b/docs/binance/binance-spot/testnet_websocket-api_data-sources.md new file mode 100644 index 0000000..9b4b161 --- /dev/null +++ b/docs/binance/binance-spot/testnet_websocket-api_data-sources.md @@ -0,0 +1,37 @@ +--- +title: "Data sources | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/data-sources" +fetched_at: "2026-02-26T10:38:11.308Z" +--- +- The API system is asynchronous. Some delay in the response is normal and expected. + +- Each method has a data source indicating where the data is coming from, and thus how up-to-date it is. + + +Data Source + +Latency + +Description + +Matching Engine + +lowest + +The Matching Engine produces the response directly + +Memory + +low + +Data is fetched from API server's local or external memory cache + +Database + +moderate + +Data is retrieved from the database + +- Some methods have more than one data source (e.g., Memory => Database). + + This means that the API will look for the latest data in that order: first in the cache, then in the database. diff --git a/docs/binance/binance-spot/testnet_websocket-api_event-format.md b/docs/binance/binance-spot/testnet_websocket-api_event-format.md new file mode 100644 index 0000000..8d3b2e6 --- /dev/null +++ b/docs/binance/binance-spot/testnet_websocket-api_event-format.md @@ -0,0 +1,42 @@ +--- +title: "Event format | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/event-format" +fetched_at: "2026-02-26T10:38:11.531Z" +--- +[User Data Stream](https://developers.binance.com/docs/binance-spot-api-docs/testnet/user-data-stream) events for non-SBE sessions are sent as JSON in **text frames**, one event per frame. + +Events in [SBE sessions](https://developers.binance.com/docs/binance-spot-api-docs/faqs/sbe_faq) will be sent as **binary frames**. + +Please refer to [`userDataStream.subscribe`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/user-data-stream-requests) for details on how to subscribe to User Data Stream in WebSocket API. + +Example of an event: + +``` +{ "subscriptionId": 0, "event": { "e": "outboundAccountPosition", "E": 1728972148778, "u": 1728972148778, "B": [ { "a": "BTC", "f": "11818.00000000", "l": "182.00000000" }, { "a": "USDT", "f": "10580.00000000", "l": "70.00000000" } ] }} +``` + +Event fields: + +Name + +Type + +Mandatory + +Description + +`event` + +OBJECT + +YES + +Event payload. See [User Data Streams](https://developers.binance.com/docs/binance-spot-api-docs/testnet/user-data-stream) + +`subscriptionId` + +INT + +NO + +Identifies which subscription the event is coming from. See [User Data Stream subscriptions](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/event-format) diff --git a/docs/binance/binance-spot/testnet_websocket-api_general-api-information.md b/docs/binance/binance-spot/testnet_websocket-api_general-api-information.md new file mode 100644 index 0000000..8cee877 --- /dev/null +++ b/docs/binance/binance-spot/testnet_websocket-api_general-api-information.md @@ -0,0 +1,29 @@ +--- +title: "General API Information | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/general-api-information" +fetched_at: "2026-02-26T10:38:11.524Z" +--- +- The base endpoint is: **`wss://ws-api.testnet.binance.vision/ws-api/v3`** + - If you experience issues with the standard 443 port, alternative port 9443 is also available. +- A single connection to the API is only valid for 24 hours; expect to be disconnected after the 24-hour mark. +- We support HMAC, RSA, and Ed25519 keys. For more information, please see [API Key types](https://developers.binance.com/docs/binance-spot-api-docs/faqs/api_key_types). +- Responses are in JSON by default. To receive responses in SBE, refer to the [SBE FAQ](https://developers.binance.com/docs/binance-spot-api-docs/faqs/sbe_faq) page. +- If your request contains a symbol name containing non-ASCII characters, then the response may contain non-ASCII characters encoded in UTF-8. +- Some methods may return asset and/or symbol names containing non-ASCII characters encoded in UTF-8 even if the request did not contain non-ASCII characters. +- The WebSocket server will send a `ping frame` every 20 seconds. + - If the WebSocket server does not receive a `pong frame` back from the connection within a minute the connection will be disconnected. + - When you receive a ping, you must send a pong with a copy of ping's payload as soon as possible. + - Unsolicited `pong frames` are allowed, but will not prevent disconnection. **It is recommended that the payload for these pong frames are empty.** +- Data is returned in **chronological order**, unless noted otherwise. + - Without `startTime` or `endTime`, returns the most recent items up to the limit. + - With `startTime`, returns oldest items from `startTime` up to the limit. + - With `endTime`, returns most recent items up to `endTime` and the limit. + - With both, behaves like `startTime` but does not exceed `endTime`. +- All timestamps in the JSON responses are in **milliseconds in UTC by default**. To receive the information in microseconds, please add the parameter `timeUnit=MICROSECOND` or `timeUnit=microsecond` in the URL. +- Timestamp parameters (e.g. `startTime`, `endTime`, `timestamp`) can be passed in milliseconds or microseconds. +- All field names and values are **case-sensitive**, unless noted otherwise. +- If there are enums or terms you want clarification on, please see [SPOT Glossary](https://developers.binance.com/docs/binance-spot-api-docs/faqs/spot_glossary) for more information. +- APIs have a timeout of 10 seconds when processing a request. If a response from the Matching Engine takes longer than this, the API responds with "Timeout waiting for response from backend server. Send status unknown; execution status unknown." [(-1007 TIMEOUT)](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) + - This does not always mean that the request failed in the Matching Engine. + - If the status of the request has not appeared in [User Data Stream](https://developers.binance.com/docs/binance-spot-api-docs/testnet/user-data-stream), please perform an API query for its status. +- **Please avoid SQL keywords in requests** as they may trigger a security block by a WAF (Web Application Firewall) rule. See [https://www.binance.com/en/support/faq/detail/360004492232](https://www.binance.com/en/support/faq/detail/360004492232) for more details. diff --git a/docs/binance/binance-spot/testnet_websocket-api_general-requests.md b/docs/binance/binance-spot/testnet_websocket-api_general-requests.md new file mode 100644 index 0000000..3153033 --- /dev/null +++ b/docs/binance/binance-spot/testnet_websocket-api_general-requests.md @@ -0,0 +1,130 @@ +--- +title: "General requests | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/general-requests" +fetched_at: "2026-02-26T10:38:11.585Z" +--- +### Test connectivity[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/general-requests) + +``` +{ "id": "922bcc6e-9de8-440d-9e84-7c80933a8d0d", "method": "ping"} +``` + +Test connectivity to the WebSocket API. + +**Note:** You can use regular WebSocket ping frames to test connectivity as well, WebSocket API will respond with pong frames as soon as possible. `ping` request along with `time` is a safe way to test request-response handling in your application. + +**Weight:** 1 + +**Parameters:** NONE + +**Data Source:** Memory + +**Response:** + +``` +{ "id": "922bcc6e-9de8-440d-9e84-7c80933a8d0d", "status": 200, "result": {}, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 1 } ]} +``` + +### Check server time[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/general-requests) + +``` +{ "id": "187d3cb2-942d-484c-8271-4e2141bbadb1", "method": "time"} +``` + +Test connectivity to the WebSocket API and get the current server time. + +**Weight:** 1 + +**Parameters:** NONE + +**Data Source:** Memory + +**Response:** + +``` +{ "id": "187d3cb2-942d-484c-8271-4e2141bbadb1", "status": 200, "result": { "serverTime": 1656400526260 }, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 1 } ]} +``` + +### Exchange information[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/general-requests) + +``` +{ "id": "5494febb-d167-46a2-996d-70533eb4d976", "method": "exchangeInfo", "params": { "symbols": ["BNBBTC"] }} +``` + +Query current exchange trading rules, rate limits, and symbol information. + +**Weight:** 20 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +`symbol` + +STRING + +NO + +Describe a single symbol + +`symbols` + +ARRAY of STRING + +Describe multiple symbols + +`permissions` + +ARRAY of STRING + +Filter symbols by permissions + +`showPermissionSets` + +BOOLEAN + +Controls whether the content of the `permissionSets` field is populated or not. Defaults to `true`. + +`symbolStatus` + +ENUM + +Filters for symbols that have this `tradingStatus`. +Valid values: `TRADING`, `HALT`, `BREAK` +Cannot be used in combination with `symbol` or `symbols` + +Notes: + +- Only one of `symbol`, `symbols`, `permissions` parameters can be specified. + +- Without parameters, `exchangeInfo` displays all symbols with `["SPOT, "MARGIN", "LEVERAGED"]` permissions. + + - In order to list _all_ active symbols on the exchange, you need to explicitly request all permissions. +- `permissions` accepts either a list of permissions, or a single permission name. E.g. `"SPOT"`. + +- [Available Permissions](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums) + + +**Examples of Symbol Permissions Interpretation from the Response:** + +- `[["A","B"]]` means you may place an order if your account has either permission "A" **or** permission "B". +- `[["A"],["B"]]` means you can place an order if your account has permission "A" **and** permission "B". +- `[["A"],["B","C"]]` means you can place an order if your account has permission "A" **and** permission "B" or permission "C". (Inclusive or is applied here, not exclusive or, so your account may have both permission "B" and permission "C".) + +**Data Source:** Memory + +**Response:** + +``` +{ "id": "5494febb-d167-46a2-996d-70533eb4d976", "status": 200, "result": { "timezone": "UTC", "serverTime": 1655969291181, // Global rate limits. See "Rate limits" section. "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", // Rate limit type: REQUEST_WEIGHT, ORDERS, CONNECTIONS "interval": "MINUTE", // Rate limit interval: SECOND, MINUTE, DAY "intervalNum": 1, // Rate limit interval multiplier (i.e., "1 minute") "limit": 6000 // Rate limit per interval }, { "rateLimitType": "ORDERS", "interval": "SECOND", "intervalNum": 10, "limit": 50 }, { "rateLimitType": "ORDERS", "interval": "DAY", "intervalNum": 1, "limit": 160000 }, { "rateLimitType": "CONNECTIONS", "interval": "MINUTE", "intervalNum": 5, "limit": 300 } ], // Exchange filters are explained on the "Filters" page: // https://github.com/binance/binance-spot-api-docs/blob/master/filters.md // All exchange filters are optional. "exchangeFilters": [], "symbols": [ { "symbol": "BNBBTC", "status": "TRADING", "baseAsset": "BNB", "baseAssetPrecision": 8, "quoteAsset": "BTC", "quotePrecision": 8, "quoteAssetPrecision": 8, "baseCommissionPrecision": 8, "quoteCommissionPrecision": 8, "orderTypes": [ "LIMIT", "LIMIT_MAKER", "MARKET", "STOP_LOSS_LIMIT", "TAKE_PROFIT_LIMIT" ], "icebergAllowed": true, "ocoAllowed": true, "otoAllowed": true, "opoAllowed": true, "quoteOrderQtyMarketAllowed": true, "allowTrailingStop": true, "cancelReplaceAllowed": true, "amendAllowed": false, "pegInstructionsAllowed": true, "isSpotTradingAllowed": true, "isMarginTradingAllowed": true, // Symbol filters are explained on the "Filters" page: // https://github.com/binance/binance-spot-api-docs/blob/master/filters.md // All symbol filters are optional. "filters": [ { "filterType": "PRICE_FILTER", "minPrice": "0.00000100", "maxPrice": "100000.00000000", "tickSize": "0.00000100" }, { "filterType": "LOT_SIZE", "minQty": "0.00100000", "maxQty": "100000.00000000", "stepSize": "0.00100000" } ], "permissions": [], "permissionSets": [["SPOT", "MARGIN", "TRD_GRP_004"]], "defaultSelfTradePreventionMode": "NONE", "allowedSelfTradePreventionModes": ["NONE"] } ], // Optional field. Present only when SOR is available. // https://github.com/binance/binance-spot-api-docs/blob/master/faqs/sor_faq.md "sors": [ { "baseAsset": "BTC", "symbols": ["BTCUSDT", "BTCUSDC"] } ] }, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 20 } ]} +``` + +- [Test connectivity](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/general-requests) +- [Check server time](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/general-requests) +- [Exchange information](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/general-requests) diff --git a/docs/binance/binance-spot/testnet_websocket-api_market-data-requests.md b/docs/binance/binance-spot/testnet_websocket-api_market-data-requests.md new file mode 100644 index 0000000..fcfc292 --- /dev/null +++ b/docs/binance/binance-spot/testnet_websocket-api_market-data-requests.md @@ -0,0 +1,1037 @@ +--- +title: "Market data requests | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/market-data-requests" +fetched_at: "2026-02-26T10:38:11.870Z" +--- +### Order book[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/market-data-requests) + +``` +{ "id": "51e2affb-0aba-4821-ba75-f2625006eb43", "method": "depth", "params": { "symbol": "BNBBTC", "limit": 5 }} +``` + +Get current order book. + +Note that this request returns limited market depth. + +If you need to continuously monitor order book updates, please consider using WebSocket Streams: + +- [`@depth`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/web-socket-streams) +- [`@depth`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/web-socket-streams) + +You can use `depth` request together with `@depth` streams to [maintain a local order book](https://developers.binance.com/docs/binance-spot-api-docs/testnet/web-socket-streams). + +**Weight:** Adjusted based on the limit: + +Limit + +Weight + +1–100 + +5 + +101–500 + +25 + +501–1000 + +50 + +1001–5000 + +250 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +`symbol` + +STRING + +YES + +`limit` + +INT + +NO + +Default: 100; Maximum: 5000 + +`symbolStatus` + +ENUM + +NO + +Filters for symbols that have this `tradingStatus`. +A status mismatch returns error `-1220 SYMBOL_DOES_NOT_MATCH_STATUS` +Valid values: `TRADING`, `HALT`, `BREAK` + +**Data Source:** Memory + +**Response:** + +``` +{ "id": "51e2affb-0aba-4821-ba75-f2625006eb43", "status": 200, "result": { "lastUpdateId": 2731179239, // Bid levels are sorted from highest to lowest price. "bids": [ [ "0.01379900", // Price "3.43200000" // Quantity ], ["0.01379800", "3.24300000"], ["0.01379700", "10.45500000"], ["0.01379600", "3.82100000"], ["0.01379500", "10.26200000"] ], // Ask levels are sorted from lowest to highest price. "asks": [ ["0.01380000", "5.91700000"], ["0.01380100", "6.01400000"], ["0.01380200", "0.26800000"], ["0.01380300", "0.33800000"], ["0.01380400", "0.26800000"] ] }, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 2 } ]} +``` + +### Recent trades[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/market-data-requests) + +``` +{ "id": "409a20bd-253d-41db-a6dd-687862a5882f", "method": "trades.recent", "params": { "symbol": "BNBBTC", "limit": 1 }} +``` + +Get recent trades. + +If you need access to real-time trading activity, please consider using WebSocket Streams: + +- [`@trade`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/web-socket-streams) + +**Weight:** 25 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +`symbol` + +STRING + +YES + +`limit` + +INT + +NO + +Default: 500; Maximum: 1000 + +**Data Source:** Memory + +**Response:** + +``` +{ "id": "409a20bd-253d-41db-a6dd-687862a5882f", "status": 200, "result": [ { "id": 194686783, "price": "0.01361000", "qty": "0.01400000", "quoteQty": "0.00019054", "time": 1660009530807, "isBuyerMaker": true, "isBestMatch": true } ], "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 2 } ]} +``` + +### Historical trades[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/market-data-requests) + +``` +{ "id": "cffc9c7d-4efc-4ce0-b587-6b87448f052a", "method": "trades.historical", "params": { "symbol": "BNBBTC", "fromId": 0, "limit": 1 }} +``` + +Get historical trades. + +**Weight:** 25 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +`symbol` + +STRING + +YES + +`fromId` + +INT + +NO + +Trade ID to begin at + +`limit` + +INT + +NO + +Default: 500; Maximum: 1000 + +Notes: + +- If `fromId` is not specified, the most recent trades are returned. + +**Data Source:** Database + +**Response:** + +``` +{ "id": "cffc9c7d-4efc-4ce0-b587-6b87448f052a", "status": 200, "result": [ { "id": 0, "price": "0.00005000", "qty": "40.00000000", "quoteQty": "0.00200000", "time": 1500004800376, "isBuyerMaker": true, "isBestMatch": true } ], "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 10 } ]} +``` + +### Aggregate trades[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/market-data-requests) + +``` +{ "id": "189da436-d4bd-48ca-9f95-9f613d621717", "method": "trades.aggregate", "params": { "symbol": "BNBBTC", "fromId": 50000000, "limit": 1 }} +``` + +Get aggregate trades. + +An _aggregate trade_ (aggtrade) represents one or more individual trades. Trades that fill at the same time, from the same taker order, with the same price – those trades are collected into an aggregate trade with total quantity of the individual trades. + +If you need access to real-time trading activity, please consider using WebSocket Streams: + +- [`@aggTrade`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/web-socket-streams) + +If you need historical aggregate trade data, please consider using [data.binance.vision](https://github.com/binance/binance-public-data). + +**Weight:** 4 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +`symbol` + +STRING + +YES + +`fromId` + +INT + +NO + +Aggregate trade ID to begin at + +`startTime` + +LONG + +NO + +`endTime` + +LONG + +NO + +`limit` + +INT + +NO + +Default: 500; Maximum: 1000 + +Notes: + +- If `fromId` is specified, return aggtrades with aggregate trade ID >= `fromId`. + + Use `fromId` and `limit` to page through all aggtrades. + +- If `startTime` and/or `endTime` are specified, aggtrades are filtered by execution time (`T`). + + `fromId` cannot be used together with `startTime` and `endTime`. + +- If no condition is specified, the most recent aggregate trades are returned. + + +**Data Source:** Database + +**Response:** + +``` +{ "id": "189da436-d4bd-48ca-9f95-9f613d621717", "status": 200, "result": [ { "a": 50000000, // Aggregate trade ID "p": "0.00274100", // Price "q": "57.19000000", // Quantity "f": 59120167, // First trade ID "l": 59120170, // Last trade ID "T": 1565877971222, // Timestamp "m": true, // Was the buyer the maker? "M": true // Was the trade the best price match? } ], "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 2 } ]} +``` + +### Klines[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/market-data-requests) + +``` +{ "id": "1dbbeb56-8eea-466a-8f6e-86bdcfa2fc0b", "method": "klines", "params": { "symbol": "BNBBTC", "interval": "1h", "startTime": 1655969280000, "limit": 1 }} +``` + +Get klines (candlestick bars). + +Klines are uniquely identified by their open & close time. + +If you need access to real-time kline updates, please consider using WebSocket Streams: + +- [`@kline_`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/web-socket-streams) + +If you need historical kline data, please consider using [data.binance.vision](https://github.com/binance/binance-public-data). + +**Weight:** 2 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +`symbol` + +STRING + +YES + +`interval` + +ENUM + +YES + +`startTime` + +LONG + +NO + +`endTime` + +LONG + +NO + +`timeZone` + +STRING + +NO + +Default: 0 (UTC) + +`limit` + +INT + +NO + +Default: 500; Maximum: 1000 + +Supported kline intervals (case-sensitive): + +Interval + +`interval` value + +seconds + +`1s` + +minutes + +`1m`, `3m`, `5m`, `15m`, `30m` + +hours + +`1h`, `2h`, `4h`, `6h`, `8h`, `12h` + +days + +`1d`, `3d` + +weeks + +`1w` + +months + +`1M` + +Notes: + +- If `startTime`, `endTime` are not specified, the most recent klines are returned. +- Supported values for `timeZone`: + - Hours and minutes (e.g. `-1:00`, `05:45`) + - Only hours (e.g. `0`, `8`, `4`) + - Accepted range is strictly \[-12:00 to +14:00\] inclusive +- If `timeZone` provided, kline intervals are interpreted in that timezone instead of UTC. +- Note that `startTime` and `endTime` are always interpreted in UTC, regardless of timeZone. + +**Data Source:** Database + +**Response:** + +``` +{ "id": "1dbbeb56-8eea-466a-8f6e-86bdcfa2fc0b", "status": 200, "result": [ [ 1655971200000, // Kline open time "0.01086000", // Open price "0.01086600", // High price "0.01083600", // Low price "0.01083800", // Close price "2290.53800000", // Volume 1655974799999, // Kline close time "24.85074442", // Quote asset volume 2283, // Number of trades "1171.64000000", // Taker buy base asset volume "12.71225884", // Taker buy quote asset volume "0" // Unused field, ignore ] ], "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 2 } ]} +``` + +### UI Klines[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/market-data-requests) + +``` +{ "id": "b137468a-fb20-4c06-bd6b-625148eec958", "method": "uiKlines", "params": { "symbol": "BNBBTC", "interval": "1h", "startTime": 1655969280000, "limit": 1 }} +``` + +Get klines (candlestick bars) optimized for presentation. + +This request is similar to [`klines`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/market-data-requests), having the same parameters and response. `uiKlines` return modified kline data, optimized for presentation of candlestick charts. + +**Weight:** 2 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +`symbol` + +STRING + +YES + +`interval` + +ENUM + +YES + +See [`klines`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/market-data-requests) + +`startTime` + +LONG + +NO + +`endTime` + +LONG + +NO + +`timeZone` + +STRING + +NO + +Default: 0 (UTC) + +`limit` + +INT + +NO + +Default: 500; Maximum: 1000 + +Notes: + +- If `startTime`, `endTime` are not specified, the most recent klines are returned. +- Supported values for `timeZone`: + - Hours and minutes (e.g. `-1:00`, `05:45`) + - Only hours (e.g. `0`, `8`, `4`) + - Accepted range is strictly \[-12:00 to +14:00\] inclusive +- If `timeZone` provided, kline intervals are interpreted in that timezone instead of UTC. +- Note that `startTime` and `endTime` are always interpreted in UTC, regardless of timeZone. + +**Data Source:** Database + +**Response:** + +``` +{ "id": "b137468a-fb20-4c06-bd6b-625148eec958", "status": 200, "result": [ [ 1655971200000, // Kline open time "0.01086000", // Open price "0.01086600", // High price "0.01083600", // Low price "0.01083800", // Close price "2290.53800000", // Volume 1655974799999, // Kline close time "24.85074442", // Quote asset volume 2283, // Number of trades "1171.64000000", // Taker buy base asset volume "12.71225884", // Taker buy quote asset volume "0" // Unused field, ignore ] ], "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 2 } ]} +``` + +### Current average price[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/market-data-requests) + +``` +{ "id": "ddbfb65f-9ebf-42ec-8240-8f0f91de0867", "method": "avgPrice", "params": { "symbol": "BNBBTC" }} +``` + +Get current average price for a symbol. + +**Weight:** 2 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +`symbol` + +STRING + +YES + +**Data Source:** Memory + +**Response:** + +``` +{ "id": "ddbfb65f-9ebf-42ec-8240-8f0f91de0867", "status": 200, "result": { "mins": 5, // Average price interval (in minutes) "price": "9.35751834", // Average price "closeTime": 1694061154503 // Last trade time }, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 2 } ]} +``` + +### 24hr ticker price change statistics[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/market-data-requests) + +``` +{ "id": "93fb61ef-89f8-4d6e-b022-4f035a3fadad", "method": "ticker.24hr", "params": { "symbol": "BNBBTC" }} +``` + +Get 24-hour rolling window price change statistics. + +If you need to continuously monitor trading statistics, please consider using WebSocket Streams: + +- [`@ticker`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/web-socket-streams) +- [`@miniTicker`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/web-socket-streams) or [`!miniTicker@arr`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/web-socket-streams) + +If you need different window sizes, use the [`ticker`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/market-data-requests) request. + +**Weight:** Adjusted based on the number of requested symbols: + +Symbols + +Weight + +1–20 + +2 + +21–100 + +40 + +101 or more + +80 + +all symbols + +80 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +`symbol` + +STRING + +NO + +Query ticker for a single symbol + +`symbols` + +ARRAY of STRING + +Query ticker for multiple symbols + +`type` + +ENUM + +NO + +Ticker type: `FULL` (default) or `MINI` + +symbolStatus + +ENUM + +NO + +Filters for symbols that have this `tradingStatus`. +For a single symbol, a status mismatch returns error `-1220 SYMBOL_DOES_NOT_MATCH_STATUS`. +For multiple or all symbols, non-matching ones are simply excluded from the response. +Valid values: `TRADING`, `HALT`, `BREAK` + +Notes: + +- `symbol` and `symbols` cannot be used together. + +- If no symbol is specified, returns information about all symbols currently trading on the exchange. + + +**Data Source:** Memory + +**Response:** + +`FULL` type, for a single symbol: + +``` +{ "id": "93fb61ef-89f8-4d6e-b022-4f035a3fadad", "status": 200, "result": { "symbol": "BNBBTC", "priceChange": "0.00013900", "priceChangePercent": "1.020", "weightedAvgPrice": "0.01382453", "prevClosePrice": "0.01362800", "lastPrice": "0.01376700", "lastQty": "1.78800000", "bidPrice": "0.01376700", "bidQty": "4.64600000", "askPrice": "0.01376800", "askQty": "14.31400000", "openPrice": "0.01362800", "highPrice": "0.01414900", "lowPrice": "0.01346600", "volume": "69412.40500000", "quoteVolume": "959.59411487", "openTime": 1660014164909, "closeTime": 1660100564909, "firstId": 194696115, // First trade ID "lastId": 194968287, // Last trade ID "count": 272173 // Number of trades }, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 2 } ]} +``` + +`MINI` type, for a single symbol: + +``` +{ "id": "9fa2a91b-3fca-4ed7-a9ad-58e3b67483de", "status": 200, "result": { "symbol": "BNBBTC", "openPrice": "0.01362800", "highPrice": "0.01414900", "lowPrice": "0.01346600", "lastPrice": "0.01376700", "volume": "69412.40500000", "quoteVolume": "959.59411487", "openTime": 1660014164909, "closeTime": 1660100564909, "firstId": 194696115, // First trade ID "lastId": 194968287, // Last trade ID "count": 272173 // Number of trades }, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 2 } ]} +``` + +If more than one symbol is requested, response returns an array: + +``` +{ "id": "901be0d9-fd3b-45e4-acd6-10c580d03430", "status": 200, "result": [ { "symbol": "BNBBTC", "priceChange": "0.00016500", "priceChangePercent": "1.213", "weightedAvgPrice": "0.01382508", "prevClosePrice": "0.01360800", "lastPrice": "0.01377200", "lastQty": "1.01400000", "bidPrice": "0.01377100", "bidQty": "7.55700000", "askPrice": "0.01377200", "askQty": "4.37900000", "openPrice": "0.01360700", "highPrice": "0.01414900", "lowPrice": "0.01346600", "volume": "69376.27900000", "quoteVolume": "959.13277091", "openTime": 1660014615517, "closeTime": 1660101015517, "firstId": 194697254, "lastId": 194969483, "count": 272230 }, { "symbol": "BTCUSDT", "priceChange": "-938.06000000", "priceChangePercent": "-3.938", "weightedAvgPrice": "23265.34432003", "prevClosePrice": "23819.17000000", "lastPrice": "22880.91000000", "lastQty": "0.00536000", "bidPrice": "22880.40000000", "bidQty": "0.00424000", "askPrice": "22880.91000000", "askQty": "0.04276000", "openPrice": "23818.97000000", "highPrice": "23933.25000000", "lowPrice": "22664.69000000", "volume": "153508.37606000", "quoteVolume": "3571425225.04441220", "openTime": 1660014615977, "closeTime": 1660101015977, "firstId": 1592019902, "lastId": 1597301762, "count": 5281861 } ], "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 2 } ]} +``` + +### Trading Day Ticker[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/market-data-requests) + +``` +{ "id": "f4b3b507-c8f2-442a-81a6-b2f12daa030f", "method": "ticker.tradingDay", "params": { "symbols": ["BNBBTC", "BTCUSDT"], "timeZone": "00:00" }} +``` + +Price change statistics for a trading day. + +**Weight:** + +4 for each requested symbol. + +The weight for this request will cap at 200 once the number of `symbols` in the request is more than 50. + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +`symbol` + +STRING + +YES + +Query ticker of a single symbol + +`symbols` + +ARRAY of STRING + +Query ticker for multiple symbols + +`timeZone` + +STRING + +NO + +Default: 0 (UTC) + +`type` + +ENUM + +NO + +Supported values: FULL or MINI. +If none provided, the default is FULL + +symbolStatus + +ENUM + +NO + +Filters for symbols that have this `tradingStatus`. +For a single symbol, a status mismatch returns error `-1220 SYMBOL_DOES_NOT_MATCH_STATUS`. +For multiple symbols, non-matching ones are simply excluded from the response. +Valid values: `TRADING`, `HALT`, `BREAK` + +**Notes:** + +- Supported values for `timeZone`: + - Hours and minutes (e.g. `-1:00`, `05:45`) + - Only hours (e.g. `0`, `8`, `4`) + +**Data Source:** Database + +**Response: - FULL** + +With `symbol`: + +``` +{ "id": "f4b3b507-c8f2-442a-81a6-b2f12daa030f", "status": 200, "result": { "symbol": "BTCUSDT", "priceChange": "-83.13000000", // Absolute price change "priceChangePercent": "-0.317", // Relative price change in percent "weightedAvgPrice": "26234.58803036", // quoteVolume / volume "openPrice": "26304.80000000", "highPrice": "26397.46000000", "lowPrice": "26088.34000000", "lastPrice": "26221.67000000", "volume": "18495.35066000", // Volume in base asset "quoteVolume": "485217905.04210480", "openTime": 1695686400000, "closeTime": 1695772799999, "firstId": 3220151555, "lastId": 3220849281, "count": 697727 }, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 4 } ]} +``` + +With `symbols`: + +``` +{ "id": "f4b3b507-c8f2-442a-81a6-b2f12daa030f", "status": 200, "result": [ { "symbol": "BTCUSDT", "priceChange": "-83.13000000", "priceChangePercent": "-0.317", "weightedAvgPrice": "26234.58803036", "openPrice": "26304.80000000", "highPrice": "26397.46000000", "lowPrice": "26088.34000000", "lastPrice": "26221.67000000", "volume": "18495.35066000", "quoteVolume": "485217905.04210480", "openTime": 1695686400000, "closeTime": 1695772799999, "firstId": 3220151555, "lastId": 3220849281, "count": 697727 }, { "symbol": "BNBUSDT", "priceChange": "2.60000000", "priceChangePercent": "1.238", "weightedAvgPrice": "211.92276958", "openPrice": "210.00000000", "highPrice": "213.70000000", "lowPrice": "209.70000000", "lastPrice": "212.60000000", "volume": "280709.58900000", "quoteVolume": "59488753.54750000", "openTime": 1695686400000, "closeTime": 1695772799999, "firstId": 672397461, "lastId": 672496158, "count": 98698 } ], "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 8 } ]} +``` + +**Response: - MINI** + +With `symbol`: + +``` +{ "id": "f4b3b507-c8f2-442a-81a6-b2f12daa030f", "status": 200, "result": { "symbol": "BTCUSDT", "openPrice": "26304.80000000", "highPrice": "26397.46000000", "lowPrice": "26088.34000000", "lastPrice": "26221.67000000", "volume": "18495.35066000", // Volume in base asset "quoteVolume": "485217905.04210480", // Volume in quote asset "openTime": 1695686400000, "closeTime": 1695772799999, "firstId": 3220151555, // Trade ID of the first trade in the interval "lastId": 3220849281, // Trade ID of the last trade in the interval "count": 697727 // Number of trades in the interval }, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 4 } ]} +``` + +With `symbols`: + +``` +{ "id": "f4b3b507-c8f2-442a-81a6-b2f12daa030f", "status": 200, "result": [ { "symbol": "BTCUSDT", "openPrice": "26304.80000000", "highPrice": "26397.46000000", "lowPrice": "26088.34000000", "lastPrice": "26221.67000000", "volume": "18495.35066000", "quoteVolume": "485217905.04210480", "openTime": 1695686400000, "closeTime": 1695772799999, "firstId": 3220151555, "lastId": 3220849281, "count": 697727 }, { "symbol": "BNBUSDT", "openPrice": "210.00000000", "highPrice": "213.70000000", "lowPrice": "209.70000000", "lastPrice": "212.60000000", "volume": "280709.58900000", "quoteVolume": "59488753.54750000", "openTime": 1695686400000, "closeTime": 1695772799999, "firstId": 672397461, "lastId": 672496158, "count": 98698 } ], "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 8 } ]} +``` + +### Rolling window price change statistics[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/market-data-requests) + +``` +{ "id": "f4b3b507-c8f2-442a-81a6-b2f12daa030f", "method": "ticker", "params": { "symbols": ["BNBBTC", "BTCUSDT"], "windowSize": "7d" }} +``` + +Get rolling window price change statistics with a custom window. + +This request is similar to [`ticker.24hr`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/market-data-requests), but statistics are computed on demand using the arbitrary window you specify. + +**Note:** Window size precision is limited to 1 minute. While the `closeTime` is the current time of the request, `openTime` always start on a minute boundary. As such, the effective window might be up to 59999 ms wider than the requested `windowSize`. + +Window computation example + +For example, a request for `"windowSize": "7d"` might result in the following window: + +``` +{ "openTime": 1659580020000, "closeTime": 1660184865291} +``` + +Time of the request – `closeTime` – is 1660184865291 (August 11, 2022 02:27:45.291). Requested window size should put the `openTime` 7 days before that – August 4, 02:27:45.291 – but due to limited precision it ends up a bit earlier: 1659580020000 (August 4, 2022 02:27:00), exactly at the start of a minute. + +If you need to continuously monitor trading statistics, please consider using WebSocket Streams: + +- [`@ticker_`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/web-socket-streams) or [`!ticker_@arr`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/web-socket-streams) + +**Weight:** Adjusted based on the number of requested symbols: + +Symbols + +Weight + +1–50 + +4 per symbol + +51–100 + +200 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +`symbol` + +STRING + +YES + +Query ticker of a single symbol + +`symbols` + +ARRAY of STRING + +Query ticker for multiple symbols + +`type` + +ENUM + +NO + +Ticker type: `FULL` (default) or `MINI` + +`windowSize` + +ENUM + +NO + +Default `1d` + +symbolStatus + +ENUM + +NO + +Filters for symbols that have this `tradingStatus`. +For a single symbol, a status mismatch returns error `-1220 SYMBOL_DOES_NOT_MATCH_STATUS`. +For multiple symbols, non-matching ones are simply excluded from the response. +Valid values: `TRADING`, `HALT`, `BREAK` + +Supported window sizes: + +Unit + +`windowSize` value + +minutes + +`1m`, `2m` ... `59m` + +hours + +`1h`, `2h` ... `23h` + +days + +`1d`, `2d` ... `7d` + +Notes: + +- Either `symbol` or `symbols` must be specified. + +- Maximum number of symbols in one request: 200. + +- Window size units cannot be combined. E.g., `1d 2h` is not supported. + + +**Data Source:** Database + +**Response:** + +`FULL` type, for a single symbol: + +``` +{ "id": "f4b3b507-c8f2-442a-81a6-b2f12daa030f", "status": 200, "result": { "symbol": "BNBBTC", "priceChange": "0.00061500", "priceChangePercent": "4.735", "weightedAvgPrice": "0.01368242", "openPrice": "0.01298900", "highPrice": "0.01418800", "lowPrice": "0.01296000", "lastPrice": "0.01360400", "volume": "587179.23900000", "quoteVolume": "8034.03382165", "openTime": 1659580020000, "closeTime": 1660184865291, "firstId": 192977765, // First trade ID "lastId": 195365758, // Last trade ID "count": 2387994 // Number of trades }, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 4 } ]} +``` + +`MINI` type, for a single symbol: + +``` +{ "id": "bdb7c503-542c-495c-b797-4d2ee2e91173", "status": 200, "result": { "symbol": "BNBBTC", "openPrice": "0.01298900", "highPrice": "0.01418800", "lowPrice": "0.01296000", "lastPrice": "0.01360400", "volume": "587179.23900000", "quoteVolume": "8034.03382165", "openTime": 1659580020000, "closeTime": 1660184865291, "firstId": 192977765, // First trade ID "lastId": 195365758, // Last trade ID "count": 2387994 // Number of trades }, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 4 } ]} +``` + +If more than one symbol is requested, response returns an array: + +``` +{ "id": "f4b3b507-c8f2-442a-81a6-b2f12daa030f", "status": 200, "result": [ { "symbol": "BNBBTC", "priceChange": "0.00061500", "priceChangePercent": "4.735", "weightedAvgPrice": "0.01368242", "openPrice": "0.01298900", "highPrice": "0.01418800", "lowPrice": "0.01296000", "lastPrice": "0.01360400", "volume": "587169.48600000", "quoteVolume": "8033.90114517", "openTime": 1659580020000, "closeTime": 1660184820927, "firstId": 192977765, "lastId": 195365700, "count": 2387936 }, { "symbol": "BTCUSDT", "priceChange": "1182.92000000", "priceChangePercent": "5.113", "weightedAvgPrice": "23349.27074846", "openPrice": "23135.33000000", "highPrice": "24491.22000000", "lowPrice": "22400.00000000", "lastPrice": "24318.25000000", "volume": "1039498.10978000", "quoteVolume": "24271522807.76838630", "openTime": 1659580020000, "closeTime": 1660184820927, "firstId": 1568787779, "lastId": 1604337406, "count": 35549628 } ], "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 8 } ]} +``` + +### Symbol price ticker[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/market-data-requests) + +``` +{ "id": "043a7cf2-bde3-4888-9604-c8ac41fcba4d", "method": "ticker.price", "params": { "symbol": "BNBBTC" }} +``` + +Get the latest market price for a symbol. + +If you need access to real-time price updates, please consider using WebSocket Streams: + +- [`@aggTrade`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/web-socket-streams) +- [`@trade`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/web-socket-streams) + +**Weight:** Adjusted based on the number of requested symbols: + +Parameter + +Weight + +`symbol` + +2 + +`symbols` + +4 + +none + +4 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +`symbol` + +STRING + +NO + +Query price for a single symbol + +`symbols` + +ARRAY of STRING + +Query price for multiple symbols + +symbolStatus + +ENUM + +NO + +Filters for symbols that have this `tradingStatus`. +For a single symbol, a status mismatch returns error `-1220 SYMBOL_DOES_NOT_MATCH_STATUS`. +For multiple or all symbols, non-matching ones are simply excluded from the response. +Valid values: `TRADING`, `HALT`, `BREAK` + +Notes: + +- `symbol` and `symbols` cannot be used together. + +- If no symbol is specified, returns information about all symbols currently trading on the exchange. + + +**Data Source:** Memory + +**Response:** + +``` +{ "id": "043a7cf2-bde3-4888-9604-c8ac41fcba4d", "status": 200, "result": { "symbol": "BNBBTC", "price": "0.01361900" }, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 2 } ]} +``` + +If more than one symbol is requested, response returns an array: + +``` +{ "id": "e739e673-24c8-4adf-9cfa-b81f30330b09", "status": 200, "result": [ { "symbol": "BNBBTC", "price": "0.01363700" }, { "symbol": "BTCUSDT", "price": "24267.15000000" }, { "symbol": "BNBBUSD", "price": "331.10000000" } ], "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 4 } ]} +``` + +### Symbol order book ticker[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/market-data-requests) + +``` +{ "id": "057deb3a-2990-41d1-b58b-98ea0f09e1b4", "method": "ticker.book", "params": { "symbols": ["BNBBTC", "BTCUSDT"] }} +``` + +Get the current best price and quantity on the order book. + +If you need access to real-time order book ticker updates, please consider using WebSocket Streams: + +- [`@bookTicker`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/web-socket-streams) + +**Weight:** Adjusted based on the number of requested symbols: + +Parameter + +Weight + +`symbol` + +2 + +`symbols` + +4 + +none + +4 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +`symbol` + +STRING + +NO + +Query ticker for a single symbol + +`symbols` + +ARRAY of STRING + +Query ticker for multiple symbols + +symbolStatus + +ENUM + +NO + +Filters for symbols that have this `tradingStatus`. +For a single symbol, a status mismatch returns error `-1220 SYMBOL_DOES_NOT_MATCH_STATUS`. +For multiple or all symbols, non-matching ones are simply excluded from the response. +Valid values: `TRADING`, `HALT`, `BREAK` + +Notes: + +- `symbol` and `symbols` cannot be used together. + +- If no symbol is specified, returns information about all symbols currently trading on the exchange. + + +**Data Source:** Memory + +**Response:** + +``` +{ "id": "9d32157c-a556-4d27-9866-66760a174b57", "status": 200, "result": { "symbol": "BNBBTC", "bidPrice": "0.01358000", "bidQty": "12.53400000", "askPrice": "0.01358100", "askQty": "17.83700000" }, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 2 } ]} +``` + +If more than one symbol is requested, response returns an array: + +``` +{ "id": "057deb3a-2990-41d1-b58b-98ea0f09e1b4", "status": 200, "result": [ { "symbol": "BNBBTC", "bidPrice": "0.01358000", "bidQty": "12.53400000", "askPrice": "0.01358100", "askQty": "17.83700000" }, { "symbol": "BTCUSDT", "bidPrice": "23980.49000000", "bidQty": "0.01000000", "askPrice": "23981.31000000", "askQty": "0.01512000" } ], "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 4 } ]} +``` + +- [Order book](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/market-data-requests) +- [Recent trades](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/market-data-requests) +- [Historical trades](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/market-data-requests) +- [Aggregate trades](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/market-data-requests) +- [Klines](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/market-data-requests) +- [UI Klines](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/market-data-requests) +- [Current average price](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/market-data-requests) +- [24hr ticker price change statistics](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/market-data-requests) +- [Trading Day Ticker](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/market-data-requests) +- [Rolling window price change statistics](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/market-data-requests) +- [Symbol price ticker](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/market-data-requests) +- [Symbol order book ticker](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/market-data-requests) diff --git a/docs/binance/binance-spot/testnet_websocket-api_rate-limits.md b/docs/binance/binance-spot/testnet_websocket-api_rate-limits.md new file mode 100644 index 0000000..6c4703d --- /dev/null +++ b/docs/binance/binance-spot/testnet_websocket-api_rate-limits.md @@ -0,0 +1,178 @@ +--- +title: "Rate limits | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/rate-limits" +fetched_at: "2026-02-26T10:38:11.792Z" +--- +### Connection limits[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/rate-limits) + +There is a limit of **300 connections per attempt every 5 minutes**. + +The connection is per **IP address**. + +### General information on rate limits[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/rate-limits) + +- Current API rate limits can be queried using the [`exchangeInfo`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/rate-limits) request. +- There are multiple rate limit types across multiple intervals. +- Responses can indicate current rate limit status in the optional `rateLimits` field. +- Requests fail with status `429` when unfilled order count or request rate limits are violated. + +#### How to interpret rate limits[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/rate-limits) + +A response with rate limit status may look like this: + +``` +{ "id": "7069b743-f477-4ae3-81db-db9b8df085d2", "status": 200, "result": { "serverTime": 1656400526260 }, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 70 } ]} +``` + +The `rateLimits` array describes all currently active rate limits affected by the request. + +Name + +Type + +Mandatory + +Description + +`rateLimitType` + +ENUM + +YES + +Rate limit type: `REQUEST_WEIGHT`, `ORDERS` + +`interval` + +ENUM + +YES + +Rate limit interval: `SECOND`, `MINUTE`, `HOUR`, `DAY` + +`intervalNum` + +INT + +YES + +Rate limit interval multiplier + +`limit` + +INT + +YES + +Request limit per interval + +`count` + +INT + +YES + +Current usage per interval + +Rate limits are accounted by intervals. + +For example, a `1 MINUTE` interval starts every minute. Request submitted at 00:01:23.456 counts towards the 00:01:00 minute's limit. Once the 00:02:00 minute starts, the count will reset to zero again. + +Other intervals behave in a similar manner. For example, `1 DAY` rate limit resets at 00:00 UTC every day, and `10 SECOND` interval resets at 00, 10, 20... seconds of each minute. + +APIs have multiple rate-limiting intervals. If you exhaust a shorter interval but the longer interval still allows requests, you will have to wait for the shorter interval to expire and reset. If you exhaust a longer interval, you will have to wait for that interval to reset, even if shorter rate limit count is zero. + +#### How to show/hide rate limit information[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/rate-limits) + +`rateLimits` field is included with every response by default. + +However, rate limit information can be quite bulky. If you are not interested in detailed rate limit status of every request, the `rateLimits` field can be omitted from responses to reduce their size. + +- Optional `returnRateLimits` boolean parameter in request. + + Use `returnRateLimits` parameter to control whether to include `rateLimits` fields in response to individual requests. + + Default request and response: + + ``` + { "id": 1, "method": "time" } + ``` + + ``` + { "id": 1, "status": 200, "result": { "serverTime": 1656400526260 }, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 70 } ]} + ``` + + Request and response without rate limit status: + + ``` + { "id": 2, "method": "time", "params": { "returnRateLimits": false } } + ``` + + ``` + { "id": 2, "status": 200, "result": { "serverTime": 1656400527891 } } + ``` + +- Optional `returnRateLimits` boolean parameter in connection URL. + + If you wish to omit `rateLimits` from all responses by default, use `returnRateLimits` parameter in the query string instead: + + ``` + wss://ws-api.binance.com:443/ws-api/v3?returnRateLimits=false + ``` + + This will make all requests made through this connection behave as if you have passed `"returnRateLimits": false`. + + If you _want_ to see rate limits for a particular request, you need to explicitly pass the `"returnRateLimits": true` parameter. + + +**Note:** Your requests are still rate limited if you hide the `rateLimits` field in responses. + +### IP limits[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/rate-limits) + +- Every request has a certain **weight**, added to your limit as you perform requests. + - The heavier the request (e.g. querying data from multiple symbols), the more weight the request will cost. + - Connecting to WebSocket API costs 2 weight. +- Current weight usage is indicated by the `REQUEST_WEIGHT` rate limit type. +- Use the [`exchangeInfo`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/rate-limits) request to keep track of the current weight limits. +- Weight is accumulated **per IP address** and is shared by all connections from that address. +- If you go over the weight limit, requests fail with status `429`. + - This status code indicates you should back off and stop spamming the API. + - Rate-limited responses include a `retryAfter` field, indicating when you can retry the request. +- **Repeatedly violating rate limits and/or failing to back off after receiving 429s will result in an automated IP ban and you will be disconnected.** + - Requests from a banned IP address fail with status `418`. + - `retryAfter` field indicates the timestamp when the ban will be lifted. +- IP bans are tracked and **scale in duration** for repeat offenders, **from 2 minutes to 3 days**. + +Successful response indicating that in 1 minute you have used 70 weight out of your 6000 limit: + +``` +{ "id": "7069b743-f477-4ae3-81db-db9b8df085d2", "status": 200, "result": [], "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 70 } ]} +``` + +Failed response indicating that you are banned and the ban will last until epoch `1659146400000`: + +``` +{ "id": "fc93a61a-a192-4cf4-bb2a-a8f0f0c51e06", "status": 418, "error": { "code": -1003, "msg": "Way too much request weight used; IP banned until 1659146400000. Please use WebSocket Streams for live updates to avoid bans.", "data": { "serverTime": 1659142907531, "retryAfter": 1659146400000 } }, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 2411 } ]} +``` + +### Unfilled Order Count[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/rate-limits) + +- Successfully placed orders update the `ORDERS` rate limit type. +- Rejected or unsuccessful orders might or might not update the `ORDERS` rate limit type. +- **Please note that if your orders are consistently filled by trades, you can continuously place orders on the API**. For more information, please see [Spot Unfilled Order Count Rules](https://developers.binance.com/docs/binance-spot-api-docs/faqs/order_count_decrement). +- Use the [`account.rateLimits.orders`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/account-requests) request to keep track of how many orders you have placed within this interval. +- If you exceed this, requests fail with status `429`. + - This status code indicates you should back off and stop spamming the API. + - Responses that have a status `429` include a `retryAfter` field, indicating when you can retry the request. +- This is maintained **per account** and is shared by all API keys of the account. + +Successful response indicating that you have placed 12 orders in 10 seconds, and 4043 orders in the past 24 hours: + +``` +{ "id": "e2a85d9f-07a5-4f94-8d5f-789dc3deb097", "status": 200, "result": { "symbol": "BTCUSDT", "orderId": 12510053279, "orderListId": -1, "clientOrderId": "a097fe6304b20a7e4fc436", "transactTime": 1655716096505, "price": "0.10000000", "origQty": "10.00000000", "executedQty": "0.00000000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "0.00000000", "status": "NEW", "timeInForce": "GTC", "type": "LIMIT", "side": "BUY", "workingTime": 1655716096505, "selfTradePreventionMode": "NONE" }, "rateLimits": [ { "rateLimitType": "ORDERS", "interval": "SECOND", "intervalNum": 10, "limit": 50, "count": 12 }, { "rateLimitType": "ORDERS", "interval": "DAY", "intervalNum": 1, "limit": 160000, "count": 4043 }, { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 321 } ]} +``` + +- [Connection limits](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/rate-limits) +- [General information on rate limits](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/rate-limits) +- [IP limits](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/rate-limits) +- [Unfilled Order Count](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/rate-limits) diff --git a/docs/binance/binance-spot/testnet_websocket-api_request-format.md b/docs/binance/binance-spot/testnet_websocket-api_request-format.md new file mode 100644 index 0000000..792124e --- /dev/null +++ b/docs/binance/binance-spot/testnet_websocket-api_request-format.md @@ -0,0 +1,54 @@ +--- +title: "Request format | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/request-format" +fetched_at: "2026-02-26T10:38:11.797Z" +--- +Requests must be sent as JSON in **text frames**, one request per frame. + +Example of request: + +``` +{ "id": "e2a85d9f-07a5-4f94-8d5f-789dc3deb097", "method": "order.place", "params": { "symbol": "BTCUSDT", "side": "BUY", "type": "LIMIT", "price": "0.1", "quantity": "10", "timeInForce": "GTC", "timestamp": 1655716096498, "apiKey": "T59MTDLWlpRW16JVeZ2Nju5A5C98WkMm8CSzWC4oqynUlTm1zXOxyauT8LmwXEv9", "signature": "5942ad337e6779f2f4c62cd1c26dba71c91514400a24990a3e7f5edec9323f90" }} +``` + +Request fields: + +Name + +Type + +Mandatory + +Description + +`id` + +INT / STRING / `null` + +YES + +Arbitrary ID used to match responses to requests + +`method` + +STRING + +YES + +Request method name + +`params` + +OBJECT + +NO + +Request parameters. May be omitted if there are no parameters + +- Request `id` is truly arbitrary. You can use UUIDs, sequential IDs, current timestamp, etc. The server does not interpret `id` in any way, simply echoing it back in the response. + + You can freely reuse IDs within a session. However, be careful to not send more than one request at a time with the same ID, since otherwise it might be impossible to tell the responses apart. + +- Request method names may be prefixed with explicit version: e.g., `"v3/order.place"`. + +- The order of `params` is not significant. diff --git a/docs/binance/binance-spot/testnet_websocket-api_request-security.md b/docs/binance/binance-spot/testnet_websocket-api_request-security.md new file mode 100644 index 0000000..b171301 --- /dev/null +++ b/docs/binance/binance-spot/testnet_websocket-api_request-security.md @@ -0,0 +1,589 @@ +--- +title: "Request security | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/request-security" +fetched_at: "2026-02-26T10:38:11.884Z" +--- +- Each method has a security type indicating required API key permissions, shown next to the method name (e.g., [Place new order (TRADE)](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/request-security)). +- If unspecified, the security type is `NONE`. +- Except for `NONE`, all methods with a security type are considered `SIGNED` requests (i.e. including a `signature`), except for [listenKey management](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/request-security). +- Secure methods require a valid API key to be specified and authenticated. + - API keys can be created on the [SPOT Test Network](https://testnet.binance.vision/) upon logging in with your Github account. + - **Both API key and secret key are sensitive.** Never share them with anyone. If you notice unusual activity in your account, immediately revoke all the keys and contact Binance support. +- API keys can be configured to allow access only to certain types of secure methods. + - For example, you can have an API key with `TRADE` permission for trading, while using a separate API key with `USER_DATA` permission to monitor your order status. + - By default, an API key cannot `TRADE`. You need to enable trading in API Management first. + +Security type + +Description + +`NONE` + +Public market data + +`TRADE` + +Trading on the exchange, placing and canceling orders + +`USER_DATA` + +Private account information, such as order status and your trading history + +`USER_STREAM` + +Managing User Data Stream subscriptions + +### SIGNED request security[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/request-security) + +- `SIGNED` requests require an additional parameter: `signature`, authorizing the request. + +#### Signature Case Sensitivity[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/request-security) + +- **HMAC:** Signatures generated using HMAC are **not case-sensitive**. This means the signature string can be verified regardless of letter casing. +- **RSA:** Signatures generated using RSA are **case-sensitive**. +- **Ed25519:** Signatures generated using ED25519 are also **case-sensitive** + +Please consult [SIGNED request example (HMAC)](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/request-security), [SIGNED request example (RSA)](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/request-security), and [SIGNED request example (Ed25519)](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/request-security) on how to compute signature, depending on which API key type you are using. + +### Timing security[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/request-security) + +- `SIGNED` requests also require a `timestamp` parameter which should be the current timestamp either in milliseconds or microseconds. (See [General API Information](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/request-security)) +- An additional optional parameter, `recvWindow`, specifies for how long the request stays valid and may only be specified in milliseconds. + - `recvWindow` supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + - If `recvWindow` is not sent, **it defaults to 5000 milliseconds**. + - Maximum `recvWindow` is 60000 milliseconds. +- Request processing logic is as follows: + +``` +serverTime = getCurrentTime()if (timestamp < (serverTime + 1 second) && (serverTime - timestamp) <= recvWindow) { // begin processing request serverTime = getCurrentTime() if (serverTime - timestamp) <= recvWindow { // forward request to Matching Engine } else { // reject request } // finish processing request} else { // reject request} +``` + +**Serious trading is about timing.** Networks can be unstable and unreliable, which can lead to requests taking varying amounts of time to reach the servers. With `recvWindow`, you can specify that the request must be processed within a certain number of milliseconds or be rejected by the server. + +**It is recommended to use a small `recvWindow` of 5000 or less!** + +### SIGNED request example (HMAC)[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/request-security) + +Here is a step-by-step guide on how to sign requests using an HMAC secret key. + +Example API key and secret key: + +Key + +Value + +`apiKey` + +`vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A` + +`secretKey` + +`NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j` + +**WARNING: DO NOT SHARE YOUR API KEY AND SECRET KEY WITH ANYONE.** + +The example keys are provided here only for illustrative purposes. + +Example of request with a symbol name comprised entirely of ASCII characters: + +``` +{ "id": "4885f793-e5ad-4c3b-8f6c-55d891472b71", "method": "order.place", "params": { "symbol": "BTCUSDT", "side": "SELL", "type": "LIMIT", "timeInForce": "GTC", "quantity": "0.01000000", "price": "52000.00", "recvWindow": 100, "timestamp": 1645423376532, "apiKey": "vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A", "signature": "------ FILL ME ------" }} +``` + +Example of a request with a symbol name containing non-ASCII characters: + +``` +{ "id": "4885f793-e5ad-4c3b-8f6c-55d891472b71", "method": "order.place", "params": { "symbol": "123456", "side": "BUY", "type": "LIMIT", "timeInForce": "GTC", "quantity": "0.01000000", "price": "0.10000000", "recvWindow": 5000, "timestamp": 1645423376532, "apiKey": "vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A", "signature": "------ FILL ME ------" }} +``` + +As you can see, the `signature` parameter is currently missing. + +**Step 1: Construct the signature payload** + +Take all request `params` except `signature` and **sort them in alphabetical order by parameter name**: + +For the first set of example parameters (ASCII only): + +Parameter + +Value + +`apiKey` + +vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A + +`price` + +52000.00 + +`quantity` + +0.01000000 + +`recvWindow` + +100 + +`side` + +SELL + +`symbol` + +BTCUSDT + +`timeInForce` + +GTC + +`timestamp` + +1645423376532 + +`type` + +LIMIT + +For the second set of example parameters (some non-ASCII characters): + +Parameter + +Value + +`apiKey` + +vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A + +`price` + +0.10000000 + +`quantity` + +1.00000000 + +`recvWindow` + +5000 + +`side` + +BUY + +`symbol` + +123456 + +`timeInForce` + +GTC + +`timestamp` + +1645423376532 + +`type` + +LIMIT + +Format parameters as `parameter=value` pairs separated by `&`. Values need to be encoded in UTF-8. + +For the first set of example parameters (ASCII only), the signature payload should look like this: + +``` +apiKey=vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A&price=52000.00&quantity=0.01000000&recvWindow=100&side=SELL&symbol=BTCUSDT&timeInForce=GTC×tamp=1645423376532&type=LIMIT +``` + +For the second set of example parameters (some non-ASCII characters), the signature payload should look like this: + +``` +apiKey=vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A&price=0.10000000&quantity=1.00000000&recvWindow=5000&side=BUY&symbol=123456&timeInForce=GTC×tamp=1645423376532&type=LIMIT +``` + +**Step 2: Compute the signature** + +1. Use the `secretKey` of your API key as the signing key for the HMAC-SHA-256 algorithm. +2. Sign the UTF-8 bytes of the signature payload constructed in Step 1. +3. Encode the HMAC-SHA-256 output as a hex string. + +Note that `apiKey`, `secretKey`, and the payload are **case-sensitive**, while the resulting signature value is case-insensitive. + +You can cross-check your signature algorithm implementation with OpenSSL: + +For the first set of example parameters (ASCII only): + +``` +$ echo -n 'apiKey=vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A&price=52000.00&quantity=0.01000000&recvWindow=100&side=SELL&symbol=BTCUSDT&timeInForce=GTC×tamp=1645423376532&type=LIMIT' \ | openssl dgst -hex -sha256 -hmac 'NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j'aa1b5712c094bc4e57c05a1a5c1fd8d88dcd628338ea863fec7b88e59fe2db24 +``` + +For the second set of example parameters (some non-ASCII characters): + +``` +$ echo -n 'apiKey=vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A&price=0.10000000&quantity=1.00000000&recvWindow=5000&side=BUY&symbol=123456&timeInForce=GTC×tamp=1645423376532&type=LIMIT' \ | openssl dgst -hex -sha256 -hmac 'NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j'b33892ae8e687c939f4468c6268ddd4c40ac1af18ad19a064864c47bae0752cd +``` + +**Step 3: Add `signature` to request `params`** + +Complete the request by adding the `signature` parameter with the signature string. + +For the first set of example parameters (ASCII only): + +``` +{ "id": "4885f793-e5ad-4c3b-8f6c-55d891472b71", "method": "order.place", "params": { "symbol": "BTCUSDT", "side": "SELL", "type": "LIMIT", "timeInForce": "GTC", "quantity": "0.01000000", "price": "52000.00", "recvWindow": 100, "timestamp": 1645423376532, "apiKey": "vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A", "signature": "aa1b5712c094bc4e57c05a1a5c1fd8d88dcd628338ea863fec7b88e59fe2db24" }} +``` + +For the second set of example parameters (some non-ASCII characters): + +``` +{ "id": "4885f793-e5ad-4c3b-8f6c-55d891472b71", "method": "order.place", "params": { "symbol": "123456", "side": "BUY", "type": "LIMIT", "timeInForce": "GTC", "quantity": "1.00000000", "price": "0.10000000", "recvWindow": 5000, "timestamp": 1645423376532, "apiKey": "vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A", "signature": "b33892ae8e687c939f4468c6268ddd4c40ac1af18ad19a064864c47bae0752cd" }} +``` + +### SIGNED request example (RSA)[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/request-security) + +Here is a step-by-step guide on how to sign requests using an RSA private key. + +Key + +Value + +`apiKey` + +`CAvIjXy3F44yW6Pou5k8Dy1swsYDWJZLeoK2r8G4cFDnE9nosRppc2eKc1T8TRTQ` + +These examples assume the private key is stored in the file `test-rsa-prv.pem`. + +**WARNING: DO NOT SHARE YOUR API KEY AND PRIVATE KEY WITH ANYONE.** + +The example keys are provided here only for illustrative purposes. + +Example of request with a symbol name comprised entirely of ASCII characters: + +``` +{ "id": "4885f793-e5ad-4c3b-8f6c-55d891472b71", "method": "order.place", "params": { "symbol": "BTCUSDT", "side": "SELL", "type": "LIMIT", "timeInForce": "GTC", "quantity": "0.01000000", "price": "52000.00", "recvWindow": 100, "timestamp": 1645423376532, "apiKey": "CAvIjXy3F44yW6Pou5k8Dy1swsYDWJZLeoK2r8G4cFDnE9nosRppc2eKc1T8TRTQ", "signature": "------ FILL ME ------" }} +``` + +Example of a request with a symbol name containing non-ASCII characters: + +``` +{ "id": "4885f793-e5ad-4c3b-8f6c-55d891472b71", "method": "order.place", "params": { "symbol": "123456", "side": "BUY", "type": "LIMIT", "timeInForce": "GTC", "quantity": "0.01000000", "price": "0.10000000", "recvWindow": 5000, "timestamp": 1645423376532, "apiKey": "CAvIjXy3F44yW6Pou5k8Dy1swsYDWJZLeoK2r8G4cFDnE9nosRppc2eKc1T8TRTQ", "signature": "------ FILL ME ------" }} +``` + +**Step 1: Construct the signature payload** + +Take all request `params` except `signature` and **sort them in alphabetical order by parameter name**: + +For the first set of example parameters (ASCII only): + +Parameter + +Value + +`apiKey` + +CAvIjXy3F44yW6Pou5k8Dy1swsYDWJZLeoK2r8G4cFDnE9nosRppc2eKc1T8TRTQ + +`price` + +52000.00 + +`quantity` + +0.01000000 + +`recvWindow` + +100 + +`side` + +SELL + +`symbol` + +BTCUSDT + +`timeInForce` + +GTC + +`timestamp` + +1645423376532 + +`type` + +LIMIT + +For the second set of example parameters (some non-ASCII characters): + +Parameter + +Value + +`apiKey` + +CAvIjXy3F44yW6Pou5k8Dy1swsYDWJZLeoK2r8G4cFDnE9nosRppc2eKc1T8TRTQ + +`price` + +0.10000000 + +`quantity` + +1.00000000 + +`recvWindow` + +5000 + +`side` + +BUY + +`symbol` + +123456 + +`timeInForce` + +GTC + +`timestamp` + +1645423376532 + +`type` + +LIMIT + +Format parameters as `parameter=value` pairs separated by `&`. Values need to be encoded in UTF-8. + +For the first set of example parameters (ASCII only), the signature payload should look like this: + +``` +apiKey=CAvIjXy3F44yW6Pou5k8Dy1swsYDWJZLeoK2r8G4cFDnE9nosRppc2eKc1T8TRTQ&price=52000.00&quantity=0.01000000&recvWindow=100&side=SELL&symbol=BTCUSDT&timeInForce=GTC×tamp=1645423376532&type=LIMIT +``` + +For the second set of example parameters (some non-ASCII characters), the signature payload should look like this: + +``` +apiKey=CAvIjXy3F44yW6Pou5k8Dy1swsYDWJZLeoK2r8G4cFDnE9nosRppc2eKc1T8TRTQ&price=0.10000000&quantity=1.00000000&recvWindow=5000&side=BUY&symbol=123456&timeInForce=GTC×tamp=1645423376532&type=LIMIT +``` + +**Step 2: Compute the signature** + +1. Sign the UTF-8 bytes of the signature payload constructed in Step 1 using the RSASSA-PKCS1-v1\_5 algorithm with SHA-256 hash function. +2. Encode the output in base64. + +Note that `apiKey`, the payload, and the resulting `signature` are **case-sensitive**. + +You can cross-check your signature algorithm implementation with OpenSSL: + +For the first set of example parameters (ASCII only): + +``` +$ echo -n 'apiKey=CAvIjXy3F44yW6Pou5k8Dy1swsYDWJZLeoK2r8G4cFDnE9nosRppc2eKc1T8TRTQ&price=52000.00&quantity=0.01000000&recvWindow=100&side=SELL&symbol=BTCUSDT&timeInForce=GTC×tamp=1645423376532&type=LIMIT' \ | openssl dgst -sha256 -sign test-rsa-prv.pem \ | openssl enc -base64 -AOJJaf8C/3VGrU4ATTR4GiUDqL2FboSE1Qw7UnnoYNfXTXHubIl1iaePGuGyfct4NPu5oVEZCH4Q6ZStfB1w4ssgu0uiB/Bg+fBrRFfVgVaLKBdYHMvT+ljUJzqVaeoThG9oXlduiw8PbS9U8DYAbDvWN3jqZLo4Z2YJbyovyDAvDTr/oC0+vssLqP7NmlNb3fF3Bj7StmOwJvQJTbRAtzxK5PP7OQe+0mbW+D7RqVkUiSswR8qJFWTeSe4nXXNIdZdueYhF/Xf25L+KitJS5IHdIHcKfEw3MQzHFb2ZsGWkjDQwxkwr7Noi0Zaa+gFtxCuatGFm9dFIyx217pmSHtA== +``` + +For the second set of example parameters (some non-ASCII characters): + +``` +$ echo -n 'apiKey=CAvIjXy3F44yW6Pou5k8Dy1swsYDWJZLeoK2r8G4cFDnE9nosRppc2eKc1T8TRTQ&price=0.10000000&quantity=1.00000000&recvWindow=5000&side=BUY&symbol=123456&timeInForce=GTC×tamp=1645423376532&type=LIMIT' \ | openssl dgst -sha256 -sign test-rsa-prv.pem \ | openssl enc -base64 -AF3o/79Ttvl2cVYGPfBOF3oEOcm5QcYmTYWpdVIrKve5u+8paMNDAdUE+teqMxFM9HcquetGcfuFpLYtsQames5bDx/tskGM76TWW8HaM+6tuSYBSFLrKqChfA9hQGLYGjAiflf1YBnDhY+7vNbJFusUborNOloOj+ufzP5q42PvI3H0uNy3W5V3pyfXpDGCBtfCYYr9NAqA4d+AQfyllL/zkO9h9JSdozN49t0/hWGoD2dWgSO0Je6MytKEvD4DQXGeqNlBTB6tUXcWnRW+FcaKZ4KYqnxCtb1u8rFXUYgFykr2CbcJLSmw6ydEJ3EZ/NaZopRr+cU0W2m0HZ3qucw== +``` + +**Step 3: Add `signature` to request `params`** + +Complete the request by adding the `signature` parameter with the signature string. + +For the first set of example parameters (ASCII only): + +``` +{ "id": "4885f793-e5ad-4c3b-8f6c-55d891472b71", "method": "order.place", "params": { "symbol": "BTCUSDT", "side": "SELL", "type": "LIMIT", "timeInForce": "GTC", "quantity": "0.01000000", "price": "52000.00", "newOrderRespType": "ACK", "recvWindow": 100, "timestamp": 1645423376532, "apiKey": "CAvIjXy3F44yW6Pou5k8Dy1swsYDWJZLeoK2r8G4cFDnE9nosRppc2eKc1T8TRTQ", "signature": "OJJaf8C/3VGrU4ATTR4GiUDqL2FboSE1Qw7UnnoYNfXTXHubIl1iaePGuGyfct4NPu5oVEZCH4Q6ZStfB1w4ssgu0uiB/Bg+fBrRFfVgVaLKBdYHMvT+ljUJzqVaeoThG9oXlduiw8PbS9U8DYAbDvWN3jqZLo4Z2YJbyovyDAvDTr/oC0+vssLqP7NmlNb3fF3Bj7StmOwJvQJTbRAtzxK5PP7OQe+0mbW+D7RqVkUiSswR8qJFWTeSe4nXXNIdZdueYhF/Xf25L+KitJS5IHdIHcKfEw3MQzHFb2ZsGWkjDQwxkwr7Noi0Zaa+gFtxCuatGFm9dFIyx217pmSHtA==" }} +``` + +For the second set of example parameters (some non-ASCII characters): + +``` +{ "id": "4885f793-e5ad-4c3b-8f6c-55d891472b71", "method": "order.place", "params": { "symbol": "123456", "side": "SELL", "type": "LIMIT", "timeInForce": "GTC", "quantity": "1.00000000", "price": "0.10000000", "recvWindow": 5000, "timestamp": 1645423376532, "apiKey": "CAvIjXy3F44yW6Pou5k8Dy1swsYDWJZLeoK2r8G4cFDnE9nosRppc2eKc1T8TRTQ", "signature": "F3o/79Ttvl2cVYGPfBOF3oEOcm5QcYmTYWpdVIrKve5u+8paMNDAdUE+teqMxFM9HcquetGcfuFpLYtsQames5bDx/tskGM76TWW8HaM+6tuSYBSFLrKqChfA9hQGLYGjAiflf1YBnDhY+7vNbJFusUborNOloOj+ufzP5q42PvI3H0uNy3W5V3pyfXpDGCBtfCYYr9NAqA4d+AQfyllL/zkO9h9JSdozN49t0/hWGoD2dWgSO0Je6MytKEvD4DQXGeqNlBTB6tUXcWnRW+FcaKZ4KYqnxCtb1u8rFXUYgFykr2CbcJLSmw6ydEJ3EZ/NaZopRr+cU0W2m0HZ3qucw==" }} +``` + +### SIGNED Request Example (Ed25519)[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/request-security) + +**Note: It is highly recommended to use Ed25519 API keys as they will provide the best performance and security out of all supported key types.** + +Here is a step-by-step guide on how to sign requests using an Ed25519 private key. + +Key + +Value + +`apiKey` + +`4yNzx3yWC5bS6YTwEkSRaC0nRmSQIIStAUOh1b6kqaBrTLIhjCpI5lJH8q8R8WNO` + +These examples assume the private key is stored in the file `test-ed25519-prv.pem`. + +**WARNING: DO NOT SHARE YOUR API KEY AND PRIVATE KEY WITH ANYONE.** + +The example keys are provided here only for illustrative purposes. + +Example of request with a symbol name comprised entirely of ASCII characters: + +``` +{ "id": "4885f793-e5ad-4c3b-8f6c-55d891472b71", "method": "order.place", "params": { "symbol": "BTCUSDT", "side": "SELL", "type": "LIMIT", "timeInForce": "GTC", "quantity": "0.01000000", "price": "52000.00", "recvWindow": 100, "timestamp": 1645423376532, "apiKey": "4yNzx3yWC5bS6YTwEkSRaC0nRmSQIIStAUOh1b6kqaBrTLIhjCpI5lJH8q8R8WNO", "signature": "------ FILL ME ------" }} +``` + +Example of a request with a symbol name containing non-ASCII characters: + +``` +{ "id": "4885f793-e5ad-4c3b-8f6c-55d891472b71", "method": "order.place", "params": { "symbol": "123456", "side": "BUY", "type": "LIMIT", "timeInForce": "GTC", "quantity": "0.01000000", "price": "0.10000000", "recvWindow": 5000, "timestamp": 1645423376532, "apiKey": "4yNzx3yWC5bS6YTwEkSRaC0nRmSQIIStAUOh1b6kqaBrTLIhjCpI5lJH8q8R8WNO", "signature": "------ FILL ME ------" }} +``` + +**Step 1: Construct the signature payload** + +Take all request `params` except `signature` and **sort them in alphabetical order by parameter name**: + +For the first set of example parameters (ASCII only): + +Parameter + +Value + +`apiKey` + +4yNzx3yWC5bS6YTwEkSRaC0nRmSQIIStAUOh1b6kqaBrTLIhjCpI5lJH8q8R8WNO + +`price` + +52000.00 + +`quantity` + +0.01000000 + +`recvWindow` + +100 + +`side` + +SELL + +`symbol` + +BTCUSDT + +`timeInForce` + +GTC + +`timestamp` + +1645423376532 + +`type` + +LIMIT + +For the second set of example parameters (some non-ASCII characters): + +Parameter + +Value + +`apiKey` + +4yNzx3yWC5bS6YTwEkSRaC0nRmSQIIStAUOh1b6kqaBrTLIhjCpI5lJH8q8R8WNO + +`price` + +0.20000000 + +`quantity` + +1.00000000 + +`recvWindow` + +5000 + +`side` + +SELL + +`symbol` + +123456 + +`timeInForce` + +GTC + +`timestamp` + +1668481559918 + +`type` + +LIMIT + +Format parameters as `parameter=value` pairs separated by `&`. Values need to be encoded in UTF-8. + +For the first set of example parameters (ASCII only), the signature payload should look like this: + +``` +apiKey=4yNzx3yWC5bS6YTwEkSRaC0nRmSQIIStAUOh1b6kqaBrTLIhjCpI5lJH8q8R8WNO&price=52000.00&quantity=0.01000000&recvWindow=100&side=SELL&symbol=BTCUSDT&timeInForce=GTC×tamp=1645423376532&type=LIMIT +``` + +For the second set of example parameters (some non-ASCII characters), the signature payload should look like this: + +``` +apiKey=4yNzx3yWC5bS6YTwEkSRaC0nRmSQIIStAUOh1b6kqaBrTLIhjCpI5lJH8q8R8WNO&price=0.10000000&quantity=1.00000000&recvWindow=5000&side=BUY&symbol=123456&timeInForce=GTC×tamp=1645423376532&type=LIMIT +``` + +**Step 2: Compute the signature** + +1. Sign the UTF-8 bytes of your signature payload constructed in Step 1 using the Ed25519 private key. +2. Encode the output in base64. + +Note that `apiKey`, the payload, and the resulting `signature` are **case-sensitive**. + +You can cross-check your signature algorithm implementation with OpenSSL: + +For the first set of example parameters (ASCII only): + +``` +echo -n "apiKey=4yNzx3yWC5bS6YTwEkSRaC0nRmSQIIStAUOh1b6kqaBrTLIhjCpI5lJH8q8R8WNO&price=52000.00&quantity=0.01000000&recvWindow=100&side=SELL&symbol=BTCUSDT&timeInForce=GTC×tamp=1645423376532&type=LIMIT" \ | openssl dgst -sign ./test-ed25519-prv.pem \ | openssl enc -base64 -AEocljwPl29jDxWYaaRaOo4pJ9wEblFbklJvPugNscLLuKd5vHM2grWjn1z+rY0aJ7r/44enxHL6mOAJuJ1kqCg== +``` + +For the second set of example parameters (some non-ASCII characters): + +``` +echo -n "apiKey=4yNzx3yWC5bS6YTwEkSRaC0nRmSQIIStAUOh1b6kqaBrTLIhjCpI5lJH8q8R8WNO&price=0.10000000&quantity=1.00000000&recvWindow=5000&side=BUY&symbol=123456&timeInForce=GTC×tamp=1645423376532&type=LIMIT" \ | openssl dgst -sign ./test-ed25519-prv.pem \ | openssl enc -base64 -AdtNHJeyKry+cNjiGv+sv5kynO9S40tf8k7D5CfAEQAp0s2scunZj+ovJdz2OgW8XhkB9G3/HmASkA9uY9eyFCA== +``` + +**Step 3: Add the signature to request `params`** + +For the first set of example parameters (ASCII only): + +``` +{ "id": "4885f793-e5ad-4c3b-8f6c-55d891472b71", "method": "order.place", "params": { "symbol": "BTCUSDT", "side": "SELL", "type": "LIMIT", "timeInForce": "GTC", "quantity": "0.01000000", "price": "52000.00", "newOrderRespType": "ACK", "recvWindow": 100, "timestamp": 1645423376532, "apiKey": "4yNzx3yWC5bS6YTwEkSRaC0nRmSQIIStAUOh1b6kqaBrTLIhjCpI5lJH8q8R8WNO", "signature": "EocljwPl29jDxWYaaRaOo4pJ9wEblFbklJvPugNscLLuKd5vHM2grWjn1z+rY0aJ7r/44enxHL6mOAJuJ1kqCg==" }} +``` + +For the second set of example parameters (some non-ASCII characters): + +``` +{ "id": "4885f793-e5ad-4c3b-8f6c-55d891472b71", "method": "order.place", "params": { "symbol": "123456", "side": "SELL", "type": "LIMIT", "timeInForce": "GTC", "quantity": "1.00000000", "price": "0.10000000", "recvWindow": 5000, "timestamp": 1645423376532, "apiKey": "4yNzx3yWC5bS6YTwEkSRaC0nRmSQIIStAUOh1b6kqaBrTLIhjCpI5lJH8q8R8WNO", "signature": "dtNHJeyKry+cNjiGv+sv5kynO9S40tf8k7D5CfAEQAp0s2scunZj+ovJdz2OgW8XhkB9G3/HmASkA9uY9eyFCA==" }} +``` + +Here is a sample Python script performing all the steps above: + +``` +#!/usr/bin/env python3import base64import timeimport jsonfrom cryptography.hazmat.primitives.serialization import load_pem_private_keyfrom websocket import create_connection# Set up authenticationAPI_KEY='put your own API Key here'PRIVATE_KEY_PATH='test-prv-key.pem'# Load the private key.# In this example the key is expected to be stored without encryption,# but we recommend using a strong password for improved security.with open(PRIVATE_KEY_PATH, 'rb') as f: private_key = load_pem_private_key(data=f.read(), password=None)# Set up the request parametersparams = { 'apiKey': API_KEY, 'symbol': '123456', 'side': 'SELL', 'type': 'LIMIT', 'timeInForce': 'GTC', 'quantity': '1.0000000', 'price': '0.10000000', 'recvWindow': 5000}# Timestamp the requesttimestamp = int(time.time() * 1000) # UNIX timestamp in millisecondsparams['timestamp'] = timestamp# Sort parameters alphabetically by nameparams = dict(sorted(params.items()))# Compute the signature payloadpayload = '&'.join([f"{k}={v}" for k,v in params.items()]) # no percent encoding here!# Sign the requestsignature = base64.b64encode(private_key.sign(payload.encode('UTF-8')))params['signature'] = signature.decode('ASCII')# Send the requestrequest = { 'id': 'my_new_order', 'method': 'order.place', 'params': params}ws = create_connection("wss://ws-api.testnet.binance.vision/ws-api/v3")ws.send(json.dumps(request))result = ws.recv()ws.close()print(result) +``` + +- [SIGNED request security](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/request-security) +- [Timing security](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/request-security) +- [SIGNED request example (HMAC)](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/request-security) +- [SIGNED request example (RSA)](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/request-security) +- [SIGNED Request Example (Ed25519)](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/request-security) diff --git a/docs/binance/binance-spot/testnet_websocket-api_response-format.md b/docs/binance/binance-spot/testnet_websocket-api_response-format.md new file mode 100644 index 0000000..ec07417 --- /dev/null +++ b/docs/binance/binance-spot/testnet_websocket-api_response-format.md @@ -0,0 +1,86 @@ +--- +title: "Response format | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/response-format" +fetched_at: "2026-02-26T10:38:12.057Z" +--- +Responses are returned as JSON in **text frames**, one response per frame. + +Example of successful response: + +``` +{ "id": "e2a85d9f-07a5-4f94-8d5f-789dc3deb097", "status": 200, "result": { "symbol": "BTCUSDT", "orderId": 12510053279, "orderListId": -1, "clientOrderId": "a097fe6304b20a7e4fc436", "transactTime": 1655716096505, "price": "0.10000000", "origQty": "10.00000000", "executedQty": "0.00000000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "0.00000000", "status": "NEW", "timeInForce": "GTC", "type": "LIMIT", "side": "BUY", "workingTime": 1655716096505, "selfTradePreventionMode": "NONE" }, "rateLimits": [ { "rateLimitType": "ORDERS", "interval": "SECOND", "intervalNum": 10, "limit": 50, "count": 12 }, { "rateLimitType": "ORDERS", "interval": "DAY", "intervalNum": 1, "limit": 160000, "count": 4043 }, { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 321 } ]} +``` + +Example of failed response: + +``` +{ "id": "e2a85d9f-07a5-4f94-8d5f-789dc3deb097", "status": 400, "error": { "code": -2010, "msg": "Account has insufficient balance for requested action." }, "rateLimits": [ { "rateLimitType": "ORDERS", "interval": "SECOND", "intervalNum": 10, "limit": 50, "count": 13 }, { "rateLimitType": "ORDERS", "interval": "DAY", "intervalNum": 1, "limit": 160000, "count": 4044 }, { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 322 } ]} +``` + +Response fields: + +Name + +Type + +Mandatory + +Description + +`id` + +INT / STRING / `null` + +YES + +Same as in the original request + +`status` + +INT + +YES + +Response status. See [Status codes](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/response-format) + +`result` + +OBJECT / ARRAY + +YES + +Response content. Present if request succeeded + +`error` + +OBJECT + +Error description. Present if request failed + +`rateLimits` + +ARRAY + +NO + +Rate limiting status. See [Rate limits](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/response-format) + +### Status codes[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/response-format) + +Status codes in the `status` field are the same as in HTTP. + +Here are some common status codes that you might encounter: + +- `200` indicates a successful response. +- `4XX` status codes indicate invalid requests; the issue is on your side. + - `400` – your request failed, see `error` for the reason. + - `403` – you have been blocked by the Web Application Firewall. This can indicate a rate limit violation or a security block. See [https://www.binance.com/en/support/faq/detail/360004492232](https://www.binance.com/en/support/faq/detail/360004492232) for more details. + - `409` – your request partially failed but also partially succeeded, see `error` for details. + - `418` – you have been auto-banned for repeated violation of rate limits. + - `429` – you have exceeded API request rate limit, please slow down. +- `5XX` status codes indicate internal errors; the issue is on Binance's side. + - **Important:** If a response contains 5xx status code, it **does not** necessarily mean that your request has failed. Execution status is _unknown_ and the request might have actually succeeded. Please use query methods to confirm the status. You might also want to establish a new WebSocket connection for that. + +See [Error codes for Binance](https://developers.binance.com/docs/binance-spot-api-docs/testnet/errors) for a list of error codes and messages. + +- [Status codes](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/response-format) diff --git a/docs/binance/binance-spot/testnet_websocket-api_session-authentication.md b/docs/binance/binance-spot/testnet_websocket-api_session-authentication.md new file mode 100644 index 0000000..2951228 --- /dev/null +++ b/docs/binance/binance-spot/testnet_websocket-api_session-authentication.md @@ -0,0 +1,37 @@ +--- +title: "Session Authentication | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/session-authentication" +fetched_at: "2026-02-26T10:38:12.191Z" +--- +**Note:** Only _Ed25519_ keys are supported for this feature. + +If you do not want to specify `apiKey` and `signature` in each individual request, you can authenticate your API key for the active WebSocket session. + +Once authenticated, you no longer have to specify `apiKey` and `signature` for those requests that need them. Requests will be performed on behalf of the account owning the authenticated API key. + +**Note:** You still have to specify the `timestamp` parameter for `SIGNED` requests. + +### Authenticate after connection[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/session-authentication) + +You can authenticate an already established connection using session authentication requests: + +- [`session.logon`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/session-authentication) – authenticate, or change the API key associated with the connection +- [`session.status`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/session-authentication) – check connection status and the current API key +- [`session.logout`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/session-authentication) – forget the API key associated with the connection + +**Regarding API key revocation:** + +If during an active session the API key becomes invalid for _any reason_ (e.g. IP address is not whitelisted, API key was deleted, API key doesn't have correct permissions, etc), after the next request the session will be revoked with the following error message: + +``` +{ "id": null, "status": 401, "error": { "code": -2015, "msg": "Invalid API-key, IP, or permissions for action." }} +``` + +### Authorize _ad hoc_ requests[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/session-authentication) + +Only one API key can be authenticated with the WebSocket connection. The authenticated API key is used by default for requests that require an `apiKey` parameter. However, you can always specify the `apiKey` and `signature` explicitly for individual requests, overriding the authenticated API key and using a different one to authorize a specific request. + +For example, you might want to authenticate your `USER_DATA` key to be used by default, but specify the `TRADE` key with an explicit signature when placing orders. + +- [Authenticate after connection](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/session-authentication) +- [Authorize _ad hoc_ requests](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/session-authentication) diff --git a/docs/binance/binance-spot/testnet_websocket-api_trading-requests.md b/docs/binance/binance-spot/testnet_websocket-api_trading-requests.md new file mode 100644 index 0000000..0039f11 --- /dev/null +++ b/docs/binance/binance-spot/testnet_websocket-api_trading-requests.md @@ -0,0 +1,3324 @@ +--- +title: "Trading requests | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/trading-requests" +fetched_at: "2026-02-26T10:38:12.294Z" +--- +### Place new order (TRADE)[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/trading-requests) + +``` +{ "id": "56374a46-3061-486b-a311-99ee972eb648", "method": "order.place", "params": { "symbol": "BTCUSDT", "side": "SELL", "type": "LIMIT", "timeInForce": "GTC", "price": "23416.10000000", "quantity": "0.00847000", "apiKey": "vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A", "signature": "15af09e41c36f3cc61378c2fbe2c33719a03dd5eba8d0f9206fbda44de717c88", "timestamp": 1660801715431 }} +``` + +Send in a new order. + +This adds 1 order to the `EXCHANGE_MAX_ORDERS` filter and the `MAX_NUM_ORDERS` filter. + +**Weight:** 1 + +**Unfilled Order Count:** 1 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +`symbol` + +STRING + +YES + +`side` + +ENUM + +YES + +`BUY` or `SELL` + +`type` + +ENUM + +YES + +`timeInForce` + +ENUM + +NO \* + +`price` + +DECIMAL + +NO \* + +`quantity` + +DECIMAL + +NO \* + +`quoteOrderQty` + +DECIMAL + +NO \* + +`newClientOrderId` + +STRING + +NO + +Arbitrary unique ID among open orders. Automatically generated if not sent + +`newOrderRespType` + +ENUM + +NO + +Select response format: `ACK`, `RESULT`, `FULL`. + +`MARKET` and `LIMIT` orders use `FULL` by default, other order types default to `ACK`. + +`stopPrice` + +DECIMAL + +NO \* + +`trailingDelta` + +INT + +NO \* + +See [Trailing Stop order FAQ](https://developers.binance.com/docs/binance-spot-api-docs/faqs/trailing-stop-faq) + +`icebergQty` + +DECIMAL + +NO + +`strategyId` + +LONG + +NO + +Arbitrary numeric value identifying the order within an order strategy. + +`strategyType` + +INT + +NO + +Arbitrary numeric value identifying the order strategy. + +Values smaller than `1000000` are reserved and cannot be used. + +`selfTradePreventionMode` + +ENUM + +NO + +The allowed enums is dependent on what is configured on the symbol. Supported values: [STP Modes](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums) + +`pegPriceType` + +ENUM + +NO + +`PRIMARY_PEG` or `MARKET_PEG` +See [Pegged Orders](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/trading-requests) + +`pegOffsetValue` + +INT + +NO + +Price level to peg the price to (max: 100) +See [Pegged Orders](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/trading-requests) + +`pegOffsetType` + +ENUM + +NO + +Only `PRICE_LEVEL` is supported +See [Pegged Orders](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/trading-requests) + +`apiKey` + +STRING + +YES + +`recvWindow` + +DECIMAL + +NO + +The value cannot be greater than `60000`. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +`signature` + +STRING + +YES + +`timestamp` + +LONG + +YES + +Certain parameters (\*) become mandatory based on the order `type`: + +Order `type` + +Mandatory parameters + +`LIMIT` + +- `timeInForce` +- `price` +- `quantity` + +`LIMIT_MAKER` + +- `price` +- `quantity` + +`MARKET` + +- `quantity` or `quoteOrderQty` + +`STOP_LOSS` + +- `quantity` +- `stopPrice` or `trailingDelta` + +`STOP_LOSS_LIMIT` + +- `timeInForce` +- `price` +- `quantity` +- `stopPrice` or `trailingDelta` + +`TAKE_PROFIT` + +- `quantity` +- `stopPrice` or `trailingDelta` + +`TAKE_PROFIT_LIMIT` + +- `timeInForce` +- `price` +- `quantity` +- `stopPrice` or `trailingDelta` + +Supported order types: + +Order `type` + +Description + +`LIMIT` + +Buy or sell `quantity` at the specified `price` or better. + +`LIMIT_MAKER` + +`LIMIT` order that will be rejected if it immediately matches and trades as a taker. + +This order type is also known as a POST-ONLY order. + +`MARKET` + +Buy or sell at the best available market price. + +- `MARKET` order with `quantity` parameter specifies the amount of the _base asset_ you want to buy or sell. Actually executed quantity of the quote asset will be determined by available market liquidity. + + E.g., a MARKET BUY order on BTCUSDT for `"quantity": "0.1000"` specifies that you want to buy 0.1 BTC at the best available price. If there is not enough BTC at the best price, keep buying at the next best price, until either your order is filled, or you run out of USDT, or market runs out of BTC. + +- `MARKET` order with `quoteOrderQty` parameter specifies the amount of the _quote asset_ you want to spend (when buying) or receive (when selling). Actually executed quantity of the base asset will be determined by available market liquidity. + + E.g., a MARKET BUY on BTCUSDT for `"quoteOrderQty": "100.00"` specifies that you want to buy as much BTC as you can for 100 USDT at the best available price. Similarly, a SELL order will sell as much available BTC as needed for you to receive 100 USDT (before commission). + + +`STOP_LOSS` + +Execute a `MARKET` order for given `quantity` when specified conditions are met. + +I.e., when `stopPrice` is reached, or when `trailingDelta` is activated. + +`STOP_LOSS_LIMIT` + +Place a `LIMIT` order with given parameters when specified conditions are met. + +`TAKE_PROFIT` + +Like `STOP_LOSS` but activates when market price moves in the favorable direction. + +`TAKE_PROFIT_LIMIT` + +Like `STOP_LOSS_LIMIT` but activates when market price moves in the favorable direction. + +Notes on using parameters for Pegged Orders: + +- These parameters are allowed for `LIMIT`, `LIMIT_MAKER`, `STOP_LOSS_LIMIT`, `TAKE_PROFIT_LIMIT` orders. +- If `pegPriceType` is specified, `price` becomes optional. Otherwise, it is still mandatory. +- `pegPriceType=PRIMARY_PEG` means the primary peg, that is the best price on the same side of the order book as your order. +- `pegPriceType=MARKET_PEG` means the market peg, that is the best price on the opposite side of the order book from your order. +- Use `pegOffsetType` and `pegOffsetValue` to request a price level other than the best one. These parameters must be specified together. + +Available `timeInForce` options, setting how long the order should be active before expiration: + +TIF + +Description + +`GTC` + +**Good 'til Canceled** – the order will remain on the book until you cancel it, or the order is completely filled. + +`IOC` + +**Immediate or Cancel** – the order will be filled for as much as possible, the unfilled quantity immediately expires. + +`FOK` + +**Fill or Kill** – the order will expire unless it cannot be immediately filled for the entire quantity. + +Notes: + +- `newClientOrderId` specifies `clientOrderId` value for the order. + + A new order with the same `clientOrderId` is accepted only when the previous one is filled or expired. + +- Any `LIMIT` or `LIMIT_MAKER` order can be made into an iceberg order by specifying the `icebergQty`. + + An order with an `icebergQty` must have `timeInForce` set to `GTC`. + +- Trigger order price rules for `STOP_LOSS`/`TAKE_PROFIT` orders: + + - `stopPrice` must be above market price: `STOP_LOSS BUY`, `TAKE_PROFIT SELL` + - `stopPrice` must be below market price: `STOP_LOSS SELL`, `TAKE_PROFIT BUY` +- `MARKET` orders using `quoteOrderQty` follow [`LOT_SIZE`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/filters) filter rules. + + The order will execute a quantity that has notional value as close as possible to requested `quoteOrderQty`. + + +**Data Source:** Matching Engine + +**Response:** + +Response format is selected by using the `newOrderRespType` parameter. + +`ACK` response type: + +``` +{ "id": "56374a46-3061-486b-a311-99ee972eb648", "status": 200, "result": { "symbol": "BTCUSDT", "orderId": 12569099453, "orderListId": -1, // always -1 for singular orders "clientOrderId": "4d96324ff9d44481926157ec08158a40", "transactTime": 1660801715639 }, "rateLimits": [ { "rateLimitType": "ORDERS", "interval": "SECOND", "intervalNum": 10, "limit": 50, "count": 1 }, { "rateLimitType": "ORDERS", "interval": "DAY", "intervalNum": 1, "limit": 160000, "count": 1 }, { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 1 } ]} +``` + +`RESULT` response type: + +``` +{ "id": "56374a46-3061-486b-a311-99ee972eb648", "status": 200, "result": { "symbol": "BTCUSDT", "orderId": 12569099453, "orderListId": -1, // always -1 for singular orders "clientOrderId": "4d96324ff9d44481926157ec08158a40", "transactTime": 1660801715639, "price": "23416.10000000", "origQty": "0.00847000", "executedQty": "0.00000000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "0.00000000", "status": "NEW", "timeInForce": "GTC", "type": "LIMIT", "side": "SELL", "workingTime": 1660801715639, "selfTradePreventionMode": "NONE" }, "rateLimits": [ { "rateLimitType": "ORDERS", "interval": "SECOND", "intervalNum": 10, "limit": 50, "count": 1 }, { "rateLimitType": "ORDERS", "interval": "DAY", "intervalNum": 1, "limit": 160000, "count": 1 }, { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 1 } ]} +``` + +`FULL` response type: + +``` +{ "id": "56374a46-3061-486b-a311-99ee972eb648", "status": 200, "result": { "symbol": "BTCUSDT", "orderId": 12569099453, "orderListId": -1, "clientOrderId": "4d96324ff9d44481926157ec08158a40", "transactTime": 1660801715793, "price": "23416.10000000", "origQty": "0.00847000", "executedQty": "0.00847000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "198.33521500", "status": "FILLED", "timeInForce": "GTC", "type": "LIMIT", "side": "SELL", "workingTime": 1660801715793, // FULL response is identical to RESULT response, with the same optional fields // based on the order type and parameters. FULL response additionally includes // the list of trades which immediately filled the order. "fills": [ { "price": "23416.10000000", "qty": "0.00635000", "commission": "0.000000", "commissionAsset": "BNB", "tradeId": 1650422481 }, { "price": "23416.50000000", "qty": "0.00212000", "commission": "0.000000", "commissionAsset": "BNB", "tradeId": 1650422482 } ] }, "rateLimits": [ { "rateLimitType": "ORDERS", "interval": "SECOND", "intervalNum": 10, "limit": 50, "count": 1 }, { "rateLimitType": "ORDERS", "interval": "DAY", "intervalNum": 1, "limit": 160000, "count": 1 }, { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 1 } ]} +``` + +**Conditional fields in Order Responses** + +There are fields in the order responses (e.g. order placement, order query, order cancellation) that appear only if certain conditions are met. + +These fields can apply to Order lists. + +The fields are listed below: + +Field + +Description + +Visibility conditions + +Examples + +`icebergQty` + +Quantity for the iceberg order + +Appears only if the parameter `icebergQty` was sent in the request. + +`"icebergQty": "0.00000000"` + +`preventedMatchId` + +When used in combination with `symbol`, can be used to query a prevented match. + +Appears only if the order expired due to STP. + +`"preventedMatchId": 0` + +`preventedQuantity` + +Order quantity that expired due to STP + +Appears only if the order expired due to STP. + +`"preventedQuantity": "1.200000"` + +`stopPrice` + +Price when the algorithmic order will be triggered + +Appears for `STOP_LOSS`. `TAKE_PROFIT`, `STOP_LOSS_LIMIT` and `TAKE_PROFIT_LIMIT` orders. + +`"stopPrice": "23500.00000000"` + +`strategyId` + +Can be used to label an order that's part of an order strategy. + +Appears if the parameter was populated in the request. + +`"strategyId": 37463720` + +`strategyType` + +Can be used to label an order that is using an order strategy. + +Appears if the parameter was populated in the request. + +`"strategyType": 1000000` + +`trailingDelta` + +Delta price change required before order activation + +Appears for Trailing Stop Orders. + +`"trailingDelta": 10` + +`trailingTime` + +Time when the trailing order is now active and tracking price changes + +Appears only for Trailing Stop Orders. + +`"trailingTime": -1` + +`usedSor` + +Field that determines whether order used SOR + +Appears when placing orders using SOR + +`"usedSor": true` + +`workingFloor` + +Field that determines whether the order is being filled by the SOR or by the order book the order was submitted to. + +Appears when placing orders using SOR + +`"workingFloor": "SOR"` + +`pegPriceType` + +Price peg type + +Only for pegged orders + +`"pegPriceType": "PRIMARY_PEG"` + +`pegOffsetType` + +Price peg offset type + +Only for pegged orders, if requested + +`"pegOffsetType": "PRICE_LEVEL"` + +`pegOffsetValue` + +Price peg offset value + +Only for pegged orders, if requested + +`"pegOffsetValue": 5` + +`peggedPrice` + +Current price order is pegged at + +Only for pegged orders, once determined + +`"peggedPrice": "87523.83710000"` + +### Test new order (TRADE)[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/trading-requests) + +``` +{ "id": "6ffebe91-01d9-43ac-be99-57cf062e0e30", "method": "order.test", "params": { "symbol": "BTCUSDT", "side": "SELL", "type": "LIMIT", "timeInForce": "GTC", "price": "23416.10000000", "quantity": "0.00847000", "apiKey": "vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A", "signature": "15af09e41c36f3cc61378c2fbe2c33719a03dd5eba8d0f9206fbda44de717c88", "timestamp": 1660801715431 }} +``` + +Test order placement. + +Validates new order parameters and verifies your signature but does not send the order into the matching engine. + +**Weight:** + +Condition + +Request Weight + +Without `computeCommissionRates` + +1 + +With `computeCommissionRates` + +20 + +**Parameters:** + +In addition to all parameters accepted by [`order.place`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/trading-requests), the following optional parameters are also accepted: + +Name + +Type + +Mandatory + +Description + +`computeCommissionRates` + +BOOLEAN + +NO + +Default: `false` +See [Commissions FAQ](https://developers.binance.com/docs/binance-spot-api-docs/faqs/commission_faq) to learn more. + +**Data Source:** Memory + +**Response:** + +Without `computeCommissionRates`: + +``` +{ "id": "6ffebe91-01d9-43ac-be99-57cf062e0e30", "status": 200, "result": {}, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 1 } ]} +``` + +With `computeCommissionRates`: + +``` +{ "id": "6ffebe91-01d9-43ac-be99-57cf062e0e30", "status": 200, "result": { "standardCommissionForOrder": { // Standard commission rates on trades from the order. "maker": "0.00000112", "taker": "0.00000114" }, "specialCommissionForOrder": { // Special commission rates on trades from the order. "maker": "0.05000000", "taker": "0.06000000" }, "taxCommissionForOrder": { // Tax commission rates for trades from the order "maker": "0.00000112", "taker": "0.00000114" }, "discount": { // Discount on standard commissions when paying in BNB. "enabledForAccount": true, "enabledForSymbol": true, "discountAsset": "BNB", "discount": "0.25000000" // Standard commission is reduced by this rate when paying in BNB. } }, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 20 } ]} +``` + +### Cancel order (TRADE)[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/trading-requests) + +``` +{ "id": "5633b6a2-90a9-4192-83e7-925c90b6a2fd", "method": "order.cancel", "params": { "symbol": "BTCUSDT", "origClientOrderId": "4d96324ff9d44481926157", "apiKey": "vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A", "signature": "33d5b721f278ae17a52f004a82a6f68a70c68e7dd6776ed0be77a455ab855282", "timestamp": 1660801715830 }} +``` + +Cancel an active order. + +**Weight:** 1 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +`symbol` + +STRING + +YES + +`orderId` + +LONG + +YES + +Cancel order by `orderId` + +`origClientOrderId` + +STRING + +Cancel order by `clientOrderId` + +`newClientOrderId` + +STRING + +NO + +New ID for the canceled order. Automatically generated if not sent + +`cancelRestrictions` + +ENUM + +NO + +Supported values: +`ONLY_NEW` - Cancel will succeed if the order status is `NEW`. +`ONLY_PARTIALLY_FILLED` - Cancel will succeed if order status is `PARTIALLY_FILLED`. + +`apiKey` + +STRING + +YES + +`recvWindow` + +DECIMAL + +NO + +The value cannot be greater than 60000. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +`signature` + +STRING + +YES + +`timestamp` + +LONG + +YES + +Notes: + +- If both `orderId` and `origClientOrderId` parameters are provided, the `orderId` is searched first, then the `origClientOrderId` from that result is checked against that order. If both conditions are not met the request will be rejected. + +- `newClientOrderId` will replace `clientOrderId` of the canceled order, freeing it up for new orders. + +- If you cancel an order that is a part of an order list, the entire order list is canceled. + +- The performance for canceling an order (single cancel or as part of a cancel-replace) is always better when only `orderId` is sent. Sending `origClientOrderId` or both `orderId` + `origClientOrderId` will be slower. + + +**Data Source:** Matching Engine + +**Response:** + +When an individual order is canceled: + +``` +{ "id": "5633b6a2-90a9-4192-83e7-925c90b6a2fd", "status": 200, "result": { "symbol": "BTCUSDT", "origClientOrderId": "4d96324ff9d44481926157", // clientOrderId that was canceled "orderId": 12569099453, "orderListId": -1, // set only for legs of an order list "clientOrderId": "91fe37ce9e69c90d6358c0", // newClientOrderId from request "transactTime": 1684804350068, "price": "23416.10000000", "origQty": "0.00847000", "executedQty": "0.00001000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "0.23416100", "status": "CANCELED", "timeInForce": "GTC", "type": "LIMIT", "side": "SELL", "stopPrice": "0.00000000", // present only if stopPrice set for the order "trailingDelta": 0, // present only if trailingDelta set for the order "icebergQty": "0.00000000", // present only if icebergQty set for the order "strategyId": 37463720, // present only if strategyId set for the order "strategyType": 1000000, // present only if strategyType set for the order "selfTradePreventionMode": "NONE" }, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 1 } ]} +``` + +When an order list is canceled: + +``` +{ "id": "16eaf097-bbec-44b9-96ff-e97e6e875870", "status": 200, "result": { "orderListId": 19431, "contingencyType": "OCO", "listStatusType": "ALL_DONE", "listOrderStatus": "ALL_DONE", "listClientOrderId": "iuVNVJYYrByz6C4yGOPPK0", "transactionTime": 1660803702431, "symbol": "BTCUSDT", "orders": [ { "symbol": "BTCUSDT", "orderId": 12569099453, "clientOrderId": "bX5wROblo6YeDwa9iTLeyY" }, { "symbol": "BTCUSDT", "orderId": 12569099454, "clientOrderId": "Tnu2IP0J5Y4mxw3IATBfmW" } ], // order list order's status format is the same as for individual orders. "orderReports": [ { "symbol": "BTCUSDT", "origClientOrderId": "bX5wROblo6YeDwa9iTLeyY", "orderId": 12569099453, "orderListId": 19431, "clientOrderId": "OFFXQtxVFZ6Nbcg4PgE2DA", "transactTime": 1684804350068, "price": "23450.50000000", "origQty": "0.00850000", "executedQty": "0.00000000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "0.00000000", "status": "CANCELED", "timeInForce": "GTC", "type": "STOP_LOSS_LIMIT", "side": "BUY", "stopPrice": "23430.00000000", "selfTradePreventionMode": "NONE" }, { "symbol": "BTCUSDT", "origClientOrderId": "Tnu2IP0J5Y4mxw3IATBfmW", "orderId": 12569099454, "orderListId": 19431, "clientOrderId": "OFFXQtxVFZ6Nbcg4PgE2DA", "transactTime": 1684804350068, "price": "23400.00000000", "origQty": "0.00850000", "executedQty": "0.00000000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "0.00000000", "status": "CANCELED", "timeInForce": "GTC", "type": "LIMIT_MAKER", "side": "BUY", "selfTradePreventionMode": "NONE" } ] }, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 1 } ]} +``` + +**Note:** The payload above does not show all fields that can appear. Please refer to [Conditional fields in Order Responses](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/trading-requests). + +**Regarding `cancelRestrictions`** + +- If the `cancelRestrictions` value is not any of the supported values, the error will be: + +``` +{ "code": -1145, "msg": "Invalid cancelRestrictions"} +``` + +- If the order did not pass the conditions for `cancelRestrictions`, the error will be: + +``` +{ "code": -2011, "msg": "Order was not canceled due to cancel restrictions."} +``` + +### Cancel and replace order (TRADE)[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/trading-requests) + +``` +{ "id": "99de1036-b5e2-4e0f-9b5c-13d751c93a1a", "method": "order.cancelReplace", "params": { "symbol": "BTCUSDT", "cancelReplaceMode": "ALLOW_FAILURE", "cancelOrigClientOrderId": "4d96324ff9d44481926157", "side": "SELL", "type": "LIMIT", "timeInForce": "GTC", "price": "23416.10000000", "quantity": "0.00847000", "apiKey": "vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A", "signature": "7028fdc187868754d25e42c37ccfa5ba2bab1d180ad55d4c3a7e2de643943dc5", "timestamp": 1660813156900 }} +``` + +Cancel an existing order and immediately place a new order instead of the canceled one. + +A new order that was not attempted (i.e. when `newOrderResult: NOT_ATTEMPTED`), will still increase the unfilled order count by 1. + +**Weight:** 1 + +**Unfilled Order Count:** 1 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +`symbol` + +STRING + +YES + +`cancelReplaceMode` + +ENUM + +YES + +`cancelOrderId` + +LONG + +YES + +Cancel order by `orderId` + +`cancelOrigClientOrderId` + +STRING + +Cancel order by `clientOrderId` + +`cancelNewClientOrderId` + +STRING + +NO + +New ID for the canceled order. Automatically generated if not sent + +`side` + +ENUM + +YES + +`BUY` or `SELL` + +`type` + +ENUM + +YES + +`timeInForce` + +ENUM + +NO \* + +`price` + +DECIMAL + +NO \* + +`quantity` + +DECIMAL + +NO \* + +`quoteOrderQty` + +DECIMAL + +NO \* + +`newClientOrderId` + +STRING + +NO + +Arbitrary unique ID among open orders. Automatically generated if not sent + +`newOrderRespType` + +ENUM + +NO + +Select response format: `ACK`, `RESULT`, `FULL`. + +`MARKET` and `LIMIT` orders produce `FULL` response by default, other order types default to `ACK`. + +`stopPrice` + +DECIMAL + +NO \* + +`trailingDelta` + +DECIMAL + +NO \* + +See [Trailing Stop order FAQ](https://developers.binance.com/docs/binance-spot-api-docs/faqs/trailing-stop-faq) + +`icebergQty` + +DECIMAL + +NO + +`strategyId` + +LONG + +NO + +Arbitrary numeric value identifying the order within an order strategy. + +`strategyType` + +INT + +NO + +Arbitrary numeric value identifying the order strategy. + +Values smaller than 1000000 are reserved and cannot be used. + +`selfTradePreventionMode` + +ENUM + +NO + +The allowed enums is dependent on what is configured on the symbol. + +Supported values: [STP Modes](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums.md). + +`cancelRestrictions` + +ENUM + +NO + +Supported values: +`ONLY_NEW` - Cancel will succeed if the order status is `NEW`. +`ONLY_PARTIALLY_FILLED` - Cancel will succeed if order status is `PARTIALLY_FILLED`. For more information please refer to [Regarding `cancelRestrictions`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/trading-requests). + +`apiKey` + +STRING + +YES + +`orderRateLimitExceededMode` + +ENUM + +NO + +Supported values: +`DO_NOTHING` (default)- will only attempt to cancel the order if account has not exceeded the unfilled order rate limit +`CANCEL_ONLY` - will always cancel the order. + +`pegPriceType` + +ENUM + +NO + +`PRIMARY_PEG` or `MARKET_PEG`. +See [Pegged Orders](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/trading-requests)" + +`pegOffsetValue` + +INT + +NO + +Price level to peg the price to (max: 100) +See [Pegged Orders](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/trading-requests) + +`pegOffsetType` + +ENUM + +NO + +Only `PRICE_LEVEL` is supported +See [Pegged Orders](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/trading-requests) + +`recvWindow` + +DECIMAL + +NO + +The value cannot be greater than 60000. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +`signature` + +STRING + +YES + +`timestamp` + +LONG + +YES + +Similar to the [`order.place`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/trading-requests) request, additional mandatory parameters (\*) are determined by the new order [`type`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/trading-requests). + +Available `cancelReplaceMode` options: + +- `STOP_ON_FAILURE` – if cancellation request fails, new order placement will not be attempted. +- `ALLOW_FAILURE` – new order placement will be attempted even if the cancel request fails. + +Request + +Response + +`cancelReplaceMode` + +`orderRateLimitExceededMode` + +Unfilled Order Count + +`cancelResult` + +`newOrderResult` + +`status` + +`STOP_ON_FAILURE` + +`DO_NOTHING` + +Within Limits + +✅ `SUCCESS` + +✅ `SUCCESS` + +`200` + +❌ `FAILURE` + +➖ `NOT_ATTEMPTED` + +`400` + +✅ `SUCCESS` + +❌ `FAILURE` + +`409` + +Exceeds Limits + +✅ `SUCCESS` + +✅ `SUCCESS` + +N/A + +❌ `FAILURE` + +➖ `NOT_ATTEMPTED` + +N/A + +✅ `SUCCESS` + +❌ `FAILURE` + +N/A + +`CANCEL_ONLY` + +Within Limits + +✅ `SUCCESS` + +✅ `SUCCESS` + +`200` + +❌ `FAILURE` + +➖ `NOT_ATTEMPTED` + +`400` + +✅ `SUCCESS` + +❌ `FAILURE` + +`409` + +Exceeds Limits + +❌ `FAILURE` + +➖ `NOT_ATTEMPTED` + +`429` + +✅ `SUCCESS` + +❌ `FAILURE` + +`429` + +`ALLOW_FAILURE` + +`DO_NOTHING` + +Within Limits + +✅ `SUCCESS` + +✅ `SUCCESS` + +`200` + +❌ `FAILURE` + +❌ `FAILURE` + +`400` + +❌ `FAILURE` + +✅ `SUCCESS` + +`409` + +✅ `SUCCESS` + +❌ `FAILURE` + +`409` + +Exceeds Limits + +✅ `SUCCESS` + +✅ `SUCCESS` + +N/A + +❌ `FAILURE` + +❌ `FAILURE` + +N/A + +❌ `FAILURE` + +✅ `SUCCESS` + +N/A + +✅ `SUCCESS` + +❌ `FAILURE` + +N/A + +`CANCEL_ONLY` + +Within Limits + +✅ `SUCCESS` + +✅ `SUCCESS` + +`200` + +❌ `FAILURE` + +❌ `FAILURE` + +`400` + +❌ `FAILURE` + +✅ `SUCCESS` + +`409` + +✅ `SUCCESS` + +❌ `FAILURE` + +`409` + +Exceeds Limits + +✅ `SUCCESS` + +✅ `SUCCESS` + +`200` + +❌ `FAILURE` + +❌ `FAILURE` + +`400` + +❌ `FAILURE` + +✅ `SUCCESS` + +N/A + +✅ `SUCCESS` + +❌ `FAILURE` + +`409` + +Notes: + +- If both `cancelOrderId` and `cancelOrigClientOrderId` parameters are provided, the `cancelOrderId` is searched first, then the `cancelOrigClientOrderId` from that result is checked against that order. If both conditions are not met the request will be rejected. + +- `cancelNewClientOrderId` will replace `clientOrderId` of the canceled order, freeing it up for new orders. + +- `newClientOrderId` specifies `clientOrderId` value for the placed order. + + A new order with the same `clientOrderId` is accepted only when the previous one is filled or expired. + + The new order can reuse old `clientOrderId` of the canceled order. + +- This cancel-replace operation is **not transactional**. + + If one operation succeeds but the other one fails, the successful operation is still executed. + + For example, in `STOP_ON_FAILURE` mode, if the new order placement fails, the old order is still canceled. + +- Filters and order count limits are evaluated before cancellation and order placement occurs. + +- If new order placement is not attempted, your order count is still incremented. + +- Like [`order.cancel`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/trading-requests), if you cancel an individual order from an order list, the entire order list is canceled. + +- The performance for canceling an order (single cancel or as part of a cancel-replace) is always better when only `orderId` is sent. Sending `origClientOrderId` or both `orderId` + `origClientOrderId` will be slower. + + +**Data Source:** Matching Engine + +**Response:** + +If both cancel and placement succeed, you get the following response with `"status": 200`: + +``` +{ "id": "99de1036-b5e2-4e0f-9b5c-13d751c93a1a", "status": 200, "result": { "cancelResult": "SUCCESS", "newOrderResult": "SUCCESS", // Format is identical to "order.cancel" format. // Some fields are optional and are included only for orders that set them. "cancelResponse": { "symbol": "BTCUSDT", "origClientOrderId": "4d96324ff9d44481926157", // cancelOrigClientOrderId from request "orderId": 125690984230, "orderListId": -1, "clientOrderId": "91fe37ce9e69c90d6358c0", // cancelNewClientOrderId from request "transactTime": 1684804350068, "price": "23450.00000000", "origQty": "0.00847000", "executedQty": "0.00001000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "0.23450000", "status": "CANCELED", "timeInForce": "GTC", "type": "LIMIT", "side": "SELL", "selfTradePreventionMode": "NONE" }, // Format is identical to "order.place" format, affected by "newOrderRespType". // Some fields are optional and are included only for orders that set them. "newOrderResponse": { "symbol": "BTCUSDT", "orderId": 12569099453, "orderListId": -1, "clientOrderId": "bX5wROblo6YeDwa9iTLeyY", // newClientOrderId from request "transactTime": 1660813156959, "price": "23416.10000000", "origQty": "0.00847000", "executedQty": "0.00000000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "0.00000000", "status": "NEW", "timeInForce": "GTC", "type": "LIMIT", "side": "SELL", "selfTradePreventionMode": "NONE" } }, "rateLimits": [ { "rateLimitType": "ORDERS", "interval": "SECOND", "intervalNum": 10, "limit": 50, "count": 1 }, { "rateLimitType": "ORDERS", "interval": "DAY", "intervalNum": 1, "limit": 160000, "count": 1 }, { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 1 } ]} +``` + +In `STOP_ON_FAILURE` mode, failed order cancellation prevents new order from being placed and returns the following response with `"status": 400`: + +``` +{ "id": "27e1bf9f-0539-4fb0-85c6-06183d36f66c", "status": 400, "error": { "code": -2022, "msg": "Order cancel-replace failed.", "data": { "cancelResult": "FAILURE", "newOrderResult": "NOT_ATTEMPTED", "cancelResponse": { "code": -2011, "msg": "Unknown order sent." }, "newOrderResponse": null } }, "rateLimits": [ { "rateLimitType": "ORDERS", "interval": "SECOND", "intervalNum": 10, "limit": 50, "count": 1 }, { "rateLimitType": "ORDERS", "interval": "DAY", "intervalNum": 1, "limit": 160000, "count": 1 }, { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 1 } ]} +``` + +If cancel-replace mode allows failure and one of the operations fails, you get a response with `"status": 409`, and the `"data"` field detailing which operation succeeded, which failed, and why: + +``` +{ "id": "b220edfe-f3c4-4a3a-9d13-b35473783a25", "status": 409, "error": { "code": -2021, "msg": "Order cancel-replace partially failed.", "data": { "cancelResult": "SUCCESS", "newOrderResult": "FAILURE", "cancelResponse": { "symbol": "BTCUSDT", "origClientOrderId": "4d96324ff9d44481926157", "orderId": 125690984230, "orderListId": -1, "clientOrderId": "91fe37ce9e69c90d6358c0", "transactTime": 1684804350068, "price": "23450.00000000", "origQty": "0.00847000", "executedQty": "0.00001000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "0.23450000", "status": "CANCELED", "timeInForce": "GTC", "type": "LIMIT", "side": "SELL", "selfTradePreventionMode": "NONE" }, "newOrderResponse": { "code": -2010, "msg": "Order would immediately match and take." } } }, "rateLimits": [ { "rateLimitType": "ORDERS", "interval": "SECOND", "intervalNum": 10, "limit": 50, "count": 1 }, { "rateLimitType": "ORDERS", "interval": "DAY", "intervalNum": 1, "limit": 160000, "count": 1 }, { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 1 } ]} +``` + +``` +{ "id": "ce641763-ff74-41ac-b9f7-db7cbe5e93b1", "status": 409, "error": { "code": -2021, "msg": "Order cancel-replace partially failed.", "data": { "cancelResult": "FAILURE", "newOrderResult": "SUCCESS", "cancelResponse": { "code": -2011, "msg": "Unknown order sent." }, "newOrderResponse": { "symbol": "BTCUSDT", "orderId": 12569099453, "orderListId": -1, "clientOrderId": "bX5wROblo6YeDwa9iTLeyY", "transactTime": 1660813156959, "price": "23416.10000000", "origQty": "0.00847000", "executedQty": "0.00000000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "0.00000000", "status": "NEW", "timeInForce": "GTC", "type": "LIMIT", "side": "SELL", "workingTime": 1669693344508, "fills": [], "selfTradePreventionMode": "NONE" } } }, "rateLimits": [ { "rateLimitType": "ORDERS", "interval": "SECOND", "intervalNum": 10, "limit": 50, "count": 1 }, { "rateLimitType": "ORDERS", "interval": "DAY", "intervalNum": 1, "limit": 160000, "count": 1 }, { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 1 } ]} +``` + +If both operations fail, response will have `"status": 400`: + +``` +{ "id": "3b3ac45c-1002-4c7d-88e8-630c408ecd87", "status": 400, "error": { "code": -2022, "msg": "Order cancel-replace failed.", "data": { "cancelResult": "FAILURE", "newOrderResult": "FAILURE", "cancelResponse": { "code": -2011, "msg": "Unknown order sent." }, "newOrderResponse": { "code": -2010, "msg": "Order would immediately match and take." } } }, "rateLimits": [ { "rateLimitType": "ORDERS", "interval": "SECOND", "intervalNum": 10, "limit": 50, "count": 1 }, { "rateLimitType": "ORDERS", "interval": "DAY", "intervalNum": 1, "limit": 160000, "count": 1 }, { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 1 } ]} +``` + +If `orderRateLimitExceededMode` is `DO_NOTHING` regardless of `cancelReplaceMode`, and you have exceeded your unfilled order count, you will get status `429` with the following error: + +``` +{ "id": "3b3ac45c-1002-4c7d-88e8-630c408ecd87", "status": 429, "error": { "code": -1015, "msg": "Too many new orders; current limit is 50 orders per 10 SECOND." }, "rateLimits": [ { "rateLimitType": "ORDERS", "interval": "SECOND", "intervalNum": 10, "limit": 50, "count": 50 }, { "rateLimitType": "ORDERS", "interval": "DAY", "intervalNum": 1, "limit": 160000, "count": 50 }, { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 1 } ]} +``` + +If `orderRateLimitExceededMode` is `CANCEL_ONLY` regardless of `cancelReplaceMode`, and you have exceeded your unfilled order count, you will get status `409` with the following error: + +``` +{ "id": "3b3ac45c-1002-4c7d-88e8-630c408ecd87", "status": 409, "error": { "code": -2021, "msg": "Order cancel-replace partially failed.", "data": { "cancelResult": "SUCCESS", "newOrderResult": "FAILURE", "cancelResponse": { "symbol": "LTCBNB", "origClientOrderId": "GKt5zzfOxRDSQLveDYCTkc", "orderId": 64, "orderListId": -1, "clientOrderId": "loehOJF3FjoreUBDmv739R", "transactTime": 1715779007228, "price": "1.00", "origQty": "10.00000000", "executedQty": "0.00000000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "0.00", "status": "CANCELED", "timeInForce": "GTC", "type": "LIMIT", "side": "SELL", "selfTradePreventionMode": "NONE" }, "newOrderResponse": { "code": -1015, "msg": "Too many new orders; current limit is 50 orders per 10 SECOND." } } }, "rateLimits": [ { "rateLimitType": "ORDERS", "interval": "SECOND", "intervalNum": 10, "limit": 50, "count": 50 }, { "rateLimitType": "ORDERS", "interval": "DAY", "intervalNum": 1, "limit": 160000, "count": 50 }, { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 1 } ]} +``` + +**Note:** The payload above does not show all fields that can appear. Please refer to [Conditional fields in Order Responses](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/trading-requests). + +### Order Amend Keep Priority (TRADE)[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/trading-requests) + +``` +{ "id": "56374a46-3061-486b-a311-89ee972eb648", "method": "order.amend.keepPriority", "params": { "newQty": "5", "origClientOrderId": "my_test_order1", "recvWindow": 5000, "symbol": "BTCUSDT", "timestamp": 1741922620419, "apiKey": "Rl1KOMDCpSg6xviMYOkNk9ENUB5QOTnufXukVe0Ijd40yduAlpHn78at3rJyJN4F", "signature": "fa49c0c4ebc331c6ebd3fcb20deb387f60081ea858eebe6e35aa6fcdf2a82e08" }} +``` + +Reduce the quantity of an existing open order. + +This adds 0 orders to the `EXCHANGE_MAX_ORDERS` filter and the `MAX_NUM_ORDERS` filter. + +Read [Order Amend Keep Priority FAQ](https://developers.binance.com/docs/binance-spot-api-docs/faqs/order_amend_keep_priority) to learn more. + +**Weight**: 4 + +**Unfilled Order Count:** 0 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +orderId + +LONG + +NO\* + +`orderId` or `origClientOrderId` must be sent + +origClientOrderId + +STRING + +NO\* + +`orderId` or `origClientOrderId` must be sent + +newClientOrderId + +STRING + +NO\* + +The new client order ID for the order after being amended. +If not sent, one will be randomly generated. +It is possible to reuse the current clientOrderId by sending it as the `newClientOrderId`. + +newQty + +DECIMAL + +YES + +`newQty` must be greater than 0 and less than the order's quantity. + +recvWindow + +DECIMAL + +NO + +The value cannot be greater than `60000`. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +timestamp + +LONG + +YES + +**Data Source**: Matching Engine + +**Response:** + +Response for a single order: + +``` +{ "id": "56374a46-3061-486b-a311-89ee972eb648", "status": 200, "result": { "transactTime": 1741923284382, "executionId": 16, "amendedOrder": { "symbol": "BTCUSDT", "orderId": 12, "orderListId": -1, "origClientOrderId": "my_test_order1", "clientOrderId": "4zR9HFcEq8gM1tWUqPEUHc", "price": "5.00000000", "qty": "5.00000000", "executedQty": "0.00000000", "preventedQty": "0.00000000", "quoteOrderQty": "0.00000000", "cumulativeQuoteQty": "0.00000000", "status": "NEW", "timeInForce": "GTC", "type": "LIMIT", "side": "BUY", "workingTime": 1741923284364, "selfTradePreventionMode": "NONE" } }, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 1 } ]} +``` + +Response for an order which is part of an Order list: + +``` +{ "id": "56374b46-3061-486b-a311-89ee972eb648", "status": 200, "result": { "transactTime": 1741924229819, "executionId": 60, "amendedOrder": { "symbol": "BTUCSDT", "orderId": 23, "orderListId": 4, "origClientOrderId": "my_pending_order", "clientOrderId": "xbxXh5SSwaHS7oUEOCI88B", "price": "1.00000000", "qty": "5.00000000", "executedQty": "0.00000000", "preventedQty": "0.00000000", "quoteOrderQty": "0.00000000", "cumulativeQuoteQty": "0.00000000", "status": "NEW", "timeInForce": "GTC", "type": "LIMIT", "side": "BUY", "workingTime": 1741924204920, "selfTradePreventionMode": "NONE" }, "listStatus": { "orderListId": 4, "contingencyType": "OTO", "listOrderStatus": "EXECUTING", "listClientOrderId": "8nOGLLawudj1QoOiwbroRH", "symbol": "BTCUSDT", "orders": [ { "symbol": "BTCUSDT", "orderId": 22, "clientOrderId": "g04EWsjaackzedjC9wRkWD" }, { "symbol": "BTCUSDT", "orderId": 23, "clientOrderId": "xbxXh5SSwaHS7oUEOCI88B" } ] } }, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 1 } ]} +``` + +**Note:** The payloads above do not show all fields that can appear. Please refer to [Conditional fields in Order Responses](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/trading-requests). + +### Cancel open orders (TRADE)[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/trading-requests) + +``` +{ "id": "778f938f-9041-4b88-9914-efbf64eeacc8", "method": "openOrders.cancelAll", "params": { "symbol": "BTCUSDT", "apiKey": "vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A", "signature": "773f01b6e3c2c9e0c1d217bc043ce383c1ddd6f0e25f8d6070f2b66a6ceaf3a5", "timestamp": 1660805557200 }} +``` + +Cancel all open orders on a symbol. This includes orders that are part of an order list. + +**Weight:** 1 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +`symbol` + +STRING + +YES + +`apiKey` + +STRING + +YES + +`recvWindow` + +DECIMAL + +NO + +The value cannot be greater than `60000`. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +`signature` + +STRING + +YES + +`timestamp` + +LONG + +YES + +**Data Source:** Matching Engine + +**Response:** + +Cancellation reports for orders and order lists have the same format as in [`order.cancel`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/trading-requests). + +``` +{ "id": "778f938f-9041-4b88-9914-efbf64eeacc8", "status": 200, "result": [ { "symbol": "BTCUSDT", "origClientOrderId": "4d96324ff9d44481926157", "orderId": 12569099453, "orderListId": -1, "clientOrderId": "91fe37ce9e69c90d6358c0", "transactTime": 1684804350068, "price": "23416.10000000", "origQty": "0.00847000", "executedQty": "0.00001000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "0.23416100", "status": "CANCELED", "timeInForce": "GTC", "type": "LIMIT", "side": "SELL", "stopPrice": "0.00000000", "trailingDelta": 0, "trailingTime": -1, "icebergQty": "0.00000000", "strategyId": 37463720, "strategyType": 1000000, "selfTradePreventionMode": "NONE" }, { "orderListId": 19431, "contingencyType": "OCO", "listStatusType": "ALL_DONE", "listOrderStatus": "ALL_DONE", "listClientOrderId": "iuVNVJYYrByz6C4yGOPPK0", "transactionTime": 1660803702431, "symbol": "BTCUSDT", "orders": [ { "symbol": "BTCUSDT", "orderId": 12569099453, "clientOrderId": "bX5wROblo6YeDwa9iTLeyY" }, { "symbol": "BTCUSDT", "orderId": 12569099454, "clientOrderId": "Tnu2IP0J5Y4mxw3IATBfmW" } ], "orderReports": [ { "symbol": "BTCUSDT", "origClientOrderId": "bX5wROblo6YeDwa9iTLeyY", "orderId": 12569099453, "orderListId": 19431, "clientOrderId": "OFFXQtxVFZ6Nbcg4PgE2DA", "transactTime": 1684804350068, "price": "23450.50000000", "origQty": "0.00850000", "executedQty": "0.00000000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "0.00000000", "status": "CANCELED", "timeInForce": "GTC", "type": "STOP_LOSS_LIMIT", "side": "BUY", "stopPrice": "23430.00000000", "selfTradePreventionMode": "NONE" }, { "symbol": "BTCUSDT", "origClientOrderId": "Tnu2IP0J5Y4mxw3IATBfmW", "orderId": 12569099454, "orderListId": 19431, "clientOrderId": "OFFXQtxVFZ6Nbcg4PgE2DA", "transactTime": 1684804350068, "price": "23400.00000000", "origQty": "0.00850000", "executedQty": "0.00000000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "0.00000000", "status": "CANCELED", "timeInForce": "GTC", "type": "LIMIT_MAKER", "side": "BUY", "selfTradePreventionMode": "NONE" } ] } ], "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 1 } ]} +``` + +**Note:** The payload above does not show all fields that can appear. Please refer to [Conditional fields in Order Responses](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/trading-requests). + +### Order lists[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/trading-requests) + +#### Place new Order list - OCO (TRADE)[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/trading-requests) + +``` +{ "id": "56374a46-3261-486b-a211-99ed972eb648", "method": "orderList.place.oco", "params": { "symbol": "LTCBNB", "side": "BUY", "quantity": 1, "timestamp": 1711062760647, "aboveType": "STOP_LOSS_LIMIT", "abovePrice": "1.5", "aboveStopPrice": "1.50000001", "aboveTimeInForce": "GTC", "belowType": "LIMIT_MAKER", "belowPrice": "1.49999999", "apiKey": "duwNf97YPLqhFIk7kZF0dDdGYVAXStA7BeEz0fIT9RAhUbixJtyS6kJ3hhzJsRXC", "signature": "64614cfd8dd38260d4fd86d3c455dbf4b9d1c8a8170ea54f700592a986c30ddb" }} +``` + +Send in an one-cancels-the-other (OCO) pair, where activation of one order immediately cancels the other. + +- An OCO has 2 orders called the **above order** and **below order**. +- One of the orders must be a `LIMIT_MAKER/TAKE_PROFIT/TAKE_PROFIT_LIMIT` order and the other must be `STOP_LOSS` or `STOP_LOSS_LIMIT` order. +- Price restrictions: + - If the OCO is on the `SELL` side: + - `LIMIT_MAKER/TAKE_PROFIT_LIMIT` `price` > Last Traded Price > `STOP_LOSS/STOP_LOSS_LIMIT` `stopPrice` + - `TAKE_PROFIT stopPrice` > Last Traded Price > `STOP_LOSS/STOP_LOSS_LIMIT stopPrice` + - If the OCO is on the `BUY` side: + - `LIMIT_MAKER` `price` < Last Traded Price < `STOP_LOSS/STOP_LOSS_LIMIT` `stopPrice` + - `TAKE_PROFIT stopPrice >` Last Traded Price `> STOP_LOSS/STOP_LOSS_LIMIT stopPrice` +- OCOs add **2 orders** to the `EXCHANGE_MAX_ORDERS` filter and `MAX_NUM_ORDERS` filter. + +**Weight:** 1 + +**Unfilled Order Count:** 2 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +`symbol` + +STRING + +YES + +`listClientOrderId` + +STRING + +NO + +Arbitrary unique ID among open order lists. Automatically generated if not sent. +A new order list with the same `listClientOrderId` is accepted only when the previous one is filled or completely expired. +`listClientOrderId` is distinct from the `aboveClientOrderId` and the `belowCLientOrderId`. + +`side` + +ENUM + +YES + +`BUY` or `SELL` + +`quantity` + +DECIMAL + +YES + +Quantity for both orders of the order list. + +`aboveType` + +ENUM + +YES + +Supported values: `STOP_LOSS_LIMIT`, `STOP_LOSS`, `LIMIT_MAKER`, `TAKE_PROFIT`, `TAKE_PROFIT_LIMIT` + +`aboveClientOrderId` + +STRING + +NO + +Arbitrary unique ID among open orders for the above order. Automatically generated if not sent + +`aboveIcebergQty` + +LONG + +NO + +Note that this can only be used if `aboveTimeInForce` is `GTC`. + +`abovePrice` + +DECIMAL + +NO + +Can be used if `aboveType` is `STOP_LOSS_LIMIT` , `LIMIT_MAKER`, or `TAKE_PROFIT_LIMIT` to specify the limit price. + +`aboveStopPrice` + +DECIMAL + +NO + +Can be used if `aboveType` is `STOP_LOSS`, `STOP_LOSS_LIMIT`, `TAKE_PROFIT`, `TAKE_PROFIT_LIMIT`. +Either `aboveStopPrice` or `aboveTrailingDelta` or both, must be specified. + +`aboveTrailingDelta` + +LONG + +NO + +See [Trailing Stop order FAQ](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/..faqs/trailing-stop-faq.md). + +`aboveTimeInForce` + +ENUM + +NO + +Required if `aboveType` is `STOP_LOSS_LIMIT` or `TAKE_PROFIT_LIMIT`. + +`aboveStrategyId` + +LONG + +NO + +Arbitrary numeric value identifying the above order within an order strategy. + +`aboveStrategyType` + +INT + +NO + +Arbitrary numeric value identifying the above order strategy. +Values smaller than 1000000 are reserved and cannot be used. + +`abovePegPriceType` + +ENUM + +NO + +See [Pegged Orders](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/trading-requests) + +`abovePegOffsetType` + +ENUM + +NO + +`abovePegOffsetValue` + +INT + +NO + +`belowType` + +ENUM + +YES + +Supported values: `STOP_LOSS`, `STOP_LOSS_LIMIT`, `TAKE_PROFIT`,`TAKE_PROFIT_LIMIT` + +`belowClientOrderId` + +STRING + +NO + +`belowIcebergQty` + +LONG + +NO + +Note that this can only be used if `belowTimeInForce` is `GTC`. + +`belowPrice` + +DECIMAL + +NO + +Can be used if `belowType` is `STOP_LOSS_LIMIT` , `LIMIT_MAKER`, or `TAKE_PROFIT_LIMIT` to specify the limit price. + +`belowStopPrice` + +DECIMAL + +NO + +Can be used if `belowType` is `STOP_LOSS`, `STOP_LOSS_LIMIT`, `TAKE_PROFIT` or `TAKE_PROFIT_LIMIT`. +Either `belowStopPrice` or `belowTrailingDelta` or both, must be specified. + +`belowTrailingDelta` + +LONG + +NO + +See [Trailing Stop order FAQ](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/..faqs/trailing-stop-faq.md). + +`belowTimeInForce` + +ENUM + +NO + +Required if `belowType` is `STOP_LOSS_LIMIT` or `TAKE_PROFIT_LIMIT` + +`belowStrategyId` + +LONG + +NO + +Arbitrary numeric value identifying the below order within an order strategy. + +`belowStrategyType` + +INT + +NO + +Arbitrary numeric value identifying the below order strategy. +Values smaller than 1000000 are reserved and cannot be used. + +`belowPegPriceType` + +ENUM + +NO + +See [Pegged Orders](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/trading-requests) + +`belowPegOffsetType` + +ENUM + +NO + +`belowPegOffsetValue` + +INT + +NO + +`newOrderRespType` + +ENUM + +NO + +Select response format: `ACK`, `RESULT`, `FULL` + +`selfTradePreventionMode` + +ENUM + +NO + +The allowed enums is dependent on what is configured on the symbol. The possible supported values are: [STP Modes](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums). + +`apiKey` + +STRING + +YES + +`recvWindow` + +DECIMAL + +NO + +The value cannot be greater than `60000`. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +`timestamp` + +LONG + +YES + +`signature` + +STRING + +YES + +**Data Source:** Matching Engine + +**Response:** + +Response format for `orderReports` is selected using the `newOrderRespType` parameter. The following example is for `RESULT` response type. See [`order.place`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/trading-requests) for more examples. + +``` +{ "id": "56374a46-3261-486b-a211-99ed972eb648", "status": 200, "result": { "orderListId": 2, "contingencyType": "OCO", "listStatusType": "EXEC_STARTED", "listOrderStatus": "EXECUTING", "listClientOrderId": "cKPMnDCbcLQILtDYM4f4fX", "transactionTime": 1711062760648, "symbol": "LTCBNB", "orders": [ { "symbol": "LTCBNB", "orderId": 2, "clientOrderId": "0m6I4wfxvTUrOBSMUl0OPU" }, { "symbol": "LTCBNB", "orderId": 3, "clientOrderId": "Z2IMlR79XNY5LU0tOxrWyW" } ], "orderReports": [ { "symbol": "LTCBNB", "orderId": 2, "orderListId": 2, "clientOrderId": "0m6I4wfxvTUrOBSMUl0OPU", "transactTime": 1711062760648, "price": "1.50000000", "origQty": "1.000000", "executedQty": "0.000000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "0.00000000", "status": "NEW", "timeInForce": "GTC", "type": "STOP_LOSS_LIMIT", "side": "BUY", "stopPrice": "1.50000001", "workingTime": -1, "selfTradePreventionMode": "NONE" }, { "symbol": "LTCBNB", "orderId": 3, "orderListId": 2, "clientOrderId": "Z2IMlR79XNY5LU0tOxrWyW", "transactTime": 1711062760648, "price": "1.49999999", "origQty": "1.000000", "executedQty": "0.000000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "0.00000000", "status": "NEW", "timeInForce": "GTC", "type": "LIMIT_MAKER", "side": "BUY", "workingTime": 1711062760648, "selfTradePreventionMode": "NONE" } ] }, "rateLimits": [ { "rateLimitType": "ORDERS", "interval": "SECOND", "intervalNum": 10, "limit": 50, "count": 2 }, { "rateLimitType": "ORDERS", "interval": "DAY", "intervalNum": 1, "limit": 160000, "count": 2 }, { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 1 } ]} +``` + +#### Place new Order list - OTO (TRADE)[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/trading-requests) + +``` +{ "id": "1712544395950", "method": "orderList.place.oto", "params": { "signature": "3e1e5ac8690b0caf9a2afd5c5de881ceba69939cc9d817daead5386bf65d0cbb", "apiKey": "Rf07JlnL9PHVxjs27O5CvKNyOsV4qJ5gXdrRfpvlOdvMZbGZbPO5Ce2nIwfRP0iA", "pendingQuantity": 1, "pendingSide": "BUY", "pendingType": "MARKET", "symbol": "LTCBNB", "recvWindow": "5000", "timestamp": "1712544395951", "workingPrice": 1, "workingQuantity": 1, "workingSide": "SELL", "workingTimeInForce": "GTC", "workingType": "LIMIT" }} +``` + +Places an OTO. + +- 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 `EXCHANGE_MAX_NUM_ORDERS` filter and `MAX_NUM_ORDERS` filter. + +**Weight:** 1 + +**Unfilled Order Count:** 2 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +`symbol` + +STRING + +YES + +`listClientOrderId` + +STRING + +NO + +Arbitrary unique ID among open order lists. Automatically generated if not sent. +A new order list with the same listClientOrderId is accepted only when the previous one is filled or completely expired. +`listClientOrderId` is distinct from the `workingClientOrderId` and the `pendingClientOrderId`. + +`newOrderRespType` + +ENUM + +NO + +Format of the JSON response. Supported values: [Order Response Type](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums) + +`selfTradePreventionMode` + +ENUM + +NO + +The allowed values are dependent on what is configured on the symbol. Supported values: [STP Modes](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums) + +`workingType` + +ENUM + +YES + +Supported values: `LIMIT`,`LIMIT_MAKER` + +`workingSide` + +ENUM + +YES + +Supported values: [Order side](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums) + +`workingClientOrderId` + +STRING + +NO + +Arbitrary unique ID among open orders for the working order. +Automatically generated if not sent. + +`workingPrice` + +DECIMAL + +YES + +`workingQuantity` + +DECIMAL + +YES + +Sets the quantity for the working order. + +`workingIcebergQty` + +DECIMAL + +NO + +This can only be used if `workingTimeInForce` is `GTC`, or if `workingType` is `LIMIT_MAKER`. + +`workingTimeInForce` + +ENUM + +NO + +Supported values: [Time In Force](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums) + +`workingStrategyId` + +LONG + +NO + +Arbitrary numeric value identifying the working order within an order strategy. + +`workingStrategyType` + +INT + +NO + +Arbitrary numeric value identifying the working order strategy. +Values smaller than 1000000 are reserved and cannot be used. + +`workingPegPriceType` + +ENUM + +NO + +See [Pegged Orders](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/trading-requests) + +`workingPegOffsetType` + +ENUM + +NO + +`workingPegOffsetValue` + +INT + +NO + +`pendingType` + +ENUM + +YES + +Supported values: [Order types](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/trading-requests). +Note that `MARKET` orders using `quoteOrderQty` are not supported. + +`pendingSide` + +ENUM + +YES + +Supported values: [Order side](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums) + +`pendingClientOrderId` + +STRING + +NO + +Arbitrary unique ID among open orders for the pending order. +Automatically generated if not sent. + +`pendingPrice` + +DECIMAL + +NO + +`pendingStopPrice` + +DECIMAL + +NO + +`pendingTrailingDelta` + +DECIMAL + +NO + +`pendingQuantity` + +DECIMAL + +YES + +Sets the quantity for the pending order. + +`pendingIcebergQty` + +DECIMAL + +NO + +This can only be used if `pendingTimeInForce` is `GTC`, or if `pendingType` is `LIMIT_MAKER`. + +`pendingTimeInForce` + +ENUM + +NO + +Supported values: [Time In Force](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums) + +`pendingStrategyId` + +LONG + +NO + +Arbitrary numeric value identifying the pending order within an order strategy. + +`pendingStrategyType` + +INT + +NO + +Arbitrary numeric value identifying the pending order strategy. +Values smaller than 1000000 are reserved and cannot be used. + +`pendingPegOffsetType` + +ENUM + +NO + +See [Pegged Orders](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/trading-requests) + +`pendingPegPriceType` + +ENUM + +NO + +`pendingPegOffsetValue` + +INT + +NO + +`recvWindow` + +DECIMAL + +NO + +The value cannot be greater than `60000`. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +`timestamp` + +LONG + +YES + +`signature` + +STRING + +YES + +**Mandatory parameters based on `pendingType` or `workingType`** + +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` + +**Data Source:** + +Matching Engine + +**Response:** + +``` +{ "id": "1712544395950", "status": 200, "result": { "orderListId": 626, "contingencyType": "OTO", "listStatusType": "EXEC_STARTED", "listOrderStatus": "EXECUTING", "listClientOrderId": "KA4EBjGnzvSwSCQsDdTrlf", "transactionTime": 1712544395981, "symbol": "1712544378871", "orders": [ { "symbol": "LTCBNB", "orderId": 13, "clientOrderId": "YiAUtM9yJjl1a2jXHSp9Ny" }, { "symbol": "LTCBNB", "orderId": 14, "clientOrderId": "9MxJSE1TYkmyx5lbGLve7R" } ], "orderReports": [ { "symbol": "LTCBNB", "orderId": 13, "orderListId": 626, "clientOrderId": "YiAUtM9yJjl1a2jXHSp9Ny", "transactTime": 1712544395981, "price": "1.000000", "origQty": "1.000000", "executedQty": "0.000000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "0.000000", "status": "NEW", "timeInForce": "GTC", "type": "LIMIT", "side": "SELL", "workingTime": 1712544395981, "selfTradePreventionMode": "NONE" }, { "symbol": "LTCBNB", "orderId": 14, "orderListId": 626, "clientOrderId": "9MxJSE1TYkmyx5lbGLve7R", "transactTime": 1712544395981, "price": "0.000000", "origQty": "1.000000", "executedQty": "0.000000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "0.000000", "status": "PENDING_NEW", "timeInForce": "GTC", "type": "MARKET", "side": "BUY", "workingTime": -1, "selfTradePreventionMode": "NONE" } ] }, "rateLimits": [ { "rateLimitType": "ORDERS", "interval": "MINUTE", "intervalNum": 1, "limit": 10000000, "count": 10 }, { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 1000, "count": 38 } ]} +``` + +**Note:** The payload above does not show all fields that can appear. Please refer to [Conditional fields in Order Responses](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/trading-requests). + +#### Place new Order list - OTOCO (TRADE)[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/trading-requests) + +``` +{ "id": "1712544408508", "method": "orderList.place.otoco", "params": { "signature": "c094473304374e1b9c5f7e2558358066cfa99df69f50f63d09cfee755136cb07", "apiKey": "Rf07JlnL9PHVxjs27O5CvKNyOsV4qJ5gXdrRfpvlOdvMZbGZbPO5Ce2nIwfRP0iA", "pendingQuantity": 5, "pendingSide": "SELL", "pendingBelowPrice": 5, "pendingBelowType": "LIMIT_MAKER", "pendingAboveStopPrice": 0.5, "pendingAboveType": "STOP_LOSS", "symbol": "LTCBNB", "recvWindow": "5000", "timestamp": "1712544408509", "workingPrice": 1.5, "workingQuantity": 1, "workingSide": "BUY", "workingTimeInForce": "GTC", "workingType": "LIMIT" }} +``` + +Place an OTOCO. + +- 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](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/trading-requests). +- 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](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/trading-requests). +- OTOCOs add **3 orders** to the `EXCHANGE_MAX_NUM_ORDERS` filter and `MAX_NUM_ORDERS` filter. + +**Weight:** 1 + +**Unfilled Order Count:** 3 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +`symbol` + +STRING + +YES + +`listClientOrderId` + +STRING + +NO + +Arbitrary unique ID among open order lists. Automatically generated if not sent. +A new order list with the same listClientOrderId is accepted only when the previous one is filled or completely expired. +`listClientOrderId` is distinct from the `workingClientOrderId`, `pendingAboveClientOrderId`, and the `pendingBelowClientOrderId`. + +`newOrderRespType` + +ENUM + +NO + +Format of the JSON response. Supported values: [Order Response Type](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums) + +`selfTradePreventionMode` + +ENUM + +NO + +The allowed values are dependent on what is configured on the symbol. Supported values: [STP Modes](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums) + +`workingType` + +ENUM + +YES + +Supported values: `LIMIT`, `LIMIT_MAKER` + +`workingSide` + +ENUM + +YES + +Supported values: [Order Side](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums) + +`workingClientOrderId` + +STRING + +NO + +Arbitrary unique ID among open orders for the working order. +Automatically generated if not sent. + +`workingPrice` + +DECIMAL + +YES + +`workingQuantity` + +DECIMAL + +YES + +`workingIcebergQty` + +DECIMAL + +NO + +This can only be used if `workingTimeInForce` is `GTC` or if `workingType` is `LIMIT_MAKER`. + +`workingTimeInForce` + +ENUM + +NO + +Supported values: [Time In Force](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums) + +`workingStrategyId` + +LONG + +NO + +Arbitrary numeric value identifying the working order within an order strategy. + +`workingStrategyType` + +INT + +NO + +Arbitrary numeric value identifying the working order strategy. +Values smaller than 1000000 are reserved and cannot be used. + +`workingPegPriceType` + +ENUM + +NO + +See [Pegged Orders](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/trading-requests) + +`workingPegOffsetType` + +ENUM + +NO + +`workingPegOffsetValue` + +INT + +NO + +`pendingSide` + +ENUM + +YES + +Supported values: [Order Side](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums) + +`pendingQuantity` + +DECIMAL + +YES + +`pendingAboveType` + +ENUM + +YES + +Supported values: `STOP_LOSS_LIMIT`, `STOP_LOSS`, `LIMIT_MAKER`, `TAKE_PROFIT`, `TAKE_PROFIT_LIMIT` + +`pendingAboveClientOrderId` + +STRING + +NO + +Arbitrary unique ID among open orders for the pending above order. +Automatically generated if not sent. + +`pendingAbovePrice` + +DECIMAL + +NO + +Can be used if `pendingAboveType` is `STOP_LOSS_LIMIT` , `LIMIT_MAKER`, or `TAKE_PROFIT_LIMIT` to specify the limit price. + +`pendingAboveStopPrice` + +DECIMAL + +NO + +Can be used if `pendingAboveType` is `STOP_LOSS`, `STOP_LOSS_LIMIT`, `TAKE_PROFIT`, `TAKE_PROFIT_LIMIT` + +`pendingAboveTrailingDelta` + +DECIMAL + +NO + +See [Trailing Stop FAQ](https://developers.binance.com/docs/binance-spot-api-docs/faqs/trailing-stop-faq) + +`pendingAboveIcebergQty` + +DECIMAL + +NO + +This can only be used if `pendingAboveTimeInForce` is `GTC` or if `pendingAboveType` is `LIMIT_MAKER`. + +`pendingAboveTimeInForce` + +ENUM + +NO + +`pendingAboveStrategyId` + +LONG + +NO + +Arbitrary numeric value identifying the pending above order within an order strategy. + +`pendingAboveStrategyType` + +INT + +NO + +Arbitrary numeric value identifying the pending above order strategy. +Values smaller than 1000000 are reserved and cannot be used. + +`pendingAbovePegPriceType` + +ENUM + +NO + +See [Pegged Orders](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/trading-requests) + +`pendingAbovePegOffsetType` + +ENUM + +NO + +`pendingAbovePegOffsetValue` + +INT + +NO + +`pendingBelowType` + +ENUM + +NO + +Supported values: `STOP_LOSS`, `STOP_LOSS_LIMIT`, `TAKE_PROFIT`,`TAKE_PROFIT_LIMIT` + +`pendingBelowClientOrderId` + +STRING + +NO + +Arbitrary unique ID among open orders for the pending below order. +Automatically generated if not sent. + +`pendingBelowPrice` + +DECIMAL + +NO + +Can be used if `pendingBelowType` is `STOP_LOSS_LIMIT` or `TAKE_PROFIT_LIMIT` to specify the limit price. + +`pendingBelowStopPrice` + +DECIMAL + +NO + +Can be used if `pendingBelowType` is `STOP_LOSS`, `STOP_LOSS_LIMIT, TAKE_PROFIT or TAKE_PROFIT_LIMIT`. +Either `pendingBelowStopPrice` or `pendingBelowTrailingDelta` or both, must be specified. + +`pendingBelowTrailingDelta` + +DECIMAL + +NO + +`pendingBelowIcebergQty` + +DECIMAL + +NO + +This can only be used if `pendingBelowTimeInForce` is `GTC`, or if `pendingBelowType` is `LIMIT_MAKER`. + +`pendingBelowTimeInForce` + +ENUM + +NO + +Supported values: [Time In Force](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums) + +`pendingBelowStrategyId` + +LONG + +NO + +Arbitrary numeric value identifying the pending below order within an order strategy. + +`pendingBelowStrategyType` + +INT + +NO + +Arbitrary numeric value identifying the pending below order strategy. +Values smaller than 1000000 are reserved and cannot be used. + +`pendingBelowPegPriceType` + +ENUM + +NO + +See [Pegged Orders](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/trading-requests) + +`pendingBelowPegOffsetType` + +ENUM + +NO + +`pendingBelowPegOffsetValue` + +INT + +NO + +`recvWindow` + +DECIMAL + +NO + +The value cannot be greater than `60000`. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +`timestamp` + +LONG + +YES + +`signature` + +STRING + +YES + +**Mandatory parameters based on `pendingAboveType`, `pendingBelowType` or `workingType`** + +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/TAKE_PROFIT` + +`pendingAboveStopPrice` and/or `pendingAboveTrailingDelta` + +`pendingAboveType=STOP_LOSS_LIMIT/TAKE_PROFIT_LIMIT` + +`pendingAbovePrice`, `pendingAboveStopPrice` and/or `pendingAboveTrailingDelta`, `pendingAboveTimeInForce` + +`pendingBelowType`\= `LIMIT_MAKER` + +`pendingBelowPrice` + +`pendingBelowType= STOP_LOSS/TAKE_PROFIT` + +`pendingBelowStopPrice` and/or `pendingBelowTrailingDelta` + +`pendingBelowType=STOP_LOSS_LIMIT/TAKE_PROFIT_LIMIT` + +`pendingBelowPrice`, `pendingBelowStopPrice` and/or `pendingBelowTrailingDelta`, `pendingBelowTimeInForce` + +**Data Source:** Matching Engine + +**Response:** + +``` +{ "id": "1712544408508", "status": 200, "result": { "orderListId": 629, "contingencyType": "OTO", "listStatusType": "EXEC_STARTED", "listOrderStatus": "EXECUTING", "listClientOrderId": "GaeJHjZPasPItFj4x7Mqm6", "transactionTime": 1712544408537, "symbol": "1712544378871", "orders": [ { "symbol": "LTCBNB", "orderId": 23, "clientOrderId": "OVQOpKwfmPCfaBTD0n7e7H" }, { "symbol": "LTCBNB", "orderId": 24, "clientOrderId": "YcCPKCDMQIjNvLtNswt82X" }, { "symbol": "LTCBNB", "orderId": 25, "clientOrderId": "ilpIoShcFZ1ZGgSASKxMPt" } ], "orderReports": [ { "symbol": "LTCBNB", "orderId": 23, "orderListId": 629, "clientOrderId": "OVQOpKwfmPCfaBTD0n7e7H", "transactTime": 1712544408537, "price": "1.500000", "origQty": "1.000000", "executedQty": "0.000000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "0.000000", "status": "NEW", "timeInForce": "GTC", "type": "LIMIT", "side": "BUY", "workingTime": 1712544408537, "selfTradePreventionMode": "NONE" }, { "symbol": "LTCBNB", "orderId": 24, "orderListId": 629, "clientOrderId": "YcCPKCDMQIjNvLtNswt82X", "transactTime": 1712544408537, "price": "0.000000", "origQty": "5.000000", "executedQty": "0.000000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "0.000000", "status": "PENDING_NEW", "timeInForce": "GTC", "type": "STOP_LOSS", "side": "SELL", "stopPrice": "0.500000", "workingTime": -1, "selfTradePreventionMode": "NONE" }, { "symbol": "LTCBNB", "orderId": 25, "orderListId": 629, "clientOrderId": "ilpIoShcFZ1ZGgSASKxMPt", "transactTime": 1712544408537, "price": "5.000000", "origQty": "5.000000", "executedQty": "0.000000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "0.000000", "status": "PENDING_NEW", "timeInForce": "GTC", "type": "LIMIT_MAKER", "side": "SELL", "workingTime": -1, "selfTradePreventionMode": "NONE" } ] }, "rateLimits": [ { "rateLimitType": "ORDERS", "interval": "MINUTE", "intervalNum": 1, "limit": 10000000, "count": 18 }, { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 1000, "count": 65 } ]} +``` + +**Note:** The payload above does not show all fields that can appear. Please refer to [Conditional fields in Order Responses](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/trading-requests). + +#### OPO (TRADE)[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/trading-requests) + +``` +{ "id": "1762941318128", "method": "orderList.place.opo", "params": { "workingPrice": "101496", "workingQuantity": "0.0007", "workingType": "LIMIT", "workingTimeInForce": "GTC", "pendingType": "MARKET", "pendingSide": "SELL", "recvWindow": 5000, "workingSide": "BUY", "symbol": "BTCUSDT", "timestamp": 1762941318129, "apiKey": "aHb4Ur1cK1biW3sgibqUFs39SE58f9d5Xwf4uEW0tFh7ibun5g035QKSktxoOBfE", "signature": "b50ce8977333a78a3bbad21df178d7e104a8c985d19007b55df688cdf868639a" }} +``` + +Place an [OPO](https://developers.binance.com/docs/binance-spot-api-docs/faqs/opo). + +- OPOs add 2 orders to the EXCHANGE\_MAX\_NUM\_ORDERS filter and MAX\_NUM\_ORDERS filter. + +**Weight:** 1 + +**Unfilled Order Count:** 2 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +`symbol` + +STRING + +YES + +`listClientOrderId` + +STRING + +NO + +Arbitrary unique ID among open order lists. Automatically generated if not sent. A new order list with the same listClientOrderId is accepted only when the previous one is filled or completely expired. `listClientOrderId` is distinct from the `workingClientOrderId` and the `pendingClientOrderId`. + +`newOrderRespType` + +ENUM + +NO + +Format of the JSON response. Supported values: [Order Response Type](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums) + +`selfTradePreventionMode` + +ENUM + +NO + +The allowed values are dependent on what is configured on the symbol. Supported values: [STP Modes](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums) + +`workingType` + +ENUM + +YES + +Supported values: `LIMIT`,`LIMIT_MAKER` + +`workingSide` + +ENUM + +YES + +Supported values: [Order Side](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums) + +`workingClientOrderId` + +STRING + +NO + +Arbitrary unique ID among open orders for the working order. Automatically generated if not sent. + +`workingPrice` + +DECIMAL + +YES + +`workingQuantity` + +DECIMAL + +YES + +Sets the quantity for the working order. + +`workingIcebergQty` + +DECIMAL + +NO + +This can only be used if `workingTimeInForce` is `GTC`, or if `workingType` is `LIMIT_MAKER`. + +`workingTimeInForce` + +ENUM + +NO + +Supported values: [Time In Force](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums) + +`workingStrategyId` + +LONG + +NO + +Arbitrary numeric value identifying the working order within an order strategy. + +`workingStrategyType` + +INT + +NO + +Arbitrary numeric value identifying the working order strategy. Values smaller than 1000000 are reserved and cannot be used. + +`workingPegPriceType` + +ENUM + +NO + +See [Pegged Orders](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/trading-requests) + +`workingPegOffsetType` + +ENUM + +NO + +`workingPegOffsetValue` + +INT + +NO + +`pendingType` + +ENUM + +YES + +Supported values: [Order Types](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/trading-requests) Note that `MARKET` orders using `quoteOrderQty` are not supported. + +`pendingSide` + +ENUM + +YES + +Supported values: [Order Side](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums) + +`pendingClientOrderId` + +STRING + +NO + +Arbitrary unique ID among open orders for the pending order. Automatically generated if not sent. + +`pendingPrice` + +DECIMAL + +NO + +`pendingStopPrice` + +DECIMAL + +NO + +`pendingTrailingDelta` + +DECIMAL + +NO + +`pendingIcebergQty` + +DECIMAL + +NO + +This can only be used if `pendingTimeInForce` is `GTC` or if `pendingType` is `LIMIT_MAKER`. + +`pendingTimeInForce` + +ENUM + +NO + +Supported values: [Time In Force](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums) + +`pendingStrategyId` + +LONG + +NO + +Arbitrary numeric value identifying the pending order within an order strategy. + +`pendingStrategyType` + +INT + +NO + +Arbitrary numeric value identifying the pending order strategy. Values smaller than 1000000 are reserved and cannot be used. + +`pendingPegPriceType` + +ENUM + +NO + +See [Pegged Orders](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/trading-requests) + +`pendingPegOffsetType` + +ENUM + +NO + +`pendingPegOffsetValue` + +INT + +NO + +`recvWindow` + +DECIMAL + +NO + +The value cannot be greater than `60000`. Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +`timestamp` + +LONG + +YES + +**Data Source**: Matching Engine + +**Response:** + +``` +{ "id": "1762941318128", "status": 200, "result": { "orderListId": 2, "contingencyType": "OTO", "listStatusType": "EXEC_STARTED", "listOrderStatus": "EXECUTING", "listClientOrderId": "OiOgqvRagBefpzdM5gjYX3", "transactionTime": 1762941318142, "symbol": "BTCUSDT", "orders": [ { "symbol": "BTCUSDT", "orderId": 2, "clientOrderId": "pUzhKBbc0ZVdMScIRAqitH" }, { "symbol": "BTCUSDT", "orderId": 3, "clientOrderId": "x7ISSjywZxFXOdzwsThNnd" } ], "orderReports": [ { "symbol": "BTCUSDT", "orderId": 2, "orderListId": 2, "clientOrderId": "pUzhKBbc0ZVdMScIRAqitH", "transactTime": 1762941318142, "price": "101496.00000000", "origQty": "0.00070000", "executedQty": "0.00000000", "origQuoteOrderQty": "0.00000000", "cummulativeQuoteQty": "0.00000000", "status": "NEW", "timeInForce": "GTC", "type": "LIMIT", "side": "BUY", "workingTime": 1762941318142, "selfTradePreventionMode": "NONE" }, { "symbol": "BTCUSDT", "orderId": 3, "orderListId": 2, "clientOrderId": "x7ISSjywZxFXOdzwsThNnd", "transactTime": 1762941318142, "price": "0.00000000", "executedQty": "0.00000000", "origQuoteOrderQty": "0.00000000", "cummulativeQuoteQty": "0.00000000", "status": "PENDING_NEW", "timeInForce": "GTC", "type": "MARKET", "side": "SELL", "workingTime": -1, "selfTradePreventionMode": "NONE" } ] }} +``` + +**Note:** The payload above does not show all fields that can appear. Please refer to [Conditional fields in Order Responses](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/trading-requests). + +#### OPOCO (TRADE)[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/trading-requests) + +``` +{ "id": "1763000139090", "method": "orderList.place.opoco", "params": { "workingPrice": "102496", "workingQuantity": "0.0017", "workingType": "LIMIT", "workingTimeInForce": "GTC", "pendingAboveType": "LIMIT_MAKER", "pendingAbovePrice": "104261", "pendingBelowStopPrice": "10100", "pendingBelowPrice": "101613", "pendingBelowType": "STOP_LOSS_LIMIT", "pendingBelowTimeInForce": "IOC", "pendingSide": "SELL", "recvWindow": 5000, "workingSide": "BUY", "symbol": "BTCUSDT", "timestamp": 1763000139091, "apiKey": "2wiKgTLyllTCu0QWXaEtKWX9tUQ5iQMiDQqTQPdUe2bZ1IVT9aXoS6o19wkYIKl2", "signature": "adfa185c50f793392a54ad5a6e2c39fd34ef6d35944adf2ddd6f30e1866e58d3" }} +``` + +Place an [OPOCO](https://developers.binance.com/docs/binance-spot-api-docs/faqs/opo). + +**Weight**: 1 + +**Unfilled Order Count:** 3 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +`symbol` + +STRING + +YES + +`listClientOrderId` + +STRING + +NO + +Arbitrary unique ID among open order lists. Automatically generated if not sent. A new order list with the same listClientOrderId is accepted only when the previous one is filled or completely expired. `listClientOrderId` is distinct from the `workingClientOrderId`, `pendingAboveClientOrderId`, and the `pendingBelowClientOrderId`. + +`newOrderRespType` + +ENUM + +NO + +Format of the JSON response. Supported values: [Order Response Type](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums) + +`selfTradePreventionMode` + +ENUM + +NO + +The allowed values are dependent on what is configured on the symbol. Supported values: [STP Modes](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums) + +`workingType` + +ENUM + +YES + +Supported values: `LIMIT`, `LIMIT_MAKER` + +`workingSide` + +ENUM + +YES + +Supported values: [Order side](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums) + +`workingClientOrderId` + +STRING + +NO + +Arbitrary unique ID among open orders for the working order. Automatically generated if not sent. + +`workingPrice` + +DECIMAL + +YES + +`workingQuantity` + +DECIMAL + +YES + +`workingIcebergQty` + +DECIMAL + +NO + +This can only be used if `workingTimeInForce` is `GTC`, or if `workingType` is `LIMIT_MAKER`. + +`workingTimeInForce` + +ENUM + +NO + +Supported values: [Time In Force](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums) + +`workingStrategyId` + +LONG + +NO + +Arbitrary numeric value identifying the working order within an order strategy. + +`workingStrategyType` + +INT + +NO + +Arbitrary numeric value identifying the working order strategy. Values smaller than 1000000 are reserved and cannot be used. + +`workingPegPriceType` + +ENUM + +NO + +See [Pegged Orders](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/trading-requests) + +`workingPegOffsetType` + +ENUM + +NO + +`workingPegOffsetValue` + +INT + +NO + +`pendingSide` + +ENUM + +YES + +Supported values: [Order side](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums) + +`pendingAboveType` + +ENUM + +YES + +Supported values: `STOP_LOSS_LIMIT`, `STOP_LOSS`, `LIMIT_MAKER`, `TAKE_PROFIT`, `TAKE_PROFIT_LIMIT` + +`pendingAboveClientOrderId` + +STRING + +NO + +Arbitrary unique ID among open orders for the pending above order. Automatically generated if not sent. + +`pendingAbovePrice` + +DECIMAL + +NO + +Can be used if `pendingAboveType` is `STOP_LOSS_LIMIT` , `LIMIT_MAKER`, or `TAKE_PROFIT_LIMIT` to specify the limit price. + +`pendingAboveStopPrice` + +DECIMAL + +NO + +Can be used if `pendingAboveType` is `STOP_LOSS`, `STOP_LOSS_LIMIT`, `TAKE_PROFIT`, `TAKE_PROFIT_LIMIT` + +`pendingAboveTrailingDelta` + +DECIMAL + +NO + +See [Trailing Stop FAQ](https://developers.binance.com/docs/binance-spot-api-docs/faqs/trailing-stop-faq) + +`pendingAboveIcebergQty` + +DECIMAL + +NO + +This can only be used if `pendingAboveTimeInForce` is `GTC` or if `pendingAboveType` is `LIMIT_MAKER`. + +`pendingAboveTimeInForce` + +ENUM + +NO + +`pendingAboveStrategyId` + +LONG + +NO + +Arbitrary numeric value identifying the pending above order within an order strategy. + +`pendingAboveStrategyType` + +INT + +NO + +Arbitrary numeric value identifying the pending above order strategy. Values smaller than 1000000 are reserved and cannot be used. + +`pendingAbovePegPriceType` + +ENUM + +NO + +See [Pegged Orders](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/trading-requests) + +`pendingAbovePegOffsetType` + +ENUM + +NO + +`pendingAbovePegOffsetValue` + +INT + +NO + +`pendingBelowType` + +ENUM + +NO + +Supported values: `STOP_LOSS`, `STOP_LOSS_LIMIT`, `TAKE_PROFIT`,`TAKE_PROFIT_LIMIT` + +`pendingBelowClientOrderId` + +STRING + +NO + +Arbitrary unique ID among open orders for the pending below order. Automatically generated if not sent. + +`pendingBelowPrice` + +DECIMAL + +NO + +Can be used if `pendingBelowType` is `STOP_LOSS_LIMIT` or `TAKE_PROFIT_LIMIT` to specify limit price + +`pendingBelowStopPrice` + +DECIMAL + +NO + +Can be used if `pendingBelowType` is `STOP_LOSS`, `STOP_LOSS_LIMIT, TAKE_PROFIT or TAKE_PROFIT_LIMIT`. Either `pendingBelowStopPrice` or `pendingBelowTrailingDelta` or both, must be specified. + +`pendingBelowTrailingDelta` + +DECIMAL + +NO + +`pendingBelowIcebergQty` + +DECIMAL + +NO + +This can only be used if `pendingBelowTimeInForce` is `GTC`, or if `pendingBelowType` is `LIMIT_MAKER`. + +`pendingBelowTimeInForce` + +ENUM + +NO + +Supported values: [Time In Force](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums) + +`pendingBelowStrategyId` + +LONG + +NO + +Arbitrary numeric value identifying the pending below order within an order strategy. + +`pendingBelowStrategyType` + +INT + +NO + +Arbitrary numeric value identifying the pending below order strategy. Values smaller than 1000000 are reserved and cannot be used. + +`pendingBelowPegPriceType` + +ENUM + +NO + +See [Pegged Orders](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/trading-requests) + +`pendingBelowPegOffsetType` + +ENUM + +NO + +`pendingBelowPegOffsetValue` + +INT + +NO + +`recvWindow` + +DECIMAL + +NO + +The value cannot be greater than `60000`. Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +`timestamp` + +LONG + +YES + +**Data Source:** Matching Engine + +**Response:** + +``` +{ "id": "1763000139090", "status": 200, "result": { "orderListId": 1, "contingencyType": "OTO", "listStatusType": "EXEC_STARTED", "listOrderStatus": "EXECUTING", "listClientOrderId": "TVbG6ymkYMXTj7tczbOsBf", "transactionTime": 1763000139104, "symbol": "BTCUSDT", "orders": [ { "symbol": "BTCUSDT", "orderId": 6, "clientOrderId": "3czuJSeyjPwV9Xo28j1Dv3" }, { "symbol": "BTCUSDT", "orderId": 7, "clientOrderId": "kyIKnMLKQclE5FmyYgaMSo" }, { "symbol": "BTCUSDT", "orderId": 8, "clientOrderId": "i76cGJWN9J1FpADS56TtQZ" } ], "orderReports": [ { "symbol": "BTCUSDT", "orderId": 6, "orderListId": 1, "clientOrderId": "3czuJSeyjPwV9Xo28j1Dv3", "transactTime": 1763000139104, "price": "102496.00000000", "origQty": "0.00170000", "executedQty": "0.00000000", "origQuoteOrderQty": "0.00000000", "cummulativeQuoteQty": "0.00000000", "status": "NEW", "timeInForce": "GTC", "type": "LIMIT", "side": "BUY", "workingTime": 1763000139104, "selfTradePreventionMode": "NONE" }, { "symbol": "BTCUSDT", "orderId": 7, "orderListId": 1, "clientOrderId": "kyIKnMLKQclE5FmyYgaMSo", "transactTime": 1763000139104, "price": "101613.00000000", "executedQty": "0.00000000", "origQuoteOrderQty": "0.00000000", "cummulativeQuoteQty": "0.00000000", "status": "PENDING_NEW", "timeInForce": "IOC", "type": "STOP_LOSS_LIMIT", "side": "SELL", "stopPrice": "10100.00000000", "workingTime": -1, "selfTradePreventionMode": "NONE" }, { "symbol": "BTCUSDT", "orderId": 8, "orderListId": 1, "clientOrderId": "i76cGJWN9J1FpADS56TtQZ", "transactTime": 1763000139104, "price": "104261.00000000", "executedQty": "0.00000000", "origQuoteOrderQty": "0.00000000", "cummulativeQuoteQty": "0.00000000", "status": "PENDING_NEW", "timeInForce": "GTC", "type": "LIMIT_MAKER", "side": "SELL", "workingTime": -1, "selfTradePreventionMode": "NONE" } ] }} +``` + +**Note:** The payload above does not show all fields that can appear. Please refer to [Conditional fields in Order Responses](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/trading-requests). + +#### Cancel Order list (TRADE)[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/trading-requests) + +``` +{ "id": "c5899911-d3f4-47ae-8835-97da553d27d0", "method": "orderList.cancel", "params": { "symbol": "BTCUSDT", "orderListId": 1274512, "apiKey": "vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A", "signature": "4973f4b2fee30bf6d45e4a973e941cc60fdd53c8dd5a25edeac96f5733c0ccee", "timestamp": 1660801720210 }} +``` + +Cancel an active order list. + +**Weight**: 1 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +`symbol` + +STRING + +YES + +`orderListId` + +INT + +YES + +Cancel order list by `orderListId` + +`listClientOrderId` + +STRING + +Cancel order list by `listClientId` + +`newClientOrderId` + +STRING + +NO + +New ID for the canceled order list. Automatically generated if not sent + +`apiKey` + +STRING + +YES + +`recvWindow` + +DECIMAL + +NO + +The value cannot be greater than 60000. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +`signature` + +STRING + +YES + +`timestamp` + +LONG + +YES + +Notes: + +- If both `orderListId` and `listClientOrderId` parameters are provided, the `orderListId` is searched first, then the `listClientOrderId` from that result is checked against that order. If both conditions are not met the request will be rejected. + +- Canceling an individual order with [`order.cancel`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/trading-requests) will cancel the entire order list as well. + + +**Data Source:** Matching Engine + +**Response:** + +``` +{ "id": "c5899911-d3f4-47ae-8835-97da553d27d0", "status": 200, "result": { "orderListId": 1274512, "contingencyType": "OCO", "listStatusType": "ALL_DONE", "listOrderStatus": "ALL_DONE", "listClientOrderId": "6023531d7edaad348f5aff", "transactionTime": 1660801720215, "symbol": "BTCUSDT", "orders": [ { "symbol": "BTCUSDT", "orderId": 12569138901, "clientOrderId": "BqtFCj5odMoWtSqGk2X9tU" }, { "symbol": "BTCUSDT", "orderId": 12569138902, "clientOrderId": "jLnZpj5enfMXTuhKB1d0us" } ], "orderReports": [ { "symbol": "BTCUSDT", "orderId": 12569138901, "orderListId": 1274512, "clientOrderId": "BqtFCj5odMoWtSqGk2X9tU", "transactTime": 1660801720215, "price": "23410.00000000", "origQty": "0.00650000", "executedQty": "0.00000000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "0.00000000", "status": "CANCELED", "timeInForce": "GTC", "type": "STOP_LOSS_LIMIT", "side": "SELL", "stopPrice": "23405.00000000", "selfTradePreventionMode": "NONE" }, { "symbol": "BTCUSDT", "orderId": 12569138902, "orderListId": 1274512, "clientOrderId": "jLnZpj5enfMXTuhKB1d0us", "transactTime": 1660801720215, "price": "23420.00000000", "origQty": "0.00650000", "executedQty": "0.00000000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "0.00000000", "status": "CANCELED", "timeInForce": "GTC", "type": "LIMIT_MAKER", "side": "SELL", "selfTradePreventionMode": "NONE" } ] }, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 1 } ]} +``` + +### SOR[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/trading-requests) + +#### Place new order using SOR (TRADE)[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/trading-requests) + +``` +{ "id": "3a4437e2-41a3-4c19-897c-9cadc5dce8b6", "method": "sor.order.place", "params": { "symbol": "BTCUSDT", "side": "BUY", "type": "LIMIT", "quantity": 0.5, "timeInForce": "GTC", "price": 31000, "timestamp": 1687485436575, "apiKey": "u5lgqJb97QWXWfgeV4cROuHbReSJM9rgQL0IvYcYc7BVeA5lpAqqc3a5p2OARIFk", "signature": "fd301899567bc9472ce023392160cdc265ad8fcbbb67e0ea1b2af70a4b0cd9c7" }} +``` + +Places an order using smart order routing (SOR). + +This adds 1 order to the `EXCHANGE_MAX_ORDERS` filter and the `MAX_NUM_ORDERS` filter. + +Read [SOR FAQ](https://developers.binance.com/docs/binance-spot-api-docs/faqs/sor_faq) to learn more. + +**Weight:** 1 + +**Unfilled Order Count:** 1 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +`symbol` + +STRING + +YES + +`side` + +ENUM + +YES + +`BUY` or `SELL` + +`type` + +ENUM + +YES + +`timeInForce` + +ENUM + +NO + +Applicable only to `LIMIT` order type + +`price` + +DECIMAL + +NO + +Applicable only to `LIMIT` order type + +`quantity` + +DECIMAL + +YES + +`newClientOrderId` + +STRING + +NO + +Arbitrary unique ID among open orders. Automatically generated if not sent + +`newOrderRespType` + +ENUM + +NO + +Select response format: `ACK`, `RESULT`, `FULL`. + +`MARKET` and `LIMIT` orders use `FULL` by default. + +`icebergQty` + +DECIMAL + +NO + +`strategyId` + +LONG + +NO + +Arbitrary numeric value identifying the order within an order strategy. + +`strategyType` + +INT + +NO + +Arbitrary numeric value identifying the order strategy. + +Values smaller than `1000000` are reserved and cannot be used. + +`selfTradePreventionMode` + +ENUM + +NO + +The allowed enums is dependent on what is configured on the symbol. The possible supported values are: [STP Modes](https://developers.binance.com/docs/binance-spot-api-docs/testnet/enums). + +`apiKey` + +STRING + +YES + +`timestamp` + +LONG + +YES + +`recvWindow` + +DECIMAL + +NO + +The value cannot be greater than `60000`. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +`signature` + +STRING + +YES + +**Note:** `sor.order.place` only supports `LIMIT` and `MARKET` orders. `quoteOrderQty` is not supported. + +**Data Source:** Matching Engine + +**Response:** + +``` +{ "id": "3a4437e2-41a3-4c19-897c-9cadc5dce8b6", "status": 200, "result": [ { "symbol": "BTCUSDT", "orderId": 2, "orderListId": -1, "clientOrderId": "sBI1KM6nNtOfj5tccZSKly", "transactTime": 1689149087774, "price": "31000.00000000", "origQty": "0.50000000", "executedQty": "0.50000000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "14000.00000000", "status": "FILLED", "timeInForce": "GTC", "type": "LIMIT", "side": "BUY", "workingTime": 1689149087774, "fills": [ { "matchType": "ONE_PARTY_TRADE_REPORT", "price": "28000.00000000", "qty": "0.50000000", "commission": "0.00000000", "commissionAsset": "BTC", "tradeId": -1, "allocId": 0 } ], "workingFloor": "SOR", "selfTradePreventionMode": "NONE", "usedSor": true } ], "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 1 } ]} +``` + +#### Test new order using SOR (TRADE)[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/trading-requests) + +``` +{ "id": "3a4437e2-41a3-4c19-897c-9cadc5dce8b6", "method": "sor.order.test", "params": { "symbol": "BTCUSDT", "side": "BUY", "type": "LIMIT", "quantity": 0.1, "timeInForce": "GTC", "price": 0.1, "timestamp": 1687485436575, "apiKey": "u5lgqJb97QWXWfgeV4cROuHbReSJM9rgQL0IvYcYc7BVeA5lpAqqc3a5p2OARIFk", "signature": "fd301899567bc9472ce023392160cdc265ad8fcbbb67e0ea1b2af70a4b0cd9c7" }} +``` + +Test new order creation and signature/recvWindow using smart order routing (SOR). Creates and validates a new order but does not send it into the matching engine. + +**Weight:** + +Condition + +Request Weight + +Without `computeCommissionRates` + +1 + +With `computeCommissionRates` + +20 + +**Parameters:** + +In addition to all parameters accepted by [`sor.order.place`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/trading-requests), the following optional parameters are also accepted: + +Name + +Type + +Mandatory + +Description + +`computeCommissionRates` + +BOOLEAN + +NO + +Default: `false` + +**Data Source:** Memory + +**Response:** + +Without `computeCommissionRates`: + +``` +{ "id": "3a4437e2-41a3-4c19-897c-9cadc5dce8b6", "status": 200, "result": {}, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 1 } ]} +``` + +With `computeCommissionRates`: + +``` +{ "id": "3a4437e2-41a3-4c19-897c-9cadc5dce8b6", "status": 200, "result": { "standardCommissionForOrder": { // Commission rates for the order depending on its role (e.g. maker or taker) "maker": "0.00000112", "taker": "0.00000114" }, "taxCommissionForOrder": { // Tax deduction rates for the order depending on its role (e.g. maker or taker) "maker": "0.00000112", "taker": "0.00000114" }, "discount": { // Discount on standard commissions when paying in BNB. "enabledForAccount": true, "enabledForSymbol": true, "discountAsset": "BNB", "discount": "0.25" // Standard commission is reduced by this rate when paying in BNB. } }, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 20 } ]} +``` + +- [Place new order (TRADE)](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/trading-requests) +- [Test new order (TRADE)](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/trading-requests) +- [Cancel order (TRADE)](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/trading-requests) +- [Cancel and replace order (TRADE)](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/trading-requests) +- [Order Amend Keep Priority (TRADE)](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/trading-requests) +- [Cancel open orders (TRADE)](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/trading-requests) +- [Order lists](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/trading-requests) +- [SOR](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/trading-requests) diff --git a/docs/binance/binance-spot/testnet_websocket-api_user-data-stream-requests.md b/docs/binance/binance-spot/testnet_websocket-api_user-data-stream-requests.md new file mode 100644 index 0000000..b226898 --- /dev/null +++ b/docs/binance/binance-spot/testnet_websocket-api_user-data-stream-requests.md @@ -0,0 +1,164 @@ +--- +title: "User Data Stream requests | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/user-data-stream-requests" +fetched_at: "2026-02-26T10:38:12.155Z" +--- +### User Data Stream subscription[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/user-data-stream-requests) + +**General information:** + +- [User Data Stream](https://developers.binance.com/docs/binance-spot-api-docs/testnet/user-data-stream) subscriptions allow you to receive all the events related to a given account on a WebSocket connection. +- There are 2 ways to start a subscription: + - If you have an authenticated session, then you can subscribe to events for that authenticated account using [`userDataStream.subscribe`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/user-data-stream-requests). + - In any session, authenticated or not, you can subscribe to events for one or more accounts for which you can provide an API Key signature, using [`userDataStream.subscribe.signature`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/user-data-stream-requests). + - You can have only one active subscription for a given account on a given connection. +- Subscriptions are identified by a `subscriptionId` which is returned when starting the subscription. That `subscriptionId` allows you to map the events you receive to a given subscription. + - All active subscriptions for a session can be found using [`session.subscriptions`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/user-data-stream-requests). +- Limits + - A single session supports **up to 1,000 active subscriptions** simultaneously. + - Attempting to start a new subscription beyond this limit will result in an error. + - If your accounts are very active, we suggest not opening too many subscriptions at once, in order to not overload your connection. + - A single session can handle a maximum of **65,535 total subscriptions** over its lifetime. + - If this limit is reached, you will receive an error and must re-establish a new connection to be able to start new subscriptions. +- To verify the status of User Data Stream subscriptions, check the `userDataStream` field in [`session.status`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/authentication-requests): + - `null` - User Data Stream subscriptions are **not available** on this WebSocket API. + - `true` - There is at **least one subscription active** in this session. + - `false` - There are **no active subscriptions** in this session. + +#### Subscribe to User Data Stream (USER\_STREAM)[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/user-data-stream-requests) + +``` +{ "id": "d3df8a21-98ea-4fe0-8f4e-0fcea5d418b7", "method": "userDataStream.subscribe"} +``` + +Subscribe to the User Data Stream in the current WebSocket connection. + +**Notes:** + +- This method requires an authenticated WebSocket connection using Ed25519 keys. Please refer to [`session.logon`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/authentication-requests). +- To check the subscription status, use [`session.status`](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/authentication-requests), see the `userDataStream` flag indicating you have have an active subscription. +- User Data Stream events are available in both JSON and [SBE](https://developers.binance.com/docs/binance-spot-api-docs/faqs/sbe_faq) sessions. + - Please refer to [User Data Streams](https://developers.binance.com/docs/binance-spot-api-docs/testnet/user-data-stream) for the event format details. + - For SBE, only SBE schema 2:1 or later is supported. + +**Weight**: 2 + +**Parameters**: NONE + +**Response**: + +``` +{ "id": "d3df8a21-98ea-4fe0-8f4e-0fcea5d418b7", "status": 200, "result": { "subscriptionId": 0 }} +``` + +#### Unsubscribe from User Data Stream[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/user-data-stream-requests) + +``` +{ "id": "d3df8a21-98ea-4fe0-8f4e-0fcea5d418b7", "method": "userDataStream.unsubscribe"} +``` + +Stop listening to the User Data Stream in the current WebSocket connection. + +Note that `session.logout` will only close the subscription created with `userDataStream.subscribe` but not subscriptions opened with `userDataStream.subscribe.signature`. + +**Weight**: 2 + +**Parameters**: + +Name + +Type + +Mandatory + +Description + +`subscriptionId` + +INT + +No + +When called with no parameter, this will close all subscriptions. +When called with the `subscriptionId` parameter, this will attempt to close the subscription with that subscription id, if it exists. + +**Response**: + +``` +{ "id": "d3df8a21-98ea-4fe0-8f4e-0fcea5d418b7", "status": 200, "result": {}} +``` + +#### Listing all subscriptions[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/user-data-stream-requests) + +``` +{ "id": "d3df5a22-88ea-4fe0-9f4e-0fcea5d418b7", "method": "session.subscriptions", "params": {}} +``` + +**Note:** + +- Users are expected to track on their side which subscription corresponds to which account. + +**Weight**: 2 + +**Data Source**: Memory + +**Response**: + +``` +{ "id": "d3df5a22-88ea-4fe0-9f4e-0fcea5d418b7", "status": 200, "result": [ { "subscriptionId": 0 }, { "subscriptionId": 1 } ]} +``` + +#### Subscribe to User Data Stream through signature subscription (USER\_STREAM)[​](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/user-data-stream-requests) + +``` +{ "id": "d3df8a22-98ea-4fe0-9f4e-0fcea5d418b7", "method": "userDataStream.subscribe.signature", "params": { "apiKey": "mjcKCrJzTU6TChLsnPmgnQJJMR616J4yWvdZWDUeXkk6vL6dLyS7rcVOQlADlVjA", "timestamp": 1747385641636, "signature": "yN1vWpXb+qoZ3/dGiFs9vmpNdV7e3FxkA+BstzbezDKwObcijvk/CVkWxIwMCtCJbP270R0OempYwEpS6rDZCQ==" }} +``` + +**Weight:** 2 + +**Parameters**: + +Name + +Type + +Mandatory + +Description + +`apiKey` + +STRING + +Yes + +`timestamp` + +LONG + +Yes + +`signature` + +STRING + +Yes + +`recvWindow` + +DECIMAL + +No + +The value cannot be greater than `60000`. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +**Data Source:** Memory + +**Response:** + +``` +{ "id": "d3df8a22-98ea-4fe0-9f4e-0fcea5d418b7", "status": 200, "result": { "subscriptionId": 0 }} +``` + +- [User Data Stream subscription](https://developers.binance.com/docs/binance-spot-api-docs/testnet/websocket-api/user-data-stream-requests) diff --git a/docs/binance/binance-spot/user-data-stream.md b/docs/binance/binance-spot/user-data-stream.md new file mode 100644 index 0000000..d35bb31 --- /dev/null +++ b/docs/binance/binance-spot/user-data-stream.md @@ -0,0 +1,293 @@ +--- +title: "User Data Stream | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs/user-data-stream" +fetched_at: "2026-02-26T10:38:12.317Z" +--- +# User Data Streams for Binance + +## General information[​](https://developers.binance.com/docs/binance-spot-api-docs/user-data-stream) + +- Subscribe via the [WebSocket API](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/user-data-stream-requests) using an API Key. +- Both [SBE](https://developers.binance.com/docs/binance-spot-api-docs/faqs/sbe_faq) and JSON output are supported. +- Account events are pushed in **real-time**. +- All timestamps in JSON payloads are in **milliseconds by default**. +- Events may contain non-ASCII characters encoded in UTF-8 if you own or trade any assets or symbols whose names contain non-ASCII characters. + +## User Data Stream Events[​](https://developers.binance.com/docs/binance-spot-api-docs/user-data-stream) + +### Account Update[​](https://developers.binance.com/docs/binance-spot-api-docs/user-data-stream) + +`outboundAccountPosition` is sent any time an account balance has changed and contains the assets that were possibly changed by the event that generated the balance change. + +``` +{ "subscriptionId": 0, "event": { "e": "outboundAccountPosition", // Event type "E": 1564034571105, // Event Time "u": 1564034571073, // Time of last account update // Balances Array "B": [ { "a": "ETH", // Asset "f": "10000.000000", // Free "l": "0.000000" // Locked } ] }} +``` + +### Balance Update[​](https://developers.binance.com/docs/binance-spot-api-docs/user-data-stream) + +Balance Update occurs during the following: + +- Deposits or withdrawals from the account +- Transfer of funds between accounts (e.g. Spot to Margin) + +**Payload** + +``` +{ "subscriptionId": 0, "event": { "e": "balanceUpdate", // Event Type "E": 1573200697110, // Event Time "a": "BTC", // Asset "d": "100.00000000", // Balance Delta "T": 1573200697068 // Clear Time }} +``` + +### Order Update[​](https://developers.binance.com/docs/binance-spot-api-docs/user-data-stream) + +Orders are updated with the `executionReport` event. + +**Payload:** + +``` +{ "subscriptionId": 0, "event": { "e": "executionReport", // Event type "E": 1499405658658, // Event time "s": "ETHBTC", // Symbol "c": "mUvoqJxFIILMdfAW5iGSOW", // Client order ID "S": "BUY", // Side "o": "LIMIT", // Order type "f": "GTC", // Time in force "q": "1.00000000", // Order quantity "p": "0.10264410", // Order price "P": "0.00000000", // Stop price "F": "0.00000000", // Iceberg quantity "g": -1, // OrderListId "C": "", // Original client order ID; This is the ID of the order being canceled "x": "NEW", // Current execution type "X": "NEW", // Current order status "r": "NONE", // Order reject reason; Please see Order Reject Reason (below) for more information. "i": 4293153, // Order ID "l": "0.00000000", // Last executed quantity "z": "0.00000000", // Cumulative filled quantity "L": "0.00000000", // Last executed price "n": "0", // Commission amount "N": null, // Commission asset "T": 1499405658657, // Transaction time "t": -1, // Trade ID "v": 3, // Prevented Match Id; This is only visible if the order expired due to STP "I": 8641984, // Execution Id "w": true, // Is the order on the book? "m": false, // Is this trade the maker side? "M": false, // Ignore "O": 1499405658657, // Order creation time "Z": "0.00000000", // Cumulative quote asset transacted quantity "Y": "0.00000000", // Last quote asset transacted quantity (i.e. lastPrice * lastQty) "Q": "0.00000000", // Quote Order Quantity "W": 1499405658657, // Working Time; This is only visible if the order has been placed on the book. "V": "NONE" // SelfTradePreventionMode }} +``` + +**Note:** Average price can be found by doing `Z` divided by `z`. + +#### Conditional Fields in Execution Report[​](https://developers.binance.com/docs/binance-spot-api-docs/user-data-stream) + +These are fields that appear in the payload only if certain conditions are met. + +For additional information on these parameters, please refer to the [Spot Glossary](https://developers.binance.com/docs/binance-spot-api-docs/faqs/spot_glossary). + +Field + +Name + +Description + +Examples + +`d` + +Trailing Delta + +Appears only for trailing stop orders. + +`"d": 4` + +`D` + +Trailing Time + +`"D": 1668680518494` + +`j` + +Strategy Id + +Appears only if the `strategyId` parameter was provided upon order placement. + +`"j": 1` + +`J` + +Strategy Type + +Appears only if the `strategyType` parameter was provided upon order placement. + +`"J": 1000000` + +`v` + +Prevented Match Id + +Appears only for orders that expired due to STP. + +`"v": 3` + +`A` + +Prevented Quantity + +`"A":"3.000000"` + +`B` + +Last Prevented Quantity + +`"B":"3.000000"` + +`u` + +Trade Group Id + +`"u":1` + +`U` + +Counter Order Id + +`"U":37` + +`Cs` + +Counter Symbol + +`"Cs": "BTCUSDT"` + +`pl` + +Prevented Execution Quantity + +`"pl":"2.123456"` + +`pL` + +Prevented Execution Price + +`"pL":"0.10000001"` + +`pY` + +Prevented Execution Quote Qty + +`"pY":"0.21234562"` + +`W` + +Working Time + +Appears when the order is working on the book + +`"W": 1668683798379` + +`b` + +Match Type + +Appears for orders that have allocations + +`"b":"ONE_PARTY_TRADE_REPORT"` + +`a` + +Allocation ID + +`"a":1234` + +`k` + +Working Floor + +Appears for orders that potentially have allocations + +`"k":"SOR"` + +`uS` + +UsedSor + +Appears for orders that used SOR + +`"uS":true` + +`gP` + +Pegged Price Type + +Appears only for Pegged Orders + +`"gP": "PRIMARY_PEG"` + +`gOT` + +Pegged offset Type + +`"gOT": "PRICE_LEVEL"` + +`gOV` + +Pegged Offset Value + +`"gOV": 5` + +`gp` + +Pegged Price + +`"gp": "1.00000000"` + +#### Order Reject Reason[​](https://developers.binance.com/docs/binance-spot-api-docs/user-data-stream) + +For additional details, look up the Error Message in the [Errors](https://developers.binance.com/docs/binance-spot-api-docs/errors) documentation. + +Rejection Reason (`r`) + +Error Message + +`NONE` + +N/A (i.e. The order was not rejected.) + +`INSUFFICIENT_BALANCES` + +"Account has insufficient balance for requested action." + +`STOP_PRICE_WOULD_TRIGGER_IMMEDIATELY` + +"Order would trigger immediately." + +`WOULD_MATCH_IMMEDIATELY` + +"Order would immediately match and take." + +`OCO_BAD_PRICES` + +"The relationship of the prices for the orders is not correct." + +If the order is an order list, an event named `ListStatus` will be sent in addition to the `executionReport` event. + +**Payload** + +``` +{ "subscriptionId": 0, "event": { "e": "listStatus", // Event Type "E": 1564035303637, // Event Time "s": "ETHBTC", // Symbol "g": 2, // OrderListId "c": "OCO", // Contingency Type "l": "EXEC_STARTED", // List Status Type "L": "EXECUTING", // List Order Status "r": "NONE", // List Reject Reason "C": "F4QN4G8DlFATFlIUQ0cjdD", // List Client Order ID "T": 1564035303625, // Transaction Time // An array of objects "O": [ { "s": "ETHBTC", // Symbol "i": 17, // OrderId "c": "AJYsMjErWJesZvqlJCTUgL" // ClientOrderId }, { "s": "ETHBTC", "i": 18, "c": "bfYPSQdLoqAJeNrOr9adzq" } ] }} +``` + +**Execution types:** + +- `NEW` - The order has been accepted into the engine. +- `CANCELED` - The order has been canceled by the user. +- `REPLACED` - The order has been amended. +- `REJECTED` - The order has been rejected and was not processed (e.g. Cancel Replace Orders wherein the new order placement is rejected but the request to cancel request succeeds.) +- `TRADE` - Part of the order or all of the order's quantity has filled. +- `EXPIRED` - The order was canceled according to the order type's rules (e.g. LIMIT FOK orders with no fill, LIMIT IOC or MARKET orders that partially fill) or by the exchange, (e.g. orders canceled during liquidation, orders canceled during maintenance). +- `TRADE_PREVENTION` - The order has expired due to STP. + +Check the [Enums page](https://developers.binance.com/docs/binance-spot-api-docs/enums) for more relevant enum definitions. + +## Event Stream Terminated[​](https://developers.binance.com/docs/binance-spot-api-docs/user-data-stream) + +`eventStreamTerminated` is sent when: + +- [A listen token subscription](https://developers.binance.com/docs/margin_trading/trade-data-stream/Listen-Token-Websocket-API) expires due to token expiration. +- A [logon subscription](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests) ends after sending [`session.logout`](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests) method. +- The subscription is stopped via the [`userDataStream.unsubscribe`](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/user-data-stream-requests) method. + +**Payload:** + +``` +{ "subscriptionId": 0, "event": { "e": "eventStreamTerminated", // Event Type "E": 1728973001334 // Event Time }} +``` + +## External Lock Update[​](https://developers.binance.com/docs/binance-spot-api-docs/user-data-stream) + +`externalLockUpdate` is sent when part of your spot wallet balance is locked/unlocked by an external system, for example when used as margin collateral. + +**Payload:** + +``` +{ "subscriptionId": 0, "event": { "e": "externalLockUpdate", // Event Type "E": 1581557507324, // Event Time "a": "NEO", // Asset "d": "10.00000000", // Delta "T": 1581557507268 // Transaction Time }} +``` + +- [General information](https://developers.binance.com/docs/binance-spot-api-docs/user-data-stream) +- [User Data Stream Events](https://developers.binance.com/docs/binance-spot-api-docs/user-data-stream) + - [Account Update](https://developers.binance.com/docs/binance-spot-api-docs/user-data-stream) + - [Balance Update](https://developers.binance.com/docs/binance-spot-api-docs/user-data-stream) + - [Order Update](https://developers.binance.com/docs/binance-spot-api-docs/user-data-stream) +- [Event Stream Terminated](https://developers.binance.com/docs/binance-spot-api-docs/user-data-stream) +- [External Lock Update](https://developers.binance.com/docs/binance-spot-api-docs/user-data-stream) diff --git a/docs/binance/binance-spot/web-socket-api.md.error.txt b/docs/binance/binance-spot/web-socket-api.md.error.txt new file mode 100644 index 0000000..1df4690 --- /dev/null +++ b/docs/binance/binance-spot/web-socket-api.md.error.txt @@ -0,0 +1,2 @@ +URL: https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api.md +Error: 404 diff --git a/docs/binance/binance-spot/web-socket-streams.md b/docs/binance/binance-spot/web-socket-streams.md new file mode 100644 index 0000000..7dc3dc6 --- /dev/null +++ b/docs/binance/binance-spot/web-socket-streams.md @@ -0,0 +1,434 @@ +--- +title: "WebSocket Streams | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams" +fetched_at: "2026-02-26T10:38:12.473Z" +--- +# WebSocket Streams for Binance + +## General WSS information[​](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) + +- The base endpoint is: **wss://stream.binance.com:9443** or **wss://stream.binance.com:443**. +- Streams can be accessed either in a single raw stream or in a combined stream. +- Raw streams are accessed at **/ws/** +- Combined streams are accessed at **/stream?streams=//** +- Combined stream events are wrapped as follows: **{"stream":"","data":}** +- All symbols for streams are **lowercase** +- A single connection to **stream.binance.com** is only valid for 24 hours; expect to be disconnected at the 24 hour mark +- The WebSocket server will send a `ping frame` every 20 seconds. + - If the WebSocket server does not receive a `pong frame` back from the connection within a minute the connection will be disconnected. + - When you receive a ping, you must send a pong with a copy of ping's payload as soon as possible. + - Unsolicited `pong frames` are allowed, but will not prevent disconnection. **It is recommended that the payload for these pong frames are empty.** +- The base endpoint **wss://data-stream.binance.vision** can be subscribed to receive **only** market data messages. + User data stream is **NOT** available from this URL. +- All time and timestamp related fields are **milliseconds by default**. To receive the information in microseconds, please add the parameter `timeUnit=MICROSECOND or timeUnit=microsecond` in the URL. + - For example: `/stream?streams=btcusdt@trade&timeUnit=MICROSECOND` +- If your request contains a symbol name containing non-ASCII characters, then the stream events may contain non-ASCII characters encoded in UTF-8. +- \[All Market Mini Tickers Stream\](#all-market-mini-tickers-stream and [All Market Rolling Window Statistics Streams](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) events may contain non-ASCII characters encoded in UTF-8. + +## WebSocket Limits[​](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) + +- WebSocket connections have a limit of 5 incoming messages per second. A message is considered: + - A PING frame + - A PONG frame + - A JSON controlled message (e.g. subscribe, unsubscribe) +- A connection that goes beyond the limit will be disconnected; IPs that are repeatedly disconnected may be banned. +- A single connection can listen to a maximum of 1024 streams. +- There is a limit of **300 connections per attempt every 5 minutes per IP**. + +## Live Subscribing/Unsubscribing to streams[​](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) + +- The following data can be sent through the WebSocket instance in order to subscribe/unsubscribe from streams. Examples can be seen below. +- The `id` is used as an identifier to uniquely identify the messages going back and forth. The following formats are accepted: + - 64-bit signed integer + - alphanumeric strings; max length 36 + - `null` +- In the response, if the `result` received is `null` this means the request sent was a success for non-query requests (e.g. Subscribing/Unsubscribing). + +### Subscribe to a stream[​](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) + +- Request + + ``` + { "method": "SUBSCRIBE", "params": ["btcusdt@aggTrade", "btcusdt@depth"], "id": 1} + ``` + +- Response + + ``` + { "result": null, "id": 1} + ``` + + +### Unsubscribe to a stream[​](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) + +- Request + + ``` + { "method": "UNSUBSCRIBE", "params": ["btcusdt@depth"], "id": 312} + ``` + +- Response + + ``` + { "result": null, "id": 312} + ``` + + +### Listing Subscriptions[​](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) + +- Request + + ``` + { "method": "LIST_SUBSCRIPTIONS", "id": 3} + ``` + +- Response + + ``` + { "result": ["btcusdt@aggTrade"], "id": 3} + ``` + + +### Setting Properties[​](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) + +Currently, the only property that can be set is whether `combined` stream payloads are enabled or not. The combined property is set to `false` when connecting using `/ws/` ("raw streams") and `true` when connecting using `/stream/`. + +- Request + + ``` + { "method": "SET_PROPERTY", "params": ["combined", true], "id": 5} + ``` + +- Response + + ``` + { "result": null, "id": 5} + ``` + + +### Retrieving Properties[​](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) + +- Request + + ``` + { "method": "GET_PROPERTY", "params": ["combined"], "id": 2} + ``` + +- Response + + ``` + { "result": true, // Indicates that combined is set to true. "id": 2} + ``` + + +### Error Messages[​](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) + +Error Message + +Description + +{"code": 0, "msg": "Unknown property","id": %s} + +Parameter used in the `SET_PROPERTY` or `GET_PROPERTY` was invalid + +{"code": 1, "msg": "Invalid value type: expected Boolean"} + +Value should only be `true` or `false` + +{"code": 2, "msg": "Invalid request: property name must be a string"} + +Property name provided was invalid + +{"code": 2, "msg": "Invalid request: request ID must be an unsigned integer"} + +Parameter `id` had to be provided or the value provided in the `id` parameter is an unsupported type + +{"code": 2, "msg": "Invalid request: unknown variant %s, expected one of `SUBSCRIBE`, `UNSUBSCRIBE`, `LIST_SUBSCRIPTIONS`, `SET_PROPERTY`, `GET_PROPERTY` at line 1 column 28"} + +Possible typo in the provided method or provided method was neither of the expected values + +{"code": 2, "msg": "Invalid request: too many parameters"} + +Unnecessary parameters provided in the data + +{"code": 2, "msg": "Invalid request: property name must be a string"} + +Property name was not provided + +{"code": 2, "msg": "Invalid request: missing field `method` at line 1 column 73"} + +`method` was not provided in the data + +{"code":3,"msg":"Invalid JSON: expected value at line %s column %s"} + +JSON data sent has incorrect syntax. + +# Detailed Stream information + +## Aggregate Trade Streams[​](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) + +The Aggregate Trade Streams push trade information that is aggregated for a single taker order. + +**Stream Name:** @aggTrade + +**Update Speed:** Real-time + +**Payload:** + +``` +{ "e": "aggTrade", // Event type "E": 1672515782136, // Event time "s": "BNBBTC", // Symbol "a": 12345, // Aggregate trade ID "p": "0.001", // Price "q": "100", // Quantity "f": 100, // First trade ID "l": 105, // Last trade ID "T": 1672515782136, // Trade time "m": true, // Is the buyer the market maker? "M": true // Ignore} +``` + +## Trade Streams[​](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) + +The Trade Streams push raw trade information; each trade has a unique buyer and seller. + +**Stream Name:** @trade + +**Update Speed:** Real-time + +**Payload:** + +``` +{ "e": "trade", // Event type "E": 1672515782136, // Event time "s": "BNBBTC", // Symbol "t": 12345, // Trade ID "p": "0.001", // Price "q": "100", // Quantity "T": 1672515782136, // Trade time "m": true, // Is the buyer the market maker? "M": true // Ignore} +``` + +## Kline/Candlestick Streams for UTC[​](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) + +The Kline/Candlestick Stream push updates to the current klines/candlestick every second in `UTC+0` timezone + +**Kline/Candlestick chart intervals:** + +s-> seconds; m -> minutes; h -> hours; d -> days; w -> weeks; M -> months + +- 1s +- 1m +- 3m +- 5m +- 15m +- 30m +- 1h +- 2h +- 4h +- 6h +- 8h +- 12h +- 1d +- 3d +- 1w +- 1M + +**Stream Name:** @kline\_ + +**Update Speed:** 1000ms for `1s`, 2000ms for the other intervals + +**Payload:** + +``` +{ "e": "kline", // Event type "E": 1672515782136, // Event time "s": "BNBBTC", // Symbol "k": { "t": 1672515780000, // Kline start time "T": 1672515839999, // Kline close time "s": "BNBBTC", // Symbol "i": "1m", // Interval "f": 100, // First trade ID "L": 200, // Last trade ID "o": "0.0010", // Open price "c": "0.0020", // Close price "h": "0.0025", // High price "l": "0.0015", // Low price "v": "1000", // Base asset volume "n": 100, // Number of trades "x": false, // Is this kline closed? "q": "1.0000", // Quote asset volume "V": "500", // Taker buy base asset volume "Q": "0.500", // Taker buy quote asset volume "B": "123456" // Ignore }} +``` + +## Kline/Candlestick Streams with timezone offset[​](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) + +The Kline/Candlestick Stream push updates to the current klines/candlestick every second in `UTC+8` timezone + +**Kline/Candlestick chart intervals:** + +Supported intervals: See [`Kline/Candlestick chart intervals`](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) + +**UTC+8 timezone offset:** + +- Kline intervals open and close in the `UTC+8` timezone. For example the `1d` klines will open at the beginning of the `UTC+8` day, and close at the end of the `UTC+8` day. +- Note that `E` (event time), `t` (start time) and `T` (close time) in the payload are Unix timestamps, which are always interpreted in UTC. + +**Stream Name:** @kline\_@+08:00 + +**Update Speed:** 1000ms for `1s`, 2000ms for the other intervals + +**Payload:** + +``` +{ "e": "kline", // Event type "E": 1672515782136, // Event time "s": "BNBBTC", // Symbol "k": { "t": 1672515780000, // Kline start time "T": 1672515839999, // Kline close time "s": "BNBBTC", // Symbol "i": "1m", // Interval "f": 100, // First trade ID "L": 200, // Last trade ID "o": "0.0010", // Open price "c": "0.0020", // Close price "h": "0.0025", // High price "l": "0.0015", // Low price "v": "1000", // Base asset volume "n": 100, // Number of trades "x": false, // Is this kline closed? "q": "1.0000", // Quote asset volume "V": "500", // Taker buy base asset volume "Q": "0.500", // Taker buy quote asset volume "B": "123456" // Ignore }} +``` + +## Individual Symbol Mini Ticker Stream[​](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) + +24hr rolling window mini-ticker statistics. These are NOT the statistics of the UTC day, but a 24hr rolling window for the previous 24hrs. + +**Stream Name:** @miniTicker + +**Update Speed:** 1000ms + +**Payload:** + +``` +{ "e": "24hrMiniTicker", // Event type "E": 1672515782136, // Event time "s": "BNBBTC", // Symbol "c": "0.0025", // Close price "o": "0.0010", // Open price "h": "0.0025", // High price "l": "0.0010", // Low price "v": "10000", // Total traded base asset volume "q": "18" // Total traded quote asset volume} +``` + +## All Market Mini Tickers Stream[​](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) + +24hr rolling window mini-ticker statistics for all symbols that changed in an array. These are NOT the statistics of the UTC day, but a 24hr rolling window for the previous 24hrs. Note that only tickers that have changed will be present in the array. + +**Stream Name:** !miniTicker@arr + +**Update Speed:** 1000ms + +**Payload:** + +``` +[ { // Same as @miniTicker payload }] +``` + +## Individual Symbol Ticker Streams[​](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) + +24hr rolling window ticker statistics for a single symbol. These are NOT the statistics of the UTC day, but a 24hr rolling window for the previous 24hrs. + +**Stream Name:** @ticker + +**Update Speed:** 1000ms + +**Payload:** + +``` +{ "e": "24hrTicker", // Event type "E": 1672515782136, // Event time "s": "BNBBTC", // Symbol "p": "0.0015", // Price change "P": "250.00", // Price change percent "w": "0.0018", // Weighted average price "x": "0.0009", // First trade(F)-1 price (first trade before the 24hr rolling window) "c": "0.0025", // Last price "Q": "10", // Last quantity "b": "0.0024", // Best bid price "B": "10", // Best bid quantity "a": "0.0026", // Best ask price "A": "100", // Best ask quantity "o": "0.0010", // Open price "h": "0.0025", // High price "l": "0.0010", // Low price "v": "10000", // Total traded base asset volume "q": "18", // Total traded quote asset volume "O": 0, // Statistics open time "C": 86400000, // Statistics close time "F": 0, // First trade ID "L": 18150, // Last trade Id "n": 18151 // Total number of trades} +``` + +## Individual Symbol Rolling Window Statistics Streams[​](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) + +Rolling window ticker statistics for a single symbol, computed over multiple windows. + +**Stream Name:** @ticker\_ + +**Window Sizes:** 1h,4h,1d + +**Update Speed:** 1000ms + +**Note**: This stream is different from the @ticker stream. The open time `"O"` always starts on a minute, while the closing time `"C"` is the current time of the update. As such, the effective window might be up to 59999ms wider than . + +**Payload:** + +``` +{ "e": "1hTicker", // Event type "E": 1672515782136, // Event time "s": "BNBBTC", // Symbol "p": "0.0015", // Price change "P": "250.00", // Price change percent "o": "0.0010", // Open price "h": "0.0025", // High price "l": "0.0010", // Low price "c": "0.0025", // Last price "w": "0.0018", // Weighted average price "v": "10000", // Total traded base asset volume "q": "18", // Total traded quote asset volume "O": 0, // Statistics open time "C": 1675216573749, // Statistics close time "F": 0, // First trade ID "L": 18150, // Last trade Id "n": 18151 // Total number of trades} +``` + +## All Market Rolling Window Statistics Streams[​](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) + +Rolling window ticker statistics for all market symbols, computed over multiple windows. Note that only tickers that have changed will be present in the array. + +**Stream Name:** !ticker\_@arr + +**Window Size:** 1h,4h,1d + +**Update Speed:** 1000ms + +**Payload:** + +``` +[ { // Same as @ticker_ payload, // one for each symbol updated within the interval. }] +``` + +## Individual Symbol Book Ticker Streams[​](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) + +Pushes any update to the best bid or ask's price or quantity in real-time for a specified symbol. Multiple `@bookTicker` streams can be subscribed to over one connection. + +**Stream Name:** @bookTicker + +**Update Speed:** Real-time + +**Payload:** + +``` +{ "u": 400900217, // order book updateId "s": "BNBUSDT", // symbol "b": "25.35190000", // best bid price "B": "31.21000000", // best bid qty "a": "25.36520000", // best ask price "A": "40.66000000" // best ask qty} +``` + +## Average Price[​](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) + +Average price streams push changes in the average price over a fixed time interval. + +**Stream Name:** @avgPrice + +**Update Speed:** 1000ms + +**Payload:** + +``` +{ "e": "avgPrice", // Event type "E": 1693907033000, // Event time "s": "BTCUSDT", // Symbol "i": "5m", // Average price interval "w": "25776.86000000", // Average price "T": 1693907032213 // Last trade time} +``` + +## Partial Book Depth Streams[​](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) + +Top **** bids and asks, pushed every second. Valid **** are 5, 10, or 20. + +**Stream Names:** @depth OR @depth@100ms + +**Update Speed:** 1000ms or 100ms + +**Payload:** + +``` +{ "lastUpdateId": 160, // Last update ID "bids": [ // Bids to be updated [ "0.0024", // Price level to be updated "10" // Quantity ] ], "asks": [ // Asks to be updated [ "0.0026", // Price level to be updated "100" // Quantity ] ]} +``` + +## Diff. Depth Stream[​](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) + +Order book price and quantity depth updates used to locally manage an order book. + +**Stream Name:** @depth OR @depth@100ms + +**Update Speed:** 1000ms or 100ms + +**Payload:** + +``` +{ "e": "depthUpdate", // Event type "E": 1672515782136, // Event time "s": "BNBBTC", // Symbol "U": 157, // First update ID in event "u": 160, // Final update ID in event "b": [ // Bids to be updated [ "0.0024", // Price level to be updated "10" // Quantity ] ], "a": [ // Asks to be updated [ "0.0026", // Price level to be updated "100" // Quantity ] ]} +``` + +## How to manage a local order book correctly[​](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) + +1. Open a WebSocket connection to `wss://stream.binance.com:9443/ws/bnbbtc@depth`. +2. Buffer the events received from the stream. Note the `U` of the first event you received. +3. Get a depth snapshot from `https://api.binance.com/api/v3/depth?symbol=BNBBTC&limit=5000`. +4. If the `lastUpdateId` from the snapshot is strictly less than the `U` from step 2, go back to step 3. +5. In the buffered events, discard any event where `u` is <= `lastUpdateId` of the snapshot. The first buffered event should now have `lastUpdateId` within its `[U;u]` range. +6. Set your local order book to the snapshot. Its update ID is `lastUpdateId`. +7. Apply the update procedure below to all buffered events, and then to all subsequent events received. + +To apply an event to your local order book, follow this update procedure: + +1. Decide whether the update event can be applied: + - If the event last update ID (`u`) is less than the update ID of your local order book, ignore the event. + - If the event first update ID (`U`) is greater than the update ID of your local order book + 1, you have missed some events. + Discard your local order book and restart the process from the beginning. + - Normally, `U` of the next event is equal to `u + 1` of the previous event. +2. For each price level in bids (`b`) and asks (`a`), set the new quantity in the order book: + - If the price level does not exist in the order book, insert it with new quantity. + - If the quantity is zero, remove the price level from the order book. +3. Set the order book update ID to the last update ID (`u`) in the processed event. + +> \[!NOTE\] Since depth snapshots retrieved from the API have a limit on the number of price levels (5000 on each side maximum), you won't learn the quantities for the levels outside of the initial snapshot unless they change. +> So be careful when using the information for those levels, since they might not reflect the full view of the order book. +> However, for most use cases, seeing 5000 levels on each side is enough to understand the market and trade effectively. + +- [General WSS information](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) +- [WebSocket Limits](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) +- [Live Subscribing/Unsubscribing to streams](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) + - [Subscribe to a stream](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) + - [Unsubscribe to a stream](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) + - [Listing Subscriptions](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) + - [Setting Properties](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) + - [Retrieving Properties](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) + - [Error Messages](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) +- [Aggregate Trade Streams](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) +- [Trade Streams](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) +- [Kline/Candlestick Streams for UTC](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) +- [Kline/Candlestick Streams with timezone offset](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) +- [Individual Symbol Mini Ticker Stream](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) +- [All Market Mini Tickers Stream](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) +- [Individual Symbol Ticker Streams](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) +- [Individual Symbol Rolling Window Statistics Streams](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) +- [All Market Rolling Window Statistics Streams](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) +- [Individual Symbol Book Ticker Streams](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) +- [Average Price](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) +- [Partial Book Depth Streams](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) +- [Diff. Depth Stream](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) +- [How to manage a local order book correctly](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) diff --git a/docs/binance/binance-spot/websocket-api_account-requests.md b/docs/binance/binance-spot/websocket-api_account-requests.md new file mode 100644 index 0000000..a436d07 --- /dev/null +++ b/docs/binance/binance-spot/websocket-api_account-requests.md @@ -0,0 +1,1147 @@ +--- +title: "Account requests | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests" +fetched_at: "2026-02-26T10:38:12.594Z" +--- +### Account information (USER\_DATA)[​](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests) + +``` +{ "id": "605a6d20-6588-4cb9-afa0-b0ab087507ba", "method": "account.status", "params": { "apiKey": "vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A", "signature": "83303b4a136ac1371795f465808367242685a9e3a42b22edb4d977d0696eb45c", "timestamp": 1660801839480 }} +``` + +Query information about your account. + +**Weight:** 20 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +`apiKey` + +STRING + +YES + +`omitZeroBalances` + +BOOLEAN + +NO + +When set to `true`, emits only the non-zero balances of an account. +Default value: false + +`recvWindow` + +DECIMAL + +NO + +The value cannot be greater than `60000`. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +`signature` + +STRING + +YES + +`timestamp` + +LONG + +YES + +**Data Source:** Memory => Database + +**Response:** + +``` +{ "id": "605a6d20-6588-4cb9-afa0-b0ab087507ba", "status": 200, "result": { "makerCommission": 15, "takerCommission": 15, "buyerCommission": 0, "sellerCommission": 0, "canTrade": true, "canWithdraw": true, "canDeposit": true, "commissionRates": { "maker": "0.00150000", "taker": "0.00150000", "buyer": "0.00000000", "seller": "0.00000000" }, "brokered": false, "requireSelfTradePrevention": false, "preventSor": false, "updateTime": 1660801833000, "accountType": "SPOT", "balances": [ { "asset": "BNB", "free": "0.00000000", "locked": "0.00000000" }, { "asset": "BTC", "free": "1.3447112", "locked": "0.08600000" }, { "asset": "USDT", "free": "1021.21000000", "locked": "0.00000000" } ], "permissions": ["SPOT"], "uid": 354937868 }, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 20 } ]} +``` + +### Query order (USER\_DATA)[​](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests) + +``` +{ "id": "aa62318a-5a97-4f3b-bdc7-640bbe33b291", "method": "order.status", "params": { "symbol": "BTCUSDT", "orderId": 12569099453, "apiKey": "vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A", "signature": "2c3aab5a078ee4ea465ecd95523b77289f61476c2f238ec10c55ea6cb11a6f35", "timestamp": 1660801720951 }} +``` + +Check execution status of an order. + +**Weight:** 4 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +`symbol` + +STRING + +YES + +`orderId` + +LONG + +YES + +Lookup order by `orderId` + +`origClientOrderId` + +STRING + +Lookup order by `clientOrderId` + +`apiKey` + +STRING + +YES + +`recvWindow` + +DECIMAL + +NO + +The value cannot be greater than 60000. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +`signature` + +STRING + +YES + +`timestamp` + +LONG + +YES + +Notes: + +- If both `orderId` and `origClientOrderId` are provided, the `orderId` is searched first, then the `origClientOrderId` from that result is checked against that order. If both conditions are not met the request will be rejected. + +- For some historical orders the `cummulativeQuoteQty` response field may be negative, meaning the data is not available at this time. + + +**Data Source:** Memory => Database + +**Response:** + +``` +{ "id": "aa62318a-5a97-4f3b-bdc7-640bbe33b291", "status": 200, "result": { "symbol": "BTCUSDT", "orderId": 12569099453, "orderListId": -1, // set only for orders of an order list "clientOrderId": "4d96324ff9d44481926157", "price": "23416.10000000", "origQty": "0.00847000", "executedQty": "0.00847000", "cummulativeQuoteQty": "198.33521500", "status": "FILLED", "timeInForce": "GTC", "type": "LIMIT", "side": "SELL", "stopPrice": "0.00000000", // always present, zero if order type does not use stopPrice "trailingDelta": 10, // present only if trailingDelta set for the order "trailingTime": -1, // present only if trailingDelta set for the order "icebergQty": "0.00000000", // always present, zero for non-iceberg orders "time": 1660801715639, // time when the order was placed "updateTime": 1660801717945, // time of the last update to the order "isWorking": true, "workingTime": 1660801715639, "origQuoteOrderQty": "0.00000000", // always present, zero if order type does not use quoteOrderQty "strategyId": 37463720, // present only if strategyId set for the order "strategyType": 1000000, // present only if strategyType set for the order "selfTradePreventionMode": "NONE", "preventedMatchId": 0, // present only if the order expired due to STP "preventedQuantity": "1.200000" // present only if the order expired due to STP }, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 4 } ]} +``` + +**Note:** The payload above does not show all fields that can appear. Please refer to [Conditional fields in Order Responses](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests). + +### Current open orders (USER\_DATA)[​](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests) + +``` +{ "id": "55f07876-4f6f-4c47-87dc-43e5fff3f2e7", "method": "openOrders.status", "params": { "symbol": "BTCUSDT", "apiKey": "vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A", "signature": "d632b3fdb8a81dd44f82c7c901833309dd714fe508772a89b0a35b0ee0c48b89", "timestamp": 1660813156812 }} +``` + +Query execution status of all open orders. + +If you need to continuously monitor order status updates, please consider using WebSocket Streams: + +- [`userDataStream.start`](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests) request +- [`executionReport`](https://developers.binance.com/docs/binance-spot-api-docs/user-data-stream) user data stream event + +**Weight:** Adjusted based on the number of requested symbols: + +Parameter + +Weight + +`symbol` + +6 + +none + +80 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +`symbol` + +STRING + +NO + +If omitted, open orders for all symbols are returned + +`apiKey` + +STRING + +YES + +`recvWindow` + +DECIMAL + +NO + +The value cannot be greater than `60000`. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +`signature` + +STRING + +YES + +`timestamp` + +LONG + +YES + +**Data Source:** Memory => Database + +**Response:** + +Status reports for open orders are identical to [`order.status`](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests). + +Note that some fields are optional and included only for orders that set them. + +Open orders are always returned as a flat list. If all symbols are requested, use the `symbol` field to tell which symbol the orders belong to. + +``` +{ "id": "55f07876-4f6f-4c47-87dc-43e5fff3f2e7", "status": 200, "result": [ { "symbol": "BTCUSDT", "orderId": 12569099453, "orderListId": -1, "clientOrderId": "4d96324ff9d44481926157", "price": "23416.10000000", "origQty": "0.00847000", "executedQty": "0.00720000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "172.43931000", "status": "PARTIALLY_FILLED", "timeInForce": "GTC", "type": "LIMIT", "side": "SELL", "stopPrice": "0.00000000", "icebergQty": "0.00000000", "time": 1660801715639, "updateTime": 1660801717945, "isWorking": true, "workingTime": 1660801715639, "origQuoteOrderQty": "0.00000000", "selfTradePreventionMode": "NONE" } ], "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 6 } ]} +``` + +**Note:** The payload above does not show all fields that can appear. Please refer to [Conditional fields in Order Responses](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests). + +### Account order history (USER\_DATA)[​](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests) + +``` +{ "id": "734235c2-13d2-4574-be68-723e818c08f3", "method": "allOrders", "params": { "symbol": "BTCUSDT", "startTime": 1660780800000, "endTime": 1660867200000, "limit": 5, "apiKey": "vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A", "signature": "f50a972ba7fad92842187643f6b930802d4e20bce1ba1e788e856e811577bd42", "timestamp": 1661955123341 }} +``` + +Query information about all your orders – active, canceled, filled – filtered by time range. + +**Weight:** 20 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +`symbol` + +STRING + +YES + +`orderId` + +LONG + +NO + +Order ID to begin at + +`startTime` + +LONG + +NO + +`endTime` + +LONG + +NO + +`limit` + +INT + +NO + +Default: 500; Maximum: 1000 + +`apiKey` + +STRING + +YES + +`recvWindow` + +DECIMAL + +NO + +The value cannot be greater than `60000`. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +`signature` + +STRING + +YES + +`timestamp` + +LONG + +YES + +Notes: + +- If `startTime` and/or `endTime` are specified, `orderId` is ignored. + + Orders are filtered by `time` of the last execution status update. + +- If `orderId` is specified, return orders with order ID >= `orderId`. + +- If no condition is specified, the most recent orders are returned. + +- For some historical orders the `cummulativeQuoteQty` response field may be negative, meaning the data is not available at this time. + +- The time between `startTime` and `endTime` can't be longer than 24 hours. + + +**Data Source:** Database + +**Response:** + +Status reports for orders are identical to [`order.status`](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests). + +Note that some fields are optional and included only for orders that set them. + +``` +{ "id": "734235c2-13d2-4574-be68-723e818c08f3", "status": 200, "result": [ { "symbol": "BTCUSDT", "orderId": 12569099453, "orderListId": -1, "clientOrderId": "4d96324ff9d44481926157", "price": "23416.10000000", "origQty": "0.00847000", "executedQty": "0.00847000", "cummulativeQuoteQty": "198.33521500", "status": "FILLED", "timeInForce": "GTC", "type": "LIMIT", "side": "SELL", "stopPrice": "0.00000000", "icebergQty": "0.00000000", "time": 1660801715639, "updateTime": 1660801717945, "isWorking": true, "workingTime": 1660801715639, "origQuoteOrderQty": "0.00000000", "selfTradePreventionMode": "NONE", "preventedMatchId": 0, // This field only appears if the order expired due to STP. "preventedQuantity": "1.200000" // This field only appears if the order expired due to STP. } ], "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 20 } ]} +``` + +### Query Order list (USER\_DATA)[​](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests) + +``` +{ "id": "b53fd5ff-82c7-4a04-bd64-5f9dc42c2100", "method": "orderList.status", "params": { "origClientOrderId": "08985fedd9ea2cf6b28996", "apiKey": "vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A", "signature": "d12f4e8892d46c0ddfbd43d556ff6d818581b3be22a02810c2c20cb719aed6a4", "timestamp": 1660801713965 }} +``` + +Check execution status of an Order list. + +For execution status of individual orders, use [`order.status`](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests). + +**Weight:** 4 + +**Parameters**: + +Name + +Type + +Mandatory + +Description + +`origClientOrderId` + +STRING + +NO\* + +Query order list by `listClientOrderId`. +`orderListId` or `origClientOrderId` must be provided. + +`orderListId` + +INT + +Query order list by `orderListId`. +`orderListId` or `origClientOrderId` must be provided. + +`apiKey` + +STRING + +YES + +`recvWindow` + +DECIMAL + +NO + +The value cannot be greater than 60000. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +`signature` + +STRING + +YES + +`timestamp` + +LONG + +YES + +Notes: + +- `origClientOrderId` refers to `listClientOrderId` of the order list itself. + +- If both `origClientOrderId` and `orderListId` parameters are specified, only `origClientOrderId` is used and `orderListId` is ignored. + + +**Data Source:** Database + +**Response:** + +``` +{ "id": "b53fd5ff-82c7-4a04-bd64-5f9dc42c2100", "status": 200, "result": { "orderListId": 1274512, "contingencyType": "OCO", "listStatusType": "EXEC_STARTED", "listOrderStatus": "EXECUTING", "listClientOrderId": "08985fedd9ea2cf6b28996", "transactionTime": 1660801713793, "symbol": "BTCUSDT", "orders": [ { "symbol": "BTCUSDT", "orderId": 12569138901, "clientOrderId": "BqtFCj5odMoWtSqGk2X9tU" }, { "symbol": "BTCUSDT", "orderId": 12569138902, "clientOrderId": "jLnZpj5enfMXTuhKB1d0us" } ] }, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 4 } ]} +``` + +### Current open Order lists (USER\_DATA)[​](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests) + +``` +{ "id": "3a4437e2-41a3-4c19-897c-9cadc5dce8b6", "method": "openOrderLists.status", "params": { "apiKey": "vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A", "signature": "1bea8b157dd78c3da30359bddcd999e4049749fe50b828e620e12f64e8b433c9", "timestamp": 1660801713831 }} +``` + +Query execution status of all open order lists. + +If you need to continuously monitor order status updates, please consider using WebSocket Streams: + +- [`userDataStream.start`](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests) request +- [`executionReport`](https://developers.binance.com/docs/binance-spot-api-docs/user-data-stream) user data stream event + +**Weight**: 6 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +`apiKey` + +STRING + +YES + +`recvWindow` + +DECIMAL + +NO + +The value cannot be greater than `60000`. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +`signature` + +STRING + +YES + +`timestamp` + +LONG + +YES + +**Data Source:** Database + +**Response:** + +``` +{ "id": "3a4437e2-41a3-4c19-897c-9cadc5dce8b6", "status": 200, "result": [ { "orderListId": 0, "contingencyType": "OCO", "listStatusType": "EXEC_STARTED", "listOrderStatus": "EXECUTING", "listClientOrderId": "08985fedd9ea2cf6b28996", "transactionTime": 1660801713793, "symbol": "BTCUSDT", "orders": [ { "symbol": "BTCUSDT", "orderId": 4, "clientOrderId": "CUhLgTXnX5n2c0gWiLpV4d" }, { "symbol": "BTCUSDT", "orderId": 5, "clientOrderId": "1ZqG7bBuYwaF4SU8CwnwHm" } ] } ], "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 6 } ]} +``` + +### Account order list history (USER\_DATA)[​](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests) + +``` +{ "id": "8617b7b3-1b3d-4dec-94cd-eefd929b8ceb", "method": "allOrderLists", "params": { "startTime": 1660780800000, "endTime": 1660867200000, "limit": 5, "apiKey": "vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A", "signature": "c8e1484db4a4a02d0e84dfa627eb9b8298f07ebf12fcc4eaf86e4a565b2712c2", "timestamp": 1661955123341 }} +``` + +Query information about all your order lists, filtered by time range. + +**Weight:** 20 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +`fromId` + +INT + +NO + +Order list ID to begin at + +`startTime` + +LONG + +NO + +`endTime` + +LONG + +NO + +`limit` + +INT + +NO + +Default: 500; Maximum: 1000 + +`apiKey` + +STRING + +YES + +`recvWindow` + +DECIMAL + +NO + +The value cannot be greater than `60000`. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +`signature` + +STRING + +YES + +`timestamp` + +LONG + +YES + +Notes: + +- If `startTime` and/or `endTime` are specified, `fromId` is ignored. + + Order lists are filtered by `transactionTime` of the last order list execution status update. + +- If `fromId` is specified, return order lists with order list ID >= `fromId`. + +- If no condition is specified, the most recent order lists are returned. + +- The time between `startTime` and `endTime` can't be longer than 24 hours. + + +**Data Source:** Database + +**Response:** + +Status reports for order lists are identical to [`orderList.status`](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests). + +``` +{ "id": "8617b7b3-1b3d-4dec-94cd-eefd929b8ceb", "status": 200, "result": [ { "orderListId": 1274512, "contingencyType": "OCO", "listStatusType": "EXEC_STARTED", "listOrderStatus": "EXECUTING", "listClientOrderId": "08985fedd9ea2cf6b28996", "transactionTime": 1660801713793, "symbol": "BTCUSDT", "orders": [ { "symbol": "BTCUSDT", "orderId": 12569138901, "clientOrderId": "BqtFCj5odMoWtSqGk2X9tU" }, { "symbol": "BTCUSDT", "orderId": 12569138902, "clientOrderId": "jLnZpj5enfMXTuhKB1d0us" } ] } ], "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 20 } ]} +``` + +### Account trade history (USER\_DATA)[​](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests) + +``` +{ "id": "f4ce6a53-a29d-4f70-823b-4ab59391d6e8", "method": "myTrades", "params": { "symbol": "BTCUSDT", "startTime": 1660780800000, "endTime": 1660867200000, "apiKey": "vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A", "signature": "c5a5ffb79fd4f2e10a92f895d488943a57954edf5933bde3338dfb6ea6d6eefc", "timestamp": 1661955125250 }} +``` + +Query information about all your trades, filtered by time range. + +**Weight:** + +Condition + +Weight + +Without orderId + +20 + +With orderId + +5 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +`symbol` + +STRING + +YES + +`orderId` + +LONG + +NO + +`startTime` + +LONG + +NO + +`endTime` + +LONG + +NO + +`fromId` + +INT + +NO + +First trade ID to query + +`limit` + +INT + +NO + +Default: 500; Maximum: 1000 + +`apiKey` + +STRING + +YES + +`recvWindow` + +DECIMAL + +NO + +The value cannot be greater than `60000`. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +`signature` + +STRING + +YES + +`timestamp` + +LONG + +YES + +Notes: + +- If `fromId` is specified, return trades with trade ID >= `fromId`. + +- If `startTime` and/or `endTime` are specified, trades are filtered by execution time (`time`). + + `fromId` cannot be used together with `startTime` and `endTime`. + +- If `orderId` is specified, only trades related to that order are returned. + + `startTime` and `endTime` cannot be used together with `orderId`. + +- If no condition is specified, the most recent trades are returned. + +- The time between `startTime` and `endTime` can't be longer than 24 hours. + + +**Data Source:** Memory => Database + +**Response:** + +``` +{ "id": "f4ce6a53-a29d-4f70-823b-4ab59391d6e8", "status": 200, "result": [ { "symbol": "BTCUSDT", "id": 1650422481, "orderId": 12569099453, "orderListId": -1, "price": "23416.10000000", "qty": "0.00635000", "quoteQty": "148.69223500", "commission": "0.00000000", "commissionAsset": "BNB", "time": 1660801715793, "isBuyer": false, "isMaker": true, "isBestMatch": true }, { "symbol": "BTCUSDT", "id": 1650422482, "orderId": 12569099453, "orderListId": -1, "price": "23416.50000000", "qty": "0.00212000", "quoteQty": "49.64298000", "commission": "0.00000000", "commissionAsset": "BNB", "time": 1660801715793, "isBuyer": false, "isMaker": true, "isBestMatch": true } ], "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 20 } ]} +``` + +### Unfilled Order Count (USER\_DATA)[​](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests) + +``` +{ "id": "d3783d8d-f8d1-4d2c-b8a0-b7596af5a664", "method": "account.rateLimits.orders", "params": { "apiKey": "vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A", "signature": "76289424d6e288f4dc47d167ac824e859dabf78736f4348abbbac848d719eb94", "timestamp": 1660801839500 }} +``` + +Query your current unfilled order count for all intervals. + +**Weight:** 40 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +`apiKey` + +STRING + +YES + +`recvWindow` + +DECIMAL + +NO + +The value cannot be greater than `60000`. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +`signature` + +STRING + +YES + +`timestamp` + +LONG + +YES + +**Data Source:** Memory + +**Response:** + +``` +{ "id": "d3783d8d-f8d1-4d2c-b8a0-b7596af5a664", "status": 200, "result": [ { "rateLimitType": "ORDERS", "interval": "SECOND", "intervalNum": 10, "limit": 50, "count": 0 }, { "rateLimitType": "ORDERS", "interval": "DAY", "intervalNum": 1, "limit": 160000, "count": 0 } ], "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 40 } ]} +``` + +### Account prevented matches (USER\_DATA)[​](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests) + +``` +{ "id": "g4ce6a53-a39d-4f71-823b-4ab5r391d6y8", "method": "myPreventedMatches", "params": { "symbol": "BTCUSDT", "orderId": 35, "apiKey": "vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A", "signature": "c5a5ffb79fd4f2e10a92f895d488943a57954edf5933bde3338dfb6ea6d6eefc", "timestamp": 1673923281052 }} +``` + +Displays the list of orders that were expired due to STP. + +These are the combinations supported: + +- `symbol` + `preventedMatchId` +- `symbol` + `orderId` +- `symbol` + `orderId` + `fromPreventedMatchId` (`limit` will default to 500) +- `symbol` + `orderId` + `fromPreventedMatchId` + `limit` + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +preventedMatchId + +LONG + +NO + +orderId + +LONG + +NO + +fromPreventedMatchId + +LONG + +NO + +limit + +INT + +NO + +Default: `500`; Maximum: `1000` + +recvWindow + +DECIMAL + +NO + +The value cannot be greater than `60000`. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +timestamp + +LONG + +YES + +**Weight** + +Case + +Weight + +If `symbol` is invalid + +2 + +Querying by `preventedMatchId` + +2 + +Querying by `orderId` + +20 + +**Data Source:** Database + +**Response:** + +``` +{ "id": "g4ce6a53-a39d-4f71-823b-4ab5r391d6y8", "status": 200, "result": [ { "symbol": "BTCUSDT", "preventedMatchId": 1, "takerOrderId": 5, "makerSymbol": "BTCUSDT", "makerOrderId": 3, "tradeGroupId": 1, "selfTradePreventionMode": "EXPIRE_MAKER", "price": "1.100000", "makerPreventedQuantity": "1.300000", "transactTime": 1669101687094 } ], "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 20 } ]} +``` + +### Account allocations (USER\_DATA)[​](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests) + +``` +{ "id": "g4ce6a53-a39d-4f71-823b-4ab5r391d6y8", "method": "myAllocations", "params": { "symbol": "BTCUSDT", "orderId": 500, "apiKey": "vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A", "signature": "c5a5ffb79fd4f2e10a92f895d488943a57954edf5933bde3338dfb6ea6d6eefc", "timestamp": 1673923281052 }} +``` + +Retrieves allocations resulting from SOR order placement. + +**Weight:** 20 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +`symbol` + +STRING + +Yes + +`startTime` + +LONG + +No + +`endTime` + +LONG + +No + +`fromAllocationId` + +INT + +No + +`limit` + +INT + +No + +Default: 500; Maximum: 1000 + +`orderId` + +LONG + +No + +`recvWindow` + +DECIMAL + +No + +The value cannot be greater than `60000`. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +`timestamp` + +LONG + +No + +Supported parameter combinations: + +Parameters + +Response + +`symbol` + +allocations from oldest to newest + +`symbol` + `startTime` + +oldest allocations since `startTime` + +`symbol` + `endTime` + +newest allocations until `endTime` + +`symbol` + `startTime` + `endTime` + +allocations within the time range + +`symbol` + `fromAllocationId` + +allocations by allocation ID + +`symbol` + `orderId` + +allocations related to an order starting with oldest + +`symbol` + `orderId` + `fromAllocationId` + +allocations related to an order by allocation ID + +**Note:** The time between `startTime` and `endTime` can't be longer than 24 hours. + +**Data Source:** Database + +**Response:** + +``` +{ "id": "g4ce6a53-a39d-4f71-823b-4ab5r391d6y8", "status": 200, "result": [ { "symbol": "BTCUSDT", "allocationId": 0, "allocationType": "SOR", "orderId": 500, "orderListId": -1, "price": "1.00000000", "qty": "0.10000000", "quoteQty": "0.10000000", "commission": "0.00000000", "commissionAsset": "BTC", "time": 1687319487614, "isBuyer": false, "isMaker": false, "isAllocator": false } ], "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 20 } ]} +``` + +### Account Commission Rates (USER\_DATA)[​](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests) + +``` +{ "id": "d3df8a61-98ea-4fe0-8f4e-0fcea5d418b0", "method": "account.commission", "params": { "symbol": "BTCUSDT", "apiKey": "vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A", "signature": "c5a5ffb79fd4f2e10a92f895d488943a57954edf5933bde3338dfb6ea6d6eefc", "timestamp": 1673923281052 }} +``` + +Get current account commission rates. + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +`symbol` + +STRING + +YES + +**Weight:** 20 + +**Data Source:** Database + +**Response:** + +``` +{ "id": "d3df8a61-98ea-4fe0-8f4e-0fcea5d418b0", "status": 200, "result": { "symbol": "BTCUSDT", "standardCommission": { // Standard commission rates on trades from the order. "maker": "0.00000010", "taker": "0.00000020", "buyer": "0.00000030", "seller": "0.00000040" }, "specialCommission": { // Special commission rates from the order. "maker": "0.01000000", "taker": "0.02000000", "buyer": "0.03000000", "seller": "0.04000000" }, "taxCommission": { // Tax commission rates on trades from the order. "maker": "0.00000112", "taker": "0.00000114", "buyer": "0.00000118", "seller": "0.00000116" }, "discount": { // Discount on standard commissions when paying in BNB. "enabledForAccount": true, "enabledForSymbol": true, "discountAsset": "BNB", "discount": "0.75000000" // Standard commission is reduced by this rate when paying commission in BNB. } }, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 20 } ]} +``` + +### Query Order Amendments (USER\_DATA)[​](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests) + +``` +{ "id": "6f5ebe91-01d9-43ac-be99-57cf062e0e30", "method": "order.amendments", "params": { "orderId": "23", "recvWindow": 5000, "symbol": "BTCUSDT", "timestamp": 1741925524887, "apiKey": "N3Swv7WaBF7S2rzA12UkPunM3udJiDddbgv1W7CzFGnsQXH9H62zzSCST0CndjeE", "signature": "0eed2e9d95b6868ea5ec21da0d14538192ef344c30ecf9fe83d58631699334dc" }} +``` + +Queries all amendments of a single order. + +**Weight**: 4 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +orderId + +LONG + +YES + +fromExecutionId + +LONG + +NO + +limit + +LONG + +NO + +Default:500; Maximum: 1000 + +recvWindow + +DECIMAL + +NO + +The value cannot be greater than `60000`. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +timestamp + +LONG + +YES + +**Data Source:** Database + +**Response:** + +``` +{ "id": "6f5ebe91-01d9-43ac-be99-57cf062e0e30", "status": 200, "result": [ { "symbol": "BTCUSDT", "orderId": 23, "executionId": 60, "origClientOrderId": "my_pending_order", "newClientOrderId": "xbxXh5SSwaHS7oUEOCI88B", "origQty": "7.00000000", "newQty": "5.00000000", "time": 1741924229819 } ], "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 4 } ]} +``` + +### Query Relevant Filters (USER\_DATA)[​](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests) + +``` +{ "id": "74R4febb-d142-46a2-977d-90533eb4d97g", "method": "myFilters", "params": { "recvWindow": 5000, "symbol": "BTCUSDT", "timestamp": 1758008841149, "apiKey": "nQ6kG5gDExDd5MZSO0MfOOWEVZmdkRllpNMfm1FjMjkMnmw1NUd3zPDfvcnDJlil", "signature": "7edc54dd0493dd5bc47adbab9b17bfc9b378d55c20511ae5a168456d3d37aa3a" }} +``` + +Retrieves the list of [filters](https://developers.binance.com/docs/binance-spot-api-docs/filters) relevant to an account on a given symbol. This is the only method that shows if an account has [`MAX_ASSET`](https://developers.binance.com/docs/binance-spot-api-docs/filters) filters applied to it. + +**Weight:** 40 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +recvWindow + +DECIMAL + +NO + +The value cannot be greater than `60000`. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +timestamp + +LONG + +YES + +**Data Source:** Memory + +**Response:** + +``` +{ "id": "1758009606869", "status": 200, "result": { "exchangeFilters": [ { "filterType": "EXCHANGE_MAX_NUM_ORDERS", "maxNumOrders": 1000 } ], "symbolFilters": [ { "filterType": "MAX_NUM_ORDER_LISTS", "maxNumOrderLists": 20 } ], "assetFilters": [ { "filterType": "MAX_ASSET", "asset": "JPY", "limit": "1000000.00000000" } ] }} +``` + +- [Account information (USER\_DATA)](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests) +- [Query order (USER\_DATA)](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests) +- [Current open orders (USER\_DATA)](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests) +- [Account order history (USER\_DATA)](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests) +- [Query Order list (USER\_DATA)](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests) +- [Current open Order lists (USER\_DATA)](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests) +- [Account order list history (USER\_DATA)](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests) +- [Account trade history (USER\_DATA)](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests) +- [Unfilled Order Count (USER\_DATA)](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests) +- [Account prevented matches (USER\_DATA)](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests) +- [Account allocations (USER\_DATA)](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests) +- [Account Commission Rates (USER\_DATA)](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests) +- [Query Order Amendments (USER\_DATA)](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests) +- [Query Relevant Filters (USER\_DATA)](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests) diff --git a/docs/binance/binance-spot/websocket-api_authentication-requests.md b/docs/binance/binance-spot/websocket-api_authentication-requests.md new file mode 100644 index 0000000..e31c6eb --- /dev/null +++ b/docs/binance/binance-spot/websocket-api_authentication-requests.md @@ -0,0 +1,111 @@ +--- +title: "Authentication requests | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests" +fetched_at: "2026-02-26T10:38:12.599Z" +--- +**Note:** Only _Ed25519_ keys are supported for this feature. + +### Log in with API key (SIGNED)[​](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests) + +``` +{ "id": "c174a2b1-3f51-4580-b200-8528bd237cb7", "method": "session.logon", "params": { "apiKey": "vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A", "signature": "1cf54395b336b0a9727ef27d5d98987962bc47aca6e13fe978612d0adee066ed", "timestamp": 1649729878532 }} +``` + +Authenticate WebSocket connection using the provided API key. + +After calling `session.logon`, you can omit `apiKey` and `signature` parameters for future requests that require them. + +Note that only one API key can be authenticated. Calling `session.logon` multiple times changes the current authenticated API key. + +**Weight:** 2 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +`apiKey` + +STRING + +YES + +`recvWindow` + +DECIMAL + +NO + +The value cannot be greater than `60000`. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +`signature` + +STRING + +YES + +`timestamp` + +LONG + +YES + +**Data Source:** Memory + +**Response:** + +``` +{ "id": "c174a2b1-3f51-4580-b200-8528bd237cb7", "status": 200, "result": { "apiKey": "vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A", "authorizedSince": 1649729878532, "connectedSince": 1649729873021, "returnRateLimits": false, "serverTime": 1649729878630, "userDataStream": false // is User Data Stream subscription active? }} +``` + +### Query session status[​](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests) + +``` +{ "id": "b50c16cd-62c9-4e29-89e4-37f10111f5bf", "method": "session.status"} +``` + +Query the status of the WebSocket connection, inspecting which API key (if any) is used to authorize requests. + +**Weight:** 2 + +**Parameters:** NONE + +**Data Source:** Memory + +**Response:** + +``` +{ "id": "b50c16cd-62c9-4e29-89e4-37f10111f5bf", "status": 200, "result": { // if the connection is not authenticated, "apiKey" and "authorizedSince" will be shown as null "apiKey": "vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A", "authorizedSince": 1649729878532, "connectedSince": 1649729873021, "returnRateLimits": false, "serverTime": 1649730611671, "userDataStream": true // is User Data Stream subscription active? }} +``` + +### Log out of the session[​](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests) + +``` +{ "id": "c174a2b1-3f51-4580-b200-8528bd237cb7", "method": "session.logout"} +``` + +Forget the API key previously authenticated. If the connection is not authenticated, this request does nothing. + +Note that the WebSocket connection stays open after `session.logout` request. You can continue using the connection, but now you will have to explicitly provide the `apiKey` and `signature` parameters where needed. + +**Weight:** 2 + +**Parameters:** NONE + +**Data Source:** Memory + +**Response:** + +``` +{ "id": "c174a2b1-3f51-4580-b200-8528bd237cb7", "status": 200, "result": { "apiKey": null, "authorizedSince": null, "connectedSince": 1649729873021, "returnRateLimits": false, "serverTime": 1649730611671, "userDataStream": false // is User Data Stream subscription active? }} +``` + +- [Log in with API key (SIGNED)](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests) +- [Query session status](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests) +- [Log out of the session](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests) diff --git a/docs/binance/binance-spot/websocket-api_data-sources.md b/docs/binance/binance-spot/websocket-api_data-sources.md new file mode 100644 index 0000000..5d7d85a --- /dev/null +++ b/docs/binance/binance-spot/websocket-api_data-sources.md @@ -0,0 +1,37 @@ +--- +title: "Data sources | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/data-sources" +fetched_at: "2026-02-26T10:38:12.732Z" +--- +- The API system is asynchronous. Some delay in the response is normal and expected. + +- Each method has a data source indicating where the data is coming from, and thus how up-to-date it is. + + +Data Source + +Latency + +Description + +Matching Engine + +lowest + +The Matching Engine produces the response directly + +Memory + +low + +Data is fetched from API server's local or external memory cache + +Database + +moderate + +Data is retrieved from the database + +- Some methods have more than one data source (e.g., Memory => Database). + + This means that the API will look for the latest data in that order: first in the cache, then in the database. diff --git a/docs/binance/binance-spot/websocket-api_event-format.md b/docs/binance/binance-spot/websocket-api_event-format.md new file mode 100644 index 0000000..de36981 --- /dev/null +++ b/docs/binance/binance-spot/websocket-api_event-format.md @@ -0,0 +1,42 @@ +--- +title: "Event format | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/event-format" +fetched_at: "2026-02-26T10:38:12.736Z" +--- +[User Data Stream](https://developers.binance.com/docs/binance-spot-api-docs/user-data-stream) events for non-SBE sessions are sent as JSON in **text frames**, one event per frame. + +Events in [SBE sessions](https://developers.binance.com/docs/binance-spot-api-docs/faqs/sbe_faq) will be sent as **binary frames**. + +Please refer to [`userDataStream.subscribe`](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/user-data-stream-requests) for details on how to subscribe to User Data Stream in WebSocket API. + +Example of an event: + +``` +{ "subscriptionId": 0, "event": { "e": "outboundAccountPosition", "E": 1728972148778, "u": 1728972148778, "B": [ { "a": "BTC", "f": "11818.00000000", "l": "182.00000000" }, { "a": "USDT", "f": "10580.00000000", "l": "70.00000000" } ] }} +``` + +Event fields: + +Name + +Type + +Mandatory + +Description + +`event` + +OBJECT + +YES + +Event payload. See [User Data Streams](https://developers.binance.com/docs/binance-spot-api-docs/user-data-stream) + +`subscriptionId` + +INT + +NO + +Identifies which subscription the event is coming from. See [User Data Stream subscriptions](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/event-format) diff --git a/docs/binance/binance-spot/websocket-api_general-api-information.md b/docs/binance/binance-spot/websocket-api_general-api-information.md new file mode 100644 index 0000000..f1da7fd --- /dev/null +++ b/docs/binance/binance-spot/websocket-api_general-api-information.md @@ -0,0 +1,30 @@ +--- +title: "General API Information | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/general-api-information" +fetched_at: "2026-02-26T10:38:12.847Z" +--- +- The base endpoint is: **`wss://ws-api.binance.com:443/ws-api/v3`**. + - If you experience issues with the standard 443 port, alternative port 9443 is also available. + - The base endpoint for [testnet](https://testnet.binance.vision/) is: `wss://ws-api.testnet.binance.vision/ws-api/v3` +- A single connection to the API is only valid for 24 hours; expect to be disconnected after the 24-hour mark. +- We support HMAC, RSA, and Ed25519 keys. For more information, please see [API Key types](https://developers.binance.com/docs/binance-spot-api-docs/faqs/api_key_types). +- Responses are in JSON by default. To receive responses in SBE, refer to the [SBE FAQ](https://developers.binance.com/docs/binance-spot-api-docs/faqs/sbe_faq) page. +- If your request contains a symbol name containing non-ASCII characters, then the response may contain non-ASCII characters encoded in UTF-8. +- Some methods may return asset and/or symbol names containing non-ASCII characters encoded in UTF-8 even if the request did not contain non-ASCII characters. +- The WebSocket server will send a `ping frame` every 20 seconds. + - If the WebSocket server does not receive a `pong frame` back from the connection within a minute the connection will be disconnected. + - When you receive a ping, you must send a pong with a copy of ping's payload as soon as possible. + - Unsolicited `pong frames` are allowed, but will not prevent disconnection. **It is recommended that the payload for these pong frames are empty.** +- Data is returned in **chronological order**, unless noted otherwise. + - Without `startTime` or `endTime`, returns the most recent items up to the limit. + - With `startTime`, returns oldest items from `startTime` up to the limit. + - With `endTime`, returns most recent items up to `endTime` and the limit. + - With both, behaves like `startTime` but does not exceed `endTime`. +- All timestamps in the JSON responses are in **milliseconds in UTC by default**. To receive the information in microseconds, please add the parameter `timeUnit=MICROSECOND` or `timeUnit=microsecond` in the URL. +- Timestamp parameters (e.g. `startTime`, `endTime`, `timestamp`) can be passed in milliseconds or microseconds. +- All field names and values are **case-sensitive**, unless noted otherwise. +- If there are enums or terms you want clarification on, please see [SPOT Glossary](https://developers.binance.com/docs/binance-spot-api-docs/faqs/spot_glossary) for more information. +- APIs have a timeout of 10 seconds when processing a request. If a response from the Matching Engine takes longer than this, the API responds with "Timeout waiting for response from backend server. Send status unknown; execution status unknown." [(-1007 TIMEOUT)](https://developers.binance.com/docs/binance-spot-api-docs/errors) + - This does not always mean that the request failed in the Matching Engine. + - If the status of the request has not appeared in [User Data Stream](https://developers.binance.com/docs/binance-spot-api-docs/user-data-stream), please perform an API query for its status. +- **Please avoid SQL keywords in requests** as they may trigger a security block by a WAF (Web Application Firewall) rule. See [https://www.binance.com/en/support/faq/detail/360004492232](https://www.binance.com/en/support/faq/detail/360004492232) for more details. diff --git a/docs/binance/binance-spot/websocket-api_general-requests.md b/docs/binance/binance-spot/websocket-api_general-requests.md new file mode 100644 index 0000000..bf5540a --- /dev/null +++ b/docs/binance/binance-spot/websocket-api_general-requests.md @@ -0,0 +1,131 @@ +--- +title: "General requests | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/general-requests" +fetched_at: "2026-02-26T10:38:12.919Z" +--- +### Test connectivity[​](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/general-requests) + +``` +{ "id": "922bcc6e-9de8-440d-9e84-7c80933a8d0d", "method": "ping"} +``` + +Test connectivity to the WebSocket API. + +**Note:** You can use regular WebSocket ping frames to test connectivity as well, WebSocket API will respond with pong frames as soon as possible. `ping` request along with `time` is a safe way to test request-response handling in your application. + +**Weight:** 1 + +**Parameters:** NONE + +**Data Source:** Memory + +**Response:** + +``` +{ "id": "922bcc6e-9de8-440d-9e84-7c80933a8d0d", "status": 200, "result": {}, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 1 } ]} +``` + +### Check server time[​](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/general-requests) + +``` +{ "id": "187d3cb2-942d-484c-8271-4e2141bbadb1", "method": "time"} +``` + +Test connectivity to the WebSocket API and get the current server time. + +**Weight:** 1 + +**Parameters:** NONE + +**Data Source:** Memory + +**Response:** + +``` +{ "id": "187d3cb2-942d-484c-8271-4e2141bbadb1", "status": 200, "result": { "serverTime": 1656400526260 }, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 1 } ]} +``` + +### Exchange information[​](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/general-requests) + +``` +{ "id": "5494febb-d167-46a2-996d-70533eb4d976", "method": "exchangeInfo", "params": { "symbols": ["BNBBTC"] }} +``` + +Query current exchange trading rules, rate limits, and symbol information. + +**Weight:** 20 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +`symbol` + +STRING + +NO + +Describe a single symbol + +`symbols` + +ARRAY of STRING + +Describe multiple symbols + +`permissions` + +ARRAY of STRING + +Filter symbols by permissions + +`showPermissionSets` + +BOOLEAN + +Controls whether the content of the `permissionSets` field is populated or not. Defaults to `true`. + +`symbolStatus` + +ENUM + +Filters for symbols that have this `tradingStatus`. + +Valid values: `TRADING`, `HALT`, `BREAK` +Cannot be used in combination with `symbol` or `symbols` + +Notes: + +- Only one of `symbol`, `symbols`, `permissions` parameters can be specified. + +- Without parameters, `exchangeInfo` displays all symbols with `["SPOT, "MARGIN", "LEVERAGED"]` permissions. + + - In order to list _all_ active symbols on the exchange, you need to explicitly request all permissions. +- `permissions` accepts either a list of permissions, or a single permission name. E.g. `"SPOT"`. + +- [Available Permissions](https://developers.binance.com/docs/binance-spot-api-docs/enums) + + +**Examples of Symbol Permissions Interpretation from the Response:** + +- `[["A","B"]]` means you may place an order if your account has either permission "A" **or** permission "B". +- `[["A"],["B"]]` means you can place an order if your account has permission "A" **and** permission "B". +- `[["A"],["B","C"]]` means you can place an order if your account has permission "A" **and** permission "B" or permission "C". (Inclusive or is applied here, not exclusive or, so your account may have both permission "B" and permission "C".) + +**Data Source:** Memory + +**Response:** + +``` +{ "id": "5494febb-d167-46a2-996d-70533eb4d976", "status": 200, "result": { "timezone": "UTC", "serverTime": 1655969291181, // Global rate limits. See "Rate limits" section. "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", // Rate limit type: REQUEST_WEIGHT, ORDERS, CONNECTIONS "interval": "MINUTE", // Rate limit interval: SECOND, MINUTE, DAY "intervalNum": 1, // Rate limit interval multiplier (i.e., "1 minute") "limit": 6000 // Rate limit per interval }, { "rateLimitType": "ORDERS", "interval": "SECOND", "intervalNum": 10, "limit": 50 }, { "rateLimitType": "ORDERS", "interval": "DAY", "intervalNum": 1, "limit": 160000 }, { "rateLimitType": "CONNECTIONS", "interval": "MINUTE", "intervalNum": 5, "limit": 300 } ], // Exchange filters are explained on the "Filters" page: // https://github.com/binance/binance-spot-api-docs/blob/master/filters.md // All exchange filters are optional. "exchangeFilters": [], "symbols": [ { "symbol": "BNBBTC", "status": "TRADING", "baseAsset": "BNB", "baseAssetPrecision": 8, "quoteAsset": "BTC", "quotePrecision": 8, "quoteAssetPrecision": 8, "baseCommissionPrecision": 8, "quoteCommissionPrecision": 8, "orderTypes": [ "LIMIT", "LIMIT_MAKER", "MARKET", "STOP_LOSS_LIMIT", "TAKE_PROFIT_LIMIT" ], "icebergAllowed": true, "ocoAllowed": true, "otoAllowed": true, "opoAllowed": true, "quoteOrderQtyMarketAllowed": true, "allowTrailingStop": true, "cancelReplaceAllowed": true, "amendAllowed": false, "pegInstructionsAllowed": true, "isSpotTradingAllowed": true, "isMarginTradingAllowed": true, // Symbol filters are explained on the "Filters" page: // https://github.com/binance/binance-spot-api-docs/blob/master/filters.md // All symbol filters are optional. "filters": [ { "filterType": "PRICE_FILTER", "minPrice": "0.00000100", "maxPrice": "100000.00000000", "tickSize": "0.00000100" }, { "filterType": "LOT_SIZE", "minQty": "0.00100000", "maxQty": "100000.00000000", "stepSize": "0.00100000" } ], "permissions": [], "permissionSets": [["SPOT", "MARGIN", "TRD_GRP_004"]], "defaultSelfTradePreventionMode": "NONE", "allowedSelfTradePreventionModes": ["NONE"] } ], // Optional field. Present only when SOR is available. // https://github.com/binance/binance-spot-api-docs/blob/master/faqs/sor_faq.md "sors": [ { "baseAsset": "BTC", "symbols": ["BTCUSDT", "BTCUSDC"] } ] }, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 20 } ]} +``` + +- [Test connectivity](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/general-requests) +- [Check server time](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/general-requests) +- [Exchange information](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/general-requests) diff --git a/docs/binance/binance-spot/websocket-api_market-data-requests.md b/docs/binance/binance-spot/websocket-api_market-data-requests.md new file mode 100644 index 0000000..3674763 --- /dev/null +++ b/docs/binance/binance-spot/websocket-api_market-data-requests.md @@ -0,0 +1,1037 @@ +--- +title: "Market data requests | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests" +fetched_at: "2026-02-26T10:38:13.097Z" +--- +### Order book[​](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests) + +``` +{ "id": "51e2affb-0aba-4821-ba75-f2625006eb43", "method": "depth", "params": { "symbol": "BNBBTC", "limit": 5 }} +``` + +Get current order book. + +Note that this request returns limited market depth. + +If you need to continuously monitor order book updates, please consider using WebSocket Streams: + +- [`@depth`](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) +- [`@depth`](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) + +You can use `depth` request together with `@depth` streams to [maintain a local order book](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams). + +**Weight:** Adjusted based on the limit: + +Limit + +Weight + +1–100 + +5 + +101–500 + +25 + +501–1000 + +50 + +1001–5000 + +250 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +`symbol` + +STRING + +YES + +`limit` + +INT + +NO + +Default: 100; Maximum: 5000 + +`symbolStatus` + +ENUM + +NO + +Filters for symbols that have this `tradingStatus`. +A status mismatch returns error `-1220 SYMBOL_DOES_NOT_MATCH_STATUS` +Valid values: `TRADING`, `HALT`, `BREAK` + +**Data Source:** Memory + +**Response:** + +``` +{ "id": "51e2affb-0aba-4821-ba75-f2625006eb43", "status": 200, "result": { "lastUpdateId": 2731179239, // Bid levels are sorted from highest to lowest price. "bids": [ [ "0.01379900", // Price "3.43200000" // Quantity ], ["0.01379800", "3.24300000"], ["0.01379700", "10.45500000"], ["0.01379600", "3.82100000"], ["0.01379500", "10.26200000"] ], // Ask levels are sorted from lowest to highest price. "asks": [ ["0.01380000", "5.91700000"], ["0.01380100", "6.01400000"], ["0.01380200", "0.26800000"], ["0.01380300", "0.33800000"], ["0.01380400", "0.26800000"] ] }, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 2 } ]} +``` + +### Recent trades[​](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests) + +``` +{ "id": "409a20bd-253d-41db-a6dd-687862a5882f", "method": "trades.recent", "params": { "symbol": "BNBBTC", "limit": 1 }} +``` + +Get recent trades. + +If you need access to real-time trading activity, please consider using WebSocket Streams: + +- [`@trade`](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) + +**Weight:** 25 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +`symbol` + +STRING + +YES + +`limit` + +INT + +NO + +Default: 500; Maximum: 1000 + +**Data Source:** Memory + +**Response:** + +``` +{ "id": "409a20bd-253d-41db-a6dd-687862a5882f", "status": 200, "result": [ { "id": 194686783, "price": "0.01361000", "qty": "0.01400000", "quoteQty": "0.00019054", "time": 1660009530807, "isBuyerMaker": true, "isBestMatch": true } ], "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 2 } ]} +``` + +### Historical trades[​](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests) + +``` +{ "id": "cffc9c7d-4efc-4ce0-b587-6b87448f052a", "method": "trades.historical", "params": { "symbol": "BNBBTC", "fromId": 0, "limit": 1 }} +``` + +Get historical trades. + +**Weight:** 25 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +`symbol` + +STRING + +YES + +`fromId` + +INT + +NO + +Trade ID to begin at + +`limit` + +INT + +NO + +Default: 500; Maximum: 1000 + +Notes: + +- If `fromId` is not specified, the most recent trades are returned. + +**Data Source:** Database + +**Response:** + +``` +{ "id": "cffc9c7d-4efc-4ce0-b587-6b87448f052a", "status": 200, "result": [ { "id": 0, "price": "0.00005000", "qty": "40.00000000", "quoteQty": "0.00200000", "time": 1500004800376, "isBuyerMaker": true, "isBestMatch": true } ], "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 10 } ]} +``` + +### Aggregate trades[​](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests) + +``` +{ "id": "189da436-d4bd-48ca-9f95-9f613d621717", "method": "trades.aggregate", "params": { "symbol": "BNBBTC", "fromId": 50000000, "limit": 1 }} +``` + +Get aggregate trades. + +An _aggregate trade_ (aggtrade) represents one or more individual trades. Trades that fill at the same time, from the same taker order, with the same price – those trades are collected into an aggregate trade with total quantity of the individual trades. + +If you need access to real-time trading activity, please consider using WebSocket Streams: + +- [`@aggTrade`](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) + +If you need historical aggregate trade data, please consider using [data.binance.vision](https://github.com/binance/binance-public-data). + +**Weight:** 4 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +`symbol` + +STRING + +YES + +`fromId` + +LONG + +NO + +Aggregate trade ID to begin at + +`startTime` + +LONG + +NO + +`endTime` + +LONG + +NO + +`limit` + +LONG + +NO + +Default: 500; Maximum: 1000 + +Notes: + +- If `fromId` is specified, return aggtrades with aggregate trade ID >= `fromId`. + + Use `fromId` and `limit` to page through all aggtrades. + +- If `startTime` and/or `endTime` are specified, aggtrades are filtered by execution time (`T`). + + `fromId` cannot be used together with `startTime` and `endTime`. + +- If no condition is specified, the most recent aggregate trades are returned. + + +**Data Source:** Database + +**Response:** + +``` +{ "id": "189da436-d4bd-48ca-9f95-9f613d621717", "status": 200, "result": [ { "a": 50000000, // Aggregate trade ID "p": "0.00274100", // Price "q": "57.19000000", // Quantity "f": 59120167, // First trade ID "l": 59120170, // Last trade ID "T": 1565877971222, // Timestamp "m": true, // Was the buyer the maker? "M": true // Was the trade the best price match? } ], "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 2 } ]} +``` + +### Klines[​](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests) + +``` +{ "id": "1dbbeb56-8eea-466a-8f6e-86bdcfa2fc0b", "method": "klines", "params": { "symbol": "BNBBTC", "interval": "1h", "startTime": 1655969280000, "limit": 1 }} +``` + +Get klines (candlestick bars). + +Klines are uniquely identified by their open & close time. + +If you need access to real-time kline updates, please consider using WebSocket Streams: + +- [`@kline_`](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) + +If you need historical kline data, please consider using [data.binance.vision](https://github.com/binance/binance-public-data). + +**Weight:** 2 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +`symbol` + +STRING + +YES + +`interval` + +ENUM + +YES + +`startTime` + +LONG + +NO + +`endTime` + +LONG + +NO + +`timeZone` + +STRING + +NO + +Default: 0 (UTC) + +`limit` + +INT + +NO + +Default: 500; Maximum: 1000 + +Supported kline intervals (case-sensitive): + +Interval + +`interval` value + +seconds + +`1s` + +minutes + +`1m`, `3m`, `5m`, `15m`, `30m` + +hours + +`1h`, `2h`, `4h`, `6h`, `8h`, `12h` + +days + +`1d`, `3d` + +weeks + +`1w` + +months + +`1M` + +Notes: + +- If `startTime`, `endTime` are not specified, the most recent klines are returned. +- Supported values for `timeZone`: + - Hours and minutes (e.g. `-1:00`, `05:45`) + - Only hours (e.g. `0`, `8`, `4`) + - Accepted range is strictly \[-12:00 to +14:00\] inclusive +- If `timeZone` provided, kline intervals are interpreted in that timezone instead of UTC. +- Note that `startTime` and `endTime` are always interpreted in UTC, regardless of timeZone. + +**Data Source:** Database + +**Response:** + +``` +{ "id": "1dbbeb56-8eea-466a-8f6e-86bdcfa2fc0b", "status": 200, "result": [ [ 1655971200000, // Kline open time "0.01086000", // Open price "0.01086600", // High price "0.01083600", // Low price "0.01083800", // Close price "2290.53800000", // Volume 1655974799999, // Kline close time "24.85074442", // Quote asset volume 2283, // Number of trades "1171.64000000", // Taker buy base asset volume "12.71225884", // Taker buy quote asset volume "0" // Unused field, ignore ] ], "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 2 } ]} +``` + +### UI Klines[​](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests) + +``` +{ "id": "b137468a-fb20-4c06-bd6b-625148eec958", "method": "uiKlines", "params": { "symbol": "BNBBTC", "interval": "1h", "startTime": 1655969280000, "limit": 1 }} +``` + +Get klines (candlestick bars) optimized for presentation. + +This request is similar to [`klines`](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests), having the same parameters and response. `uiKlines` return modified kline data, optimized for presentation of candlestick charts. + +**Weight:** 2 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +`symbol` + +STRING + +YES + +`interval` + +ENUM + +YES + +See [`klines`](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests) + +`startTime` + +LONG + +NO + +`endTime` + +LONG + +NO + +`timeZone` + +STRING + +NO + +Default: 0 (UTC) + +`limit` + +INT + +NO + +Default: 500; Maximum: 1000 + +Notes: + +- If `startTime`, `endTime` are not specified, the most recent klines are returned. +- Supported values for `timeZone`: + - Hours and minutes (e.g. `-1:00`, `05:45`) + - Only hours (e.g. `0`, `8`, `4`) + - Accepted range is strictly \[-12:00 to +14:00\] inclusive +- If `timeZone` provided, kline intervals are interpreted in that timezone instead of UTC. +- Note that `startTime` and `endTime` are always interpreted in UTC, regardless of timeZone. + +**Data Source:** Database + +**Response:** + +``` +{ "id": "b137468a-fb20-4c06-bd6b-625148eec958", "status": 200, "result": [ [ 1655971200000, // Kline open time "0.01086000", // Open price "0.01086600", // High price "0.01083600", // Low price "0.01083800", // Close price "2290.53800000", // Volume 1655974799999, // Kline close time "24.85074442", // Quote asset volume 2283, // Number of trades "1171.64000000", // Taker buy base asset volume "12.71225884", // Taker buy quote asset volume "0" // Unused field, ignore ] ], "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 2 } ]} +``` + +### Current average price[​](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests) + +``` +{ "id": "ddbfb65f-9ebf-42ec-8240-8f0f91de0867", "method": "avgPrice", "params": { "symbol": "BNBBTC" }} +``` + +Get current average price for a symbol. + +**Weight:** 2 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +`symbol` + +STRING + +YES + +**Data Source:** Memory + +**Response:** + +``` +{ "id": "ddbfb65f-9ebf-42ec-8240-8f0f91de0867", "status": 200, "result": { "mins": 5, // Average price interval (in minutes) "price": "9.35751834", // Average price "closeTime": 1694061154503 // Last trade time }, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 2 } ]} +``` + +### 24hr ticker price change statistics[​](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests) + +``` +{ "id": "93fb61ef-89f8-4d6e-b022-4f035a3fadad", "method": "ticker.24hr", "params": { "symbol": "BNBBTC" }} +``` + +Get 24-hour rolling window price change statistics. + +If you need to continuously monitor trading statistics, please consider using WebSocket Streams: + +- [`@ticker`](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) or [`!ticker@arr`](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) +- [`@miniTicker`](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) or [`!miniTicker@arr`](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) + +If you need different window sizes, use the [`ticker`](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests) request. + +**Weight:** Adjusted based on the number of requested symbols: + +Symbols + +Weight + +1–20 + +2 + +21–100 + +40 + +101 or more + +80 + +all symbols + +80 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +`symbol` + +STRING + +NO + +Query ticker for a single symbol + +`symbols` + +ARRAY of STRING + +Query ticker for multiple symbols + +`type` + +ENUM + +NO + +Ticker type: `FULL` (default) or `MINI` + +symbolStatus + +ENUM + +NO + +Filters for symbols that have this `tradingStatus`. +For a single symbol, a status mismatch returns error `-1220 SYMBOL_DOES_NOT_MATCH_STATUS`. +For multiple or all symbols, non-matching ones are simply excluded from the response. +Valid values: `TRADING`, `HALT`, `BREAK` + +Notes: + +- `symbol` and `symbols` cannot be used together. + +- If no symbol is specified, returns information about all symbols currently trading on the exchange. + + +**Data Source:** Memory + +**Response:** + +`FULL` type, for a single symbol: + +``` +{ "id": "93fb61ef-89f8-4d6e-b022-4f035a3fadad", "status": 200, "result": { "symbol": "BNBBTC", "priceChange": "0.00013900", "priceChangePercent": "1.020", "weightedAvgPrice": "0.01382453", "prevClosePrice": "0.01362800", "lastPrice": "0.01376700", "lastQty": "1.78800000", "bidPrice": "0.01376700", "bidQty": "4.64600000", "askPrice": "0.01376800", "askQty": "14.31400000", "openPrice": "0.01362800", "highPrice": "0.01414900", "lowPrice": "0.01346600", "volume": "69412.40500000", "quoteVolume": "959.59411487", "openTime": 1660014164909, "closeTime": 1660100564909, "firstId": 194696115, // First trade ID "lastId": 194968287, // Last trade ID "count": 272173 // Number of trades }, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 2 } ]} +``` + +`MINI` type, for a single symbol: + +``` +{ "id": "9fa2a91b-3fca-4ed7-a9ad-58e3b67483de", "status": 200, "result": { "symbol": "BNBBTC", "openPrice": "0.01362800", "highPrice": "0.01414900", "lowPrice": "0.01346600", "lastPrice": "0.01376700", "volume": "69412.40500000", "quoteVolume": "959.59411487", "openTime": 1660014164909, "closeTime": 1660100564909, "firstId": 194696115, // First trade ID "lastId": 194968287, // Last trade ID "count": 272173 // Number of trades }, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 2 } ]} +``` + +If more than one symbol is requested, response returns an array: + +``` +{ "id": "901be0d9-fd3b-45e4-acd6-10c580d03430", "status": 200, "result": [ { "symbol": "BNBBTC", "priceChange": "0.00016500", "priceChangePercent": "1.213", "weightedAvgPrice": "0.01382508", "prevClosePrice": "0.01360800", "lastPrice": "0.01377200", "lastQty": "1.01400000", "bidPrice": "0.01377100", "bidQty": "7.55700000", "askPrice": "0.01377200", "askQty": "4.37900000", "openPrice": "0.01360700", "highPrice": "0.01414900", "lowPrice": "0.01346600", "volume": "69376.27900000", "quoteVolume": "959.13277091", "openTime": 1660014615517, "closeTime": 1660101015517, "firstId": 194697254, "lastId": 194969483, "count": 272230 }, { "symbol": "BTCUSDT", "priceChange": "-938.06000000", "priceChangePercent": "-3.938", "weightedAvgPrice": "23265.34432003", "prevClosePrice": "23819.17000000", "lastPrice": "22880.91000000", "lastQty": "0.00536000", "bidPrice": "22880.40000000", "bidQty": "0.00424000", "askPrice": "22880.91000000", "askQty": "0.04276000", "openPrice": "23818.97000000", "highPrice": "23933.25000000", "lowPrice": "22664.69000000", "volume": "153508.37606000", "quoteVolume": "3571425225.04441220", "openTime": 1660014615977, "closeTime": 1660101015977, "firstId": 1592019902, "lastId": 1597301762, "count": 5281861 } ], "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 2 } ]} +``` + +### Trading Day Ticker[​](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests) + +``` +{ "id": "f4b3b507-c8f2-442a-81a6-b2f12daa030f", "method": "ticker.tradingDay", "params": { "symbols": ["BNBBTC", "BTCUSDT"], "timeZone": "00:00" }} +``` + +Price change statistics for a trading day. + +**Weight:** + +4 for each requested symbol. + +The weight for this request will cap at 200 once the number of `symbols` in the request is more than 50. + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +`symbol` + +STRING + +YES + +Query ticker of a single symbol + +`symbols` + +ARRAY of STRING + +Query ticker for multiple symbols + +`timeZone` + +STRING + +NO + +Default: 0 (UTC) + +`type` + +ENUM + +NO + +Supported values: FULL or MINI. +If none provided, the default is FULL + +symbolStatus + +ENUM + +NO + +Filters for symbols that have this `tradingStatus`. +For a single symbol, a status mismatch returns error `-1220 SYMBOL_DOES_NOT_MATCH_STATUS`. +For multiple symbols, non-matching ones are simply excluded from the response. +Valid values: `TRADING`, `HALT`, `BREAK` + +**Notes:** + +- Supported values for `timeZone`: + - Hours and minutes (e.g. `-1:00`, `05:45`) + - Only hours (e.g. `0`, `8`, `4`) + +**Data Source:** Database + +**Response: - FULL** + +With `symbol`: + +``` +{ "id": "f4b3b507-c8f2-442a-81a6-b2f12daa030f", "status": 200, "result": { "symbol": "BTCUSDT", "priceChange": "-83.13000000", // Absolute price change "priceChangePercent": "-0.317", // Relative price change in percent "weightedAvgPrice": "26234.58803036", // quoteVolume / volume "openPrice": "26304.80000000", "highPrice": "26397.46000000", "lowPrice": "26088.34000000", "lastPrice": "26221.67000000", "volume": "18495.35066000", // Volume in base asset "quoteVolume": "485217905.04210480", "openTime": 1695686400000, "closeTime": 1695772799999, "firstId": 3220151555, "lastId": 3220849281, "count": 697727 }, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 4 } ]} +``` + +With `symbols`: + +``` +{ "id": "f4b3b507-c8f2-442a-81a6-b2f12daa030f", "status": 200, "result": [ { "symbol": "BTCUSDT", "priceChange": "-83.13000000", "priceChangePercent": "-0.317", "weightedAvgPrice": "26234.58803036", "openPrice": "26304.80000000", "highPrice": "26397.46000000", "lowPrice": "26088.34000000", "lastPrice": "26221.67000000", "volume": "18495.35066000", "quoteVolume": "485217905.04210480", "openTime": 1695686400000, "closeTime": 1695772799999, "firstId": 3220151555, "lastId": 3220849281, "count": 697727 }, { "symbol": "BNBUSDT", "priceChange": "2.60000000", "priceChangePercent": "1.238", "weightedAvgPrice": "211.92276958", "openPrice": "210.00000000", "highPrice": "213.70000000", "lowPrice": "209.70000000", "lastPrice": "212.60000000", "volume": "280709.58900000", "quoteVolume": "59488753.54750000", "openTime": 1695686400000, "closeTime": 1695772799999, "firstId": 672397461, "lastId": 672496158, "count": 98698 } ], "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 8 } ]} +``` + +**Response: - MINI** + +With `symbol`: + +``` +{ "id": "f4b3b507-c8f2-442a-81a6-b2f12daa030f", "status": 200, "result": { "symbol": "BTCUSDT", "openPrice": "26304.80000000", "highPrice": "26397.46000000", "lowPrice": "26088.34000000", "lastPrice": "26221.67000000", "volume": "18495.35066000", // Volume in base asset "quoteVolume": "485217905.04210480", // Volume in quote asset "openTime": 1695686400000, "closeTime": 1695772799999, "firstId": 3220151555, // Trade ID of the first trade in the interval "lastId": 3220849281, // Trade ID of the last trade in the interval "count": 697727 // Number of trades in the interval }, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 4 } ]} +``` + +With `symbols`: + +``` +{ "id": "f4b3b507-c8f2-442a-81a6-b2f12daa030f", "status": 200, "result": [ { "symbol": "BTCUSDT", "openPrice": "26304.80000000", "highPrice": "26397.46000000", "lowPrice": "26088.34000000", "lastPrice": "26221.67000000", "volume": "18495.35066000", "quoteVolume": "485217905.04210480", "openTime": 1695686400000, "closeTime": 1695772799999, "firstId": 3220151555, "lastId": 3220849281, "count": 697727 }, { "symbol": "BNBUSDT", "openPrice": "210.00000000", "highPrice": "213.70000000", "lowPrice": "209.70000000", "lastPrice": "212.60000000", "volume": "280709.58900000", "quoteVolume": "59488753.54750000", "openTime": 1695686400000, "closeTime": 1695772799999, "firstId": 672397461, "lastId": 672496158, "count": 98698 } ], "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 8 } ]} +``` + +### Rolling window price change statistics[​](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests) + +``` +{ "id": "f4b3b507-c8f2-442a-81a6-b2f12daa030f", "method": "ticker", "params": { "symbols": ["BNBBTC", "BTCUSDT"], "windowSize": "7d" }} +``` + +Get rolling window price change statistics with a custom window. + +This request is similar to [`ticker.24hr`](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests), but statistics are computed on demand using the arbitrary window you specify. + +**Note:** Window size precision is limited to 1 minute. While the `closeTime` is the current time of the request, `openTime` always start on a minute boundary. As such, the effective window might be up to 59999 ms wider than the requested `windowSize`. + +Window computation example + +For example, a request for `"windowSize": "7d"` might result in the following window: + +``` +{ "openTime": 1659580020000, "closeTime": 1660184865291} +``` + +Time of the request – `closeTime` – is 1660184865291 (August 11, 2022 02:27:45.291). Requested window size should put the `openTime` 7 days before that – August 4, 02:27:45.291 – but due to limited precision it ends up a bit earlier: 1659580020000 (August 4, 2022 02:27:00), exactly at the start of a minute. + +If you need to continuously monitor trading statistics, please consider using WebSocket Streams: + +- [`@ticker_`](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) or [`!ticker_@arr`](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) + +**Weight:** Adjusted based on the number of requested symbols: + +Symbols + +Weight + +1–50 + +4 per symbol + +51–100 + +200 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +`symbol` + +STRING + +YES + +Query ticker of a single symbol + +`symbols` + +ARRAY of STRING + +Query ticker for multiple symbols + +`type` + +ENUM + +NO + +Ticker type: `FULL` (default) or `MINI` + +`windowSize` + +ENUM + +NO + +Default `1d` + +symbolStatus + +ENUM + +NO + +Filters for symbols that have this `tradingStatus`. +For a single symbol, a status mismatch returns error `-1220 SYMBOL_DOES_NOT_MATCH_STATUS`. +For multiple symbols, non-matching ones are simply excluded from the response. +Valid values: `TRADING`, `HALT`, `BREAK` + +Supported window sizes: + +Unit + +`windowSize` value + +minutes + +`1m`, `2m` ... `59m` + +hours + +`1h`, `2h` ... `23h` + +days + +`1d`, `2d` ... `7d` + +Notes: + +- Either `symbol` or `symbols` must be specified. + +- Maximum number of symbols in one request: 200. + +- Window size units cannot be combined. E.g., `1d 2h` is not supported. + + +**Data Source:** Database + +**Response:** + +`FULL` type, for a single symbol: + +``` +{ "id": "f4b3b507-c8f2-442a-81a6-b2f12daa030f", "status": 200, "result": { "symbol": "BNBBTC", "priceChange": "0.00061500", "priceChangePercent": "4.735", "weightedAvgPrice": "0.01368242", "openPrice": "0.01298900", "highPrice": "0.01418800", "lowPrice": "0.01296000", "lastPrice": "0.01360400", "volume": "587179.23900000", "quoteVolume": "8034.03382165", "openTime": 1659580020000, "closeTime": 1660184865291, "firstId": 192977765, // First trade ID "lastId": 195365758, // Last trade ID "count": 2387994 // Number of trades }, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 4 } ]} +``` + +`MINI` type, for a single symbol: + +``` +{ "id": "bdb7c503-542c-495c-b797-4d2ee2e91173", "status": 200, "result": { "symbol": "BNBBTC", "openPrice": "0.01298900", "highPrice": "0.01418800", "lowPrice": "0.01296000", "lastPrice": "0.01360400", "volume": "587179.23900000", "quoteVolume": "8034.03382165", "openTime": 1659580020000, "closeTime": 1660184865291, "firstId": 192977765, // First trade ID "lastId": 195365758, // Last trade ID "count": 2387994 // Number of trades }, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 4 } ]} +``` + +If more than one symbol is requested, response returns an array: + +``` +{ "id": "f4b3b507-c8f2-442a-81a6-b2f12daa030f", "status": 200, "result": [ { "symbol": "BNBBTC", "priceChange": "0.00061500", "priceChangePercent": "4.735", "weightedAvgPrice": "0.01368242", "openPrice": "0.01298900", "highPrice": "0.01418800", "lowPrice": "0.01296000", "lastPrice": "0.01360400", "volume": "587169.48600000", "quoteVolume": "8033.90114517", "openTime": 1659580020000, "closeTime": 1660184820927, "firstId": 192977765, "lastId": 195365700, "count": 2387936 }, { "symbol": "BTCUSDT", "priceChange": "1182.92000000", "priceChangePercent": "5.113", "weightedAvgPrice": "23349.27074846", "openPrice": "23135.33000000", "highPrice": "24491.22000000", "lowPrice": "22400.00000000", "lastPrice": "24318.25000000", "volume": "1039498.10978000", "quoteVolume": "24271522807.76838630", "openTime": 1659580020000, "closeTime": 1660184820927, "firstId": 1568787779, "lastId": 1604337406, "count": 35549628 } ], "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 8 } ]} +``` + +### Symbol price ticker[​](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests) + +``` +{ "id": "043a7cf2-bde3-4888-9604-c8ac41fcba4d", "method": "ticker.price", "params": { "symbol": "BNBBTC" }} +``` + +Get the latest market price for a symbol. + +If you need access to real-time price updates, please consider using WebSocket Streams: + +- [`@aggTrade`](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) +- [`@trade`](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) + +**Weight:** Adjusted based on the number of requested symbols: + +Parameter + +Weight + +`symbol` + +2 + +`symbols` + +4 + +none + +4 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +`symbol` + +STRING + +NO + +Query price for a single symbol + +`symbols` + +ARRAY of STRING + +Query price for multiple symbols + +symbolStatus + +ENUM + +NO + +Filters for symbols that have this `tradingStatus`. +For a single symbol, a status mismatch returns error `-1220 SYMBOL_DOES_NOT_MATCH_STATUS`. +For multiple or all symbols, non-matching ones are simply excluded from the response. +Valid values: `TRADING`, `HALT`, `BREAK` + +Notes: + +- `symbol` and `symbols` cannot be used together. + +- If no symbol is specified, returns information about all symbols currently trading on the exchange. + + +**Data Source:** Memory + +**Response:** + +``` +{ "id": "043a7cf2-bde3-4888-9604-c8ac41fcba4d", "status": 200, "result": { "symbol": "BNBBTC", "price": "0.01361900" }, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 2 } ]} +``` + +If more than one symbol is requested, response returns an array: + +``` +{ "id": "e739e673-24c8-4adf-9cfa-b81f30330b09", "status": 200, "result": [ { "symbol": "BNBBTC", "price": "0.01363700" }, { "symbol": "BTCUSDT", "price": "24267.15000000" }, { "symbol": "BNBBUSD", "price": "331.10000000" } ], "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 4 } ]} +``` + +### Symbol order book ticker[​](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests) + +``` +{ "id": "057deb3a-2990-41d1-b58b-98ea0f09e1b4", "method": "ticker.book", "params": { "symbols": ["BNBBTC", "BTCUSDT"] }} +``` + +Get the current best price and quantity on the order book. + +If you need access to real-time order book ticker updates, please consider using WebSocket Streams: + +- [`@bookTicker`](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) + +**Weight:** Adjusted based on the number of requested symbols: + +Parameter + +Weight + +`symbol` + +2 + +`symbols` + +4 + +none + +4 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +`symbol` + +STRING + +NO + +Query ticker for a single symbol + +`symbols` + +ARRAY of STRING + +Query ticker for multiple symbols + +symbolStatus + +ENUM + +NO + +Filters for symbols that have this `tradingStatus`. +For a single symbol, a status mismatch returns error `-1220 SYMBOL_DOES_NOT_MATCH_STATUS`. +For multiple or all symbols, non-matching ones are simply excluded from the response. +Valid values: `TRADING`, `HALT`, `BREAK` + +Notes: + +- `symbol` and `symbols` cannot be used together. + +- If no symbol is specified, returns information about all symbols currently trading on the exchange. + + +**Data Source:** Memory + +**Response:** + +``` +{ "id": "9d32157c-a556-4d27-9866-66760a174b57", "status": 200, "result": { "symbol": "BNBBTC", "bidPrice": "0.01358000", "bidQty": "12.53400000", "askPrice": "0.01358100", "askQty": "17.83700000" }, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 2 } ]} +``` + +If more than one symbol is requested, response returns an array: + +``` +{ "id": "057deb3a-2990-41d1-b58b-98ea0f09e1b4", "status": 200, "result": [ { "symbol": "BNBBTC", "bidPrice": "0.01358000", "bidQty": "12.53400000", "askPrice": "0.01358100", "askQty": "17.83700000" }, { "symbol": "BTCUSDT", "bidPrice": "23980.49000000", "bidQty": "0.01000000", "askPrice": "23981.31000000", "askQty": "0.01512000" } ], "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 4 } ]} +``` + +- [Order book](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests) +- [Recent trades](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests) +- [Historical trades](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests) +- [Aggregate trades](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests) +- [Klines](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests) +- [UI Klines](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests) +- [Current average price](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests) +- [24hr ticker price change statistics](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests) +- [Trading Day Ticker](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests) +- [Rolling window price change statistics](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests) +- [Symbol price ticker](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests) +- [Symbol order book ticker](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests) diff --git a/docs/binance/binance-spot/websocket-api_rate-limits.md b/docs/binance/binance-spot/websocket-api_rate-limits.md new file mode 100644 index 0000000..ebf90b2 --- /dev/null +++ b/docs/binance/binance-spot/websocket-api_rate-limits.md @@ -0,0 +1,178 @@ +--- +title: "Rate limits | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/rate-limits" +fetched_at: "2026-02-26T10:38:13.003Z" +--- +### Connection limits[​](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/rate-limits) + +There is a limit of **300 connections per attempt every 5 minutes**. + +The connection is per **IP address**. + +### General information on rate limits[​](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/rate-limits) + +- Current API rate limits can be queried using the [`exchangeInfo`](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/rate-limits) request. +- There are multiple rate limit types across multiple intervals. +- Responses can indicate current rate limit status in the optional `rateLimits` field. +- Requests fail with status `429` when unfilled order count or request rate limits are violated. + +#### How to interpret rate limits[​](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/rate-limits) + +A response with rate limit status may look like this: + +``` +{ "id": "7069b743-f477-4ae3-81db-db9b8df085d2", "status": 200, "result": { "serverTime": 1656400526260 }, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 70 } ]} +``` + +The `rateLimits` array describes all currently active rate limits affected by the request. + +Name + +Type + +Mandatory + +Description + +`rateLimitType` + +ENUM + +YES + +Rate limit type: `REQUEST_WEIGHT`, `ORDERS` + +`interval` + +ENUM + +YES + +Rate limit interval: `SECOND`, `MINUTE`, `HOUR`, `DAY` + +`intervalNum` + +INT + +YES + +Rate limit interval multiplier + +`limit` + +INT + +YES + +Request limit per interval + +`count` + +INT + +YES + +Current usage per interval + +Rate limits are accounted by intervals. + +For example, a `1 MINUTE` interval starts every minute. Request submitted at 00:01:23.456 counts towards the 00:01:00 minute's limit. Once the 00:02:00 minute starts, the count will reset to zero again. + +Other intervals behave in a similar manner. For example, `1 DAY` rate limit resets at 00:00 UTC every day, and `10 SECOND` interval resets at 00, 10, 20... seconds of each minute. + +APIs have multiple rate-limiting intervals. If you exhaust a shorter interval but the longer interval still allows requests, you will have to wait for the shorter interval to expire and reset. If you exhaust a longer interval, you will have to wait for that interval to reset, even if shorter rate limit count is zero. + +#### How to show/hide rate limit information[​](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/rate-limits) + +`rateLimits` field is included with every response by default. + +However, rate limit information can be quite bulky. If you are not interested in detailed rate limit status of every request, the `rateLimits` field can be omitted from responses to reduce their size. + +- Optional `returnRateLimits` boolean parameter in request. + + Use `returnRateLimits` parameter to control whether to include `rateLimits` fields in response to individual requests. + + Default request and response: + + ``` + { "id": 1, "method": "time" } + ``` + + ``` + { "id": 1, "status": 200, "result": { "serverTime": 1656400526260 }, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 70 } ]} + ``` + + Request and response without rate limit status: + + ``` + { "id": 2, "method": "time", "params": { "returnRateLimits": false } } + ``` + + ``` + { "id": 2, "status": 200, "result": { "serverTime": 1656400527891 } } + ``` + +- Optional `returnRateLimits` boolean parameter in connection URL. + + If you wish to omit `rateLimits` from all responses by default, use `returnRateLimits` parameter in the query string instead: + + ``` + wss://ws-api.binance.com:443/ws-api/v3?returnRateLimits=false + ``` + + This will make all requests made through this connection behave as if you have passed `"returnRateLimits": false`. + + If you _want_ to see rate limits for a particular request, you need to explicitly pass the `"returnRateLimits": true` parameter. + + +**Note:** Your requests are still rate limited if you hide the `rateLimits` field in responses. + +### IP limits[​](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/rate-limits) + +- Every request has a certain **weight**, added to your limit as you perform requests. + - The heavier the request (e.g. querying data from multiple symbols), the more weight the request will cost. + - Connecting to WebSocket API costs 2 weight. +- Current weight usage is indicated by the `REQUEST_WEIGHT` rate limit type. +- Use the [`exchangeInfo`](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/rate-limits) request to keep track of the current weight limits. +- Weight is accumulated **per IP address** and is shared by all connections from that address. +- If you go over the weight limit, requests fail with status `429`. + - This status code indicates you should back off and stop spamming the API. + - Rate-limited responses include a `retryAfter` field, indicating when you can retry the request. +- **Repeatedly violating rate limits and/or failing to back off after receiving 429s will result in an automated IP ban and you will be disconnected.** + - Requests from a banned IP address fail with status `418`. + - `retryAfter` field indicates the timestamp when the ban will be lifted. +- IP bans are tracked and **scale in duration** for repeat offenders, **from 2 minutes to 3 days**. + +Successful response indicating that in 1 minute you have used 70 weight out of your 6000 limit: + +``` +{ "id": "7069b743-f477-4ae3-81db-db9b8df085d2", "status": 200, "result": [], "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 70 } ]} +``` + +Failed response indicating that you are banned and the ban will last until epoch `1659146400000`: + +``` +{ "id": "fc93a61a-a192-4cf4-bb2a-a8f0f0c51e06", "status": 418, "error": { "code": -1003, "msg": "Way too much request weight used; IP banned until 1659146400000. Please use WebSocket Streams for live updates to avoid bans.", "data": { "serverTime": 1659142907531, "retryAfter": 1659146400000 } }, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 2411 } ]} +``` + +### Unfilled Order Count[​](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/rate-limits) + +- Successfully placed orders update the `ORDERS` rate limit type. +- Rejected or unsuccessful orders might or might not update the `ORDERS` rate limit type. +- **Please note that if your orders are consistently filled by trades, you can continuously place orders on the API**. For more information, please see [Spot Unfilled Order Count Rules](https://developers.binance.com/docs/binance-spot-api-docs/faqs/order_count_decrement). +- Use the [`account.rateLimits.orders`](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests) request to keep track of how many orders you have placed within this interval. +- If you exceed this, requests fail with status `429`. + - This status code indicates you should back off and stop spamming the API. + - Responses that have a status `429` include a `retryAfter` field, indicating when you can retry the request. +- This is maintained **per account** and is shared by all API keys of the account. + +Successful response indicating that you have placed 12 orders in 10 seconds, and 4043 orders in the past 24 hours: + +``` +{ "id": "e2a85d9f-07a5-4f94-8d5f-789dc3deb097", "status": 200, "result": { "symbol": "BTCUSDT", "orderId": 12510053279, "orderListId": -1, "clientOrderId": "a097fe6304b20a7e4fc436", "transactTime": 1655716096505, "price": "0.10000000", "origQty": "10.00000000", "executedQty": "0.00000000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "0.00000000", "status": "NEW", "timeInForce": "GTC", "type": "LIMIT", "side": "BUY", "workingTime": 1655716096505, "selfTradePreventionMode": "NONE" }, "rateLimits": [ { "rateLimitType": "ORDERS", "interval": "SECOND", "intervalNum": 10, "limit": 50, "count": 12 }, { "rateLimitType": "ORDERS", "interval": "DAY", "intervalNum": 1, "limit": 160000, "count": 4043 }, { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 321 } ]} +``` + +- [Connection limits](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/rate-limits) +- [General information on rate limits](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/rate-limits) +- [IP limits](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/rate-limits) +- [Unfilled Order Count](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/rate-limits) diff --git a/docs/binance/binance-spot/websocket-api_request-format.md b/docs/binance/binance-spot/websocket-api_request-format.md new file mode 100644 index 0000000..a2a991c --- /dev/null +++ b/docs/binance/binance-spot/websocket-api_request-format.md @@ -0,0 +1,54 @@ +--- +title: "Request format | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/request-format" +fetched_at: "2026-02-26T10:38:13.107Z" +--- +Requests must be sent as JSON in **text frames**, one request per frame. + +Example of request: + +``` +{ "id": "e2a85d9f-07a5-4f94-8d5f-789dc3deb097", "method": "order.place", "params": { "symbol": "BTCUSDT", "side": "BUY", "type": "LIMIT", "price": "0.1", "quantity": "10", "timeInForce": "GTC", "timestamp": 1655716096498, "apiKey": "T59MTDLWlpRW16JVeZ2Nju5A5C98WkMm8CSzWC4oqynUlTm1zXOxyauT8LmwXEv9", "signature": "5942ad337e6779f2f4c62cd1c26dba71c91514400a24990a3e7f5edec9323f90" }} +``` + +Request fields: + +Name + +Type + +Mandatory + +Description + +`id` + +INT / STRING / `null` + +YES + +Arbitrary ID used to match responses to requests + +`method` + +STRING + +YES + +Request method name + +`params` + +OBJECT + +NO + +Request parameters. May be omitted if there are no parameters + +- Request `id` is truly arbitrary. You can use UUIDs, sequential IDs, current timestamp, etc. The server does not interpret `id` in any way, simply echoing it back in the response. + + You can freely reuse IDs within a session. However, be careful to not send more than one request at a time with the same ID, since otherwise it might be impossible to tell the responses apart. + +- Request method names may be prefixed with explicit version: e.g., `"v3/order.place"`. + +- The order of `params` is not significant. diff --git a/docs/binance/binance-spot/websocket-api_request-security.md b/docs/binance/binance-spot/websocket-api_request-security.md new file mode 100644 index 0000000..43ef0a7 --- /dev/null +++ b/docs/binance/binance-spot/websocket-api_request-security.md @@ -0,0 +1,589 @@ +--- +title: "Request security | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/request-security" +fetched_at: "2026-02-26T10:38:13.191Z" +--- +- Each method has a security type indicating required API key permissions, shown next to the method name (e.g., [Place new order (TRADE)](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/request-security)). +- If unspecified, the security type is `NONE`. +- Except for `NONE`, all methods with a security type are considered `SIGNED` requests (i.e. including a `signature`), except for [listenKey management](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/request-security). +- Secure methods require a valid API key to be specified and authenticated. + - API keys can be created on the [API Management](https://www.binance.com/en/support/faq/360002502072) page of your Binance account. + - **Both API key and secret key are sensitive.** Never share them with anyone. If you notice unusual activity in your account, immediately revoke all the keys and contact Binance support. +- API keys can be configured to allow access only to certain types of secure methods. + - For example, you can have an API key with `TRADE` permission for trading, while using a separate API key with `USER_DATA` permission to monitor your order status. + - By default, an API key cannot `TRADE`. You need to enable trading in API Management first. + +Security type + +Description + +`NONE` + +Public market data + +`TRADE` + +Trading on the exchange, placing and canceling orders + +`USER_DATA` + +Private account information, such as order status and your trading history + +`USER_STREAM` + +Managing User Data Stream subscriptions + +### SIGNED request security[​](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/request-security) + +- `SIGNED` requests require an additional parameter: `signature`, authorizing the request. + +#### Signature Case Sensitivity[​](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/request-security) + +- **HMAC:** Signatures generated using HMAC are **not case-sensitive**. This means the signature string can be verified regardless of letter casing. +- **RSA:** Signatures generated using RSA are **case-sensitive**. +- **Ed25519:** Signatures generated using ED25519 are also **case-sensitive** + +Please consult [SIGNED request example (HMAC)](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/request-security), [SIGNED request example (RSA)](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/request-security), and [SIGNED request example (Ed25519)](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/request-security) on how to compute signature, depending on which API key type you are using. + +### Timing security[​](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/request-security) + +- `SIGNED` requests also require a `timestamp` parameter which should be the current timestamp either in milliseconds or microseconds. (See [General API Information](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/request-security)) +- An additional optional parameter, `recvWindow`, specifies for how long the request stays valid and may only be specified in milliseconds. + - `recvWindow` supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + - If `recvWindow` is not sent, **it defaults to 5000 milliseconds**. + - Maximum `recvWindow` is 60000 milliseconds. +- Request processing logic is as follows: + +``` +serverTime = getCurrentTime()if (timestamp < (serverTime + 1 second) && (serverTime - timestamp) <= recvWindow) { // begin processing request serverTime = getCurrentTime() if (serverTime - timestamp) <= recvWindow { // forward request to Matching Engine } else { // reject request } // finish processing request} else { // reject request} +``` + +**Serious trading is about timing.** Networks can be unstable and unreliable, which can lead to requests taking varying amounts of time to reach the servers. With `recvWindow`, you can specify that the request must be processed within a certain number of milliseconds or be rejected by the server. + +**It is recommended to use a small `recvWindow` of 5000 or less!** + +### SIGNED request example (HMAC)[​](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/request-security) + +Here is a step-by-step guide on how to sign requests using an HMAC secret key. + +Example API key and secret key: + +Key + +Value + +`apiKey` + +`vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A` + +`secretKey` + +`NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j` + +**WARNING: DO NOT SHARE YOUR API KEY AND SECRET KEY WITH ANYONE.** + +The example keys are provided here only for illustrative purposes. + +Example of request with a symbol name comprised entirely of ASCII characters: + +``` +{ "id": "4885f793-e5ad-4c3b-8f6c-55d891472b71", "method": "order.place", "params": { "symbol": "BTCUSDT", "side": "SELL", "type": "LIMIT", "timeInForce": "GTC", "quantity": "0.01000000", "price": "52000.00", "recvWindow": 100, "timestamp": 1645423376532, "apiKey": "vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A", "signature": "------ FILL ME ------" }} +``` + +Example of a request with a symbol name containing non-ASCII characters: + +``` +{ "id": "4885f793-e5ad-4c3b-8f6c-55d891472b71", "method": "order.place", "params": { "symbol": "123456", "side": "BUY", "type": "LIMIT", "timeInForce": "GTC", "quantity": "0.01000000", "price": "0.10000000", "recvWindow": 5000, "timestamp": 1645423376532, "apiKey": "vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A", "signature": "------ FILL ME ------" }} +``` + +As you can see, the `signature` parameter is currently missing. + +**Step 1: Construct the signature payload** + +Take all request `params` except `signature` and **sort them in alphabetical order by parameter name**: + +For the first set of example parameters (ASCII only): + +Parameter + +Value + +`apiKey` + +vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A + +`price` + +52000.00 + +`quantity` + +0.01000000 + +`recvWindow` + +100 + +`side` + +SELL + +`symbol` + +BTCUSDT + +`timeInForce` + +GTC + +`timestamp` + +1645423376532 + +`type` + +LIMIT + +For the second set of example parameters (some non-ASCII characters): + +Parameter + +Value + +`apiKey` + +vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A + +`price` + +0.10000000 + +`quantity` + +1.00000000 + +`recvWindow` + +5000 + +`side` + +BUY + +`symbol` + +123456 + +`timeInForce` + +GTC + +`timestamp` + +1645423376532 + +`type` + +LIMIT + +Format parameters as `parameter=value` pairs separated by `&`. Values need to be encoded in UTF-8. + +For the first set of example parameters (ASCII only), the signature payload should look like this: + +``` +apiKey=vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A&price=52000.00&quantity=0.01000000&recvWindow=100&side=SELL&symbol=BTCUSDT&timeInForce=GTC×tamp=1645423376532&type=LIMIT +``` + +For the second set of example parameters (some non-ASCII characters), the signature payload should look like this: + +``` +apiKey=vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A&price=0.10000000&quantity=1.00000000&recvWindow=5000&side=BUY&symbol=123456&timeInForce=GTC×tamp=1645423376532&type=LIMIT +``` + +**Step 2: Compute the signature** + +1. Use the `secretKey` of your API key as the signing key for the HMAC-SHA-256 algorithm. +2. Sign the UTF-8 bytes of the signature payload constructed in Step 1. +3. Encode the HMAC-SHA-256 output as a hex string. + +Note that `apiKey`, `secretKey`, and the payload are **case-sensitive**, while the resulting signature value is case-insensitive. + +You can cross-check your signature algorithm implementation with OpenSSL: + +For the first set of example parameters (ASCII only): + +``` +$ echo -n 'apiKey=vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A&price=52000.00&quantity=0.01000000&recvWindow=100&side=SELL&symbol=BTCUSDT&timeInForce=GTC×tamp=1645423376532&type=LIMIT' \ | openssl dgst -hex -sha256 -hmac 'NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j'aa1b5712c094bc4e57c05a1a5c1fd8d88dcd628338ea863fec7b88e59fe2db24 +``` + +For the second set of example parameters (some non-ASCII characters): + +``` +$ echo -n 'apiKey=vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A&price=0.10000000&quantity=1.00000000&recvWindow=5000&side=BUY&symbol=123456&timeInForce=GTC×tamp=1645423376532&type=LIMIT' \ | openssl dgst -hex -sha256 -hmac 'NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j'b33892ae8e687c939f4468c6268ddd4c40ac1af18ad19a064864c47bae0752cd +``` + +**Step 3: Add `signature` to request `params`** + +Complete the request by adding the `signature` parameter with the signature string. + +For the first set of example parameters (ASCII only): + +``` +{ "id": "4885f793-e5ad-4c3b-8f6c-55d891472b71", "method": "order.place", "params": { "symbol": "BTCUSDT", "side": "SELL", "type": "LIMIT", "timeInForce": "GTC", "quantity": "0.01000000", "price": "52000.00", "recvWindow": 100, "timestamp": 1645423376532, "apiKey": "vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A", "signature": "aa1b5712c094bc4e57c05a1a5c1fd8d88dcd628338ea863fec7b88e59fe2db24" }} +``` + +For the second set of example parameters (some non-ASCII characters): + +``` +{ "id": "4885f793-e5ad-4c3b-8f6c-55d891472b71", "method": "order.place", "params": { "symbol": "123456", "side": "BUY", "type": "LIMIT", "timeInForce": "GTC", "quantity": "1.00000000", "price": "0.10000000", "recvWindow": 5000, "timestamp": 1645423376532, "apiKey": "vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A", "signature": "b33892ae8e687c939f4468c6268ddd4c40ac1af18ad19a064864c47bae0752cd" }} +``` + +### SIGNED request example (RSA)[​](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/request-security) + +Here is a step-by-step guide on how to sign requests using an RSA private key. + +Key + +Value + +`apiKey` + +`CAvIjXy3F44yW6Pou5k8Dy1swsYDWJZLeoK2r8G4cFDnE9nosRppc2eKc1T8TRTQ` + +These examples assume the private key is stored in the file `test-rsa-prv.pem`. + +**WARNING: DO NOT SHARE YOUR API KEY AND PRIVATE KEY WITH ANYONE.** + +The example keys are provided here only for illustrative purposes. + +Example of request with a symbol name comprised entirely of ASCII characters: + +``` +{ "id": "4885f793-e5ad-4c3b-8f6c-55d891472b71", "method": "order.place", "params": { "symbol": "BTCUSDT", "side": "SELL", "type": "LIMIT", "timeInForce": "GTC", "quantity": "0.01000000", "price": "52000.00", "recvWindow": 100, "timestamp": 1645423376532, "apiKey": "CAvIjXy3F44yW6Pou5k8Dy1swsYDWJZLeoK2r8G4cFDnE9nosRppc2eKc1T8TRTQ", "signature": "------ FILL ME ------" }} +``` + +Example of a request with a symbol name containing non-ASCII characters: + +``` +{ "id": "4885f793-e5ad-4c3b-8f6c-55d891472b71", "method": "order.place", "params": { "symbol": "123456", "side": "BUY", "type": "LIMIT", "timeInForce": "GTC", "quantity": "0.01000000", "price": "0.10000000", "recvWindow": 5000, "timestamp": 1645423376532, "apiKey": "CAvIjXy3F44yW6Pou5k8Dy1swsYDWJZLeoK2r8G4cFDnE9nosRppc2eKc1T8TRTQ", "signature": "------ FILL ME ------" }} +``` + +**Step 1: Construct the signature payload** + +Take all request `params` except `signature` and **sort them in alphabetical order by parameter name**: + +For the first set of example parameters (ASCII only): + +Parameter + +Value + +`apiKey` + +CAvIjXy3F44yW6Pou5k8Dy1swsYDWJZLeoK2r8G4cFDnE9nosRppc2eKc1T8TRTQ + +`price` + +52000.00 + +`quantity` + +0.01000000 + +`recvWindow` + +100 + +`side` + +SELL + +`symbol` + +BTCUSDT + +`timeInForce` + +GTC + +`timestamp` + +1645423376532 + +`type` + +LIMIT + +For the second set of example parameters (some non-ASCII characters): + +Parameter + +Value + +`apiKey` + +CAvIjXy3F44yW6Pou5k8Dy1swsYDWJZLeoK2r8G4cFDnE9nosRppc2eKc1T8TRTQ + +`price` + +0.10000000 + +`quantity` + +1.00000000 + +`recvWindow` + +5000 + +`side` + +BUY + +`symbol` + +123456 + +`timeInForce` + +GTC + +`timestamp` + +1645423376532 + +`type` + +LIMIT + +Format parameters as `parameter=value` pairs separated by `&`. Values need to be encoded in UTF-8. + +For the first set of example parameters (ASCII only), the signature payload should look like this: + +``` +apiKey=CAvIjXy3F44yW6Pou5k8Dy1swsYDWJZLeoK2r8G4cFDnE9nosRppc2eKc1T8TRTQ&price=52000.00&quantity=0.01000000&recvWindow=100&side=SELL&symbol=BTCUSDT&timeInForce=GTC×tamp=1645423376532&type=LIMIT +``` + +For the second set of example parameters (some non-ASCII characters), the signature payload should look like this: + +``` +apiKey=CAvIjXy3F44yW6Pou5k8Dy1swsYDWJZLeoK2r8G4cFDnE9nosRppc2eKc1T8TRTQ&price=0.10000000&quantity=1.00000000&recvWindow=5000&side=BUY&symbol=123456&timeInForce=GTC×tamp=1645423376532&type=LIMIT +``` + +**Step 2: Compute the signature** + +1. Sign the UTF-8 bytes of the signature payload constructed in Step 1 using the RSASSA-PKCS1-v1\_5 algorithm with SHA-256 hash function. +2. Encode the output in base64. + +Note that `apiKey`, the payload, and the resulting `signature` are **case-sensitive**. + +You can cross-check your signature algorithm implementation with OpenSSL: + +For the first set of example parameters (ASCII only): + +``` +$ echo -n 'apiKey=CAvIjXy3F44yW6Pou5k8Dy1swsYDWJZLeoK2r8G4cFDnE9nosRppc2eKc1T8TRTQ&price=52000.00&quantity=0.01000000&recvWindow=100&side=SELL&symbol=BTCUSDT&timeInForce=GTC×tamp=1645423376532&type=LIMIT' \ | openssl dgst -sha256 -sign test-rsa-prv.pem \ | openssl enc -base64 -AOJJaf8C/3VGrU4ATTR4GiUDqL2FboSE1Qw7UnnoYNfXTXHubIl1iaePGuGyfct4NPu5oVEZCH4Q6ZStfB1w4ssgu0uiB/Bg+fBrRFfVgVaLKBdYHMvT+ljUJzqVaeoThG9oXlduiw8PbS9U8DYAbDvWN3jqZLo4Z2YJbyovyDAvDTr/oC0+vssLqP7NmlNb3fF3Bj7StmOwJvQJTbRAtzxK5PP7OQe+0mbW+D7RqVkUiSswR8qJFWTeSe4nXXNIdZdueYhF/Xf25L+KitJS5IHdIHcKfEw3MQzHFb2ZsGWkjDQwxkwr7Noi0Zaa+gFtxCuatGFm9dFIyx217pmSHtA== +``` + +For the second set of example parameters (some non-ASCII characters): + +``` +$ echo -n 'apiKey=CAvIjXy3F44yW6Pou5k8Dy1swsYDWJZLeoK2r8G4cFDnE9nosRppc2eKc1T8TRTQ&price=0.10000000&quantity=1.00000000&recvWindow=5000&side=BUY&symbol=123456&timeInForce=GTC×tamp=1645423376532&type=LIMIT' \ | openssl dgst -sha256 -sign test-rsa-prv.pem \ | openssl enc -base64 -AF3o/79Ttvl2cVYGPfBOF3oEOcm5QcYmTYWpdVIrKve5u+8paMNDAdUE+teqMxFM9HcquetGcfuFpLYtsQames5bDx/tskGM76TWW8HaM+6tuSYBSFLrKqChfA9hQGLYGjAiflf1YBnDhY+7vNbJFusUborNOloOj+ufzP5q42PvI3H0uNy3W5V3pyfXpDGCBtfCYYr9NAqA4d+AQfyllL/zkO9h9JSdozN49t0/hWGoD2dWgSO0Je6MytKEvD4DQXGeqNlBTB6tUXcWnRW+FcaKZ4KYqnxCtb1u8rFXUYgFykr2CbcJLSmw6ydEJ3EZ/NaZopRr+cU0W2m0HZ3qucw== +``` + +**Step 3: Add `signature` to request `params`** + +Complete the request by adding the `signature` parameter with the signature string. + +For the first set of example parameters (ASCII only): + +``` +{ "id": "4885f793-e5ad-4c3b-8f6c-55d891472b71", "method": "order.place", "params": { "symbol": "BTCUSDT", "side": "SELL", "type": "LIMIT", "timeInForce": "GTC", "quantity": "0.01000000", "price": "52000.00", "newOrderRespType": "ACK", "recvWindow": 100, "timestamp": 1645423376532, "apiKey": "CAvIjXy3F44yW6Pou5k8Dy1swsYDWJZLeoK2r8G4cFDnE9nosRppc2eKc1T8TRTQ", "signature": "OJJaf8C/3VGrU4ATTR4GiUDqL2FboSE1Qw7UnnoYNfXTXHubIl1iaePGuGyfct4NPu5oVEZCH4Q6ZStfB1w4ssgu0uiB/Bg+fBrRFfVgVaLKBdYHMvT+ljUJzqVaeoThG9oXlduiw8PbS9U8DYAbDvWN3jqZLo4Z2YJbyovyDAvDTr/oC0+vssLqP7NmlNb3fF3Bj7StmOwJvQJTbRAtzxK5PP7OQe+0mbW+D7RqVkUiSswR8qJFWTeSe4nXXNIdZdueYhF/Xf25L+KitJS5IHdIHcKfEw3MQzHFb2ZsGWkjDQwxkwr7Noi0Zaa+gFtxCuatGFm9dFIyx217pmSHtA==" }} +``` + +For the second set of example parameters (some non-ASCII characters): + +``` +{ "id": "4885f793-e5ad-4c3b-8f6c-55d891472b71", "method": "order.place", "params": { "symbol": "123456", "side": "SELL", "type": "LIMIT", "timeInForce": "GTC", "quantity": "1.00000000", "price": "0.10000000", "recvWindow": 5000, "timestamp": 1645423376532, "apiKey": "CAvIjXy3F44yW6Pou5k8Dy1swsYDWJZLeoK2r8G4cFDnE9nosRppc2eKc1T8TRTQ", "signature": "F3o/79Ttvl2cVYGPfBOF3oEOcm5QcYmTYWpdVIrKve5u+8paMNDAdUE+teqMxFM9HcquetGcfuFpLYtsQames5bDx/tskGM76TWW8HaM+6tuSYBSFLrKqChfA9hQGLYGjAiflf1YBnDhY+7vNbJFusUborNOloOj+ufzP5q42PvI3H0uNy3W5V3pyfXpDGCBtfCYYr9NAqA4d+AQfyllL/zkO9h9JSdozN49t0/hWGoD2dWgSO0Je6MytKEvD4DQXGeqNlBTB6tUXcWnRW+FcaKZ4KYqnxCtb1u8rFXUYgFykr2CbcJLSmw6ydEJ3EZ/NaZopRr+cU0W2m0HZ3qucw==" }} +``` + +### SIGNED Request Example (Ed25519)[​](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/request-security) + +**Note: It is highly recommended to use Ed25519 API keys as they will provide the best performance and security out of all supported key types.** + +Here is a step-by-step guide on how to sign requests using an Ed25519 private key. + +Key + +Value + +`apiKey` + +`4yNzx3yWC5bS6YTwEkSRaC0nRmSQIIStAUOh1b6kqaBrTLIhjCpI5lJH8q8R8WNO` + +These examples assume the private key is stored in the file `test-ed25519-prv.pem`. + +**WARNING: DO NOT SHARE YOUR API KEY AND PRIVATE KEY WITH ANYONE.** + +The example keys are provided here only for illustrative purposes. + +Example of request with a symbol name comprised entirely of ASCII characters: + +``` +{ "id": "4885f793-e5ad-4c3b-8f6c-55d891472b71", "method": "order.place", "params": { "symbol": "BTCUSDT", "side": "SELL", "type": "LIMIT", "timeInForce": "GTC", "quantity": "0.01000000", "price": "52000.00", "recvWindow": 100, "timestamp": 1645423376532, "apiKey": "4yNzx3yWC5bS6YTwEkSRaC0nRmSQIIStAUOh1b6kqaBrTLIhjCpI5lJH8q8R8WNO", "signature": "------ FILL ME ------" }} +``` + +Example of a request with a symbol name containing non-ASCII characters: + +``` +{ "id": "4885f793-e5ad-4c3b-8f6c-55d891472b71", "method": "order.place", "params": { "symbol": "123456", "side": "BUY", "type": "LIMIT", "timeInForce": "GTC", "quantity": "0.01000000", "price": "0.10000000", "recvWindow": 5000, "timestamp": 1645423376532, "apiKey": "4yNzx3yWC5bS6YTwEkSRaC0nRmSQIIStAUOh1b6kqaBrTLIhjCpI5lJH8q8R8WNO", "signature": "------ FILL ME ------" }} +``` + +**Step 1: Construct the signature payload** + +Take all request `params` except `signature` and **sort them in alphabetical order by parameter name**: + +For the first set of example parameters (ASCII only): + +Parameter + +Value + +`apiKey` + +4yNzx3yWC5bS6YTwEkSRaC0nRmSQIIStAUOh1b6kqaBrTLIhjCpI5lJH8q8R8WNO + +`price` + +52000.00 + +`quantity` + +0.01000000 + +`recvWindow` + +100 + +`side` + +SELL + +`symbol` + +BTCUSDT + +`timeInForce` + +GTC + +`timestamp` + +1645423376532 + +`type` + +LIMIT + +For the second set of example parameters (some non-ASCII characters): + +Parameter + +Value + +`apiKey` + +4yNzx3yWC5bS6YTwEkSRaC0nRmSQIIStAUOh1b6kqaBrTLIhjCpI5lJH8q8R8WNO + +`price` + +0.20000000 + +`quantity` + +1.00000000 + +`recvWindow` + +5000 + +`side` + +SELL + +`symbol` + +123456 + +`timeInForce` + +GTC + +`timestamp` + +1668481559918 + +`type` + +LIMIT + +Format parameters as `parameter=value` pairs separated by `&`. Values need to be encoded in UTF-8. + +For the first set of example parameters (ASCII only), the signature payload should look like this: + +``` +apiKey=4yNzx3yWC5bS6YTwEkSRaC0nRmSQIIStAUOh1b6kqaBrTLIhjCpI5lJH8q8R8WNO&price=52000.00&quantity=0.01000000&recvWindow=100&side=SELL&symbol=BTCUSDT&timeInForce=GTC×tamp=1645423376532&type=LIMIT +``` + +For the second set of example parameters (some non-ASCII characters), the signature payload should look like this: + +``` +apiKey=4yNzx3yWC5bS6YTwEkSRaC0nRmSQIIStAUOh1b6kqaBrTLIhjCpI5lJH8q8R8WNO&price=0.10000000&quantity=1.00000000&recvWindow=5000&side=BUY&symbol=123456&timeInForce=GTC×tamp=1645423376532&type=LIMIT +``` + +**Step 2: Compute the signature** + +1. Sign the UTF-8 bytes of your signature payload constructed in Step 1 using the Ed25519 private key. +2. Encode the output in base64. + +Note that `apiKey`, the payload, and the resulting `signature` are **case-sensitive**. + +You can cross-check your signature algorithm implementation with OpenSSL: + +For the first set of example parameters (ASCII only): + +``` +echo -n "apiKey=4yNzx3yWC5bS6YTwEkSRaC0nRmSQIIStAUOh1b6kqaBrTLIhjCpI5lJH8q8R8WNO&price=52000.00&quantity=0.01000000&recvWindow=100&side=SELL&symbol=BTCUSDT&timeInForce=GTC×tamp=1645423376532&type=LIMIT" \ | openssl dgst -sign ./test-ed25519-prv.pem \ | openssl enc -base64 -AEocljwPl29jDxWYaaRaOo4pJ9wEblFbklJvPugNscLLuKd5vHM2grWjn1z+rY0aJ7r/44enxHL6mOAJuJ1kqCg== +``` + +For the second set of example parameters (some non-ASCII characters): + +``` +echo -n "apiKey=4yNzx3yWC5bS6YTwEkSRaC0nRmSQIIStAUOh1b6kqaBrTLIhjCpI5lJH8q8R8WNO&price=0.10000000&quantity=1.00000000&recvWindow=5000&side=BUY&symbol=123456&timeInForce=GTC×tamp=1645423376532&type=LIMIT" \ | openssl dgst -sign ./test-ed25519-prv.pem \ | openssl enc -base64 -AdtNHJeyKry+cNjiGv+sv5kynO9S40tf8k7D5CfAEQAp0s2scunZj+ovJdz2OgW8XhkB9G3/HmASkA9uY9eyFCA== +``` + +**Step 3: Add the signature to request `params`** + +For the first set of example parameters (ASCII only): + +``` +{ "id": "4885f793-e5ad-4c3b-8f6c-55d891472b71", "method": "order.place", "params": { "symbol": "BTCUSDT", "side": "SELL", "type": "LIMIT", "timeInForce": "GTC", "quantity": "0.01000000", "price": "52000.00", "newOrderRespType": "ACK", "recvWindow": 100, "timestamp": 1645423376532, "apiKey": "4yNzx3yWC5bS6YTwEkSRaC0nRmSQIIStAUOh1b6kqaBrTLIhjCpI5lJH8q8R8WNO", "signature": "EocljwPl29jDxWYaaRaOo4pJ9wEblFbklJvPugNscLLuKd5vHM2grWjn1z+rY0aJ7r/44enxHL6mOAJuJ1kqCg==" }} +``` + +For the second set of example parameters (some non-ASCII characters): + +``` +{ "id": "4885f793-e5ad-4c3b-8f6c-55d891472b71", "method": "order.place", "params": { "symbol": "123456", "side": "SELL", "type": "LIMIT", "timeInForce": "GTC", "quantity": "1.00000000", "price": "0.10000000", "recvWindow": 5000, "timestamp": 1645423376532, "apiKey": "4yNzx3yWC5bS6YTwEkSRaC0nRmSQIIStAUOh1b6kqaBrTLIhjCpI5lJH8q8R8WNO", "signature": "dtNHJeyKry+cNjiGv+sv5kynO9S40tf8k7D5CfAEQAp0s2scunZj+ovJdz2OgW8XhkB9G3/HmASkA9uY9eyFCA==" }} +``` + +Here is a sample Python script performing all the steps above: + +``` +#!/usr/bin/env python3import base64import timeimport jsonfrom cryptography.hazmat.primitives.serialization import load_pem_private_keyfrom websocket import create_connection# Set up authenticationAPI_KEY='put your own API Key here'PRIVATE_KEY_PATH='test-prv-key.pem'# Load the private key.# In this example the key is expected to be stored without encryption,# but we recommend using a strong password for improved security.with open(PRIVATE_KEY_PATH, 'rb') as f: private_key = load_pem_private_key(data=f.read(), password=None)# Set up the request parametersparams = { 'apiKey': API_KEY, 'symbol': '123456', 'side': 'SELL', 'type': 'LIMIT', 'timeInForce': 'GTC', 'quantity': '1.0000000', 'price': '0.10000000', 'recvWindow': 5000}# Timestamp the requesttimestamp = int(time.time() * 1000) # UNIX timestamp in millisecondsparams['timestamp'] = timestamp# Sort parameters alphabetically by nameparams = dict(sorted(params.items()))# Compute the signature payloadpayload = '&'.join([f"{k}={v}" for k,v in params.items()]) # no percent encoding here!# Sign the requestsignature = base64.b64encode(private_key.sign(payload.encode('UTF-8')))params['signature'] = signature.decode('ASCII')# Send the requestrequest = { 'id': 'my_new_order', 'method': 'order.place', 'params': params}ws = create_connection("wss://ws-api.binance.com:443/ws-api/v3")ws.send(json.dumps(request))result = ws.recv()ws.close()print(result) +``` + +- [SIGNED request security](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/request-security) +- [Timing security](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/request-security) +- [SIGNED request example (HMAC)](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/request-security) +- [SIGNED request example (RSA)](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/request-security) +- [SIGNED Request Example (Ed25519)](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/request-security) diff --git a/docs/binance/binance-spot/websocket-api_response-format.md b/docs/binance/binance-spot/websocket-api_response-format.md new file mode 100644 index 0000000..32eff77 --- /dev/null +++ b/docs/binance/binance-spot/websocket-api_response-format.md @@ -0,0 +1,86 @@ +--- +title: "Response format | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/response-format" +fetched_at: "2026-02-26T10:38:13.259Z" +--- +Responses are returned as JSON in **text frames**, one response per frame. + +Example of successful response: + +``` +{ "id": "e2a85d9f-07a5-4f94-8d5f-789dc3deb097", "status": 200, "result": { "symbol": "BTCUSDT", "orderId": 12510053279, "orderListId": -1, "clientOrderId": "a097fe6304b20a7e4fc436", "transactTime": 1655716096505, "price": "0.10000000", "origQty": "10.00000000", "executedQty": "0.00000000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "0.00000000", "status": "NEW", "timeInForce": "GTC", "type": "LIMIT", "side": "BUY", "workingTime": 1655716096505, "selfTradePreventionMode": "NONE" }, "rateLimits": [ { "rateLimitType": "ORDERS", "interval": "SECOND", "intervalNum": 10, "limit": 50, "count": 12 }, { "rateLimitType": "ORDERS", "interval": "DAY", "intervalNum": 1, "limit": 160000, "count": 4043 }, { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 321 } ]} +``` + +Example of failed response: + +``` +{ "id": "e2a85d9f-07a5-4f94-8d5f-789dc3deb097", "status": 400, "error": { "code": -2010, "msg": "Account has insufficient balance for requested action." }, "rateLimits": [ { "rateLimitType": "ORDERS", "interval": "SECOND", "intervalNum": 10, "limit": 50, "count": 13 }, { "rateLimitType": "ORDERS", "interval": "DAY", "intervalNum": 1, "limit": 160000, "count": 4044 }, { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 322 } ]} +``` + +Response fields: + +Name + +Type + +Mandatory + +Description + +`id` + +INT / STRING / `null` + +YES + +Same as in the original request + +`status` + +INT + +YES + +Response status. See [Status codes](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/response-format) + +`result` + +OBJECT / ARRAY + +YES + +Response content. Present if request succeeded + +`error` + +OBJECT + +Error description. Present if request failed + +`rateLimits` + +ARRAY + +NO + +Rate limiting status. See [Rate limits](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/response-format) + +### Status codes[​](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/response-format) + +Status codes in the `status` field are the same as in HTTP. + +Here are some common status codes that you might encounter: + +- `200` indicates a successful response. +- `4XX` status codes indicate invalid requests; the issue is on your side. + - `400` – your request failed, see `error` for the reason. + - `403` – you have been blocked by the Web Application Firewall. This can indicate a rate limit violation or a security block. See [https://www.binance.com/en/support/faq/detail/360004492232](https://www.binance.com/en/support/faq/detail/360004492232) for more details. + - `409` – your request partially failed but also partially succeeded, see `error` for details. + - `418` – you have been auto-banned for repeated violation of rate limits. + - `429` – you have exceeded API request rate limit, please slow down. +- `5XX` status codes indicate internal errors; the issue is on Binance's side. + - **Important:** If a response contains 5xx status code, it **does not** necessarily mean that your request has failed. Execution status is _unknown_ and the request might have actually succeeded. Please use query methods to confirm the status. You might also want to establish a new WebSocket connection for that. + +See [Error codes for Binance](https://developers.binance.com/docs/binance-spot-api-docs/errors) for a list of error codes and messages. + +- [Status codes](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/response-format) diff --git a/docs/binance/binance-spot/websocket-api_session-authentication.md b/docs/binance/binance-spot/websocket-api_session-authentication.md new file mode 100644 index 0000000..d6fa860 --- /dev/null +++ b/docs/binance/binance-spot/websocket-api_session-authentication.md @@ -0,0 +1,37 @@ +--- +title: "Session Authentication | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/session-authentication" +fetched_at: "2026-02-26T10:38:13.356Z" +--- +**Note:** Only _Ed25519_ keys are supported for this feature. + +If you do not want to specify `apiKey` and `signature` in each individual request, you can authenticate your API key for the active WebSocket session. + +Once authenticated, you no longer have to specify `apiKey` and `signature` for those requests that need them. Requests will be performed on behalf of the account owning the authenticated API key. + +**Note:** You still have to specify the `timestamp` parameter for `SIGNED` requests. + +### Authenticate after connection[​](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/session-authentication) + +You can authenticate an already established connection using session authentication requests: + +- [`session.logon`](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/session-authentication) – authenticate, or change the API key associated with the connection +- [`session.status`](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/session-authentication) – check connection status and the current API key +- [`session.logout`](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/session-authentication) – forget the API key associated with the connection + +**Regarding API key revocation:** + +If during an active session the API key becomes invalid for _any reason_ (e.g. IP address is not whitelisted, API key was deleted, API key doesn't have correct permissions, etc), after the next request the session will be revoked with the following error message: + +``` +{ "id": null, "status": 401, "error": { "code": -2015, "msg": "Invalid API-key, IP, or permissions for action." }} +``` + +### Authorize _ad hoc_ requests[​](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/session-authentication) + +Only one API key can be authenticated with the WebSocket connection. The authenticated API key is used by default for requests that require an `apiKey` parameter. However, you can always specify the `apiKey` and `signature` explicitly for individual requests, overriding the authenticated API key and using a different one to authorize a specific request. + +For example, you might want to authenticate your `USER_DATA` key to be used by default, but specify the `TRADE` key with an explicit signature when placing orders. + +- [Authenticate after connection](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/session-authentication) +- [Authorize _ad hoc_ requests](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/session-authentication) diff --git a/docs/binance/binance-spot/websocket-api_trading-requests.md b/docs/binance/binance-spot/websocket-api_trading-requests.md new file mode 100644 index 0000000..3c12421 --- /dev/null +++ b/docs/binance/binance-spot/websocket-api_trading-requests.md @@ -0,0 +1,3564 @@ +--- +title: "Trading requests | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests" +fetched_at: "2026-02-26T10:38:13.538Z" +--- +### Place new order (TRADE)[​](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests) + +``` +{ "id": "56374a46-3061-486b-a311-99ee972eb648", "method": "order.place", "params": { "symbol": "BTCUSDT", "side": "SELL", "type": "LIMIT", "timeInForce": "GTC", "price": "23416.10000000", "quantity": "0.00847000", "apiKey": "vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A", "signature": "15af09e41c36f3cc61378c2fbe2c33719a03dd5eba8d0f9206fbda44de717c88", "timestamp": 1660801715431 }} +``` + +Send in a new order. + +This adds 1 order to the `EXCHANGE_MAX_ORDERS` filter and the `MAX_NUM_ORDERS` filter. + +**Weight:** 1 + +**Unfilled Order Count:** 1 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +`symbol` + +STRING + +YES + +`side` + +ENUM + +YES + +`BUY` or `SELL` + +`type` + +ENUM + +YES + +`timeInForce` + +ENUM + +NO \* + +`price` + +DECIMAL + +NO \* + +`quantity` + +DECIMAL + +NO \* + +`quoteOrderQty` + +DECIMAL + +NO \* + +`newClientOrderId` + +STRING + +NO + +Arbitrary unique ID among open orders. Automatically generated if not sent + +`newOrderRespType` + +ENUM + +NO + +Select response format: `ACK`, `RESULT`, `FULL`. + +`MARKET` and `LIMIT` orders use `FULL` by default, other order types default to `ACK`. + +`stopPrice` + +DECIMAL + +NO \* + +`trailingDelta` + +INT + +NO \* + +See [Trailing Stop order FAQ](https://developers.binance.com/docs/binance-spot-api-docs/faqs/trailing-stop-faq) + +`icebergQty` + +DECIMAL + +NO + +`strategyId` + +LONG + +NO + +Arbitrary numeric value identifying the order within an order strategy. + +`strategyType` + +INT + +NO + +Arbitrary numeric value identifying the order strategy. + +Values smaller than `1000000` are reserved and cannot be used. + +`selfTradePreventionMode` + +ENUM + +NO + +The allowed enums is dependent on what is configured on the symbol. Supported values: [STP Modes](https://developers.binance.com/docs/binance-spot-api-docs/enums) + +`pegPriceType` + +ENUM + +NO + +`PRIMARY_PEG` or `MARKET_PEG` +See [Pegged Orders](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests) + +`pegOffsetValue` + +INT + +NO + +Price level to peg the price to (max: 100) +See [Pegged Orders](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests) + +`pegOffsetType` + +ENUM + +NO + +Only `PRICE_LEVEL` is supported +See [Pegged Orders](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests) + +`apiKey` + +STRING + +YES + +`recvWindow` + +DECIMAL + +NO + +The value cannot be greater than `60000`. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +`signature` + +STRING + +YES + +`timestamp` + +LONG + +YES + +Certain parameters (\*) become mandatory based on the order `type`: + +Order `type` + +Mandatory parameters + +`LIMIT` + +- `timeInForce` +- `price` +- `quantity` + +`LIMIT_MAKER` + +- `price` +- `quantity` + +`MARKET` + +- `quantity` or `quoteOrderQty` + +`STOP_LOSS` + +- `quantity` +- `stopPrice` or `trailingDelta` + +`STOP_LOSS_LIMIT` + +- `timeInForce` +- `price` +- `quantity` +- `stopPrice` or `trailingDelta` + +`TAKE_PROFIT` + +- `quantity` +- `stopPrice` or `trailingDelta` + +`TAKE_PROFIT_LIMIT` + +- `timeInForce` +- `price` +- `quantity` +- `stopPrice` or `trailingDelta` + +Supported order types: + +Order `type` + +Description + +`LIMIT` + +Buy or sell `quantity` at the specified `price` or better. + +`LIMIT_MAKER` + +`LIMIT` order that will be rejected if it immediately matches and trades as a taker. + +This order type is also known as a POST-ONLY order. + +`MARKET` + +Buy or sell at the best available market price. + +- `MARKET` order with `quantity` parameter specifies the amount of the _base asset_ you want to buy or sell. Actually executed quantity of the quote asset will be determined by available market liquidity. + + E.g., a MARKET BUY order on BTCUSDT for `"quantity": "0.1000"` specifies that you want to buy 0.1 BTC at the best available price. If there is not enough BTC at the best price, keep buying at the next best price, until either your order is filled, or you run out of USDT, or market runs out of BTC. + +- `MARKET` order with `quoteOrderQty` parameter specifies the amount of the _quote asset_ you want to spend (when buying) or receive (when selling). Actually executed quantity of the base asset will be determined by available market liquidity. + + E.g., a MARKET BUY on BTCUSDT for `"quoteOrderQty": "100.00"` specifies that you want to buy as much BTC as you can for 100 USDT at the best available price. Similarly, a SELL order will sell as much available BTC as needed for you to receive 100 USDT (before commission). + + +`STOP_LOSS` + +Execute a `MARKET` order for given `quantity` when specified conditions are met. + +I.e., when `stopPrice` is reached, or when `trailingDelta` is activated. + +`STOP_LOSS_LIMIT` + +Place a `LIMIT` order with given parameters when specified conditions are met. + +`TAKE_PROFIT` + +Like `STOP_LOSS` but activates when market price moves in the favorable direction. + +`TAKE_PROFIT_LIMIT` + +Like `STOP_LOSS_LIMIT` but activates when market price moves in the favorable direction. + +Notes on using parameters for Pegged Orders: + +- These parameters are allowed for `LIMIT`, `LIMIT_MAKER`, `STOP_LOSS_LIMIT`, `TAKE_PROFIT_LIMIT` orders. +- If `pegPriceType` is specified, `price` becomes optional. Otherwise, it is still mandatory. +- `pegPriceType=PRIMARY_PEG` means the primary peg, that is the best price on the same side of the order book as your order. +- `pegPriceType=MARKET_PEG` means the market peg, that is the best price on the opposite side of the order book from your order. +- Use `pegOffsetType` and `pegOffsetValue` to request a price level other than the best one. These parameters must be specified together. + +Available `timeInForce` options, setting how long the order should be active before expiration: + +TIF + +Description + +`GTC` + +**Good 'til Canceled** – the order will remain on the book until you cancel it, or the order is completely filled. + +`IOC` + +**Immediate or Cancel** – the order will be filled for as much as possible, the unfilled quantity immediately expires. + +`FOK` + +**Fill or Kill** – the order will expire unless it cannot be immediately filled for the entire quantity. + +Notes: + +- `newClientOrderId` specifies `clientOrderId` value for the order. + + A new order with the same `clientOrderId` is accepted only when the previous one is filled or expired. + +- Any `LIMIT` or `LIMIT_MAKER` order can be made into an iceberg order by specifying the `icebergQty`. + + An order with an `icebergQty` must have `timeInForce` set to `GTC`. + +- Trigger order price rules for `STOP_LOSS`/`TAKE_PROFIT` orders: + + - `stopPrice` must be above market price: `STOP_LOSS BUY`, `TAKE_PROFIT SELL` + - `stopPrice` must be below market price: `STOP_LOSS SELL`, `TAKE_PROFIT BUY` +- `MARKET` orders using `quoteOrderQty` follow [`LOT_SIZE`](https://developers.binance.com/docs/binance-spot-api-docs/filters) filter rules. + + The order will execute a quantity that has notional value as close as possible to requested `quoteOrderQty`. + + +**Data Source:** Matching Engine + +**Response:** + +Response format is selected by using the `newOrderRespType` parameter. + +`ACK` response type: + +``` +{ "id": "56374a46-3061-486b-a311-99ee972eb648", "status": 200, "result": { "symbol": "BTCUSDT", "orderId": 12569099453, "orderListId": -1, // always -1 for singular orders "clientOrderId": "4d96324ff9d44481926157ec08158a40", "transactTime": 1660801715639 }, "rateLimits": [ { "rateLimitType": "ORDERS", "interval": "SECOND", "intervalNum": 10, "limit": 50, "count": 1 }, { "rateLimitType": "ORDERS", "interval": "DAY", "intervalNum": 1, "limit": 160000, "count": 1 }, { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 1 } ]} +``` + +`RESULT` response type: + +``` +{ "id": "56374a46-3061-486b-a311-99ee972eb648", "status": 200, "result": { "symbol": "BTCUSDT", "orderId": 12569099453, "orderListId": -1, // always -1 for singular orders "clientOrderId": "4d96324ff9d44481926157ec08158a40", "transactTime": 1660801715639, "price": "23416.10000000", "origQty": "0.00847000", "executedQty": "0.00000000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "0.00000000", "status": "NEW", "timeInForce": "GTC", "type": "LIMIT", "side": "SELL", "workingTime": 1660801715639, "selfTradePreventionMode": "NONE" }, "rateLimits": [ { "rateLimitType": "ORDERS", "interval": "SECOND", "intervalNum": 10, "limit": 50, "count": 1 }, { "rateLimitType": "ORDERS", "interval": "DAY", "intervalNum": 1, "limit": 160000, "count": 1 }, { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 1 } ]} +``` + +`FULL` response type: + +``` +{ "id": "56374a46-3061-486b-a311-99ee972eb648", "status": 200, "result": { "symbol": "BTCUSDT", "orderId": 12569099453, "orderListId": -1, "clientOrderId": "4d96324ff9d44481926157ec08158a40", "transactTime": 1660801715793, "price": "23416.10000000", "origQty": "0.00847000", "executedQty": "0.00847000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "198.33521500", "status": "FILLED", "timeInForce": "GTC", "type": "LIMIT", "side": "SELL", "workingTime": 1660801715793, // FULL response is identical to RESULT response, with the same optional fields // based on the order type and parameters. FULL response additionally includes // the list of trades which immediately filled the order. "fills": [ { "price": "23416.10000000", "qty": "0.00635000", "commission": "0.000000", "commissionAsset": "BNB", "tradeId": 1650422481 }, { "price": "23416.50000000", "qty": "0.00212000", "commission": "0.000000", "commissionAsset": "BNB", "tradeId": 1650422482 } ] }, "rateLimits": [ { "rateLimitType": "ORDERS", "interval": "SECOND", "intervalNum": 10, "limit": 50, "count": 1 }, { "rateLimitType": "ORDERS", "interval": "DAY", "intervalNum": 1, "limit": 160000, "count": 1 }, { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 1 } ]} +``` + +**Conditional fields in Order Responses** + +There are fields in the order responses (e.g. order placement, order query, order cancellation) that appear only if certain conditions are met. + +These fields can apply to Order lists. + +The fields are listed below: + +Field + +Description + +Visibility conditions + +Examples + +`icebergQty` + +Quantity for the iceberg order + +Appears only if the parameter `icebergQty` was sent in the request. + +`"icebergQty": "0.00000000"` + +`preventedMatchId` + +When used in combination with `symbol`, can be used to query a prevented match. + +Appears only if the order expired due to STP. + +`"preventedMatchId": 0` + +`preventedQuantity` + +Order quantity that expired due to STP + +Appears only if the order expired due to STP. + +`"preventedQuantity": "1.200000"` + +`stopPrice` + +Price when the algorithmic order will be triggered + +Appears for `STOP_LOSS`. `TAKE_PROFIT`, `STOP_LOSS_LIMIT` and `TAKE_PROFIT_LIMIT` orders. + +`"stopPrice": "23500.00000000"` + +`strategyId` + +Can be used to label an order that's part of an order strategy. + +Appears if the parameter was populated in the request. + +`"strategyId": 37463720` + +`strategyType` + +Can be used to label an order that is using an order strategy. + +Appears if the parameter was populated in the request. + +`"strategyType": 1000000` + +`trailingDelta` + +Delta price change required before order activation + +Appears for Trailing Stop Orders. + +`"trailingDelta": 10` + +`trailingTime` + +Time when the trailing order is now active and tracking price changes + +Appears only for Trailing Stop Orders. + +`"trailingTime": -1` + +`usedSor` + +Field that determines whether order used SOR + +Appears when placing orders using SOR + +`"usedSor": true` + +`workingFloor` + +Field that determines whether the order is being filled by the SOR or by the order book the order was submitted to. + +Appears when placing orders using SOR + +`"workingFloor": "SOR"` + +`pegPriceType` + +Price peg type + +Only for pegged orders + +`"pegPriceType": "PRIMARY_PEG"` + +`pegOffsetType` + +Price peg offset type + +Only for pegged orders, if requested + +`"pegOffsetType": "PRICE_LEVEL"` + +`pegOffsetValue` + +Price peg offset value + +Only for pegged orders, if requested + +`"pegOffsetValue": 5` + +`peggedPrice` + +Current price order is pegged at + +Only for pegged orders, once determined + +`"peggedPrice": "87523.83710000"` + +### Test new order (TRADE)[​](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests) + +``` +{ "id": "6ffebe91-01d9-43ac-be99-57cf062e0e30", "method": "order.test", "params": { "symbol": "BTCUSDT", "side": "SELL", "type": "LIMIT", "timeInForce": "GTC", "price": "23416.10000000", "quantity": "0.00847000", "apiKey": "vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A", "signature": "15af09e41c36f3cc61378c2fbe2c33719a03dd5eba8d0f9206fbda44de717c88", "timestamp": 1660801715431 }} +``` + +Test order placement. + +Validates new order parameters and verifies your signature but does not send the order into the matching engine. + +**Weight:** + +Condition + +Request Weight + +Without `computeCommissionRates` + +1 + +With `computeCommissionRates` + +20 + +**Parameters:** + +In addition to all parameters accepted by [`order.place`](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests), the following optional parameters are also accepted: + +Name + +Type + +Mandatory + +Description + +`computeCommissionRates` + +BOOLEAN + +NO + +Default: `false` +See [Commissions FAQ](https://developers.binance.com/docs/binance-spot-api-docs/faqs/commission_faq) to learn more. + +**Data Source:** Memory + +**Response:** + +Without `computeCommissionRates`: + +``` +{ "id": "6ffebe91-01d9-43ac-be99-57cf062e0e30", "status": 200, "result": {}, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 1 } ]} +``` + +With `computeCommissionRates`: + +``` +{ "id": "6ffebe91-01d9-43ac-be99-57cf062e0e30", "status": 200, "result": { "standardCommissionForOrder": { // Standard commission rates on trades from the order. "maker": "0.00000112", "taker": "0.00000114" }, "specialCommissionForOrder": { // Special commission rates on trades from the order. "maker": "0.05000000", "taker": "0.06000000" }, "taxCommissionForOrder": { // Tax commission rates for trades from the order "maker": "0.00000112", "taker": "0.00000114" }, "discount": { // Discount on standard commissions when paying in BNB. "enabledForAccount": true, "enabledForSymbol": true, "discountAsset": "BNB", "discount": "0.25000000" // Standard commission is reduced by this rate when paying in BNB. } }, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 20 } ]} +``` + +### Cancel order (TRADE)[​](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests) + +``` +{ "id": "5633b6a2-90a9-4192-83e7-925c90b6a2fd", "method": "order.cancel", "params": { "symbol": "BTCUSDT", "origClientOrderId": "4d96324ff9d44481926157", "apiKey": "vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A", "signature": "33d5b721f278ae17a52f004a82a6f68a70c68e7dd6776ed0be77a455ab855282", "timestamp": 1660801715830 }} +``` + +Cancel an active order. + +**Weight:** 1 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +`symbol` + +STRING + +YES + +`orderId` + +LONG + +YES + +Cancel order by `orderId` + +`origClientOrderId` + +STRING + +Cancel order by `clientOrderId` + +`newClientOrderId` + +STRING + +NO + +New ID for the canceled order. Automatically generated if not sent + +`cancelRestrictions` + +ENUM + +NO + +Supported values: +`ONLY_NEW` - Cancel will succeed if the order status is `NEW`. +`ONLY_PARTIALLY_FILLED` - Cancel will succeed if order status is `PARTIALLY_FILLED`. + +`apiKey` + +STRING + +YES + +`recvWindow` + +DECIMAL + +NO + +The value cannot be greater than 60000. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +`signature` + +STRING + +YES + +`timestamp` + +LONG + +YES + +Notes: + +- If both `orderId` and `origClientOrderId` parameters are provided, the `orderId` is searched first, then the `origClientOrderId` from that result is checked against that order. If both conditions are not met the request will be rejected. + +- `newClientOrderId` will replace `clientOrderId` of the canceled order, freeing it up for new orders. + +- If you cancel an order that is a part of an order list, the entire order list is canceled. + +- The performance for canceling an order (single cancel or as part of a cancel-replace) is always better when only `orderId` is sent. Sending `origClientOrderId` or both `orderId` + `origClientOrderId` will be slower. + + +**Data Source:** Matching Engine + +**Response:** + +When an individual order is canceled: + +``` +{ "id": "5633b6a2-90a9-4192-83e7-925c90b6a2fd", "status": 200, "result": { "symbol": "BTCUSDT", "origClientOrderId": "4d96324ff9d44481926157", // clientOrderId that was canceled "orderId": 12569099453, "orderListId": -1, // set only for legs of an order list "clientOrderId": "91fe37ce9e69c90d6358c0", // newClientOrderId from request "transactTime": 1684804350068, "price": "23416.10000000", "origQty": "0.00847000", "executedQty": "0.00001000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "0.23416100", "status": "CANCELED", "timeInForce": "GTC", "type": "LIMIT", "side": "SELL", "stopPrice": "0.00000000", // present only if stopPrice set for the order "trailingDelta": 0, // present only if trailingDelta set for the order "icebergQty": "0.00000000", // present only if icebergQty set for the order "strategyId": 37463720, // present only if strategyId set for the order "strategyType": 1000000, // present only if strategyType set for the order "selfTradePreventionMode": "NONE" }, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 1 } ]} +``` + +When an order list is canceled: + +``` +{ "id": "16eaf097-bbec-44b9-96ff-e97e6e875870", "status": 200, "result": { "orderListId": 19431, "contingencyType": "OCO", "listStatusType": "ALL_DONE", "listOrderStatus": "ALL_DONE", "listClientOrderId": "iuVNVJYYrByz6C4yGOPPK0", "transactionTime": 1660803702431, "symbol": "BTCUSDT", "orders": [ { "symbol": "BTCUSDT", "orderId": 12569099453, "clientOrderId": "bX5wROblo6YeDwa9iTLeyY" }, { "symbol": "BTCUSDT", "orderId": 12569099454, "clientOrderId": "Tnu2IP0J5Y4mxw3IATBfmW" } ], // order list order's status format is the same as for individual orders. "orderReports": [ { "symbol": "BTCUSDT", "origClientOrderId": "bX5wROblo6YeDwa9iTLeyY", "orderId": 12569099453, "orderListId": 19431, "clientOrderId": "OFFXQtxVFZ6Nbcg4PgE2DA", "transactTime": 1684804350068, "price": "23450.50000000", "origQty": "0.00850000", "executedQty": "0.00000000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "0.00000000", "status": "CANCELED", "timeInForce": "GTC", "type": "STOP_LOSS_LIMIT", "side": "BUY", "stopPrice": "23430.00000000", "selfTradePreventionMode": "NONE" }, { "symbol": "BTCUSDT", "origClientOrderId": "Tnu2IP0J5Y4mxw3IATBfmW", "orderId": 12569099454, "orderListId": 19431, "clientOrderId": "OFFXQtxVFZ6Nbcg4PgE2DA", "transactTime": 1684804350068, "price": "23400.00000000", "origQty": "0.00850000", "executedQty": "0.00000000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "0.00000000", "status": "CANCELED", "timeInForce": "GTC", "type": "LIMIT_MAKER", "side": "BUY", "selfTradePreventionMode": "NONE" } ] }, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 1 } ]} +``` + +**Note:** The payload above does not show all fields that can appear. Please refer to [Conditional fields in Order Responses](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests). + +**Regarding `cancelRestrictions`** + +- If the `cancelRestrictions` value is not any of the supported values, the error will be: + +``` +{ "code": -1145, "msg": "Invalid cancelRestrictions"} +``` + +- If the order did not pass the conditions for `cancelRestrictions`, the error will be: + +``` +{ "code": -2011, "msg": "Order was not canceled due to cancel restrictions."} +``` + +### Cancel and replace order (TRADE)[​](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests) + +``` +{ "id": "99de1036-b5e2-4e0f-9b5c-13d751c93a1a", "method": "order.cancelReplace", "params": { "symbol": "BTCUSDT", "cancelReplaceMode": "ALLOW_FAILURE", "cancelOrigClientOrderId": "4d96324ff9d44481926157", "side": "SELL", "type": "LIMIT", "timeInForce": "GTC", "price": "23416.10000000", "quantity": "0.00847000", "apiKey": "vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A", "signature": "7028fdc187868754d25e42c37ccfa5ba2bab1d180ad55d4c3a7e2de643943dc5", "timestamp": 1660813156900 }} +``` + +Cancel an existing order and immediately place a new order instead of the canceled one. + +A new order that was not attempted (i.e. when `newOrderResult: NOT_ATTEMPTED`), will still increase the unfilled order count by 1. + +**Weight:** 1 + +**Unfilled Order Count:** 1 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +`symbol` + +STRING + +YES + +`cancelReplaceMode` + +ENUM + +YES + +`cancelOrderId` + +LONG + +YES + +Cancel order by `orderId` + +`cancelOrigClientOrderId` + +STRING + +Cancel order by `clientOrderId` + +`cancelNewClientOrderId` + +STRING + +NO + +New ID for the canceled order. Automatically generated if not sent + +`side` + +ENUM + +YES + +`BUY` or `SELL` + +`type` + +ENUM + +YES + +`timeInForce` + +ENUM + +NO \* + +`price` + +DECIMAL + +NO \* + +`quantity` + +DECIMAL + +NO \* + +`quoteOrderQty` + +DECIMAL + +NO \* + +`newClientOrderId` + +STRING + +NO + +Arbitrary unique ID among open orders. Automatically generated if not sent + +`newOrderRespType` + +ENUM + +NO + +Select response format: `ACK`, `RESULT`, `FULL`. + +`MARKET` and `LIMIT` orders produce `FULL` response by default, other order types default to `ACK`. + +`stopPrice` + +DECIMAL + +NO \* + +`trailingDelta` + +DECIMAL + +NO \* + +See [Trailing Stop order FAQ](https://developers.binance.com/docs/binance-spot-api-docs/faqs/trailing-stop-faq) + +`icebergQty` + +DECIMAL + +NO + +`strategyId` + +LONG + +NO + +Arbitrary numeric value identifying the order within an order strategy. + +`strategyType` + +INT + +NO + +Arbitrary numeric value identifying the order strategy. + +Values smaller than 1000000 are reserved and cannot be used. + +`selfTradePreventionMode` + +ENUM + +NO + +The allowed enums is dependent on what is configured on the symbol. + +Supported values: [STP Modes](https://developers.binance.com/docs/binance-spot-api-docs/enums.md). + +`cancelRestrictions` + +ENUM + +NO + +Supported values: +`ONLY_NEW` - Cancel will succeed if the order status is `NEW`. +`ONLY_PARTIALLY_FILLED` - Cancel will succeed if order status is `PARTIALLY_FILLED`. For more information please refer to [Regarding `cancelRestrictions`](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests). + +`apiKey` + +STRING + +YES + +`orderRateLimitExceededMode` + +ENUM + +NO + +Supported values: +`DO_NOTHING` (default)- will only attempt to cancel the order if account has not exceeded the unfilled order rate limit +`CANCEL_ONLY` - will always cancel the order. + +`pegPriceType` + +ENUM + +NO + +`PRIMARY_PEG` or `MARKET_PEG`. +See [Pegged Orders](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests)" + +`pegOffsetValue` + +INT + +NO + +Price level to peg the price to (max: 100) +See [Pegged Orders](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests) + +`pegOffsetType` + +ENUM + +NO + +Only `PRICE_LEVEL` is supported +See [Pegged Orders](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests) + +`recvWindow` + +DECIMAL + +NO + +The value cannot be greater than 60000. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +`signature` + +STRING + +YES + +`timestamp` + +LONG + +YES + +Similar to the [`order.place`](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests) request, additional mandatory parameters (\*) are determined by the new order [`type`](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests). + +Available `cancelReplaceMode` options: + +- `STOP_ON_FAILURE` – if cancellation request fails, new order placement will not be attempted. +- `ALLOW_FAILURE` – new order placement will be attempted even if the cancel request fails. + +Request + +Response + +`cancelReplaceMode` + +`orderRateLimitExceededMode` + +Unfilled Order Count + +`cancelResult` + +`newOrderResult` + +`status` + +`STOP_ON_FAILURE` + +`DO_NOTHING` + +Within Limits + +✅ `SUCCESS` + +✅ `SUCCESS` + +`200` + +❌ `FAILURE` + +➖ `NOT_ATTEMPTED` + +`400` + +✅ `SUCCESS` + +❌ `FAILURE` + +`409` + +Exceeds Limits + +✅ `SUCCESS` + +✅ `SUCCESS` + +N/A + +❌ `FAILURE` + +➖ `NOT_ATTEMPTED` + +N/A + +✅ `SUCCESS` + +❌ `FAILURE` + +N/A + +`CANCEL_ONLY` + +Within Limits + +✅ `SUCCESS` + +✅ `SUCCESS` + +`200` + +❌ `FAILURE` + +➖ `NOT_ATTEMPTED` + +`400` + +✅ `SUCCESS` + +❌ `FAILURE` + +`409` + +Exceeds Limits + +❌ `FAILURE` + +➖ `NOT_ATTEMPTED` + +`429` + +✅ `SUCCESS` + +❌ `FAILURE` + +`429` + +`ALLOW_FAILURE` + +`DO_NOTHING` + +Within Limits + +✅ `SUCCESS` + +✅ `SUCCESS` + +`200` + +❌ `FAILURE` + +❌ `FAILURE` + +`400` + +❌ `FAILURE` + +✅ `SUCCESS` + +`409` + +✅ `SUCCESS` + +❌ `FAILURE` + +`409` + +Exceeds Limits + +✅ `SUCCESS` + +✅ `SUCCESS` + +N/A + +❌ `FAILURE` + +❌ `FAILURE` + +N/A + +❌ `FAILURE` + +✅ `SUCCESS` + +N/A + +✅ `SUCCESS` + +❌ `FAILURE` + +N/A + +`CANCEL_ONLY` + +Within Limits + +✅ `SUCCESS` + +✅ `SUCCESS` + +`200` + +❌ `FAILURE` + +❌ `FAILURE` + +`400` + +❌ `FAILURE` + +✅ `SUCCESS` + +`409` + +✅ `SUCCESS` + +❌ `FAILURE` + +`409` + +Exceeds Limits + +✅ `SUCCESS` + +✅ `SUCCESS` + +`200` + +❌ `FAILURE` + +❌ `FAILURE` + +`400` + +❌ `FAILURE` + +✅ `SUCCESS` + +N/A + +✅ `SUCCESS` + +❌ `FAILURE` + +`409` + +Notes: + +- If both `cancelOrderId` and `cancelOrigClientOrderId` parameters are provided, the `cancelOrderId` is searched first, then the `cancelOrigClientOrderId` from that result is checked against that order. If both conditions are not met the request will be rejected. + +- `cancelNewClientOrderId` will replace `clientOrderId` of the canceled order, freeing it up for new orders. + +- `newClientOrderId` specifies `clientOrderId` value for the placed order. + + A new order with the same `clientOrderId` is accepted only when the previous one is filled or expired. + + The new order can reuse old `clientOrderId` of the canceled order. + +- This cancel-replace operation is **not transactional**. + + If one operation succeeds but the other one fails, the successful operation is still executed. + + For example, in `STOP_ON_FAILURE` mode, if the new order placement fails, the old order is still canceled. + +- Filters and order count limits are evaluated before cancellation and order placement occurs. + +- If new order placement is not attempted, your order count is still incremented. + +- Like [`order.cancel`](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests), if you cancel an individual order from an order list, the entire order list is canceled. + +- The performance for canceling an order (single cancel or as part of a cancel-replace) is always better when only `orderId` is sent. Sending `origClientOrderId` or both `orderId` + `origClientOrderId` will be slower. + + +**Data Source:** Matching Engine + +**Response:** + +If both cancel and placement succeed, you get the following response with `"status": 200`: + +``` +{ "id": "99de1036-b5e2-4e0f-9b5c-13d751c93a1a", "status": 200, "result": { "cancelResult": "SUCCESS", "newOrderResult": "SUCCESS", // Format is identical to "order.cancel" format. // Some fields are optional and are included only for orders that set them. "cancelResponse": { "symbol": "BTCUSDT", "origClientOrderId": "4d96324ff9d44481926157", // cancelOrigClientOrderId from request "orderId": 125690984230, "orderListId": -1, "clientOrderId": "91fe37ce9e69c90d6358c0", // cancelNewClientOrderId from request "transactTime": 1684804350068, "price": "23450.00000000", "origQty": "0.00847000", "executedQty": "0.00001000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "0.23450000", "status": "CANCELED", "timeInForce": "GTC", "type": "LIMIT", "side": "SELL", "selfTradePreventionMode": "NONE" }, // Format is identical to "order.place" format, affected by "newOrderRespType". // Some fields are optional and are included only for orders that set them. "newOrderResponse": { "symbol": "BTCUSDT", "orderId": 12569099453, "orderListId": -1, "clientOrderId": "bX5wROblo6YeDwa9iTLeyY", // newClientOrderId from request "transactTime": 1660813156959, "price": "23416.10000000", "origQty": "0.00847000", "executedQty": "0.00000000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "0.00000000", "status": "NEW", "timeInForce": "GTC", "type": "LIMIT", "side": "SELL", "selfTradePreventionMode": "NONE" } }, "rateLimits": [ { "rateLimitType": "ORDERS", "interval": "SECOND", "intervalNum": 10, "limit": 50, "count": 1 }, { "rateLimitType": "ORDERS", "interval": "DAY", "intervalNum": 1, "limit": 160000, "count": 1 }, { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 1 } ]} +``` + +In `STOP_ON_FAILURE` mode, failed order cancellation prevents new order from being placed and returns the following response with `"status": 400`: + +``` +{ "id": "27e1bf9f-0539-4fb0-85c6-06183d36f66c", "status": 400, "error": { "code": -2022, "msg": "Order cancel-replace failed.", "data": { "cancelResult": "FAILURE", "newOrderResult": "NOT_ATTEMPTED", "cancelResponse": { "code": -2011, "msg": "Unknown order sent." }, "newOrderResponse": null } }, "rateLimits": [ { "rateLimitType": "ORDERS", "interval": "SECOND", "intervalNum": 10, "limit": 50, "count": 1 }, { "rateLimitType": "ORDERS", "interval": "DAY", "intervalNum": 1, "limit": 160000, "count": 1 }, { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 1 } ]} +``` + +If cancel-replace mode allows failure and one of the operations fails, you get a response with `"status": 409`, and the `"data"` field detailing which operation succeeded, which failed, and why: + +``` +{ "id": "b220edfe-f3c4-4a3a-9d13-b35473783a25", "status": 409, "error": { "code": -2021, "msg": "Order cancel-replace partially failed.", "data": { "cancelResult": "SUCCESS", "newOrderResult": "FAILURE", "cancelResponse": { "symbol": "BTCUSDT", "origClientOrderId": "4d96324ff9d44481926157", "orderId": 125690984230, "orderListId": -1, "clientOrderId": "91fe37ce9e69c90d6358c0", "transactTime": 1684804350068, "price": "23450.00000000", "origQty": "0.00847000", "executedQty": "0.00001000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "0.23450000", "status": "CANCELED", "timeInForce": "GTC", "type": "LIMIT", "side": "SELL", "selfTradePreventionMode": "NONE" }, "newOrderResponse": { "code": -2010, "msg": "Order would immediately match and take." } } }, "rateLimits": [ { "rateLimitType": "ORDERS", "interval": "SECOND", "intervalNum": 10, "limit": 50, "count": 1 }, { "rateLimitType": "ORDERS", "interval": "DAY", "intervalNum": 1, "limit": 160000, "count": 1 }, { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 1 } ]} +``` + +``` +{ "id": "ce641763-ff74-41ac-b9f7-db7cbe5e93b1", "status": 409, "error": { "code": -2021, "msg": "Order cancel-replace partially failed.", "data": { "cancelResult": "FAILURE", "newOrderResult": "SUCCESS", "cancelResponse": { "code": -2011, "msg": "Unknown order sent." }, "newOrderResponse": { "symbol": "BTCUSDT", "orderId": 12569099453, "orderListId": -1, "clientOrderId": "bX5wROblo6YeDwa9iTLeyY", "transactTime": 1660813156959, "price": "23416.10000000", "origQty": "0.00847000", "executedQty": "0.00000000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "0.00000000", "status": "NEW", "timeInForce": "GTC", "type": "LIMIT", "side": "SELL", "workingTime": 1669693344508, "fills": [], "selfTradePreventionMode": "NONE" } } }, "rateLimits": [ { "rateLimitType": "ORDERS", "interval": "SECOND", "intervalNum": 10, "limit": 50, "count": 1 }, { "rateLimitType": "ORDERS", "interval": "DAY", "intervalNum": 1, "limit": 160000, "count": 1 }, { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 1 } ]} +``` + +If both operations fail, response will have `"status": 400`: + +``` +{ "id": "3b3ac45c-1002-4c7d-88e8-630c408ecd87", "status": 400, "error": { "code": -2022, "msg": "Order cancel-replace failed.", "data": { "cancelResult": "FAILURE", "newOrderResult": "FAILURE", "cancelResponse": { "code": -2011, "msg": "Unknown order sent." }, "newOrderResponse": { "code": -2010, "msg": "Order would immediately match and take." } } }, "rateLimits": [ { "rateLimitType": "ORDERS", "interval": "SECOND", "intervalNum": 10, "limit": 50, "count": 1 }, { "rateLimitType": "ORDERS", "interval": "DAY", "intervalNum": 1, "limit": 160000, "count": 1 }, { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 1 } ]} +``` + +If `orderRateLimitExceededMode` is `DO_NOTHING` regardless of `cancelReplaceMode`, and you have exceeded your unfilled order count, you will get status `429` with the following error: + +``` +{ "id": "3b3ac45c-1002-4c7d-88e8-630c408ecd87", "status": 429, "error": { "code": -1015, "msg": "Too many new orders; current limit is 50 orders per 10 SECOND." }, "rateLimits": [ { "rateLimitType": "ORDERS", "interval": "SECOND", "intervalNum": 10, "limit": 50, "count": 50 }, { "rateLimitType": "ORDERS", "interval": "DAY", "intervalNum": 1, "limit": 160000, "count": 50 }, { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 1 } ]} +``` + +If `orderRateLimitExceededMode` is `CANCEL_ONLY` regardless of `cancelReplaceMode`, and you have exceeded your unfilled order count, you will get status `409` with the following error: + +``` +{ "id": "3b3ac45c-1002-4c7d-88e8-630c408ecd87", "status": 409, "error": { "code": -2021, "msg": "Order cancel-replace partially failed.", "data": { "cancelResult": "SUCCESS", "newOrderResult": "FAILURE", "cancelResponse": { "symbol": "LTCBNB", "origClientOrderId": "GKt5zzfOxRDSQLveDYCTkc", "orderId": 64, "orderListId": -1, "clientOrderId": "loehOJF3FjoreUBDmv739R", "transactTime": 1715779007228, "price": "1.00", "origQty": "10.00000000", "executedQty": "0.00000000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "0.00", "status": "CANCELED", "timeInForce": "GTC", "type": "LIMIT", "side": "SELL", "selfTradePreventionMode": "NONE" }, "newOrderResponse": { "code": -1015, "msg": "Too many new orders; current limit is 50 orders per 10 SECOND." } } }, "rateLimits": [ { "rateLimitType": "ORDERS", "interval": "SECOND", "intervalNum": 10, "limit": 50, "count": 50 }, { "rateLimitType": "ORDERS", "interval": "DAY", "intervalNum": 1, "limit": 160000, "count": 50 }, { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 1 } ]} +``` + +**Note:** The payload above does not show all fields that can appear. Please refer to [Conditional fields in Order Responses](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests). + +### Order Amend Keep Priority (TRADE)[​](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests) + +``` +{ "id": "56374a46-3061-486b-a311-89ee972eb648", "method": "order.amend.keepPriority", "params": { "newQty": "5", "origClientOrderId": "my_test_order1", "recvWindow": 5000, "symbol": "BTCUSDT", "timestamp": 1741922620419, "apiKey": "Rl1KOMDCpSg6xviMYOkNk9ENUB5QOTnufXukVe0Ijd40yduAlpHn78at3rJyJN4F", "signature": "fa49c0c4ebc331c6ebd3fcb20deb387f60081ea858eebe6e35aa6fcdf2a82e08" }} +``` + +Reduce the quantity of an existing open order. + +This adds 0 orders to the `EXCHANGE_MAX_ORDERS` filter and the `MAX_NUM_ORDERS` filter. + +Read [Order Amend Keep Priority FAQ](https://developers.binance.com/docs/binance-spot-api-docs/faqs/order_amend_keep_priority) to learn more. + +**Weight**: 4 + +**Unfilled Order Count:** 0 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +orderId + +LONG + +NO\* + +`orderId` or `origClientOrderId` must be sent + +origClientOrderId + +STRING + +NO\* + +`orderId` or `origClientOrderId` must be sent + +newClientOrderId + +STRING + +NO\* + +The new client order ID for the order after being amended. +If not sent, one will be randomly generated. +It is possible to reuse the current clientOrderId by sending it as the `newClientOrderId`. + +newQty + +DECIMAL + +YES + +`newQty` must be greater than 0 and less than the order's quantity. + +recvWindow + +DECIMAL + +NO + +The value cannot be greater than `60000`. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +timestamp + +LONG + +YES + +**Data Source**: Matching Engine + +**Response:** + +Response for a single order: + +``` +{ "id": "56374a46-3061-486b-a311-89ee972eb648", "status": 200, "result": { "transactTime": 1741923284382, "executionId": 16, "amendedOrder": { "symbol": "BTCUSDT", "orderId": 12, "orderListId": -1, "origClientOrderId": "my_test_order1", "clientOrderId": "4zR9HFcEq8gM1tWUqPEUHc", "price": "5.00000000", "qty": "5.00000000", "executedQty": "0.00000000", "preventedQty": "0.00000000", "quoteOrderQty": "0.00000000", "cumulativeQuoteQty": "0.00000000", "status": "NEW", "timeInForce": "GTC", "type": "LIMIT", "side": "BUY", "workingTime": 1741923284364, "selfTradePreventionMode": "NONE" } }, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 1 } ]} +``` + +Response for an order which is part of an Order list: + +``` +{ "id": "56374b46-3061-486b-a311-89ee972eb648", "status": 200, "result": { "transactTime": 1741924229819, "executionId": 60, "amendedOrder": { "symbol": "BTUCSDT", "orderId": 23, "orderListId": 4, "origClientOrderId": "my_pending_order", "clientOrderId": "xbxXh5SSwaHS7oUEOCI88B", "price": "1.00000000", "qty": "5.00000000", "executedQty": "0.00000000", "preventedQty": "0.00000000", "quoteOrderQty": "0.00000000", "cumulativeQuoteQty": "0.00000000", "status": "NEW", "timeInForce": "GTC", "type": "LIMIT", "side": "BUY", "workingTime": 1741924204920, "selfTradePreventionMode": "NONE" }, "listStatus": { "orderListId": 4, "contingencyType": "OTO", "listOrderStatus": "EXECUTING", "listClientOrderId": "8nOGLLawudj1QoOiwbroRH", "symbol": "BTCUSDT", "orders": [ { "symbol": "BTCUSDT", "orderId": 22, "clientOrderId": "g04EWsjaackzedjC9wRkWD" }, { "symbol": "BTCUSDT", "orderId": 23, "clientOrderId": "xbxXh5SSwaHS7oUEOCI88B" } ] } }, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 1 } ]} +``` + +**Note:** The payloads above do not show all fields that can appear. Please refer to [Conditional fields in Order Responses](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests). + +### Cancel open orders (TRADE)[​](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests) + +``` +{ "id": "778f938f-9041-4b88-9914-efbf64eeacc8", "method": "openOrders.cancelAll", "params": { "symbol": "BTCUSDT", "apiKey": "vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A", "signature": "773f01b6e3c2c9e0c1d217bc043ce383c1ddd6f0e25f8d6070f2b66a6ceaf3a5", "timestamp": 1660805557200 }} +``` + +Cancel all open orders on a symbol. This includes orders that are part of an order list. + +**Weight:** 1 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +`symbol` + +STRING + +YES + +`apiKey` + +STRING + +YES + +`recvWindow` + +DECIMAL + +NO + +The value cannot be greater than `60000`. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +`signature` + +STRING + +YES + +`timestamp` + +LONG + +YES + +**Data Source:** Matching Engine + +**Response:** + +Cancellation reports for orders and order lists have the same format as in [`order.cancel`](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests). + +``` +{ "id": "778f938f-9041-4b88-9914-efbf64eeacc8", "status": 200, "result": [ { "symbol": "BTCUSDT", "origClientOrderId": "4d96324ff9d44481926157", "orderId": 12569099453, "orderListId": -1, "clientOrderId": "91fe37ce9e69c90d6358c0", "transactTime": 1684804350068, "price": "23416.10000000", "origQty": "0.00847000", "executedQty": "0.00001000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "0.23416100", "status": "CANCELED", "timeInForce": "GTC", "type": "LIMIT", "side": "SELL", "stopPrice": "0.00000000", "trailingDelta": 0, "trailingTime": -1, "icebergQty": "0.00000000", "strategyId": 37463720, "strategyType": 1000000, "selfTradePreventionMode": "NONE" }, { "orderListId": 19431, "contingencyType": "OCO", "listStatusType": "ALL_DONE", "listOrderStatus": "ALL_DONE", "listClientOrderId": "iuVNVJYYrByz6C4yGOPPK0", "transactionTime": 1660803702431, "symbol": "BTCUSDT", "orders": [ { "symbol": "BTCUSDT", "orderId": 12569099453, "clientOrderId": "bX5wROblo6YeDwa9iTLeyY" }, { "symbol": "BTCUSDT", "orderId": 12569099454, "clientOrderId": "Tnu2IP0J5Y4mxw3IATBfmW" } ], "orderReports": [ { "symbol": "BTCUSDT", "origClientOrderId": "bX5wROblo6YeDwa9iTLeyY", "orderId": 12569099453, "orderListId": 19431, "clientOrderId": "OFFXQtxVFZ6Nbcg4PgE2DA", "transactTime": 1684804350068, "price": "23450.50000000", "origQty": "0.00850000", "executedQty": "0.00000000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "0.00000000", "status": "CANCELED", "timeInForce": "GTC", "type": "STOP_LOSS_LIMIT", "side": "BUY", "stopPrice": "23430.00000000", "selfTradePreventionMode": "NONE" }, { "symbol": "BTCUSDT", "origClientOrderId": "Tnu2IP0J5Y4mxw3IATBfmW", "orderId": 12569099454, "orderListId": 19431, "clientOrderId": "OFFXQtxVFZ6Nbcg4PgE2DA", "transactTime": 1684804350068, "price": "23400.00000000", "origQty": "0.00850000", "executedQty": "0.00000000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "0.00000000", "status": "CANCELED", "timeInForce": "GTC", "type": "LIMIT_MAKER", "side": "BUY", "selfTradePreventionMode": "NONE" } ] } ], "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 1 } ]} +``` + +**Note:** The payload above does not show all fields that can appear. Please refer to [Conditional fields in Order Responses](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests). + +### Order lists[​](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests) + +#### Place new OCO - Deprecated (TRADE)[​](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests) + +``` +{ "id": "56374a46-3061-486b-a311-99ee972eb648", "method": "orderList.place", "params": { "symbol": "BTCUSDT", "side": "SELL", "price": "23420.00000000", "quantity": "0.00650000", "stopPrice": "23410.00000000", "stopLimitPrice": "23405.00000000", "stopLimitTimeInForce": "GTC", "newOrderRespType": "RESULT", "apiKey": "vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A", "signature": "6689c2a36a639ff3915c2904871709990ab65f3c7a9ff13857558fd350315c35", "timestamp": 1660801713767 }} +``` + +Send in a new one-cancels-the-other (OCO) pair: `LIMIT_MAKER` + `STOP_LOSS`/`STOP_LOSS_LIMIT` orders (called _legs_), where activation of one order immediately cancels the other. + +This adds 1 order to `EXCHANGE_MAX_ORDERS` filter and the `MAX_NUM_ORDERS` filter + +**Weight:** 1 + +**Unfilled Order Count:** 1 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +`symbol` + +STRING + +YES + +`side` + +ENUM + +YES + +`BUY` or `SELL` + +`price` + +DECIMAL + +YES + +Price for the limit order + +`quantity` + +DECIMAL + +YES + +`listClientOrderId` + +STRING + +NO + +Arbitrary unique ID among open order lists. Automatically generated if not sent + +`limitClientOrderId` + +STRING + +NO + +Arbitrary unique ID among open orders for the limit order. Automatically generated if not sent + +`limitIcebergQty` + +DECIMAL + +NO + +`limitStrategyId` + +LONG + +NO + +Arbitrary numeric value identifying the limit order within an order strategy. + +`limitStrategyType` + +INT + +NO + +Arbitrary numeric value identifying the limit order strategy. + +Values smaller than `1000000` are reserved and cannot be used. + +`stopPrice` + +DECIMAL + +YES \* + +Either `stopPrice` or `trailingDelta`, or both must be specified + +`trailingDelta` + +INT + +YES \* + +See [Trailing Stop order FAQ](https://developers.binance.com/docs/binance-spot-api-docs/faqs/trailing-stop-faq) + +`stopClientOrderId` + +STRING + +NO + +Arbitrary unique ID among open orders for the stop order. Automatically generated if not sent + +`stopLimitPrice` + +DECIMAL + +NO \* + +`stopLimitTimeInForce` + +ENUM + +NO \* + +See [`order.place`](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests) for available options + +`stopIcebergQty` + +DECIMAL + +NO \* + +`stopStrategyId` + +LONG + +NO + +Arbitrary numeric value identifying the stop order within an order strategy. + +`stopStrategyType` + +INT + +NO + +Arbitrary numeric value identifying the stop order strategy. + +Values smaller than `1000000` are reserved and cannot be used. + +`newOrderRespType` + +ENUM + +NO + +Select response format: `ACK`, `RESULT`, `FULL` (default) + +`selfTradePreventionMode` + +ENUM + +NO + +The allowed enums is dependent on what is configured on the symbol. The possible supported values are: [STP Modes](https://developers.binance.com/docs/binance-spot-api-docs/enums) + +`apiKey` + +STRING + +YES + +`recvWindow` + +DECIMAL + +NO + +The value cannot be greater than `60000`. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +`signature` + +STRING + +YES + +`timestamp` + +LONG + +YES + +Notes: + +- `listClientOrderId` parameter specifies `listClientOrderId` for the OCO pair. + + A new OCO with the same `listClientOrderId` is accepted only when the previous one is filled or completely expired. + + `listClientOrderId` is distinct from `clientOrderId` of individual orders. + +- `limitClientOrderId` and `stopClientOrderId` specify `clientOrderId` values for both legs of the OCO. + + A new order with the same `clientOrderId` is accepted only when the previous one is filled or expired. + +- Price restrictions on the legs: + + `side` + + Price relation + + `BUY` + + `price` < market price < `stopPrice` + + `SELL` + + `price` > market price > `stopPrice` + +- Both legs have the same `quantity`. + + However, you can set different iceberg quantity for individual legs. + + If `stopIcebergQty` is used, `stopLimitTimeInForce` must be `GTC`. + +- `trailingDelta` applies only to the `STOP_LOSS`/`STOP_LOSS_LIMIT` leg of the OCO. + + +**Data Source:** Matching Engine + +**Response:** + +Response format for `orderReports` is selected using the `newOrderRespType` parameter. The following example is for `RESULT` response type. See [`order.place`](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests) for more examples. + +``` +{ "id": "57833dc0-e3f2-43fb-ba20-46480973b0aa", "status": 200, "result": { "orderListId": 1274512, "contingencyType": "OCO", "listStatusType": "EXEC_STARTED", "listOrderStatus": "EXECUTING", "listClientOrderId": "08985fedd9ea2cf6b28996", "transactionTime": 1660801713793, "symbol": "BTCUSDT", "orders": [ { "symbol": "BTCUSDT", "orderId": 12569138901, "clientOrderId": "BqtFCj5odMoWtSqGk2X9tU" }, { "symbol": "BTCUSDT", "orderId": 12569138902, "clientOrderId": "jLnZpj5enfMXTuhKB1d0us" } ], "orderReports": [ { "symbol": "BTCUSDT", "orderId": 12569138901, "orderListId": 1274512, "clientOrderId": "BqtFCj5odMoWtSqGk2X9tU", "transactTime": 1660801713793, "price": "23410.00000000", "origQty": "0.00650000", "executedQty": "0.00000000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "0.00000000", "status": "NEW", "timeInForce": "GTC", "type": "STOP_LOSS_LIMIT", "side": "SELL", "stopPrice": "23405.00000000", "workingTime": -1, "selfTradePreventionMode": "NONE" }, { "symbol": "BTCUSDT", "orderId": 12569138902, "orderListId": 1274512, "clientOrderId": "jLnZpj5enfMXTuhKB1d0us", "transactTime": 1660801713793, "price": "23420.00000000", "origQty": "0.00650000", "executedQty": "0.00000000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "0.00000000", "status": "NEW", "timeInForce": "GTC", "type": "LIMIT_MAKER", "side": "SELL", "workingTime": 1660801713793, "selfTradePreventionMode": "NONE" } ] }, "rateLimits": [ { "rateLimitType": "ORDERS", "interval": "SECOND", "intervalNum": 10, "limit": 50, "count": 2 }, { "rateLimitType": "ORDERS", "interval": "DAY", "intervalNum": 1, "limit": 160000, "count": 2 }, { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 1 } ]} +``` + +#### Place new Order list - OCO (TRADE)[​](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests) + +``` +{ "id": "56374a46-3261-486b-a211-99ed972eb648", "method": "orderList.place.oco", "params": { "symbol": "LTCBNB", "side": "BUY", "quantity": 1, "timestamp": 1711062760647, "aboveType": "STOP_LOSS_LIMIT", "abovePrice": "1.5", "aboveStopPrice": "1.50000001", "aboveTimeInForce": "GTC", "belowType": "LIMIT_MAKER", "belowPrice": "1.49999999", "apiKey": "duwNf97YPLqhFIk7kZF0dDdGYVAXStA7BeEz0fIT9RAhUbixJtyS6kJ3hhzJsRXC", "signature": "64614cfd8dd38260d4fd86d3c455dbf4b9d1c8a8170ea54f700592a986c30ddb" }} +``` + +Send in an one-cancels-the-other (OCO) pair, where activation of one order immediately cancels the other. + +- An OCO has 2 orders called the **above order** and **below order**. +- One of the orders must be a `LIMIT_MAKER/TAKE_PROFIT/TAKE_PROFIT_LIMIT` order and the other must be `STOP_LOSS` or `STOP_LOSS_LIMIT` order. +- Price restrictions: + - If the OCO is on the `SELL` side: + - `LIMIT_MAKER/TAKE_PROFIT_LIMIT` `price` > Last Traded Price > `STOP_LOSS/STOP_LOSS_LIMIT` `stopPrice` + - `TAKE_PROFIT stopPrice` > Last Traded Price > `STOP_LOSS/STOP_LOSS_LIMIT stopPrice` + - If the OCO is on the `BUY` side: + - `LIMIT_MAKER` `price` < Last Traded Price < `STOP_LOSS/STOP_LOSS_LIMIT` `stopPrice` + - `TAKE_PROFIT stopPrice` > Last Traded Price > `STOP_LOSS/STOP_LOSS_LIMIT stopPrice` +- OCOs add **2 orders** to the `EXCHANGE_MAX_ORDERS` filter and `MAX_NUM_ORDERS` filter. + +**Weight:** 1 + +**Unfilled Order Count:** 2 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +`symbol` + +STRING + +YES + +`listClientOrderId` + +STRING + +NO + +Arbitrary unique ID among open order lists. Automatically generated if not sent. +A new order list with the same `listClientOrderId` is accepted only when the previous one is filled or completely expired. +`listClientOrderId` is distinct from the `aboveClientOrderId` and the `belowCLientOrderId`. + +`side` + +ENUM + +YES + +`BUY` or `SELL` + +`quantity` + +DECIMAL + +YES + +Quantity for both orders of the order list. + +`aboveType` + +ENUM + +YES + +Supported values: `STOP_LOSS_LIMIT`, `STOP_LOSS`, `LIMIT_MAKER`, `TAKE_PROFIT`, `TAKE_PROFIT_LIMIT` + +`aboveClientOrderId` + +STRING + +NO + +Arbitrary unique ID among open orders for the above order. Automatically generated if not sent + +`aboveIcebergQty` + +LONG + +NO + +Note that this can only be used if `aboveTimeInForce` is `GTC`. + +`abovePrice` + +DECIMAL + +NO + +Can be used if `aboveType` is `STOP_LOSS_LIMIT` , `LIMIT_MAKER`, or `TAKE_PROFIT_LIMIT` to specify the limit price. + +`aboveStopPrice` + +DECIMAL + +NO + +Can be used if `aboveType` is `STOP_LOSS`, `STOP_LOSS_LIMIT`, `TAKE_PROFIT`, `TAKE_PROFIT_LIMIT`. +Either `aboveStopPrice` or `aboveTrailingDelta` or both, must be specified. + +`aboveTrailingDelta` + +LONG + +NO + +See [Trailing Stop order FAQ](https://developers.binance.com/docs/binance-spot-api-docs/faqs/trailing-stop-faq). + +`aboveTimeInForce` + +ENUM + +NO + +Required if `aboveType` is `STOP_LOSS_LIMIT` or `TAKE_PROFIT_LIMIT`. + +`aboveStrategyId` + +LONG + +NO + +Arbitrary numeric value identifying the above order within an order strategy. + +`aboveStrategyType` + +INT + +NO + +Arbitrary numeric value identifying the above order strategy. +Values smaller than 1000000 are reserved and cannot be used. + +`abovePegPriceType` + +ENUM + +NO + +See [Pegged Orders](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests) + +`abovePegOffsetType` + +ENUM + +NO + +`abovePegOffsetValue` + +INT + +NO + +`belowType` + +ENUM + +YES + +Supported values: `STOP_LOSS`, `STOP_LOSS_LIMIT`, `TAKE_PROFIT`,`TAKE_PROFIT_LIMIT` + +`belowClientOrderId` + +STRING + +NO + +`belowIcebergQty` + +LONG + +NO + +Note that this can only be used if `belowTimeInForce` is `GTC`. + +`belowPrice` + +DECIMAL + +NO + +Can be used if `belowType` is `STOP_LOSS_LIMIT` , `LIMIT_MAKER`, or `TAKE_PROFIT_LIMIT` to specify the limit price. + +`belowStopPrice` + +DECIMAL + +NO + +Can be used if `belowType` is `STOP_LOSS`, `STOP_LOSS_LIMIT`, `TAKE_PROFIT` or `TAKE_PROFIT_LIMIT`. +Either `belowStopPrice` or `belowTrailingDelta` or both, must be specified. + +`belowTrailingDelta` + +LONG + +NO + +See [Trailing Stop order FAQ](https://developers.binance.com/docs/binance-spot-api-docs/faqs/trailing-stop-faq). + +`belowTimeInForce` + +ENUM + +NO + +Required if `belowType` is `STOP_LOSS_LIMIT` or `TAKE_PROFIT_LIMIT` + +`belowStrategyId` + +LONG + +NO + +Arbitrary numeric value identifying the below order within an order strategy. + +`belowStrategyType` + +INT + +NO + +Arbitrary numeric value identifying the below order strategy. +Values smaller than 1000000 are reserved and cannot be used. + +`belowPegPriceType` + +ENUM + +NO + +See [Pegged Orders](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests) + +`belowPegOffsetType` + +ENUM + +NO + +`belowPegOffsetValue` + +INT + +NO + +`newOrderRespType` + +ENUM + +NO + +Select response format: `ACK`, `RESULT`, `FULL` + +`selfTradePreventionMode` + +ENUM + +NO + +The allowed enums is dependent on what is configured on the symbol. The possible supported values are: [STP Modes](https://developers.binance.com/docs/binance-spot-api-docs/enums). + +`apiKey` + +STRING + +YES + +`recvWindow` + +DECIMAL + +NO + +The value cannot be greater than `60000`. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +`timestamp` + +LONG + +YES + +`signature` + +STRING + +YES + +**Data Source:** Matching Engine + +**Response:** + +Response format for `orderReports` is selected using the `newOrderRespType` parameter. The following example is for `RESULT` response type. See [`order.place`](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests) for more examples. + +``` +{ "id": "56374a46-3261-486b-a211-99ed972eb648", "status": 200, "result": { "orderListId": 2, "contingencyType": "OCO", "listStatusType": "EXEC_STARTED", "listOrderStatus": "EXECUTING", "listClientOrderId": "cKPMnDCbcLQILtDYM4f4fX", "transactionTime": 1711062760648, "symbol": "LTCBNB", "orders": [ { "symbol": "LTCBNB", "orderId": 2, "clientOrderId": "0m6I4wfxvTUrOBSMUl0OPU" }, { "symbol": "LTCBNB", "orderId": 3, "clientOrderId": "Z2IMlR79XNY5LU0tOxrWyW" } ], "orderReports": [ { "symbol": "LTCBNB", "orderId": 2, "orderListId": 2, "clientOrderId": "0m6I4wfxvTUrOBSMUl0OPU", "transactTime": 1711062760648, "price": "1.50000000", "origQty": "1.000000", "executedQty": "0.000000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "0.00000000", "status": "NEW", "timeInForce": "GTC", "type": "STOP_LOSS_LIMIT", "side": "BUY", "stopPrice": "1.50000001", "workingTime": -1, "selfTradePreventionMode": "NONE" }, { "symbol": "LTCBNB", "orderId": 3, "orderListId": 2, "clientOrderId": "Z2IMlR79XNY5LU0tOxrWyW", "transactTime": 1711062760648, "price": "1.49999999", "origQty": "1.000000", "executedQty": "0.000000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "0.00000000", "status": "NEW", "timeInForce": "GTC", "type": "LIMIT_MAKER", "side": "BUY", "workingTime": 1711062760648, "selfTradePreventionMode": "NONE" } ] }, "rateLimits": [ { "rateLimitType": "ORDERS", "interval": "SECOND", "intervalNum": 10, "limit": 50, "count": 2 }, { "rateLimitType": "ORDERS", "interval": "DAY", "intervalNum": 1, "limit": 160000, "count": 2 }, { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 1 } ]} +``` + +#### Place new Order list - OTO (TRADE)[​](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests) + +``` +{ "id": "1712544395950", "method": "orderList.place.oto", "params": { "signature": "3e1e5ac8690b0caf9a2afd5c5de881ceba69939cc9d817daead5386bf65d0cbb", "apiKey": "Rf07JlnL9PHVxjs27O5CvKNyOsV4qJ5gXdrRfpvlOdvMZbGZbPO5Ce2nIwfRP0iA", "pendingQuantity": 1, "pendingSide": "BUY", "pendingType": "MARKET", "symbol": "LTCBNB", "recvWindow": "5000", "timestamp": "1712544395951", "workingPrice": 1, "workingQuantity": 1, "workingSide": "SELL", "workingTimeInForce": "GTC", "workingType": "LIMIT" }} +``` + +Places an OTO. + +- 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 `EXCHANGE_MAX_NUM_ORDERS` filter and `MAX_NUM_ORDERS` filter. + +**Weight:** 1 + +**Unfilled Order Count:** 2 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +`symbol` + +STRING + +YES + +`listClientOrderId` + +STRING + +NO + +Arbitrary unique ID among open order lists. Automatically generated if not sent. +A new order list with the same listClientOrderId is accepted only when the previous one is filled or completely expired. +`listClientOrderId` is distinct from the `workingClientOrderId` and the `pendingClientOrderId`. + +`newOrderRespType` + +ENUM + +NO + +Format of the JSON response. Supported values: [Order Response Type](https://developers.binance.com/docs/binance-spot-api-docs/enums) + +`selfTradePreventionMode` + +ENUM + +NO + +The allowed values are dependent on what is configured on the symbol. Supported values: [STP Modes](https://developers.binance.com/docs/binance-spot-api-docs/enums) + +`workingType` + +ENUM + +YES + +Supported values: `LIMIT`,`LIMIT_MAKER` + +`workingSide` + +ENUM + +YES + +Supported values: [Order side](https://developers.binance.com/docs/binance-spot-api-docs/enums) + +`workingClientOrderId` + +STRING + +NO + +Arbitrary unique ID among open orders for the working order. +Automatically generated if not sent. + +`workingPrice` + +DECIMAL + +YES + +`workingQuantity` + +DECIMAL + +YES + +Sets the quantity for the working order. + +`workingIcebergQty` + +DECIMAL + +NO + +This can only be used if `workingTimeInForce` is `GTC`, or if `workingType` is `LIMIT_MAKER`. + +`workingTimeInForce` + +ENUM + +NO + +Supported values: [Time In Force](https://developers.binance.com/docs/binance-spot-api-docs/enums) + +`workingStrategyId` + +LONG + +NO + +Arbitrary numeric value identifying the working order within an order strategy. + +`workingStrategyType` + +INT + +NO + +Arbitrary numeric value identifying the working order strategy. +Values smaller than 1000000 are reserved and cannot be used. + +`workingPegPriceType` + +ENUM + +NO + +See [Pegged Orders](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests) + +`workingPegOffsetType` + +ENUM + +NO + +`workingPegOffsetValue` + +INT + +NO + +`pendingType` + +ENUM + +YES + +Supported values: [Order types](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests). +Note that `MARKET` orders using `quoteOrderQty` are not supported. + +`pendingSide` + +ENUM + +YES + +Supported values: [Order side](https://developers.binance.com/docs/binance-spot-api-docs/enums) + +`pendingClientOrderId` + +STRING + +NO + +Arbitrary unique ID among open orders for the pending order. +Automatically generated if not sent. + +`pendingPrice` + +DECIMAL + +NO + +`pendingStopPrice` + +DECIMAL + +NO + +`pendingTrailingDelta` + +DECIMAL + +NO + +`pendingQuantity` + +DECIMAL + +YES + +Sets the quantity for the pending order. + +`pendingIcebergQty` + +DECIMAL + +NO + +This can only be used if `pendingTimeInForce` is `GTC`, or if `pendingType` is `LIMIT_MAKER`. + +`pendingTimeInForce` + +ENUM + +NO + +Supported values: [Time In Force](https://developers.binance.com/docs/binance-spot-api-docs/enums) + +`pendingStrategyId` + +LONG + +NO + +Arbitrary numeric value identifying the pending order within an order strategy. + +`pendingStrategyType` + +INT + +NO + +Arbitrary numeric value identifying the pending order strategy. +Values smaller than 1000000 are reserved and cannot be used. + +`pendingPegOffsetType` + +ENUM + +NO + +See [Pegged Orders](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests) + +`pendingPegPriceType` + +ENUM + +NO + +`pendingPegOffsetValue` + +INT + +NO + +`recvWindow` + +DECIMAL + +NO + +The value cannot be greater than `60000`. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +`timestamp` + +LONG + +YES + +`signature` + +STRING + +YES + +**Mandatory parameters based on `pendingType` or `workingType`** + +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` + +**Data Source:** Matching Engine + +**Response:** + +``` +{ "id": "1712544395950", "status": 200, "result": { "orderListId": 626, "contingencyType": "OTO", "listStatusType": "EXEC_STARTED", "listOrderStatus": "EXECUTING", "listClientOrderId": "KA4EBjGnzvSwSCQsDdTrlf", "transactionTime": 1712544395981, "symbol": "1712544378871", "orders": [ { "symbol": "LTCBNB", "orderId": 13, "clientOrderId": "YiAUtM9yJjl1a2jXHSp9Ny" }, { "symbol": "LTCBNB", "orderId": 14, "clientOrderId": "9MxJSE1TYkmyx5lbGLve7R" } ], "orderReports": [ { "symbol": "LTCBNB", "orderId": 13, "orderListId": 626, "clientOrderId": "YiAUtM9yJjl1a2jXHSp9Ny", "transactTime": 1712544395981, "price": "1.000000", "origQty": "1.000000", "executedQty": "0.000000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "0.000000", "status": "NEW", "timeInForce": "GTC", "type": "LIMIT", "side": "SELL", "workingTime": 1712544395981, "selfTradePreventionMode": "NONE" }, { "symbol": "LTCBNB", "orderId": 14, "orderListId": 626, "clientOrderId": "9MxJSE1TYkmyx5lbGLve7R", "transactTime": 1712544395981, "price": "0.000000", "origQty": "1.000000", "executedQty": "0.000000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "0.000000", "status": "PENDING_NEW", "timeInForce": "GTC", "type": "MARKET", "side": "BUY", "workingTime": -1, "selfTradePreventionMode": "NONE" } ] }, "rateLimits": [ { "rateLimitType": "ORDERS", "interval": "MINUTE", "intervalNum": 1, "limit": 10000000, "count": 10 }, { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 1000, "count": 38 } ]} +``` + +**Note:** The payload above does not show all fields that can appear. Please refer to [Conditional fields in Order Responses](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests). + +#### Place new Order list - OTOCO (TRADE)[​](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests) + +``` +{ "id": "1712544408508", "method": "orderList.place.otoco", "params": { "signature": "c094473304374e1b9c5f7e2558358066cfa99df69f50f63d09cfee755136cb07", "apiKey": "Rf07JlnL9PHVxjs27O5CvKNyOsV4qJ5gXdrRfpvlOdvMZbGZbPO5Ce2nIwfRP0iA", "pendingQuantity": 5, "pendingSide": "SELL", "pendingBelowPrice": 5, "pendingBelowType": "LIMIT_MAKER", "pendingAboveStopPrice": 0.5, "pendingAboveType": "STOP_LOSS", "symbol": "LTCBNB", "recvWindow": "5000", "timestamp": "1712544408509", "workingPrice": 1.5, "workingQuantity": 1, "workingSide": "BUY", "workingTimeInForce": "GTC", "workingType": "LIMIT" }} +``` + +Place an OTOCO. + +- 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](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests). +- 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](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests). +- OTOCOs add **3 orders** to the `EXCHANGE_MAX_NUM_ORDERS` filter and `MAX_NUM_ORDERS` filter. + +**Weight:** 1 + +**Unfilled Order Count:** 3 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +`symbol` + +STRING + +YES + +`listClientOrderId` + +STRING + +NO + +Arbitrary unique ID among open order lists. Automatically generated if not sent. +A new order list with the same listClientOrderId is accepted only when the previous one is filled or completely expired. +`listClientOrderId` is distinct from the `workingClientOrderId`, `pendingAboveClientOrderId`, and the `pendingBelowClientOrderId`. + +`newOrderRespType` + +ENUM + +NO + +Format of the JSON response. Supported values: [Order Response Type](https://developers.binance.com/docs/binance-spot-api-docs/enums) + +`selfTradePreventionMode` + +ENUM + +NO + +The allowed values are dependent on what is configured on the symbol. Supported values: [STP Modes](https://developers.binance.com/docs/binance-spot-api-docs/enums) + +`workingType` + +ENUM + +YES + +Supported values: `LIMIT`, `LIMIT_MAKER` + +`workingSide` + +ENUM + +YES + +Supported values: [Order Side](https://developers.binance.com/docs/binance-spot-api-docs/enums) + +`workingClientOrderId` + +STRING + +NO + +Arbitrary unique ID among open orders for the working order. +Automatically generated if not sent. + +`workingPrice` + +DECIMAL + +YES + +`workingQuantity` + +DECIMAL + +YES + +`workingIcebergQty` + +DECIMAL + +NO + +This can only be used if `workingTimeInForce` is `GTC`. + +`workingTimeInForce` + +ENUM + +NO + +Supported values: [Time In Force](https://developers.binance.com/docs/binance-spot-api-docs/enums) + +`workingStrategyId` + +LONG + +NO + +Arbitrary numeric value identifying the working order within an order strategy. + +`workingStrategyType` + +INT + +NO + +Arbitrary numeric value identifying the working order strategy. +Values smaller than 1000000 are reserved and cannot be used. + +`workingPegPriceType` + +ENUM + +NO + +See [Pegged Orders](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests) + +`workingPegOffsetType` + +ENUM + +NO + +`workingPegOffsetValue` + +INT + +NO + +`pendingSide` + +ENUM + +YES + +Supported values: [Order Side](https://developers.binance.com/docs/binance-spot-api-docs/enums) + +`pendingQuantity` + +DECIMAL + +YES + +`pendingAboveType` + +ENUM + +YES + +Supported values: `STOP_LOSS_LIMIT`, `STOP_LOSS`, `LIMIT_MAKER`, `TAKE_PROFIT`, `TAKE_PROFIT_LIMIT` + +`pendingAboveClientOrderId` + +STRING + +NO + +Arbitrary unique ID among open orders for the pending above order. +Automatically generated if not sent. + +`pendingAbovePrice` + +DECIMAL + +NO + +Can be used if `pendingAboveType` is `STOP_LOSS_LIMIT` , `LIMIT_MAKER`, or `TAKE_PROFIT_LIMIT` to specify the limit price. + +`pendingAboveStopPrice` + +DECIMAL + +NO + +Can be used if `pendingAboveType` is `STOP_LOSS`, `STOP_LOSS_LIMIT`, `TAKE_PROFIT`, `TAKE_PROFIT_LIMIT` + +`pendingAboveTrailingDelta` + +DECIMAL + +NO + +See [Trailing Stop FAQ](https://developers.binance.com/docs/binance-spot-api-docs/faqs/trailing-stop-faq) + +`pendingAboveIcebergQty` + +DECIMAL + +NO + +This can only be used if `pendingAboveTimeInForce` is `GTC` or if `pendingAboveType` is `LIMIT_MAKER`. + +`pendingAboveTimeInForce` + +ENUM + +NO + +`pendingAboveStrategyId` + +LONG + +NO + +Arbitrary numeric value identifying the pending above order within an order strategy. + +`pendingAboveStrategyType` + +INT + +NO + +Arbitrary numeric value identifying the pending above order strategy. +Values smaller than 1000000 are reserved and cannot be used. + +`pendingAbovePegPriceType` + +ENUM + +NO + +See [Pegged Orders](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests) + +`pendingAbovePegOffsetType` + +ENUM + +NO + +`pendingAbovePegOffsetValue` + +INT + +NO + +`pendingBelowType` + +ENUM + +NO + +Supported values: `STOP_LOSS`, `STOP_LOSS_LIMIT`, `TAKE_PROFIT`,`TAKE_PROFIT_LIMIT` + +`pendingBelowClientOrderId` + +STRING + +NO + +Arbitrary unique ID among open orders for the pending below order. +Automatically generated if not sent. + +`pendingBelowPrice` + +DECIMAL + +NO + +Can be used if `pendingBelowType` is `STOP_LOSS_LIMIT` or `TAKE_PROFIT_LIMIT` to specify the limit price. + +`pendingBelowStopPrice` + +DECIMAL + +NO + +Can be used if `pendingBelowType` is `STOP_LOSS`, `STOP_LOSS_LIMIT, TAKE_PROFIT or TAKE_PROFIT_LIMIT`. +Either `pendingBelowStopPrice` or `pendingBelowTrailingDelta` or both, must be specified. + +`pendingBelowTrailingDelta` + +DECIMAL + +NO + +`pendingBelowIcebergQty` + +DECIMAL + +NO + +This can only be used if `pendingBelowTimeInForce` is `GTC`, or if `pendingBelowType` is `LIMIT_MAKER`. + +`pendingBelowTimeInForce` + +ENUM + +NO + +Supported values: [Time In Force](https://developers.binance.com/docs/binance-spot-api-docs/enums) + +`pendingBelowStrategyId` + +LONG + +NO + +Arbitrary numeric value identifying the pending below order within an order strategy. + +`pendingBelowStrategyType` + +INT + +NO + +Arbitrary numeric value identifying the pending below order strategy. +Values smaller than 1000000 are reserved and cannot be used. + +`pendingBelowPegPriceType` + +ENUM + +NO + +See [Pegged Orders](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests) + +`pendingBelowPegOffsetType` + +ENUM + +NO + +`pendingBelowPegOffsetValue` + +INT + +NO + +`recvWindow` + +DECIMAL + +NO + +The value cannot be greater than `60000`. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +`timestamp` + +LONG + +YES + +`signature` + +STRING + +YES + +**Mandatory parameters based on `pendingAboveType`, `pendingBelowType` or `workingType`** + +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/TAKE_PROFIT` + +`pendingAboveStopPrice` and/or `pendingAboveTrailingDelta` + +`pendingAboveType=STOP_LOSS_LIMIT/TAKE_PROFIT_LIMIT` + +`pendingAbovePrice`, `pendingAboveStopPrice` and/or `pendingAboveTrailingDelta`, `pendingAboveTimeInForce` + +`pendingBelowType`\= `LIMIT_MAKER` + +`pendingBelowPrice` + +`pendingBelowType= STOP_LOSS/TAKE_PROFIT` + +`pendingBelowStopPrice` and/or `pendingBelowTrailingDelta` + +`pendingBelowType=STOP_LOSS_LIMIT/TAKE_PROFIT_LIMIT` + +`pendingBelowPrice`, `pendingBelowStopPrice` and/or `pendingBelowTrailingDelta`, `pendingBelowTimeInForce` + +**Data Source:** Matching Engine + +**Response:** + +``` +{ "id": "1712544408508", "status": 200, "result": { "orderListId": 629, "contingencyType": "OTO", "listStatusType": "EXEC_STARTED", "listOrderStatus": "EXECUTING", "listClientOrderId": "GaeJHjZPasPItFj4x7Mqm6", "transactionTime": 1712544408537, "symbol": "1712544378871", "orders": [ { "symbol": "LTCBNB", "orderId": 23, "clientOrderId": "OVQOpKwfmPCfaBTD0n7e7H" }, { "symbol": "LTCBNB", "orderId": 24, "clientOrderId": "YcCPKCDMQIjNvLtNswt82X" }, { "symbol": "LTCBNB", "orderId": 25, "clientOrderId": "ilpIoShcFZ1ZGgSASKxMPt" } ], "orderReports": [ { "symbol": "LTCBNB", "orderId": 23, "orderListId": 629, "clientOrderId": "OVQOpKwfmPCfaBTD0n7e7H", "transactTime": 1712544408537, "price": "1.500000", "origQty": "1.000000", "executedQty": "0.000000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "0.000000", "status": "NEW", "timeInForce": "GTC", "type": "LIMIT", "side": "BUY", "workingTime": 1712544408537, "selfTradePreventionMode": "NONE" }, { "symbol": "LTCBNB", "orderId": 24, "orderListId": 629, "clientOrderId": "YcCPKCDMQIjNvLtNswt82X", "transactTime": 1712544408537, "price": "0.000000", "origQty": "5.000000", "executedQty": "0.000000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "0.000000", "status": "PENDING_NEW", "timeInForce": "GTC", "type": "STOP_LOSS", "side": "SELL", "stopPrice": "0.500000", "workingTime": -1, "selfTradePreventionMode": "NONE" }, { "symbol": "LTCBNB", "orderId": 25, "orderListId": 629, "clientOrderId": "ilpIoShcFZ1ZGgSASKxMPt", "transactTime": 1712544408537, "price": "5.000000", "origQty": "5.000000", "executedQty": "0.000000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "0.000000", "status": "PENDING_NEW", "timeInForce": "GTC", "type": "LIMIT_MAKER", "side": "SELL", "workingTime": -1, "selfTradePreventionMode": "NONE" } ] }, "rateLimits": [ { "rateLimitType": "ORDERS", "interval": "MINUTE", "intervalNum": 1, "limit": 10000000, "count": 18 }, { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 1000, "count": 65 } ]} +``` + +**Note:** The payload above does not show all fields that can appear. Please refer to [Conditional fields in Order Responses](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests). + +#### OPO (TRADE)[​](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests) + +``` +{ "id": "1762941318128", "method": "orderList.place.opo", "params": { "workingPrice": "101496", "workingQuantity": "0.0007", "workingType": "LIMIT", "workingTimeInForce": "GTC", "pendingType": "MARKET", "pendingSide": "SELL", "recvWindow": 5000, "workingSide": "BUY", "symbol": "BTCUSDT", "timestamp": 1762941318129, "apiKey": "aHb4Ur1cK1biW3sgibqUFs39SE58f9d5Xwf4uEW0tFh7ibun5g035QKSktxoOBfE", "signature": "b50ce8977333a78a3bbad21df178d7e104a8c985d19007b55df688cdf868639a" }} +``` + +Place an [OPO](https://developers.binance.com/docs/binance-spot-api-docs/faqs/opo). + +- OPOs add 2 orders to the EXCHANGE\_MAX\_NUM\_ORDERS filter and MAX\_NUM\_ORDERS filter. + +**Weight:** 1 + +**Unfilled Order Count:** 2 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +`symbol` + +STRING + +YES + +`listClientOrderId` + +STRING + +NO + +Arbitrary unique ID among open order lists. Automatically generated if not sent. A new order list with the same listClientOrderId is accepted only when the previous one is filled or completely expired. `listClientOrderId` is distinct from the `workingClientOrderId` and the `pendingClientOrderId`. + +`newOrderRespType` + +ENUM + +NO + +Format of the JSON response. Supported values: [Order Response Type](https://developers.binance.com/docs/binance-spot-api-docs/enums) + +`selfTradePreventionMode` + +ENUM + +NO + +The allowed values are dependent on what is configured on the symbol. Supported values: [STP Modes](https://developers.binance.com/docs/binance-spot-api-docs/enums) + +`workingType` + +ENUM + +YES + +Supported values: `LIMIT`,`LIMIT_MAKER` + +`workingSide` + +ENUM + +YES + +Supported values: [Order Side](https://developers.binance.com/docs/binance-spot-api-docs/enums) + +`workingClientOrderId` + +STRING + +NO + +Arbitrary unique ID among open orders for the working order. Automatically generated if not sent. + +`workingPrice` + +DECIMAL + +YES + +`workingQuantity` + +DECIMAL + +YES + +Sets the quantity for the working order. + +`workingIcebergQty` + +DECIMAL + +NO + +This can only be used if `workingTimeInForce` is `GTC`, or if `workingType` is `LIMIT_MAKER`. + +`workingTimeInForce` + +ENUM + +NO + +Supported values: [Time In Force](https://developers.binance.com/docs/binance-spot-api-docs/enums) + +`workingStrategyId` + +LONG + +NO + +Arbitrary numeric value identifying the working order within an order strategy. + +`workingStrategyType` + +INT + +NO + +Arbitrary numeric value identifying the working order strategy. Values smaller than 1000000 are reserved and cannot be used. + +`workingPegPriceType` + +ENUM + +NO + +See [Pegged Orders](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests) + +`workingPegOffsetType` + +ENUM + +NO + +`workingPegOffsetValue` + +INT + +NO + +`pendingType` + +ENUM + +YES + +Supported values: [Order Types](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests) Note that `MARKET` orders using `quoteOrderQty` are not supported. + +`pendingSide` + +ENUM + +YES + +Supported values: [Order Side](https://developers.binance.com/docs/binance-spot-api-docs/enums) + +`pendingClientOrderId` + +STRING + +NO + +Arbitrary unique ID among open orders for the pending order. Automatically generated if not sent. + +`pendingPrice` + +DECIMAL + +NO + +`pendingStopPrice` + +DECIMAL + +NO + +`pendingTrailingDelta` + +DECIMAL + +NO + +`pendingIcebergQty` + +DECIMAL + +NO + +This can only be used if `pendingTimeInForce` is `GTC` or if `pendingType` is `LIMIT_MAKER`. + +`pendingTimeInForce` + +ENUM + +NO + +Supported values: [Time In Force](https://developers.binance.com/docs/binance-spot-api-docs/enums) + +`pendingStrategyId` + +LONG + +NO + +Arbitrary numeric value identifying the pending order within an order strategy. + +`pendingStrategyType` + +INT + +NO + +Arbitrary numeric value identifying the pending order strategy. Values smaller than 1000000 are reserved and cannot be used. + +`pendingPegPriceType` + +ENUM + +NO + +See [Pegged Orders](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests) + +`pendingPegOffsetType` + +ENUM + +NO + +`pendingPegOffsetValue` + +INT + +NO + +`recvWindow` + +DECIMAL + +NO + +The value cannot be greater than `60000`. Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +`timestamp` + +LONG + +YES + +**Data Source**: Matching Engine + +**Response:** + +``` +{ "id": "1762941318128", "status": 200, "result": { "orderListId": 2, "contingencyType": "OTO", "listStatusType": "EXEC_STARTED", "listOrderStatus": "EXECUTING", "listClientOrderId": "OiOgqvRagBefpzdM5gjYX3", "transactionTime": 1762941318142, "symbol": "BTCUSDT", "orders": [ { "symbol": "BTCUSDT", "orderId": 2, "clientOrderId": "pUzhKBbc0ZVdMScIRAqitH" }, { "symbol": "BTCUSDT", "orderId": 3, "clientOrderId": "x7ISSjywZxFXOdzwsThNnd" } ], "orderReports": [ { "symbol": "BTCUSDT", "orderId": 2, "orderListId": 2, "clientOrderId": "pUzhKBbc0ZVdMScIRAqitH", "transactTime": 1762941318142, "price": "101496.00000000", "origQty": "0.00070000", "executedQty": "0.00000000", "origQuoteOrderQty": "0.00000000", "cummulativeQuoteQty": "0.00000000", "status": "NEW", "timeInForce": "GTC", "type": "LIMIT", "side": "BUY", "workingTime": 1762941318142, "selfTradePreventionMode": "NONE" }, { "symbol": "BTCUSDT", "orderId": 3, "orderListId": 2, "clientOrderId": "x7ISSjywZxFXOdzwsThNnd", "transactTime": 1762941318142, "price": "0.00000000", "executedQty": "0.00000000", "origQuoteOrderQty": "0.00000000", "cummulativeQuoteQty": "0.00000000", "status": "PENDING_NEW", "timeInForce": "GTC", "type": "MARKET", "side": "SELL", "workingTime": -1, "selfTradePreventionMode": "NONE" } ] }} +``` + +**Note:** The payload above does not show all fields that can appear. Please refer to [Conditional fields in Order Responses](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests). + +#### OPOCO (TRADE)[​](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests) + +``` +{ "id": "1763000139090", "method": "orderList.place.opoco", "params": { "workingPrice": "102496", "workingQuantity": "0.0017", "workingType": "LIMIT", "workingTimeInForce": "GTC", "pendingAboveType": "LIMIT_MAKER", "pendingAbovePrice": "104261", "pendingBelowStopPrice": "10100", "pendingBelowPrice": "101613", "pendingBelowType": "STOP_LOSS_LIMIT", "pendingBelowTimeInForce": "IOC", "pendingSide": "SELL", "recvWindow": 5000, "workingSide": "BUY", "symbol": "BTCUSDT", "timestamp": 1763000139091, "apiKey": "2wiKgTLyllTCu0QWXaEtKWX9tUQ5iQMiDQqTQPdUe2bZ1IVT9aXoS6o19wkYIKl2", "signature": "adfa185c50f793392a54ad5a6e2c39fd34ef6d35944adf2ddd6f30e1866e58d3" }} +``` + +Place an [OPOCO](https://developers.binance.com/docs/binance-spot-api-docs/faqs/opo). + +**Weight**: 1 + +**Unfilled Order Count:** 3 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +`symbol` + +STRING + +YES + +`listClientOrderId` + +STRING + +NO + +Arbitrary unique ID among open order lists. Automatically generated if not sent. A new order list with the same listClientOrderId is accepted only when the previous one is filled or completely expired. `listClientOrderId` is distinct from the `workingClientOrderId`, `pendingAboveClientOrderId`, and the `pendingBelowClientOrderId`. + +`newOrderRespType` + +ENUM + +NO + +Format of the JSON response. Supported values: [Order Response Type](https://developers.binance.com/docs/binance-spot-api-docs/enums) + +`selfTradePreventionMode` + +ENUM + +NO + +The allowed values are dependent on what is configured on the symbol. Supported values: [STP Modes](https://developers.binance.com/docs/binance-spot-api-docs/enums) + +`workingType` + +ENUM + +YES + +Supported values: `LIMIT`, `LIMIT_MAKER` + +`workingSide` + +ENUM + +YES + +Supported values: [Order side](https://developers.binance.com/docs/binance-spot-api-docs/enums) + +`workingClientOrderId` + +STRING + +NO + +Arbitrary unique ID among open orders for the working order. Automatically generated if not sent. + +`workingPrice` + +DECIMAL + +YES + +`workingQuantity` + +DECIMAL + +YES + +`workingIcebergQty` + +DECIMAL + +NO + +This can only be used if `workingTimeInForce` is `GTC`, or if `workingType` is `LIMIT_MAKER`. + +`workingTimeInForce` + +ENUM + +NO + +Supported values: [Time In Force](https://developers.binance.com/docs/binance-spot-api-docs/enums) + +`workingStrategyId` + +LONG + +NO + +Arbitrary numeric value identifying the working order within an order strategy. + +`workingStrategyType` + +INT + +NO + +Arbitrary numeric value identifying the working order strategy. Values smaller than 1000000 are reserved and cannot be used. + +`workingPegPriceType` + +ENUM + +NO + +See [Pegged Orders](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests) + +`workingPegOffsetType` + +ENUM + +NO + +`workingPegOffsetValue` + +INT + +NO + +`pendingSide` + +ENUM + +YES + +Supported values: [Order side](https://developers.binance.com/docs/binance-spot-api-docs/enums) + +`pendingAboveType` + +ENUM + +YES + +Supported values: `STOP_LOSS_LIMIT`, `STOP_LOSS`, `LIMIT_MAKER`, `TAKE_PROFIT`, `TAKE_PROFIT_LIMIT` + +`pendingAboveClientOrderId` + +STRING + +NO + +Arbitrary unique ID among open orders for the pending above order. Automatically generated if not sent. + +`pendingAbovePrice` + +DECIMAL + +NO + +Can be used if `pendingAboveType` is `STOP_LOSS_LIMIT` , `LIMIT_MAKER`, or `TAKE_PROFIT_LIMIT` to specify the limit price. + +`pendingAboveStopPrice` + +DECIMAL + +NO + +Can be used if `pendingAboveType` is `STOP_LOSS`, `STOP_LOSS_LIMIT`, `TAKE_PROFIT`, `TAKE_PROFIT_LIMIT` + +`pendingAboveTrailingDelta` + +DECIMAL + +NO + +See [Trailing Stop FAQ](https://developers.binance.com/docs/binance-spot-api-docs/faqs/trailing-stop-faq) + +`pendingAboveIcebergQty` + +DECIMAL + +NO + +This can only be used if `pendingAboveTimeInForce` is `GTC` or if `pendingAboveType` is `LIMIT_MAKER`. + +`pendingAboveTimeInForce` + +ENUM + +NO + +`pendingAboveStrategyId` + +LONG + +NO + +Arbitrary numeric value identifying the pending above order within an order strategy. + +`pendingAboveStrategyType` + +INT + +NO + +Arbitrary numeric value identifying the pending above order strategy. Values smaller than 1000000 are reserved and cannot be used. + +`pendingAbovePegPriceType` + +ENUM + +NO + +See [Pegged Orders](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests) + +`pendingAbovePegOffsetType` + +ENUM + +NO + +`pendingAbovePegOffsetValue` + +INT + +NO + +`pendingBelowType` + +ENUM + +NO + +Supported values: `STOP_LOSS`, `STOP_LOSS_LIMIT`, `TAKE_PROFIT`,`TAKE_PROFIT_LIMIT` + +`pendingBelowClientOrderId` + +STRING + +NO + +Arbitrary unique ID among open orders for the pending below order. Automatically generated if not sent. + +`pendingBelowPrice` + +DECIMAL + +NO + +Can be used if `pendingBelowType` is `STOP_LOSS_LIMIT` or `TAKE_PROFIT_LIMIT` to specify limit price + +`pendingBelowStopPrice` + +DECIMAL + +NO + +Can be used if `pendingBelowType` is `STOP_LOSS`, `STOP_LOSS_LIMIT, TAKE_PROFIT or TAKE_PROFIT_LIMIT`. Either `pendingBelowStopPrice` or `pendingBelowTrailingDelta` or both, must be specified. + +`pendingBelowTrailingDelta` + +DECIMAL + +NO + +`pendingBelowIcebergQty` + +DECIMAL + +NO + +This can only be used if `pendingBelowTimeInForce` is `GTC`, or if `pendingBelowType` is `LIMIT_MAKER`. + +`pendingBelowTimeInForce` + +ENUM + +NO + +Supported values: [Time In Force](https://developers.binance.com/docs/binance-spot-api-docs/enums) + +`pendingBelowStrategyId` + +LONG + +NO + +Arbitrary numeric value identifying the pending below order within an order strategy. + +`pendingBelowStrategyType` + +INT + +NO + +Arbitrary numeric value identifying the pending below order strategy. Values smaller than 1000000 are reserved and cannot be used. + +`pendingBelowPegPriceType` + +ENUM + +NO + +See [Pegged Orders](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests) + +`pendingBelowPegOffsetType` + +ENUM + +NO + +`pendingBelowPegOffsetValue` + +INT + +NO + +`recvWindow` + +DECIMAL + +NO + +The value cannot be greater than `60000`. Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +`timestamp` + +LONG + +YES + +**Data Source**: Matching Engine + +**Response:** + +``` +{ "id": "1763000139090", "status": 200, "result": { "orderListId": 1, "contingencyType": "OTO", "listStatusType": "EXEC_STARTED", "listOrderStatus": "EXECUTING", "listClientOrderId": "TVbG6ymkYMXTj7tczbOsBf", "transactionTime": 1763000139104, "symbol": "BTCUSDT", "orders": [ { "symbol": "BTCUSDT", "orderId": 6, "clientOrderId": "3czuJSeyjPwV9Xo28j1Dv3" }, { "symbol": "BTCUSDT", "orderId": 7, "clientOrderId": "kyIKnMLKQclE5FmyYgaMSo" }, { "symbol": "BTCUSDT", "orderId": 8, "clientOrderId": "i76cGJWN9J1FpADS56TtQZ" } ], "orderReports": [ { "symbol": "BTCUSDT", "orderId": 6, "orderListId": 1, "clientOrderId": "3czuJSeyjPwV9Xo28j1Dv3", "transactTime": 1763000139104, "price": "102496.00000000", "origQty": "0.00170000", "executedQty": "0.00000000", "origQuoteOrderQty": "0.00000000", "cummulativeQuoteQty": "0.00000000", "status": "NEW", "timeInForce": "GTC", "type": "LIMIT", "side": "BUY", "workingTime": 1763000139104, "selfTradePreventionMode": "NONE" }, { "symbol": "BTCUSDT", "orderId": 7, "orderListId": 1, "clientOrderId": "kyIKnMLKQclE5FmyYgaMSo", "transactTime": 1763000139104, "price": "101613.00000000", "executedQty": "0.00000000", "origQuoteOrderQty": "0.00000000", "cummulativeQuoteQty": "0.00000000", "status": "PENDING_NEW", "timeInForce": "IOC", "type": "STOP_LOSS_LIMIT", "side": "SELL", "stopPrice": "10100.00000000", "workingTime": -1, "selfTradePreventionMode": "NONE" }, { "symbol": "BTCUSDT", "orderId": 8, "orderListId": 1, "clientOrderId": "i76cGJWN9J1FpADS56TtQZ", "transactTime": 1763000139104, "price": "104261.00000000", "executedQty": "0.00000000", "origQuoteOrderQty": "0.00000000", "cummulativeQuoteQty": "0.00000000", "status": "PENDING_NEW", "timeInForce": "GTC", "type": "LIMIT_MAKER", "side": "SELL", "workingTime": -1, "selfTradePreventionMode": "NONE" } ] }} +``` + +**Note:** The payload above does not show all fields that can appear. Please refer to [Conditional fields in Order Responses](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests). + +#### Cancel Order list (TRADE)[​](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests) + +``` +{ "id": "c5899911-d3f4-47ae-8835-97da553d27d0", "method": "orderList.cancel", "params": { "symbol": "BTCUSDT", "orderListId": 1274512, "apiKey": "vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A", "signature": "4973f4b2fee30bf6d45e4a973e941cc60fdd53c8dd5a25edeac96f5733c0ccee", "timestamp": 1660801720210 }} +``` + +Cancel an active order list. + +**Weight**: 1 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +`symbol` + +STRING + +YES + +`orderListId` + +INT + +YES + +Cancel order list by `orderListId` + +`listClientOrderId` + +STRING + +Cancel order list by `listClientId` + +`newClientOrderId` + +STRING + +NO + +New ID for the canceled order list. Automatically generated if not sent + +`apiKey` + +STRING + +YES + +`recvWindow` + +DECIMAL + +NO + +The value cannot be greater than 60000. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +`signature` + +STRING + +YES + +`timestamp` + +LONG + +YES + +Notes: + +- If both `orderListId` and `listClientOrderId` parameters are provided, the `orderListId` is searched first, then the `listClientOrderId` from that result is checked against that order. If both conditions are not met the request will be rejected. + +- Canceling an individual order with [`order.cancel`](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests) will cancel the entire order list as well. + + +**Data Source:** Matching Engine + +**Response:** + +``` +{ "id": "c5899911-d3f4-47ae-8835-97da553d27d0", "status": 200, "result": { "orderListId": 1274512, "contingencyType": "OCO", "listStatusType": "ALL_DONE", "listOrderStatus": "ALL_DONE", "listClientOrderId": "6023531d7edaad348f5aff", "transactionTime": 1660801720215, "symbol": "BTCUSDT", "orders": [ { "symbol": "BTCUSDT", "orderId": 12569138901, "clientOrderId": "BqtFCj5odMoWtSqGk2X9tU" }, { "symbol": "BTCUSDT", "orderId": 12569138902, "clientOrderId": "jLnZpj5enfMXTuhKB1d0us" } ], "orderReports": [ { "symbol": "BTCUSDT", "orderId": 12569138901, "orderListId": 1274512, "clientOrderId": "BqtFCj5odMoWtSqGk2X9tU", "transactTime": 1660801720215, "price": "23410.00000000", "origQty": "0.00650000", "executedQty": "0.00000000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "0.00000000", "status": "CANCELED", "timeInForce": "GTC", "type": "STOP_LOSS_LIMIT", "side": "SELL", "stopPrice": "23405.00000000", "selfTradePreventionMode": "NONE" }, { "symbol": "BTCUSDT", "orderId": 12569138902, "orderListId": 1274512, "clientOrderId": "jLnZpj5enfMXTuhKB1d0us", "transactTime": 1660801720215, "price": "23420.00000000", "origQty": "0.00650000", "executedQty": "0.00000000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "0.00000000", "status": "CANCELED", "timeInForce": "GTC", "type": "LIMIT_MAKER", "side": "SELL", "selfTradePreventionMode": "NONE" } ] }, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 1 } ]} +``` + +### SOR[​](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests) + +#### Place new order using SOR (TRADE)[​](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests) + +``` +{ "id": "3a4437e2-41a3-4c19-897c-9cadc5dce8b6", "method": "sor.order.place", "params": { "symbol": "BTCUSDT", "side": "BUY", "type": "LIMIT", "quantity": 0.5, "timeInForce": "GTC", "price": 31000, "timestamp": 1687485436575, "apiKey": "u5lgqJb97QWXWfgeV4cROuHbReSJM9rgQL0IvYcYc7BVeA5lpAqqc3a5p2OARIFk", "signature": "fd301899567bc9472ce023392160cdc265ad8fcbbb67e0ea1b2af70a4b0cd9c7" }} +``` + +Places an order using smart order routing (SOR). + +This adds 1 order to the `EXCHANGE_MAX_ORDERS` filter and the `MAX_NUM_ORDERS` filter. + +Read [SOR FAQ](https://developers.binance.com/docs/faqs/sor_faq) to learn more. + +**Weight:** 1 + +**Unfilled Order Count:** 1 + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +`symbol` + +STRING + +YES + +`side` + +ENUM + +YES + +`BUY` or `SELL` + +`type` + +ENUM + +YES + +`timeInForce` + +ENUM + +NO + +Applicable only to `LIMIT` order type + +`price` + +DECIMAL + +NO + +Applicable only to `LIMIT` order type + +`quantity` + +DECIMAL + +YES + +`newClientOrderId` + +STRING + +NO + +Arbitrary unique ID among open orders. Automatically generated if not sent + +`newOrderRespType` + +ENUM + +NO + +Select response format: `ACK`, `RESULT`, `FULL`. + +`MARKET` and `LIMIT` orders use `FULL` by default. + +`icebergQty` + +DECIMAL + +NO + +`strategyId` + +LONG + +NO + +Arbitrary numeric value identifying the order within an order strategy. + +`strategyType` + +INT + +NO + +Arbitrary numeric value identifying the order strategy. + +Values smaller than `1000000` are reserved and cannot be used. + +`selfTradePreventionMode` + +ENUM + +NO + +The allowed enums is dependent on what is configured on the symbol. The possible supported values are: [STP Modes](https://developers.binance.com/docs/binance-spot-api-docs/enums). + +`apiKey` + +STRING + +YES + +`timestamp` + +LONG + +YES + +`recvWindow` + +DECIMAL + +NO + +The value cannot be greater than `60000`. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +`signature` + +STRING + +YES + +**Note:** `sor.order.place` only supports `LIMIT` and `MARKET` orders. `quoteOrderQty` is not supported. + +**Data Source:** Matching Engine + +**Response:** + +``` +{ "id": "3a4437e2-41a3-4c19-897c-9cadc5dce8b6", "status": 200, "result": [ { "symbol": "BTCUSDT", "orderId": 2, "orderListId": -1, "clientOrderId": "sBI1KM6nNtOfj5tccZSKly", "transactTime": 1689149087774, "price": "31000.00000000", "origQty": "0.50000000", "executedQty": "0.50000000", "origQuoteOrderQty": "0.000000", "cummulativeQuoteQty": "14000.00000000", "status": "FILLED", "timeInForce": "GTC", "type": "LIMIT", "side": "BUY", "workingTime": 1689149087774, "fills": [ { "matchType": "ONE_PARTY_TRADE_REPORT", "price": "28000.00000000", "qty": "0.50000000", "commission": "0.00000000", "commissionAsset": "BTC", "tradeId": -1, "allocId": 0 } ], "workingFloor": "SOR", "selfTradePreventionMode": "NONE", "usedSor": true } ], "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 1 } ]} +``` + +#### Test new order using SOR (TRADE)[​](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests) + +``` +{ "id": "3a4437e2-41a3-4c19-897c-9cadc5dce8b6", "method": "sor.order.test", "params": { "symbol": "BTCUSDT", "side": "BUY", "type": "LIMIT", "quantity": 0.1, "timeInForce": "GTC", "price": 0.1, "timestamp": 1687485436575, "apiKey": "u5lgqJb97QWXWfgeV4cROuHbReSJM9rgQL0IvYcYc7BVeA5lpAqqc3a5p2OARIFk", "signature": "fd301899567bc9472ce023392160cdc265ad8fcbbb67e0ea1b2af70a4b0cd9c7" }} +``` + +Test new order creation and signature/recvWindow using smart order routing (SOR). Creates and validates a new order but does not send it into the matching engine. + +**Weight:** + +Condition + +Request Weight + +Without `computeCommissionRates` + +1 + +With `computeCommissionRates` + +20 + +**Parameters:** + +In addition to all parameters accepted by [`sor.order.place`](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests), the following optional parameters are also accepted: + +Name + +Type + +Mandatory + +Description + +`computeCommissionRates` + +BOOLEAN + +NO + +Default: `false` + +**Data Source:** Memory + +**Response:** + +Without `computeCommissionRates`: + +``` +{ "id": "3a4437e2-41a3-4c19-897c-9cadc5dce8b6", "status": 200, "result": {}, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 1 } ]} +``` + +With `computeCommissionRates`: + +``` +{ "id": "3a4437e2-41a3-4c19-897c-9cadc5dce8b6", "status": 200, "result": { "standardCommissionForOrder": { // Commission rates for the order depending on its role (e.g. maker or taker) "maker": "0.00000112", "taker": "0.00000114" }, "taxCommissionForOrder": { // Tax deduction rates for the order depending on its role (e.g. maker or taker) "maker": "0.00000112", "taker": "0.00000114" }, "discount": { // Discount on standard commissions when paying in BNB. "enabledForAccount": true, "enabledForSymbol": true, "discountAsset": "BNB", "discount": "0.25" // Standard commission is reduced by this rate when paying in BNB. } }, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "count": 20 } ]} +``` + +- [Place new order (TRADE)](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests) +- [Test new order (TRADE)](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests) +- [Cancel order (TRADE)](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests) +- [Cancel and replace order (TRADE)](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests) +- [Order Amend Keep Priority (TRADE)](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests) +- [Cancel open orders (TRADE)](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests) +- [Order lists](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests) +- [SOR](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests) diff --git a/docs/binance/binance-spot/websocket-api_user-data-stream-requests.md b/docs/binance/binance-spot/websocket-api_user-data-stream-requests.md new file mode 100644 index 0000000..d198ff5 --- /dev/null +++ b/docs/binance/binance-spot/websocket-api_user-data-stream-requests.md @@ -0,0 +1,164 @@ +--- +title: "User Data Stream requests | Binance Open Platform" +source: "https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/user-data-stream-requests" +fetched_at: "2026-02-26T10:38:13.543Z" +--- +### User Data Stream subscription[​](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/user-data-stream-requests) + +**General information:** + +- [User Data Stream](https://developers.binance.com/docs/binance-spot-api-docs/user-data-stream) subscriptions allow you to receive all the events related to a given account on a WebSocket connection. +- There are 2 ways to start a subscription: + - If you have an authenticated session, then you can subscribe to events for that authenticated account using [`userDataStream.subscribe`](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/user-data-stream-requests). + - In any session, authenticated or not, you can subscribe to events for one or more accounts for which you can provide an API Key signature, using [`userDataStream.subscribe.signature`](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/user-data-stream-requests). + - You can have only one active subscription for a given account on a given connection. +- Subscriptions are identified by a `subscriptionId` which is returned when starting the subscription. That `subscriptionId` allows you to map the events you receive to a given subscription. + - All active subscriptions for a session can be found using [`session.subscriptions`](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/user-data-stream-requests). +- Limits + - A single session supports **up to 1,000 active subscriptions** simultaneously. + - Attempting to start a new subscription beyond this limit will result in an error. + - If your accounts are very active, we suggest not opening too many subscriptions at once, in order to not overload your connection. + - A single session can handle a maximum of **65,535 total subscriptions** over its lifetime. + - If this limit is reached, you will receive an error and must re-establish a new connection to be able to start new subscriptions. +- To verify the status of User Data Stream subscriptions, check the `userDataStream` field in [`session.status`](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/user-data-stream-requests): + - `null` - User Data Stream subscriptions are **not available** on this WebSocket API. + - `true` - There is at **least one subscription active** in this session. + - `false` - There are **no active subscriptions** in this session. + +#### Subscribe to User Data Stream (USER\_STREAM)[​](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/user-data-stream-requests) + +``` +{ "id": "d3df8a21-98ea-4fe0-8f4e-0fcea5d418b7", "method": "userDataStream.subscribe"} +``` + +Subscribe to the User Data Stream in the current WebSocket connection. + +**Notes:** + +- This method requires an authenticated WebSocket connection using Ed25519 keys. Please refer to [`session.logon`](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests). +- To check the subscription status, use [`session.status`](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests), see the `userDataStream` flag indicating you have have an active subscription. +- User Data Stream events are available in both JSON and [SBE](https://developers.binance.com/docs/binance-spot-api-docs/faqs/sbe_faq) sessions. + - Please refer to [User Data Streams](https://developers.binance.com/docs/binance-spot-api-docs/user-data-stream) for the event format details. + - For SBE, only SBE schema 2:1 or later is supported. + +**Weight**: 2 + +**Parameters**: NONE + +**Response**: + +``` +{ "id": "d3df8a21-98ea-4fe0-8f4e-0fcea5d418b7", "status": 200, "result": { "subscriptionId": 0 }} +``` + +#### Unsubscribe from User Data Stream[​](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/user-data-stream-requests) + +``` +{ "id": "d3df8a21-98ea-4fe0-8f4e-0fcea5d418b7", "method": "userDataStream.unsubscribe"} +``` + +Stop listening to the User Data Stream in the current WebSocket connection. + +Note that `session.logout` will only close the subscription created with `userDataStream.subscribe` but not subscriptions opened with `userDataStream.subscribe.signature`. + +**Weight**: 2 + +**Parameters**: + +Name + +Type + +Mandatory + +Description + +`subscriptionId` + +INT + +No + +When called with no parameter, this will close all subscriptions. +When called with the `subscriptionId` parameter, this will attempt to close the subscription with that subscription id, if it exists. + +**Response**: + +``` +{ "id": "d3df8a21-98ea-4fe0-8f4e-0fcea5d418b7", "status": 200, "result": {}} +``` + +#### Listing all subscriptions[​](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/user-data-stream-requests) + +``` +{ "id": "d3df5a22-88ea-4fe0-9f4e-0fcea5d418b7", "method": "session.subscriptions", "params": {}} +``` + +**Note:** + +- Users are expected to track on their side which subscription corresponds to which account. + +**Weight**: 2 + +**Data Source**: Memory + +**Response**: + +``` +{ "id": "d3df5a22-88ea-4fe0-9f4e-0fcea5d418b7", "status": 200, "result": [ { "subscriptionId": 0 }, { "subscriptionId": 1 } ]} +``` + +#### Subscribe to User Data Stream through signature subscription (USER\_STREAM)[​](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/user-data-stream-requests) + +``` +{ "id": "d3df8a22-98ea-4fe0-9f4e-0fcea5d418b7", "method": "userDataStream.subscribe.signature", "params": { "apiKey": "mjcKCrJzTU6TChLsnPmgnQJJMR616J4yWvdZWDUeXkk6vL6dLyS7rcVOQlADlVjA", "timestamp": 1747385641636, "signature": "yN1vWpXb+qoZ3/dGiFs9vmpNdV7e3FxkA+BstzbezDKwObcijvk/CVkWxIwMCtCJbP270R0OempYwEpS6rDZCQ==" }} +``` + +**Weight:** 2 + +**Parameters**: + +Name + +Type + +Mandatory + +Description + +`apiKey` + +STRING + +Yes + +`timestamp` + +LONG + +Yes + +`signature` + +STRING + +Yes + +`recvWindow` + +DECIMAL + +No + +The value cannot be greater than `60000`. +Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. + +**Data Source:** Memory + +**Response:** + +``` +{ "id": "d3df8a22-98ea-4fe0-9f4e-0fcea5d418b7", "status": 200, "result": { "subscriptionId": 0 }} +``` + +- [User Data Stream subscription](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/user-data-stream-requests) diff --git a/docs/binance/binance_derivatives/docs_derivatives_Introduction.md b/docs/binance/binance_derivatives/docs_derivatives_Introduction.md new file mode 100644 index 0000000..ab69f7b --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_Introduction.md @@ -0,0 +1,10 @@ +--- +title: "Introduction | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/Introduction" +fetched_at: "2026-01-27T05:28:00.328Z" +--- +!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){try{return new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}}()||function(){try{return window.localStorage.getItem("theme")}catch(t){}}();t(null!==e?e:"light")}(),function(){try{const n=new URLSearchParams(window.location.search).entries();for(var\[t,e\]of n)if(t.startsWith("docusaurus-data-")){var a=t.replace("docusaurus-data-","data-");document.documentElement.setAttribute(a,e)}}catch(t){}}() + +[Skip to main content](https://developers.binance.com/docs/derivatives/usds-margined-futures/general-info) + +Derivative Trading API provide REST and WebSocket APIs to suit your derivative trading needs. diff --git a/docs/binance/binance_derivatives/docs_derivatives_change-log.md b/docs/binance/binance_derivatives/docs_derivatives_change-log.md new file mode 100644 index 0000000..cfc17ff --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_change-log.md @@ -0,0 +1,3369 @@ +--- +title: "Change Log | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/change-log" +fetched_at: "2026-01-27T05:28:00.328Z" +--- +# Change Log + +## 2026-01-09[​](https://developers.binance.com/docs/derivatives/change-log) + +Portfolio Margin and Portfolio Margin Pro + +- New endpoints for switch to Delta Mode: + - `POST /sapi/v1/portfolio/delta-mode`: Switch the Delta Mode for existing PM PRO / PM RETAIL accounts. + - `GET /sapi/v1/portfolio/delta-mode`: Query the Delta mode status of current account. + +## 2026-01-07[​](https://developers.binance.com/docs/derivatives/change-log) + +Option + +- New REST APIs: + - `GET /eapi/v1/commission`: query user commission rate + +## 2025-12-29[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +- The parameter "filterType": "MAX\_NUM\_ALGO\_ORDERS" has been removed from the endpoint `GET /fapi/v1/exchangeInfo`. The condtional order limits is 200 across all symbols. +- Effective on 2025-12-31, field `nq` will be available in `@aggTrade` stream. For this new field, only normal market trades will be aggregated, which means the trades involving RPI orders won't be aggregated. + +## 2025-12-11[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +- New REST APIs: + - `GET /fapi/v1/tradingSchedule`: query trading session schedules for a one-week period + - `POST /fapi/v1/stock/contract`: sign TradFi-Perps agreement contract +- New Websocket API: + - `tradingSession`: query current trading session information + +## 2025-12-10[​](https://developers.binance.com/docs/derivatives/change-log) + +- Since conditional orders have been migrated to the Algo Service, the event `CONDITIONAL_ORDER_TRIGGER_REJECT` will be deprecated effective December 15, 2025. Any conditional order rejection reasons are provided within the `ALGO_UPDATE` event. + +## 2025-12-09[​](https://developers.binance.com/docs/derivatives/change-log) + +COIN-M Futures + +- Effective on 2025-12-10, Order expire reason field `er` will be available in `ORDER_TRADE_UPDATE` stream. + +## 2025-11-25[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +- Effective on **2025-11-26**, RPI commisson fee is available in the response of User Commission Rate endpoint + - REST + - `GET /fapi/v1/commissionRate` +- New endpoints to fetch RPI order book + - REST + - `GET /fapi/v1/rpiDepth` + - WebSocket + - `@rpiDepth@500ms` + +## 2025-11-19[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +- REST API + - `GET /fapi/v1/symbolAdlRisk`: New endpoints to query ADL risk rating + +## 2025-11-18[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +- The RPI order is introduced to USDⓈ-M Futures + - New time-in-force ENUM value - RPI is supported in + - REST + - `POST /fapi/v1/order` + - `POST /fapi/v1/batchOrders` + - WebSocket + - `order.place` + - New fields in the market data response - Boolean "IsRPITrade" available in + - REST + - `GET /fapi/v1/trades` + - `GET /fapi/v1/historicalTrades` + - Order Book Exclusion - RPI orders don't appear in + - REST + - `GET /fapi/v1/depth` + - `GET /fapi/v1/ticker/bookTicker` + - WebSocket + - `ticker.book` + - `@bookTicker` + - `!bookTicker` + - `@depth` + - `@depth` +- For more details, please refer to [https://www.binance.com/en/support/faq/92c83c53173947c4a44f9a7277c3b9ce](https://www.binance.com/en/support/faq/92c83c53173947c4a44f9a7277c3b9ce) + +## 2025-11-12[​](https://developers.binance.com/docs/derivatives/change-log) + +Binance Derivative is rebuilding the Options system to enhance overall stability, performance, and scalability, while also introducing new features. + +As the first step, a new Options Demo API environment has been launched to help existing users adapt their code to the updated system. Documentation is available under the "Options Demo Trading" tab. + +To get started, please visit [https://demo.binance.com/zh-CN/my/settings/api-management](https://demo.binance.com/zh-CN/my/settings/api-management) to create a new API key. This key can be used to access the new Options Demo Trading environment. + +## 2025-11-10[​](https://developers.binance.com/docs/derivatives/change-log) + +- As BFUSD has been migrated to Binance Earn on 2025-08-13. The following endpoints is deprecated: + - `POST sapi/v1/portfolio/mint` + - `POST sapi/v1/portfolio/redeem` + +## 2025-11-06[​](https://developers.binance.com/docs/derivatives/change-log) + +- Effective on **2025-12-09**, USDⓈ-M Futures will migrate conditional orders to the Algo Service, which will affect the following order types: `STOP_MARKET`/`TAKE_PROFIT_MARKET`/`STOP`/`TAKE_PROFIT`/`TRAILING_STOP_MARKET`. + +- The new endpoints for conditional orders of REST API : + + - `POST fapi/v1/algoOrder`: Place an algo order + - `DELETE /fapi/v1/algoOrder`: Cancel an algo order + - `DELETE fapi/v1/algoOpenOrders`: Cancel all open algo orders + - `GET /fapi/v1/algoOrder`: Query an algo order + - `GET /fapi/v1/openAlgoOrders`: Query algo open order(s) + - `GET /fapi/v1/allAlgoOrders`: Query algo order(s) +- The following enpoints will block the requests for order types after the migration: `STOP_MARKET`/`TAKE_PROFIT_MARKET`/`STOP`/`TAKE_PROFIT`/`TRAILING_STOP_MARKET`. The error code `-4120` STOP\_ORDER\_SWITCH\_ALGO will be encountered. + + - `POST /fapi/v1/order` + - `POST /fapi/v1/batchOrders` +- Websocket User Stream Update + + - New algo order event: `ALGO_UPDATE` +- Websocket API Update + + - New algo order : `algoOrder.place` + - Cancel algo order: `algoOrder.cancel` +- Please note that after the migration: + + - No margin check before the conditional order gets triggered. + - GTE\_GTC orders no longer depend on open orders of the opposite side, but rather on positions only. + - There should be no latency increase in order triggering. + - Modification of untriggered conditional orders is not supported. + +## 2025-10-21[​](https://developers.binance.com/docs/derivatives/change-log) + +- Effective **2025-10-23**, the `priceMatch` enum values **`OPPONENT_10`** and **`OPPONENT_20`** are temporarily removed from **place/amend** flows, other enums are not impacted. Affected endpoints: + + **USDT-M Futures (`/fapi`)** + + - `POST /fapi/v1/order` + - `POST /fapi/v1/batchOrders` + - `PUT /fapi/v1/order` + - `PUT /fapi/v1/batchOrders` + + **COIN-M Futures (`/dapi`)** + + - `POST /dapi/v1/order` + - `POST /dapi/v1/batchOrders` + - `PUT /dapi/v1/order` + - `PUT /dapi/v1/batchOrders` + + **Portfolio Margin (`/papi`)** + + - `POST /papi/v1/um/order` + - `PUT /papi/v1/um/order` + - `POST /papi/v1/um/conditional/order` + - `POST /papi/v1/cm/order` + - `PUT /papi/v1/cm/order` + - `POST /papi/v1/cm/conditional/order` + +## 2025-10-20[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +- Effective 2025-10-23, Order expire reason field `er` will be available in `ORDER_TRADE_UPDATE` stream. + +## 2025-10-14[​](https://developers.binance.com/docs/derivatives/change-log) + +- Effective 2025-10-23, the error message for the code below will be updated: + +``` +{ "code": -1008, "msg": "Request throttled by system-level protection. Reduce-only/close-position orders are exempt. Please try again."} +``` + +## 2025-10-09[​](https://developers.binance.com/docs/derivatives/change-log) + +- Futures now supports trading pair symbols in Chinese. Example from `exchangeInfo`: `"symbol": "测试USDT"`. +- When placing orders via API, if `symbol` contains Chinese characters, it **must** be URL-encoded (UTF-8 percent-encoding). Example: + `https://fapi.binance.com/fapi/v1/order?symbol=%E6%B5%8B%E8%AF%95USDT&side=BUY&type=TAKE_PROFIT_MARKET&timeInForce=GTE_GTC&quantity=1&stopPrice=30×tamp=1760000007980` +- The `symbol` field in push messages (WebSocket/User Data Stream) may also contain Chinese. Ensure clients/downstream systems handle decoding and rendering properly. +- Requests with unencoded Chinese `symbol` may fail or return parameter parsing errors. + +## 2025-08-11[​](https://developers.binance.com/docs/derivatives/change-log) + +- BFUSD will be migrated to Binance Earn on 2025-08-13. The following endpoints will be deprecated after the migration: + - `POST sapi/v1/portfolio/mint` + - `POST sapi/v1/portfolio/redeem` +- Error code `-21015` ENDPOINT\_GONE will be encountered. +- Portfolio Margin and Portfolio Margin Pro users can switch to Binance Earn for BFUSD minting and redeeming. After the migration, the existing BFUSD under the Portfolio Margin wallet can use the aggregate balance function(`POST /sapi/v1/portfolio/asset-collection`) first, and transfer from Portfolio Margin wallet to Spot wallet for redemption. + +## 2025-07-25[​](https://developers.binance.com/docs/derivatives/change-log) + +- Added new error code in fapi: + - `-4109`: _This account is inactive. Please activate it before trading._ + This indicates the account has been archived due to inactivity. To activate it, transfer any amount of asset to the USDM Futures account. + +## 2025-07-02[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +- REST API + + - `GET /futures/data/openInterestHist`: add response field `CMCCirculatingSupply` +- Websocket Market Streams + + - A single connection of maximum streams change from 200 to 1024. + +## 2025-04-23[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +- REST API + - `GET /fapi/v1/insuranceBalance`: New endpoints to query insurance fund balance snapshot + - `GET /fapi/v1/constituents`: add response field `price` and `weight` + +## 2025-04-15[​](https://developers.binance.com/docs/derivatives/change-log) + +Portfolio Margin and Portfolio Margin Pro + +- New endpoints for Earn Asset transfer as collateral: + - `POST /sapi/v1/portfolio/earn-asset-transfer`: Transfer LDUSDT for Portfolio Margin + - `GET /sapi/v1/portfolio/earn-asset-balance`: Get Transferable Earn Asset Balance for Portfolio Margin + +## 2025-02-28[​](https://developers.binance.com/docs/derivatives/change-log) + +Portfolio Margin + +- New endpoints to query user pmloan repay record(Release on 2025-02-28): + - `GET /sapi/v1/portfolio/pmloan-history` + +## 2025-02-20[​](https://developers.binance.com/docs/derivatives/change-log) + +COIN-M Futures + +WEBSOCKET API + +- Websocket API will be available on 2025-02-25 and can be accessed through this URL: `wss://ws-dapi.binance.com/ws-dapi/v1` +- WebSocket API allows placing orders, canceling orders, etc. through a WebSocket connection. +- WebSocket API is a separate service from WebSocket Market Data streams. I.e., placing orders and listening to market data requires two separate WebSocket connections. +- WebSocket API is subject to the same Filter and Rate Limit rules as REST API. +- WebSocket API and REST API are functionally equivalent: they provide the same features, accept the same parameters, return the same status and error codes. + +## 2025-01-20[​](https://developers.binance.com/docs/derivatives/change-log) + +Portfolio Margin + +- New endpoints to query user negative balance auto exchange record(Release on 2025-01-22): + - `GET /papi/v1/portfolio/negative-balance-exchange-record` + +## 2025-01-13[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures & COIN-M Futures + +- The following endpoints will be updated at 2024-01-14: + + - `GET /fapi/v1/historicalTrades` + - `GET /dapi/v1/historicalTrades` + + Changes to the request parameter `limit`: + + - Maximum value changed from 1000 to 500 + - Default value changed from 500 to 100 + +## 2025-01-06[​](https://developers.binance.com/docs/derivatives/change-log) + +Portfolio Margin + +- New endpoints to query user rate limit: + - `GET papi/v1/rateLimit/order` + +## 2024-12-19[​](https://developers.binance.com/docs/derivatives/change-log) + +Portfolio Margin Pro & Portfolio Margin + +- New endpoints for BFUSD mint and redeem(Release on 2024-12-20): + - `POST sapi/v1/portfolio/mint` + - `POST sapi/v1/portfolio/redeem` + +## 2024-12-17[​](https://developers.binance.com/docs/derivatives/change-log) + +Options + +- REST API: Added new endpoint `GET /eapi/v1/blockTrades` to get recent block trades + +- Websocket Market Streams: Add field `X` in streams `@trade` and `@trade` to show trade type + + +## 2024-12-02[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +- The following error code will be added on 2024-12-03: + - `-4116`: ClientOrderId is duplicated. + - `-4117`: Stop order is in triggering process. Please try again later. + +## 2024-11-04[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures & COIN-M Futures + +- `GET /fapi/v1/pmExchangeInfo` and `GET /dapi/v1/pmExchangeInfo` will be deprecated on 2024-11-15 + +## 2024-11-01[​](https://developers.binance.com/docs/derivatives/change-log) + +Options + +- Add block trade endpoints: + - `POST eapi/v1/block/order/create` + - `PUT eapi/v1/block/order/create` + - `DELETE eapi/v1/block/order/create` + - `GET eapi/v1/block/order/orders` + - `POST eapi/v1/block/order/execute` + - `GET eapi/v1/block/order/execute` + - `GET eapi/v1/block/user-trades` + +## 2024-10-29[​](https://developers.binance.com/docs/derivatives/change-log) + +Portfolio Margin Pro + +- The following REST endpoints will be adjusted: + - `POST /sapi/v1/portfolio/repay-futures-switch`: Effective on 2024-11-01, rate limit will be adjusted to 20/day. + +Portfolio Margin + +- The following REST endpoints will be adjusted: + - `POST /papi/v1/repay-futures-switch`: Effective on 2024-11-01, rate limit will be adjusted to 20/day. + +## 2024-10-24[​](https://developers.binance.com/docs/derivatives/change-log) + +Options + +- API Field Removal(Effective 2024-10-28): + - In the `GET /eapi/v1/exchangeInfo` endpoint, the `id` field will be removed from `optionContracts`, the `id` field will been removed from `optionAssets`, and both the `contractId` and `id` fields have been removed from `optionSymbols`. + - The `id` and `cid` fields will been removed from the `option_pair` websocket stream + +## 2024-10-21[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures & COIN-M Futures + +- Effective from 2024-10-30 00:00 (UTC), the endpoints will only support querying futures trade histories within the most recent 6 months: + - `GET /fapi/v1/userTrades` + - `GET /dapi/v1/userTrades` + +COIN-M Futures + +- Add new historical data download endpoint: + - `GET /dapi/v1/order/asyn`: to get Download Id For Futures Order History + - `GET /dapi/v1/order/asyn/id`: to get Futures Order History Download Link by Id + - `GET /dapi/v1/trade/asyn`: to get Download Id For Futures Trade History + - `GET /dapi/v1/trade/asyn/id`: to get Futures Trade History Download Link by Id + +## 2024-10-15[​](https://developers.binance.com/docs/derivatives/change-log) + +Portfolio Margin Pro(Release date 2024-10-18) + +- New endpoint to get Portfolio Margin Pro SPAN Account Info(For Portfolio Margin Pro SPAN users only): + - `GET /sapi/v2/portfolio/account` +- New endpoint to get Portfolio Margin Pro Account Balance Info: + - `GET /sapi/v1/portfolio/balance` + +Portfolio Margin + +- New endpoint to get download id for UM futures trade history: + - `GET /papi/v1/um/trade/asyn` +- New endpoint to get UM futures trade download link by Id: + - `GET /papi/v1/um/trade/asyn/id` +- New endpoint to get download id for UM futures order history: + - `GET /papi/v1/um/order/asyn` +- New endpoint to get UM futures order download link by Id: + - `GET /papi/v1/um/order/asyn/id` +- New endpoint to get download id for UM futures transaction history: + - `GET /papi/v1/um/income/asyn` +- New endpoint to get UM futures transaction download link by Id: + - `GET /papi/v1/um/income/asyn/id` + +## 2024-10-14[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +- The following REST endpoints will be adjusted: + - `POST /fapi/v1/convert/getQuote`: Effective on 2024-10-19, rate limit will be adjusted to 360/hour, 500/day. + - `POST /fapi/v1/convert/getQuote`: `validTime` can only be set to `10s` + +## 2024-10-11[​](https://developers.binance.com/docs/derivatives/change-log) + +COIN-M Futures + +- **Self-Trade Prevention**: + +- Self-Trade Prevention (aka STP) is added to the system. This prevents orders from matching with orders from the same account, or accounts under the same `tradeGroupId`(currently only support same account). For more detail, please check [FAQ](https://www.binance.com/zh-CN/support/faq/what-is-self-trade-prevention-0941126f6413485b9a3df964a9aa2306) + +- User can set `selfTradePreventionMode` when placing new orders. All symbols support the following STP mode: + + - NONE: No Self-Trade Prevention + - EXPIRE\_TAKER: expire taker order when STP trigger + - EXPIRE\_BOTH: expire taker and maker order when STP trigger + - EXPIRE\_MAKER: expire maker order when STP trigger +- REST Update: + + - New order status `EXPIRED_IN_MATCH` - This means that the order expired due to STP being triggered. + - Add optional parameter `selfTradePreventionMode` in the endpoints below to set order's STP mode: + - `POST /dapi/v1/order` + - `POST /dapi/v1/batchOrders` + - Add new field `selfTradePreventionMode` in response of the endpoints below to show order's STP mode: + - `POST /dapi/v1/order` + - `POST /dapi/v1/batchOrders` + - `GET /dapi/v1/order` + - `GET /dapi/v1/openOrders` + - `GET /dapi/v1/allOrders` + - `PUT /dapi/v1/order` + - `PUT /dapi/v1/batchOrders` + - `DELETE /dapi/v1/order` + - `DELETE /dapi/v1/batchOrders` +- WEBSOCKET User Data Stream: + + - Add new field `V` in `ORDER_TRADE_UPDATE` to order STP mode. +- **Price Match** + +- Coin margin future supports order price match function. This feature allows users' LIMIT/STOP/TAKE\_PROFIT orders to be placed without entering a price. The price match function will automatically determine the order price in real-time based on the price match mode and the order book. + +- The following priceMatch modes are supported on order level: + + - NONE: no price match + - OPPONENT: counterparty best price + - OPPONENT\_5: counterparty 5th best price + - OPPONENT\_10: counterparty 10th best price + - OPPONENT\_20: counterparty 20th best price + - QUEUE: the best price on the same side of the order book + - QUEUE\_5: the 5th best price on the same side of the order book + - QUEUE\_10: the 10th best price on the same side of the order book + - QUEUE\_20: the 20th best price on the same side of the order book +- Example: + + - User places buy order and set priceMatch as QUEUE\_5, the order price will be 5th best bid price of the orderbook + - User places buy order and set priceMatch as OPPONENT, the order price will be best ask price of the orderbook +- REST Update: + +- Add optional parameter priceMatch in the endpoints below to set order's priceMatch mode: + + - `POST /dapi/v1/order` + - `POST /dapi/v1/batchOrders` +- Add new field priceMatch in response of the endpoints below to show order's priceMatch mode: + + - `POST /dapi/v1/order` + - `POST /dapi/v1/batchOrders` + - `GET /dapi/v1/order` + - `GET /dapi/v1/openOrders` + - `GET /dapi/v1/allOrders` + - `PUT /dapi/v1/order` + - `PUT /dapi/v1/batchOrders` + - `DELETE /dapi/v1/order` + - `DELETE /dapi/v1/batchOrders` +- WEBSOCKET User Data Stream: + + - Add new field `pm` in `ORDER_TRADE_UPDATE` to show price match mode. + +## 2024-10-10[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +- Binance will update the following endpoints, estimated to be in force on 2024-10-17 03:00 (UTC). After 2024-10-17 03:00 (UTC), the endpoints will support querying futures trade histories that are not older than one year: + + - `GET /fapi/v1/aggTrades` + - `GET /dapi/v1/aggTrades` +- Binance will update the following endpoints, estimated to be in force on 2024-10-16 03:00 (UTC). After 2024-10-16 03:00 (UTC), the endpoint will support querying future histories that are not older than 30 days: + + - `GET /fapi/v1/positionMargin/history` + +## 2024-10-08[​](https://developers.binance.com/docs/derivatives/change-log) + +COIN-M Futures + +- The most recent 7-days data is returned by default when requesting the following endpoints. The query time period for these endpoints must be less than 7 days: + + - `GET /dapi/v1/allOrders` + - `GET /dapi/v1/userTrades` +- The following endpoints will be adjusted to keep only recent three month data: + + - `GET /dapi/v1/order` + - `GET /dapi/v1/allOrders` + +## 2024-09-27[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +- The following websocket user data requests are deprecated: + - `listenkey@account` + - `listenkey@balance` + - `listenkey@position` + +COIN-M Futures + +- The following websocket user data requests are deprecated: + - `listenkey@account` + - `listenkey@balance` + - `listenkey@position` + +## 2024-09-19[​](https://developers.binance.com/docs/derivatives/change-log) + +Portfolio Margin + +- New endpoint to repay debt for Margin: + - `POST /papi/v1/margin/repay-debt`: Repay debt for a margin loan. + +## 2024-09-06[​](https://developers.binance.com/docs/derivatives/change-log) + +Portfolio Margin + +- Update endpoint for Portfolio Margin/Trade(Release date 2024-09-06): + + - `POST /papi/v1/um/order`: add parameter `priceMatch` to support priceMatch for place order + - `POST/papi/v1/um/conditional/order`: add parameter `priceMatch` to support priceMatch for plac conditional order + - `PUT /papi/v1/um/order`: add parameter `priceMatch` to ssupport priceMatch for order modification +- Add new field `priceMatch` in response of the endpoints below to show order's priceMatch: + + - `POST /papi/v1/um/order` + - `POST/papi/v1/um/conditional/order` + - `PUT /papi/v1/um/order` + - `GET /papi/v1/um/orderAmendment` + - `GET /papi/v1/um/order` + - `GET /papi/v1/um/openOrder` + - `GET /papi/v1/um/openOrders` + - `GET /papi/v1/um/allOrders` + - `GET /papi/v1/um/conditional/openOrder` + - `GET /papi/v1/um/conditional/openOrders` + - `GET /papi/v1/um/conditional/orderHistory` + - `GET /papi/v1/um/conditional/allOrders` + - `DELETE /papi/v1/um/order` + - `DELETE /papi/v1/um/conditional/order` +- WEBSOCKET + + - Add new field `pm` in `ORDER_TRADE_UPDATE` and `CONDITIONAL_ORDER_TRADE_UPDATE`, which represents priceMatch . + +## 2024-09-05[​](https://developers.binance.com/docs/derivatives/change-log) + +Portfolio Margin Pro + +- New endpoint to query Portfolio Margin Pro Tiered Collateral Rate: + - `GET /sapi/v2/portfolio/collateralRate`: Query Portfolio Margin Pro Tiered Collateral Rate. + +## 2024-09-03[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +- User data stream will add `TRADE_LITE` event. `TRADE_LITE` event designed to reduce user data latency by focusing solely on ‘TRADE’ execution type and minimizing the number of user data fields, providing a faster and more efficient experience compared to the original `ORDER_TRADE_UPDATE` user data stream. + +## 2024-08-26[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +- New endpoint to Future Convert: + - `GET /fapi/v1/convert/exchangeInfo` + - `POST /fapi/v1/convert/getQuote` + - `POST /fapi/v1/convert/acceptQuote` + - `GET /fapi/v1/convert/orderStatus` + +## 2024-08-23[​](https://developers.binance.com/docs/derivatives/change-log) + +Portfolio Margin + +- New endpoint to toggle UM Futures BNB Burn: + - `POST /papi/v1/um/feeBurn`: Toggle BNB Burn on UM Futures Trade. + - `GET /papi/v1/um/feeBurn`: Get UM Futures BNB Burn status. +- New Endpoints to Query Account Information: + - `GET /papi/v1/um/accountConfig`: Query user UM account configuration. + - `GET /papi/v1/um/symbolConfig`: Query user symbol configuration. + - `GET /papi/v2/um/account`: Compared to `GET /papi/v1/um/account`, this endpoint only returns symbols that the user has positions or open orders in. Configuration-related fields have been removed and can now be queried from `GET /papi/v1/um/symbolConfig` and `GET /papi/v1/um/accountConfig`. The V2 endpoint also offers better performance. + +## 2024-08-07[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +- The following endpoints IP weight limit will be adjusted from 2024-09-03: + + - REST API: + - `GET /fapi/v2/balance`: 5->10 + - `GET /fapi/v2/account`: 5->10 + - `GET /fapi/v2/positionRisk`: 5->10 + - Websocket API: + - `account.status`: 5->10 + - `account.balance`: 5->10 + - `account.position`: 5->10 +- The following WebSocket User Data Requests will be deprecated from 2024-09-03 + + - @account + - @balance + - @position + +Please refer to [annoucement](https://www.binance.com/en/support/announcement/notice-on-upcoming-binance-api-update-2024-09-03-19d4e3cd0758426584dd9686eb56ec64) for api replacement + +## 2024-08-06[​](https://developers.binance.com/docs/derivatives/change-log) + +COIN-M Futures + +`GET /dapi/v1/pmExchangeInfo` will be deprecated on August 6,2024 due to removing `notionalLimit` restriction. + +## 2024-07-24[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +#### REST API[​](https://developers.binance.com/docs/derivatives/change-log) + +- New Endpoints to Query Account Information: + + - `GET /fapi/v1/symbolConfig`: Query user symbol configuration. + - `GET /fapi/v1/accountConfig`: Query user account configuration. + - `GET /fapi/v3/account`: Compared to `GET /fapi/v2/account`, this endpoint only returns symbols that the user has positions or open orders in. Configuration-related fields have been removed and can now be queried from `GET /fapi/v1/symbolConfig` and `GET /fapi/v1/accountConfig`. The V3 endpoint also offers better performance. + - `GET /fapi/v3/balance`: Query user account balance. +- New Endpoints to Query Trade Information: + + - `GET /fapi/v3/positionRisk`: Compared to `GET /fapi/v2/positionRisk`, this endpoint only returns symbols that the user has positions or open orders in. Configuration-related fields have been removed and can now be queried from `GET /fapi/v1/symbolConfig`. The V3 endpoint also offers better performance. + +#### WebSocket API[​](https://developers.binance.com/docs/derivatives/change-log) + +- New Endpoints to Query Account Information: + - `v2/account.status`: Compared to `account.status`, this endpoint only returns symbols that the user has positions or open orders in. Configuration-related fields have been removed and can now be queried from `GET /fapi/v1/symbolConfig` and `GET /fapi/v1/accountConfig`. The V2 endpoint also offers better performance. + - `v2/account.balance`: Query user account balance. + - `v2/account.position`: Compared to `account.position`, this endpoint only returns symbols that the user has positions or open orders in. Configuration-related fields have been removed and can now be queried from `GET /fapi/v1/symbolConfig`. The V2 endpoint also offers better performance. + +**Deprecation Notice:** + +- The following endpoints will be deprecated in the coming months (exact date to be announced later). Please switch to the new endpoints listed above: + - REST API: + - `GET /fapi/v2/balance` + - `GET /fapi/v2/account` + - `GET /fapi/v2/positionRisk` + - Websocket API: + - `account.status` + - `account.balance` + - `account.position` + +--- + +## 2024-07-17[​](https://developers.binance.com/docs/derivatives/change-log) + +Portfolio Margin + +REST API + +- The response field `marginAsset` in `GET /papi/v1/um/userTrades` will be removed on 2024-07-17. + +--- + +## 2024-06-19[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +REST API + +- The response field `marginAsset` in `GET /fapi/v1/userTrades` will be removed on 2024-06-25. + +--- + +## 2024-05-22[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +REST API & Websocket API + +- New endpoint to toggle BNB Burn: + - `POST /fapi/v1/feeBurn` to toggle BNB Burn on Futures Trade. + - `GET /fapi/v1/feeBurn` to get BNB Burn status. + +--- + +## 2024-04-19[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +REST API & Websocket API + +- The new field listenKey will be integrated into the response received from the `PUT /fapi/v1/listenKey` endpoint and WebSocket api `userDataStream.ping`. This enhancement will allow users to view the key that has been kept alive. This update is scheduled to take effect on 2024-04-25. + +``` +{ "listenKey": "3HBntNTepshgEdjIwSUIBgB9keLyOCg5qv3n6bYAtktG8ejcaW5HXz9Vx1JgIieg"} +``` + +--- + +## 2024-04-09[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures/ COIN-M Futures / Portfolio Margin + +WEBSOCKET API + +- Good-Till-Cancel (GTC) timeInForce will have a one-year validity period after order placement. GTC orders longer than one-year will be automatically canceled. This applies to all order types including reduceOnly but does not affect part-filled orders or strategy trading or copy-trading orders. + +--- + +## 2024-04-01[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +WEBSOCKET API + +- Websocket API is now available and can be accessed through this URL: `wss://ws-fapi.binance.com/ws-fapi/v1` +- WebSocket API allows placing orders, canceling orders, etc. through a WebSocket connection. +- WebSocket API is a separate service from WebSocket Market Data streams. I.e., placing orders and listening to market data requires two separate WebSocket connections. +- WebSocket API is subject to the same Filter and Rate Limit rules as REST API. +- WebSocket API and REST API are functionally equivalent: they provide the same features, accept the same parameters, return the same status and error codes. + +--- + +## 2024-03-11[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +REST + +- Add new Account Endpoints: + - `GET /fapi/v1/rateLimit/order`: query user order rate limits + +--- + +## 2024-02-09[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +Binance Future is doing Websocket Service upgrade and the upgrade impacts the following: + +- Before upgrade: + + - The websocket server will send a ping frame every 3 minutes. If the websocket server does not receive a pong frame back from the connection within a 10 minute period, the connection will be disconnected. Unsolicited pong frames are allowed. +- After upgrade: + + - Websocket server will send a `ping frame` every 3 minutes. + - If the websocket server does not receive a `pong frame` back from the connection within a 10 minute period, the connection will be disconnected. + - When you receive a ping, you must send a pong with a copy of ping's payload as soon as possible. + - Unsolicited `pong frames` are allowed, but will not prevent disconnection. **It is recommended that the payload for these pong frames are empty.** + +--- + +## 2024-01-24[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +Testnet WEBSOCKET + +- The Websocket baseurl for **testnet** is updated to "wss://fstream.binancefuture.com" + +--- + +## 2024-01-19[​](https://developers.binance.com/docs/derivatives/change-log) + +Portfolio Margin + +- REST + + - New endpoints `PUT /papi/v1/um/order` and `PUT /papi/v1/cm/order` to support UM/CM limit order modify + - New endpoints `GET /papi/v1/um/orderAmendment` and `GET /papi/v1/cm/orderAmendment` to get UM/CM order modify history + +--- + +## 2024-01-11[​](https://developers.binance.com/docs/derivatives/change-log) + +Portfolio Margin + +- **Self-Trade Prevention(Released):** + +- Self-Trade Prevention (aka STP) will be added to the system. This will prevent orders from matching with orders from the same account, or accounts under the same `tradeGroupId`. For more detail, please check [FAQ](https://www.binance.com/en/support/faq/what-is-self-trade-prevention-stp-0941126f6413485b9a3df964a9aa2306) + +- User can set `selfTradePreventionMode` when placing new orders. All symbols support the following STP mode: + + - NONE: No Self-Trade Prevention + - EXPIRE\_TAKER: expire taker order when STP trigger + - EXPIRE\_BOTH: expire taker and maker order when STP trigger + - EXPIRE\_MAKER: expire maker order when STP trigger +- REST Update: + + - New order status `EXPIRED_IN_MATCH` - This means that the order expired due to STP being triggered. + + - GET /papi/v1/um/account: Add new field `tradeGroupId` in response to show user's tradeGroupId + + - Add optional parameter `selfTradePreventionMode` in the endpoints below to set order's STP mode: + + - POST /papi/v1/um/order + - POST/papi/v1/um/conditional/order + - POST /papi/v1/margin/order + - POST /papi/v1/margin/order/oco + - Add new field `selfTradePreventionMode` in response of the endpoints below to show order's STP mode: + + - POST /papi/v1/um/order + + - POST/papi/v1/um/conditional/order + + - GET /papi/v1/um/order + + - GET /papi/v1/um/openOrder + + - GET /papi/v1/um/openOrders + + - GET /papi/v1/um/allOrders + + - GET /papi/v1/um/conditional/openOrder + + - GET /papi/v1/um/conditional/openOrders + + - GET /papi/v1/um/conditional/orderHistory + + - GET /papi/v1/um/conditional/allOrders + + - DELETE /papi/v1/um/order + + - DELETE /papi/v1/um/conditional/order + + - DELETE /papi/v1/margin/order + + - DELETE /papi/v1/margin/allOpenOrders + + - DELETE /papi/v1/margin/orderList + + - GET /papi/v1/margin/order + + - GET /papi/v1/margin/allOrders + + - GET /papi/v1/margin/orderList + + - GET /papi/v1/margin/allOrderList + + - GET /papi/v1/margin/openOrderList + +- WEBSOCKET User Data Stream: + + - Add new field `V` in `ORDER_TRADE_UPDATE` and `CONDITIONAL_ORDER_TRADE_UPDATE` to order STP mode. + - New fields for `executionReport` (These fields will only appear if the order has expired due to STP trigger) + - `u` - `tradeGroupId` + - `v` - `preventedMatchId` + - `U` - `counterOrderId` + - `A` - `preventedQuantity` + - `B` - `lastPreventedQuantity` +- **Good Till Date TIF(Released)** + +- USDⓈ margin future will support Good To Date TIF. Orders with the TIF set to GTD will be automatically canceled by the `goodTillDate` time. + +- REST Update: + + - Add optional parameter `goodTillDate` in the endpoints below to set order's `goodTillDate` : + + - POST /papi/v1/um/order + - POST/papi/v1/um/conditional/order + - Add new field `goodTillDate` in response of the endpoints below to show order's `goodTillDate`: + + - POST /papi/v1/um/order + - POST/papi/v1/um/conditional/order + - GET /papi/v1/um/order + - GET /papi/v1/um/openOrder + - GET /papi/v1/um/openOrders + - GET /papi/v1/um/allOrders + - GET /papi/v1/um/conditional/openOrder + - GET /papi/v1/um/conditional/openOrders + - GET /papi/v1/um/conditional/orderHistory + - GET /papi/v1/um/conditional/allOrders + - DELETE /papi/v1/um/order + - DELETE /papi/v1/um/conditional/order +- WEBSOCKET User Data Stream: + + - Add new field `gtd` in `ORDER_TRADE_UPDATE` and `CONDITIONAL_ORDER_TRADE_UPDATE` to order good till date. +- **Breakeven Price(Released)** + +- REST Update + + - Add new field `breakEvenPrice` in The following endpoint + - GET /papi/v1/um/account + - GET /papi/v1/um/positionRisk + - GET /papi/v1/cm/account + - GET /papi/v1/cm/positionRisk +- WEBSOCKET + + - New field `bep` represents Break-Even Price in position `P` of payload to event: Balance and Position Update – "e": "ACCOUNT\_UPDATE" + +--- + +## 2024-01-08[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +REST + +- Update endpoint for Account/Trade(Release date 2023-01-11): + - `PUT /fapi/v1/order`: add parameter `priceMatch` to support priceMatch for order modification + - `PUT /fapi/v1/batchOrders`: add parameter `priceMatch` to support priceMatch for order modification + - Order modification will preserve the original `selfTradePreventionMode` of the order + +--- + +## 2023-12-12[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +WEBSOCKET + +- Update speed for stream `!bookTicker` will be modified from real-time to every 5 seconds on starting December 20, 2023. Individual Symbol Book Ticker Streams `@bookticker` will remain unaffected by this update + +--- + +## 2023-11-15[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +REST + +- Add new Market Data Endpoints: + - `GET /fapi/v2/ticker/price`: this is v2 endpoint for querying latest price. It has same parameters and response as the `GET /fapi/v1/ticker/price`, and it offers lower latency and consume less of the IP rate limit. Please note that the `GET /fapi/v1/ticker/price` will be deprecated in the future, with the exact timing to be determined. + +WEBSOCKET + +- Binance Futures will retire the `wss://fstream-auth.binance.com` domain at 2023-12-15 06:00. API users are advised to establish a new WebSocket connection to `wss://fstream.binance.com`. Please note that the connection method for `wss://fstream.binance.com` is different from that of `wss://fstream-auth.binance.com`. For instance: + - `wss://fstream-auth.binance.com/ws/?listenKey=` should change to `wss://fstream.binance.com/ws/` + +--- + +## 2023-11-01[​](https://developers.binance.com/docs/derivatives/change-log) + +COIN-M Futures + +REST + +- Update on `GET dapi/v1/fundingRate`: + - add response field `markPrice` to display mark price associated with a particular funding fee charge + +--- + +## 2023-11-01[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +REST + +- Add new Market Data Endpoints: + + - `GET /futures/data/basis`: query basis data +- Update on `GET /fapi/v1/fundingRate`: + + - add response field `markPrice` to display mark price associated with a particular funding fee charge + +--- + +## 2023-10-19[​](https://developers.binance.com/docs/derivatives/change-log) + +COIN-M Futures + +REST + +- New Market Data Endpoints + - `GET /futures/data/delivery-price`: query quarterly contract settlement price +- Update Rate Limit to 1000/5min/IP on Market Data Endpoints below: + - `GET /futures/data/openInterestHist` + - `GET /futures/data/topLongShortAccountRatio` + - `GET /futures/data/topLongShortPositionRatio` + - `GET /futures/data/globalLongShortAccountRatio` + - `GET /futures/data/takerlongshortRatio` + +--- + +## 2023-10-19[​](https://developers.binance.com/docs/derivatives/change-log) + +European Options + +Binance Option is doing Websocket Service upgrade and the upgrade impacts the following: + +- Before upgrade: + + - The websocket server will send a ping frame every 5 minutes. If the websocket server does not receive a pong frame back from the connection within a 15 minute period, the connection will be disconnected. Unsolicited pong frames are allowed. + - To connect websocket server without subscription, user can connect by using + - `wss://nbstream.binance.com/eoptions/ws` + - `wss://nbstream.binance.com/eoptions/stream` + - `wss://nbstream.binance.com/eoptions/ws/` + - `wss://nbstream.binance.com/eoptions/stream/` +- After upgrade: + + - The websocket server will send a ping frame every 3 minutes. If the websocket server does not receive a pong frame back from the connection within a 10 minute period, the connection will be disconnected. Unsolicited pong frames are allowed. + - To connect websocket server without subscription: + - Connect websocket server with subscription: + - `wss://nbstream.binance.com/eoptions/ws` + - `wss://nbstream.binance.com/eoptions/stream` + - `/` at the end is no longer supported + - Raw stream like `wss://nbstream.binance.com/eoptions/illegal_parameter/stream?steams=` or `wss://fstream.binance.com/illegal_parameter/ws/`is not supported, please use remove `illegal_parameter/` before `/ws` and `/stream`. + +--- + +## 2023-10-19[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +REST + +- New Market Data Endpoints + - `GET /futures/data/delivery-price`: query quarterly contract settlement price +- Update Rate Limit to 1000/5min/IP on Market Data Endpoints below: + - `GET /futures/data/openInterestHist` + - `GET /futures/data/topLongShortAccountRatio` + - `GET /futures/data/topLongShortPositionRatio` + - `GET /futures/data/globalLongShortAccountRatio` + - `GET /futures/data/takerlongshortRatio` +- Update Rate Limit to 500/5min/IP on Market Data Endpoints below: + - `GET /fapi/v1/fundingRate` + - `GET /fapi/v1/fundingInfo` + +--- + +## 2023-10-16[​](https://developers.binance.com/docs/derivatives/change-log) + +COIN-M Futures + +REST + +- New Market Data Endpoints + - `GET /dapi/v1/constituents`: query index constituents + +--- + +## 2023-10-16[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +REST + +- New Market Data Endpoints + - `GET /fapi/v1/constituents`: query index constituents + +--- + +## 2023-10-11[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +REST + +- Account Endpoints IP Weight Update: + - `GET /fapi/v1/income/asyn`: 5->1000 + - `GET /fapi/v1/order/asyn`: 5->1000 + - `GET /fapi/v1/trade/asyn`: 5->1000 + - `GET /fapi/v1/income/asyn/id`: 5->10 + - `GET /fapi/v1/order/asyn/id`: 5->10 + - `GET /fapi/v1/trade/asyn/id`: 5->10 + +--- + +## 2023-09-25[​](https://developers.binance.com/docs/derivatives/change-log) + +COIN-M Futures + +REST + +- New Market Data Endpoints Update + - `GET /dapi/v1/fundingInfo`: query adjusted funding info + +--- + +## 2023-09-25[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +REST + +- New Market Data Endpoints Update + - `GET /fapi/v1/fundingInfo`: query adjusted funding info + +--- + +## 2023-09-22[​](https://developers.binance.com/docs/derivatives/change-log) + +Portfolio Margin + +- Update on endpoints: + + - `GET /papi/v1/um/positionRisk`: add response field `liquidationPrice` + - `GET /papi/v1/cm/positionRisk`: add response field `liquidationPrice` + - `GET /papi/v1/um/leverageBracket`: add response field `notionalCoef` + - `GET /papi/v1/cm/leverageBracket`: add response field `notionalCoef` +- Websocket User Data Streams Update: + + - `outboundAccountPosition` event add new field updateId `U` + - `balanceUpdate` event add new field updateId `U` + +--- + +## 2023-09-20[​](https://developers.binance.com/docs/derivatives/change-log) + +COIN-M Futures + +REST + +- Update on `GET /dapi/v1/ticker/bookTicker`: + + - add response field `lastUpdateId` +- Update on `GET /dapi/v1/account`: + + - add response field `updateTime` in `assets` + +--- + +## 2023-09-20[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +REST + +- Update on `GET /fapi/v1/ticker/bookTicker`: + - add response field `lastUpdateId` + +--- + +## 2023-09-19[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +``` +{ "code": -1008, "msg": "Server is currently overloaded with other requests. Please try again in a few minutes."} +``` + +- New error code message for http `503` return code, endpoints below might have this response during high traffic: + - `POST /fapi/v1/order` + - `PUT /fapi/v1/order` + - `DELETE /fapi/v1/order` + - `POST /fapi/v1/batchOrder` + - `PUT /fapi/v1/batchOrder` + - `DELETE /fapi/v1/batchOrder` + - `POST /fapi/v1/order/test` + - `DELETE /fapi/v1/allOpenOrders` +- This is a failure API operation and you can resend your request if you need. + +--- + +## 2023-09-07[​](https://developers.binance.com/docs/derivatives/change-log) + +COIN-M Futures + +REST + +- New endpoint`GET /dapi/v1/income/asyn`to get Download Id For Futures Transaction History +- New endpoint`GET /dapi/v1/income/asyn/id`to get Futures Transaction History Download Link by Id + +--- + +## 2023-09-05[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +- As per the [announcement](https://www.binance.com/en/support/announcement/binance-futures-launches-self-trade-prevention-stp-function-for-usd%E2%93%A2-margined-futures-on-api-32916877372243d69154c345200e34b8), Self Trade Prevention is enabled at **2023-09-05**. +- Price Match/ Good Till Date TIF/ Breakeven Price(detail in 2023-08-29 changelog) are released at **2023-09-05** + +--- + +## 2023-09-04[​](https://developers.binance.com/docs/derivatives/change-log) + +Portfolio Margin + +**Expect 2023-09-07 Release** + +- Overall papi order ratelimit change from 2400 orders/min to 1200 orders/min, impacted endpoints are: + - POST `/papi/v1/um/order` + - POST `/papi/v1/cm/order` + - POST `/papi/v1/margin/order` + - POST `/papi/v1/margin/order/oco` + - POST `/papi/v1/um/conditional/order` + - POST `/papi/v1/cm/conditional/order` + +--- + +## 2023-08-31[​](https://developers.binance.com/docs/derivatives/change-log) + +COIN-M Futures + +Binance Future is doing Websocket Service upgrade and the upgrade impacts the following: + +- Before upgrade: + + - The websocket server will send a ping frame every 5 minutes. If the websocket server does not receive a pong frame back from the connection within a 15 minute period, the connection will be disconnected. Unsolicited pong frames are allowed. +- After upgrade: + + - The websocket server will send a ping frame every 3 minutes. If the websocket server does not receive a pong frame back from the connection within a 10 minute period, the connection will be disconnected. Unsolicited pong frames are allowed. + +--- + +## 2023-08-31[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +Binance Future is doing Websocket Service upgrade and the upgrade impacts the following: + +- Before upgrade: + + - The websocket server will send a ping frame every 5 minutes. If the websocket server does not receive a pong frame back from the connection within a 15 minute period, the connection will be disconnected. Unsolicited pong frames are allowed. +- After upgrade: + + - The websocket server will send a ping frame every 3 minutes. If the websocket server does not receive a pong frame back from the connection within a 10 minute period, the connection will be disconnected. Unsolicited pong frames are allowed. + +--- + +## 2023-08-29[​](https://developers.binance.com/docs/derivatives/change-log) + +European Options + +REST + +- `GET /eapi/v1/account`: add new field `riskLevel` to show account risk level +- `GET /eapi/v1/marginAccount`: add new field`riskLevel` to show account risk level + +Websocket User Data Stream + +- Add new event `RISK_LEVEL_CHANGE` to show account riskLevel change + +--- + +## 2023-08-29[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +- **Self-Trade Prevention(Release Date TBD)**: + +- Self-Trade Prevention (aka STP) will be added to the system. This will prevent orders from matching with orders from the same account, or accounts under the same `tradeGroupId`. For more detail, please check [FAQ](https://www.binance.com/zh-CN/support/faq/what-is-self-trade-prevention-0941126f6413485b9a3df964a9aa2306) + +- User can set `selfTradePreventionMode` when placing new orders. All symbols support the following STP mode: + + - NONE: No Self-Trade Prevention + - EXPIRE\_TAKER: expire taker order when STP trigger + - EXPIRE\_BOTH: expire taker and maker order when STP trigger + - EXPIRE\_MAKER: expire maker order when STP trigger +- REST Update: + + - New order status `EXPIRED_IN_MATCH` - This means that the order expired due to STP being triggered. + - `GET /fapi/v2/account`: Add new field `tradeGroupId` in response to show user's tradeGroupId + - Add optional parameter `selfTradePreventionMode` in the endpoints below to set order's STP mode: + - `POST /fapi/v1/order` + - `POST /fapi/v1/batchOrders` + - Add new field `selfTradePreventionMode` in response of the endpoints below to show order's STP mode: + - `POST /fapi/v1/order` + - `POST /fapi/v1/batchOrders` + - `POST /fapi/v1/order` + - `POST /fapi/v1/order` + - `GET /fapi/v1/order` + - `GET /fapi/v1/openOrders` + - `GET /fapi/v1/allOrders` + - `PUT /fapi/v1/order` + - `PUT /fapi/v1/batchOrders` + - `DELETE /fapi/v1/order` + - `DELETE /fapi/v1/batchOrders` +- WEBSOCKET User Data Stream: + + - Add new field `V` in `ORDER_TRADE_UPDATE` to order STP mode. + +--- + +## 2023-08-25[​](https://developers.binance.com/docs/derivatives/change-log) + +COIN-M Futures + +- Binance Future is doing Websocket Service upgrade and the upgrade impacts the following: + - Connect websocket server without subscription: + - Before upgrade, user can connect by using: + - `wss://dstream.binance.com/ws` + - `wss://dstream.binance.com/stream` + - `wss://dstream.binance.com/ws/` + - `wss://dstream.binance.com/stream/` + - After upgrade, user can connect by using: + - `wss://dstream.binance.com/ws` + - `wss://dstream.binance.com/stream` + - `/` at the end is no longer supported + - Connect websocket server with subscription: + - Raw stream like `wss://dstream.binance.com/illegal_parameter/stream?steams=` or `wss://dstream.binance.com/illegal_parameter/ws/`is not supported, please use remove `illegal_parameter/` before `/ws` and `/stream`. + +--- + +## 2023-08-19[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +- Binance Future is doing Websocket Service upgrade and the upgrade impacts the following: + - Connect websocket server without subscription: + - Before upgrade, user can connect by using: + - `wss://fstream.binance.com/ws` + - `wss://fstream.binance.com/stream` + - `wss://fstream.binance.com/ws/` + - `wss://fstream.binance.com/stream/` + - After upgrade, user can connect by using: + - `wss://fstream.binance.com/ws` + - `wss://fstream.binance.com/stream` + - `/` at the end is no longer supported + - Connect websocket server with subscription: + - Raw stream like `wss://fstream.binance.com/illegal_parameter/stream?steams=` or `wss://fstream.binance.com/illegal_parameter/ws/`is not supported, please use remove `illegal_parameter/` before `/ws` and `/stream`. + +--- + +## 2023-08-18[​](https://developers.binance.com/docs/derivatives/change-log) + +Portfolio Margin + +- New endpoints for Query Order: + - `GET /papi/v1/margin/order`: Query Margin Account Order + - `GET /papi/v1/margin/openOrders`: Query Current Margin Open Order + - `GET /papi/v1/margin/allOrders`: Query All Margin Account Orders + - `GET /papi/v1/margin/orderList`: Query Margin Account's OCO + - `GET /papi/v1/margin/allOrderList`: Query Margin Account's all OCO + - `GET /papi/v1/margin/openOrderList`: Query Margin Account's Open OCO + - `GET /papi/v1/margin/myTrades`: Query Margin Account's Trade List + +--- + +## 2023-08-14[​](https://developers.binance.com/docs/derivatives/change-log) + +COIN-M Futures + +- Update endpoint for Account/Trade: + - `GET /dapi/v1/income`: Add parameter `page` for pagination + +--- + +## 2023-08-14[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +- Update endpoint for Account/Trade: + - `GET /fapi/v1/income`: Add parameter `page` for pagination + +--- + +## 2023-07-28[​](https://developers.binance.com/docs/derivatives/change-log) + +Portfolio Margin + +- New endpoints for account: + - `POST /papi/v1/asset-collection`: Fund Collection by Asset + +--- + +## 2023-07-21[​](https://developers.binance.com/docs/derivatives/change-log) + +European Options + +REST + +- New endpoint`GET /eapi/v1/income/asyn`to get Download Id For Option Transaction History +- New endpoint`GET /eapi/v1/income/asyn/id`to get Option Transaction History Download Link by Id + +--- + +## 2023-07-20[​](https://developers.binance.com/docs/derivatives/change-log) + +Portfolio Margin + +- New endpoints for account: + - `GET /papi/v1/um/adlQuantile`: UM Position ADL Quantile Estimation + - `GET /papi/v1/cm/adlQuantile`: CM Position ADL Quantile Estimation + +--- + +## 2023-07-19[​](https://developers.binance.com/docs/derivatives/change-log) + +COIN-M Futures + +REST + +- Add field `notionalCoef` in `GET /dapi/v2/leverageBracket` to show the bracket multiplier comparing to default leverage bracket + +--- + +## 2023-07-18[​](https://developers.binance.com/docs/derivatives/change-log) + +Portfolio Margin + +- New endpoints for account: + - `POST /papi/v1/repay-futures-switch`: Change Auto-repay-futures Status + - `GET /papi/v1/repay-futures-switch`: Get Auto-repay-futures Status + - `POST /papi/v1/repay-futures-negative-balance`: Repay futures Negative Balance + +--- + +## 2023-07-18[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +REST + +- Add field `notionalCoef` in `GET /fapi/v1/leverageBracket` to show the bracket multiplier comparing to default leverage bracket + +--- + +## 2023-07-13[​](https://developers.binance.com/docs/derivatives/change-log) + +European Options + +Websocket Market Streams + +- These change will be effective from 2023-07-14: + - Add field `T` in streams `@ticker` and `@ticker@` to show transaction time + - Add field `E` in stream `@depth` to show event time + +--- + +## 2023-07-13[​](https://developers.binance.com/docs/derivatives/change-log) + +Portfolio Margin + +- New USER DATA STREAM event `riskLevelChange`(effective 2023-07-14) + +--- + +## 2023-07-12[​](https://developers.binance.com/docs/derivatives/change-log) + +COIN-M Futures + +REST + +- New field `breakEvenPrice` represents Break-Even Price in position of response to: + - GET /dapi/v1/account (HMAC SHA256) + - GET /dapi/v1/positionRisk (HMAC SHA256) + +WEBSOCKET + +- New field `bep` represents Break-Even Price in position `P` of payload to event: Balance and Position Update – "e": "ACCOUNT\_UPDATE" + +--- + +## 2023-07-11[​](https://developers.binance.com/docs/derivatives/change-log) + +Portfolio Margin + +REST + +- Add new endpoint `POST /papi/v1/ping` for connectivity test + +--- + +## 2023-07-04[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +REST + +- The following endpoints will be adjust to keep only recent three month data: + - `GET /fapi/v1/order`(effective 2023-07-27) + - `GET /fapi/v1/allOrders`(effective 2023-07-27) + - `GET /fapi/v1/userTrades`(exact time TBD) +- Please maintain and record old order/trade infomation or switch querying historical order/trade using new endpoint below: + - New endpoint`GET /fapi/v1/order/asyn`to get Download Id For Futures Order History + - New endpoint`GET /fapi/v1/order/asyn/id`to get Futures Order History Download Link by Id + - New endpoint`GET /fapi/v1/trade/asyn`to get Download Id For Futures Trade History + - New endpoint`GET /fapi/v1/trade/asyn/id`to get Futures Trade History Download Link by Id + +--- + +## 2023-06-28[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +**Notice:** + +REST + +- The following endpoints will no longer be supported from 2023-07-15: + - `GET /fapi/v1/account` + - `GET /fapi/v1/balance` + - `GET /fapi/v1/positionRisk` +- Please switch to corresponding v2 endpoints: + - `GET /fapi/v2/account` + - `GET /fapi/v2/balance` + - `GET /fapi/v2/positionRisk` + +--- + +## 2023-06-22[​](https://developers.binance.com/docs/derivatives/change-log) + +COIN-M Futures + +**Notice:** + +WEBSOCKET + +- Raw stream like **/ws?** is not supported, for example `wss://dstream.binance.com/ws?btcusd@depth` is invalid. +- Sending websocket message with invalid JSON format will cause disconnection now, returning this error `{"error":{"code":3,"msg":"Invalid JSON: expected value at line 1 column 1"}}` + +--- + +## 2023-06-22[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +**Notice:** + +WEBSOCKET + +- Raw stream like **/ws?** is not supported, for example `wss://fstream.binance.com/ws?btcusdt@depth` is invalid. +- Sending websocket message with invalid JSON format will cause disconnection now, returning this error `{"error":{"code":3,"msg":"Invalid JSON: expected value at line 1 column 1"}}` + +--- + +## 2023-06-19[​](https://developers.binance.com/docs/derivatives/change-log) + +Portfolio Margin + +REST + +- Add fields `CONTRACT_PRICE`,`priceProtect` in endpoints `POST /papi/v1/um/conditional/order` and `POST/papi/v1/cm/conditional/order` + +--- + +## 2023-06-16[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +**Notice:** + +- It is recommended to use standard HTTP request formats, non-standard request formats will not be supported in fapi, below are some examples for correct code practice: + + - Escaping (") with '\\x22' is no longer supported, please use the standard '%22' instead. It is necessary to URL encode the square brackets \[\] and the double quotes(")inside the square brackets. + + ``` + DELETE /fapi/v1/batchOrders?origClientOrderIdList=Unsupported: + ``` + + \[\\x229151944646313025900\\x22\] + + ``` + Suggest: + ``` + + \["9151944646313025900"\] + + ``` + --After URL encode-- + ``` + + DELETE /fapi/v1/batchOrders?origClientOrderIdList=%5B%229151944646313025900%22%5D + + - Non-standard nested JSON formats are not supported, + + ``` + POST /fapi/v1/batchOrders?batchOrders=Unsupported: + ``` + + \["{\\"type\\":\\"LIMIT\\",\\"timeInForce\\":\\"GTC\\"}"\] + + ``` + Suggest: + ``` + + \[{"type":"LIMIT","timeInForce":"GTC"}\] + + ``` + --After URL encode-- + ``` + + POST /fapi/v1/batchOrders?batchOrders=%5B%7B%22type%22%3A%22LIMIT%22%2C%22timeInForce%22%3A%22GTC%22%7D%5D + + - Using incorrect data type is not supported + + ``` + DELETE /fapi/v1/batchOrders?orderIdList=As the data type of the 'orderIdList' parameter is LIST\Unsupported: + ``` + + \["159856286502","159856313662"\] + + ``` + Suggest: + ``` + + \[159856286502,159856313662\] + + ``` + --After URL encode-- + ``` + + DELETE /fapi/v1/batchOrders?orderIdList=%5B159856286502%2C159856313662%5D + + - Invalid whitespace characters from the request parameters are not supported + + ``` + Unsupported: + ``` + + POST symbol=BTCUSDT& price= 40000.0 & signature=2d24a314 + + ``` + Suggest: + ``` + + POST symbol=BTCUSDT&&price=40000.0&signature=2d24a314 + + - Passing empty values in request parameters is not supported + + ``` + Unsupported: + ``` + + GET symbol=BTCUSDT&orderId=&signature=2d24a314 + + Suggest: + + GET symbol=BTCUSDT&signature=2d24a314 + + +--- + +## 2023-06-14[​](https://developers.binance.com/docs/derivatives/change-log) + +COIN-M Futures + +WEBSOCKET + +- New field `i` for quote asset and index price added in streams `@markPrice` and `@markPrice` + +--- + +## 2023-06-14[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +WEBSOCKET + +- New WebSocket stream `!assetIndex@arr`OR`@assetIndex` for multi-assets mode asset index update + +--- + +## 2023-06-01[​](https://developers.binance.com/docs/derivatives/change-log) + +Portfolio Margin + +REST + +- The endpoints below will be deployed on 2023-06-02: + - New endpoints `GET /papi/v1/um/income` and `GET /papi/v1/cm/income` to query portfolio margin UM/CM income history + - New endpoints `GET /papi/v1/um/account` and `GET /papi/v1/cm/account` to query portfolio margin UM/CM account history + +--- + +## 2023-05-31[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +WEBSOCKET + +- Add user data stream: + - new event `CONDITIONAL_ORDER_TRIGGER_REJECT` to the order reject reason for triggered TP/SL order + +--- + +## 2023-05-30[​](https://developers.binance.com/docs/derivatives/change-log) + +European Options + +General Information on Endpoints + +- For `GET` endpoints, parameters must be sent as a `query string` without setting content type in the http headers. + +--- + +## 2023-05-05[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +REST + +- New endpoints `PUT /fapi/v1/order` and `PUT /fapi/v1/batchOrders` to support limit order modify +- New endpoint `GET /fapi/v1/orderAmendment` to get order modify history + +WEBSOCKET + +- New type "AMENDMENT" as order modify in Execution Type `x` of Order Update event `ORDER_TRADE_UPDATE` + +--- + +## 2023-05-04[​](https://developers.binance.com/docs/derivatives/change-log) + +Portfolio Margin + +- API doc for portfolio margin + +--- + +## 2023-04-17[​](https://developers.binance.com/docs/derivatives/change-log) + +COIN-M Futures + +**RELEASE DATE TBD** + +The `recvWindow` check will also be performed when orders reach matching engine. The `recvWindow` will be checked more precisely on order placing endpoints. + +``` +{ "code": -4188, "msg": "Timestamp for this request is outside of the ME recvWindow"} +``` + +**recvWindow Logic Before Release:** + +- The order placing requests are valid if `recvWindow` + `timestamp` => REST API service server `timestamp` + +**recvWindow Logic After Release:** + +- Add new recwWindow check: the order placing requests are valid if `recvWindow` + `timestamp` => matching engine `timestamp` + +- Impacted Endpoints: + + - POST /dapi/v1/order (HMAC SHA256) + - PUT /dapi/v1/order (HMAC SHA256) + - POST /dapi/v1/batchOrders (HMAC SHA256) + - PUT /dapi/v1/batchOrders (HMAC SHA256) + +--- + +## 2023-04-17[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +**RELEASE DATE 2023-04-18** + +The `recvWindow` check will also be performed when orders reach matching engine. The `recvWindow` will be checked more precisely on order placing endpoints. + +``` +{ "code": -5028, "msg": "Timestamp for this request is outside of the ME recvWindow"} +``` + +**recvWindow Logic Before Release:** + +- The order placing requests are valid if `recvWindow` + `timestamp` => REST API service server `timestamp` + +**recvWindow Logic After Release:** + +- Add new recwWindow check: the order placing requests are valid if `recvWindow` + `timestamp` => matching engine `timestamp` + +- Impacted Endpoints: + + - POST /fapi/v1/order + - PUT /fapi/v1/order + - POST /fapi/v1/batchOrders + - PUT /fapi/v1/batchOrders + +--- + +## 2023-03-28[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +**Referal Rebate Logic Before Release** + +- For every trade,the referal rebate balance change will be reflected in `ACCOUNT_UPDATE` event of USER-DATA-STREAM in real time: + +``` +{ "e": "ACCOUNT_UPDATE", "T": 1679974782150, "E": 1679974782155, "a": { "B": [ { "a": "USDT", "wb": "685.31478079", "cw": "677.17212454", "bc": "0.00258637" } ], "P": [], "m": "ADMIN_DEPOSIT" }} +``` + +**Referal Rebate Logic After Release** + +- Referral rebates are aggregated every 20 minutes and reflected as a single push in the `ACCOUNT_UPDATE` event of the USER-DATA-STREAM, showing the total sum of rebates earned from multiple referrals. + +--- + +## 2023-03-08[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +**RELEASE DATE 2023-03-22** + +**Order Logic Before Release:** + +- When placing order with `timeInForce` `FOK` or `GTX`(Post-only), user will get order response with `status` = “NEW“ and corresponding `order_trade_update` with `x` = “NEW”, `X` = “NEW”. If the orders can't meet execution criteria, user will receive another websocket `order_trade_update` message `x` = “EXPIRED”, `X` = “EXPIRED”. The order can be found in `GET /fapi/v1/order` or `GET /fapi/v1/allOrders`. + +``` +{ "code": -5021, "msg": "Due to the order could not be filled immediately, the FOK order has been rejected. The order will not be recorded in the order history"} +``` + +**Order Logic After Release:** + +- When placing order with `timeInForce` `FOK` or `GTX`(Post-only), if the order can't meet execution criteria, order will get rejected directly and receive error response, no `order_trade_update` message in websocket. The order can't be found in `GET /fapi/v1/order` or `GET /fapi/v1/allOrders`. + +``` +{ "code": -5022, "msg": "Due to the order could not be executed as maker, the Post Only order will be rejected. The order will not be recorded in the order history"} +``` + +- Impacted Endpoints: + - POST /fapi/v1/order + - POST /fapi/v1/batchOrders + - GET /fapi/v1/order + - GET /fapi/v1/allOrders + +--- + +## 2023-02-02[​](https://developers.binance.com/docs/derivatives/change-log) + +European Options + +REST + +- Endpoint `POST /eapi/v1/transfer` is disabled. + +--- + +## 2023-01-11[​](https://developers.binance.com/docs/derivatives/change-log) + +European Options + +REST + +- Add endpoint `GET /eapi/v1/order` to check order status. + +--- + +## 2023-01-04[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +WEBSOCKET + +- Delete Order Status `NEW_INSURANCE` and `NEW_ADL` in Order Update Event + +--- + +## 2022-12-16[​](https://developers.binance.com/docs/derivatives/change-log) + +COIN-M Futures + +WEBSOCKET + +- New WebSocket stream `!contractInfo` for symbol information update + +--- + +## 2022-12-16[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +WEBSOCKET + +- New WebSocket stream `!contractInfo` for symbol information update + +--- + +## 2022-12-13[​](https://developers.binance.com/docs/derivatives/change-log) + +European Options + +WEBSOCKET + +- Add `u` and `pu` in stream`@depth1000` to get diff orderbook update. + +--- + +## 2022-12-09[​](https://developers.binance.com/docs/derivatives/change-log) + +European Options + +REST + +- Add updateId field `u` in `GET /eapi/v1/depth` +- Add parameter `underlying` in `GET /eapi/v1/exerciseHistory` to query exercise histroy by underlying + +--- + +## 2022-11-29[​](https://developers.binance.com/docs/derivatives/change-log) + +COIN-M Futures + +WEB SOCKET USER DATA STREAM + +- New WebSocket stream `STRATEGY_UPDATE` in USER-DATA-STREAM: update when a strategy is created/cancelled/expired, ...etc. +- New WebSocket stream `GRID_UPDATE` in USER-DATA-STREAM: update when a sub order of a grid is filled or partially filled. + +--- + +## 2022-11-29[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +WEB SOCKET USER DATA STREAM + +- New WebSocket stream `STRATEGY_UPDATE` in USER-DATA-STREAM: update when a strategy is created/cancelled/expired, ...etc. +- New WebSocket stream `GRID_UPDATE` in USER-DATA-STREAM: update when a sub order of a grid is filled or partially filled. + +--- + +## 2022-11-18[​](https://developers.binance.com/docs/derivatives/change-log) + +European Options + +REST + +- New endpoint `GET /eapi/v1/openInterest` is added to get options open interest for specific underlying on certain expiration date. + +WEBSOCKET + +- New stream `@openInterest@` is added for real-time option open interest feed. + +--- + +## 2022-11-16[​](https://developers.binance.com/docs/derivatives/change-log) + +European Options + +WEBSOCKET + +- New trade stream `@trade` is added for all option trades on specific underlying asset. +- Adjust format in stream `option_pair`. + +--- + +## 2022-11-03[​](https://developers.binance.com/docs/derivatives/change-log) + +European Options + +REST + +- New endpoint for Auto-Cancel All Open Orders will be added on 2022-11-07: + - `POST /eapi/v1/countdownCancelAll`:Set Auto-Cancel All Open Orders (Kill-Switch) Config + - `GET /eapi/v1/countdownCancelAll`:Get Auto-Cancel All Open Orders (Kill-Switch) Config + - `POST /eapi/v1/countdownCancelAllHeartBeat`:Auto-Cancel All Open Orders (Kill-Switch) Heartbeat + +--- + +## 2022-10-13[​](https://developers.binance.com/docs/derivatives/change-log) + +COIN-M Futures + +**Note:** This change will be effictive on 2022-10-17 + +REST RATE LIMIT WEIGHT + +Endpoint `GET /dapi/v1/ticker/bookTicker` + +**Weight Update:** + +**2** for a single symbol; +**5** when the symbol parameter is omitted + +--- + +## 2022-10-13[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +**Note:** This change will be effictive on 2022-10-17 + +REST RATE LIMIT WEIGHT + +Endpoint `GET /fapi/v1/ticker/bookTicker` + +**Weight Update:** + +**2** for a single symbol; +**5** when the symbol parameter is omitted + +--- + +## 2022-09-22[​](https://developers.binance.com/docs/derivatives/change-log) + +COIN-M Futures + +- Add new endpoint for Portfolio Margin: + - `GET /dapi/v1/pmAccountInfo`: Get Portfolio Margin current account information. + +--- + +## 2022-09-22[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +- Update endpoint for Account/Trade: + - `GET /fapi/v1/income`: Support more incomeType +- Add new endpoint for Portfolio Margin: + - `GET /fapi/v1/pmAccountInfo`: Get Portfolio Margin current account information. + +--- + +## 2022-09-20[​](https://developers.binance.com/docs/derivatives/change-log) + +European Options + +WEBSOCKET + +- New streams `@markPrice` and `@ticker@` are added. +- Streams `` will be deprecated on 2022/10/30. + +--- + +## 2022-09-14[​](https://developers.binance.com/docs/derivatives/change-log) + +European Options + +REST + +- Adjust endpoint field `strikePrice`,`makerFeeRate`,`takerFeeRate`,`minQty`,`maxQty`,`initialMargin`,`maintenanceMargin`,`minInitialMargin`,`minMaintenanceMargin` to string in endpoint `GET /eapi/v1/exchangeInfo` +- Only finished orders within 5 days can be queried in `GET /eapi/v1/historyOrders` + +--- + +## 2022-09-05[​](https://developers.binance.com/docs/derivatives/change-log) + +European Options + +REST + +- Adjust response result in endpoint `DELETE /eapi/v1/allOpenOrdersByUnderlying` + +--- + +## 2022-08-22[​](https://developers.binance.com/docs/derivatives/change-log) + +European Options + +REST + +- Add `rateLimits` information in endpoint `GET /eapi/v1/exchangeInfo` +- Parameters `symbol` set to not mandatory in `GET /eapi/v1/userTrades` + +--- + +## 2022-07-27[​](https://developers.binance.com/docs/derivatives/change-log) + +COIN-M Futures + +REST RATE LIMIT WEIGHT + +- The weight of endpoint `GET /dapi/v1/trades` is updated to 5 + +--- + +## 2022-07-27[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +REST RATE LIMIT WEIGHT + +- The weight of endpoint `GET /fapi/v1/trades` is updated to 5 + +--- + +## 2022-06-28[​](https://developers.binance.com/docs/derivatives/change-log) + +COIN-M Futures + +REST + +- New endpoint `GET /dapi/v1/pmExchangeInfo` to get current Portfolio Margin exchange trading rules. + +--- + +## 2022-06-28[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +REST + +- New endpoint `GET /fapi/v1/pmExchangeInfo` to get current Portfolio Margin exchange trading rules. + +--- + +## 2022-04-28[​](https://developers.binance.com/docs/derivatives/change-log) + +COIN-M Futures + +REST + +- New endpoints `PUT /dapi/v1/order` and `PUT /dapi/v1/batchOrders` to support limit order modify +- New endpoint `GET /dapi/v1/orderAmendment` to get order modify history + +WEBSOCKET + +- New type "AMENDMENT" as order modify in Execution Type `x` of Order Update event `ORDER_TRADE_UPDATE` + +--- + +## 2022-04-14[​](https://developers.binance.com/docs/derivatives/change-log) + +COIN-M Futures + +WEB SOCKET USER DATA STREAM + +- New WebSocket stream `ACCOUNT_CONFIG_UPDATE` in USER-DATA-STREAM for leverage changed update + +--- + +## 2022-03-01[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +REST + +- New endpoint`GET /fapi/v1/income/asyn`to get Download Id For Futures Transaction History +- New endpoint`GET /fapi/v1/income/asyn/id`to get Futures Transaction History Download Link by Id + +--- + +## 2022-02-18[​](https://developers.binance.com/docs/derivatives/change-log) + +COIN-M Futures + +REST + +- The maximum value of `limit` in `GET /dapi/v1/userTrades` is adjusted to 1000 + +--- + +## 2022-02-10[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +REST + +- Update `GET /fapi/v2/account` endpoints: + - If user is in multiAssetsMargin mode, all assets will be included in calculation for fields `totalInitialMargin``totalMaintMargin``totalWalletBalance``totalUnrealizedProfit``totalMarginBalance``totalPositionInitialMargin``totalOpenOrderInitialMargin``totalCrossWalletBalance``totalCrossUnPnl``availableBalance``maxWithdrawAmount` and the results will be show as value in USD + - If user is in singleAssetsMargin mode, only USDT assets are included in the calculation(same as before) + +--- + +## 2021-12-30[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +WEBSOCKET + +- New connection method for WEBSOCKET. + - Base Url is `wss://fstream-auth.binance.com` + - Streams can be access either in a single raw stream or a combined stream + - Raw streams are accessed at `/ws/?listenKey=` + - Combined streams are accessed at `/stream?streams=//&listenKey=` + - `` must be a valid listenKey when you establish a connection. +- More details: [Websocket Market Streams](https://developers.binance.com/docs/derivatives/change-log) and [User Data Streams](https://developers.binance.com/docs/derivatives/change-log) + +--- + +## 2021-11-02[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +REST + +- New endpoint`GET /fapi/v1/assetIndex`to get asset index for Multi-Assets mode margin asset + +--- + +## 2021-08-18[​](https://developers.binance.com/docs/derivatives/change-log) + +COIN-M Futures + +REST + +- New field `positionAmt` as position amount in response of `GET /dapi/v1/account` + +--- + +## 2021-08-17[​](https://developers.binance.com/docs/derivatives/change-log) + +COIN-M Futures + +REST + +- New endpoints `PUT /dapi/v1/order` and `PUT /dapi/v1/batchOrders` to support limit order modify +- New endpoint `GET /dapi/v1/orderAmendment` to get order modify history + +WEBSOCKET + +- New type "AMENDMENT" as order modify in Execution Type `x` of Order Update event `ORDER_TRADE_UPDATE` + +--- + +## 2021-07-23[​](https://developers.binance.com/docs/derivatives/change-log) + +COIN-M Futures + +REST + +- New field `updateTime` as last update time of asset and position in response of `GET /dapi/v1/account` and `GET /dapi/v1/positionRisk` + +--- + +## 2021-07-06[​](https://developers.binance.com/docs/derivatives/change-log) + +COIN-M Futures + +REST + +- New fields in the response of `GET /dapi/v1/exchangeInfo`: + - "liquidationFee" for liquidation fee rate + - "marketTakeBound" for he max price difference rate( from mark price) a market order can make + +--- + +## 2021-07-06[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +REST + +- New field `updateTime` as last update time of asset and position in response of `GET /fapi/v2/account` and `GET /fapi/v2/positionRisk` +- New fields in the response of `GET /fapi/v1/exchangeInfo`: + - "liquidationFee" for liquidation fee rate + - "marketTakeBound" for he max price difference rate( from mark price) a market order can make + +--- + +## 2021-06-15[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +WEBSOCKET + +- New fields "q" and "i" for quote asset and index price added in stream `@compositeIndex` + +REST + +- Update endpoints: + - New fields `component` and `quoteAsset` as component asset and quote asset added in response of `GET /fapi/v1/indexInfo` + +--- + +## 2021-05-06[​](https://developers.binance.com/docs/derivatives/change-log) + +COIN-M Futures + +WEBSOCKET + +- New field "bc" for balance change in event "ACCOUNT\_UPDATE" + +--- + +## 2021-05-06[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +WEBSOCKET + +- Update streams: + - Previous Leverage Update event `ACCOUNT_CONFIG_UPDATE` expanded as account configuration update event, including leverage update and Multi-Assets margin status update. + - Balance and Position Update event `ACCOUNT_UPDATE` add new event reason type `m` as `AUTO_EXCHANGE`to represent Multi-Assets margin auto-exchange event + +REST + +- New endpoints: + + - `POST /fapi/v1/multiAssetsMargin` to change Multi-Assets margin mode + - `GET /fapi/v1/multiAssetsMargin` to check Multi-Assets margin mode +- Update endpoints: + + - New object `assets` as asset information in response of `GET /fapi/v1/exchangeInfo`. + - New field `marginAvailable` in response of `GET /fapi/v2/balance` and `GET /fapi/v2/account` to indicate whether the asset can be used as margin in Multi-Assets mode. + +--- + +## 2021-04-27[​](https://developers.binance.com/docs/derivatives/change-log) + +COIN-M Futures + +WEBSOCKET + +- The following liquidation orders streams do not push realtime order data anymore. Instead, they push snapshot order data at a maximum frequency of 1 order push per second.: + - `@forceOrder` + - `!forceOrder@arr` + +REST + +- The endpoint `GET /dapi/v1/allForceOrders` stop being maintained and no longer accepts request. + +--- + +## 2021-04-27[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +WEBSOCKET + +- The following liquidation orders streams do not push realtime order data anymore. Instead, they push snapshot order data at a maximum frequency of 1 order push per second.: + - `@forceOrder` + - `!forceOrder@arr` + +REST + +- The endpoint `GET /fapi/v1/allForceOrders` stop being maintained and no longer accepts request. + +--- + +## 2021-04-22[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +WEBSOCKET + +- New field "bc" for balance change in event "ACCOUNT\_UPDATE" + +--- + +## 2021-03-10[​](https://developers.binance.com/docs/derivatives/change-log) + +COIN-M Futures + +REST + +- The query time period for endpoint `GET /dapi/v1/allForceOrders` must be less than 7 days (default as the recent 7 days). + +--- + +## 2021-03-02[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +- New endpoint `GET /fapi/v1/indexPriceKlines` to get index price kline/candlestick data. + +- New endpoint `GET /fapi/v1/markPriceKlines` to get mark price kline/candlestick data. + + +--- + +## 2021-02-24[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +REST RATE LIMIT WEIGHT + +- The weight of endpoint `GET /fapi/v2/balance` is updated to 5 +- The weight of endpoint `GET /fapi/v2/positionRisk` is updated to 5 + +--- + +## 2021-02-22[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +REST RATE LIMIT WEIGHT + +- The weight of endpoint `GET /fapi/v1/income` is updated to 30 + +REST + +- The query time period for endpoint `GET /fapi/v1/allOrders` must be less than 7 days. +- The query time period for endpoint `GET /fapi/v1/allForceOrders` must be within the recent 7 days. + +--- + +## 2021-01-26[​](https://developers.binance.com/docs/derivatives/change-log) + +COIN-M Futures + +REST RATE LIMIT WEIGHT + +- Following endpoints' weights will be updated to 20 with symbol and 50 without symbol: + - `GET /dapi/v1/allForceOrders` + - `GET /dapi/v1/forceOrders` + +--- + +## 2021-01-26[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +WEB SOCKET USER DATA STREAM + +- New WebSocket stream `ACCOUNT_CONFIG_UPDATE` in USER-DATA-STREAM for leverage changed update + +REST RATE LIMIT WEIGHT + +- Following endpoints' weights will be updated to 20 with symbol and 50 without symbol: + - `GET /fapi/v1/allForceOrders` + - `GET /fapi/v1/forceOrders` + +REST + +- New filter "MIN\_NOTIONAL" whicht defines the minimum notional value allowed for an order on a symbol, and shown in the `/fapi/v1/exchangeInfo` + +--- + +## 2021-01-21[​](https://developers.binance.com/docs/derivatives/change-log) + +COIN-M Futures + +The regular expression rule for `newClientOrderId` updated as `^[\.A-Z\:/a-z0-9_-]{1,36}$` + +--- + +## 2021-01-21[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +The regular expression rule for `newClientOrderId` updated as `^[\.A-Z\:/a-z0-9_-]{1,36}$` + +--- + +## 2021-01-04[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +REST RATE LIMIT WEIGHT + +- Following endpoints will use new weight rule based on the paremeter "LIMIT" in the request: + + - `GET /fapi/v1/klines` + - `GET /fapi/v1/continuousKlines` +- Following endpoints' weights will be updated to 20: + + - `GET /fapi/v1/historicalTrades` + - `GET /fapi/v1/allForceOrders` + - `GET /fapi/v1/forceOrders` + - `GET /fapi/v1/aggTrades` + +--- + +## 2020-12-30[​](https://developers.binance.com/docs/derivatives/change-log) + +COIN-M Futures + +REST + +- Following DAPI endpoints will use new weight rule based on the parameter "LIMIT" in the request: + + - `GET /dapi/v1/klines` + - `GET /dapi/v1/continuousKlines` + - `GET /dapi/v1/indexPriceKlines` + - `GET /dapi/v1/markPriceKlines` +- Following DAPI endpoints' weights will be updated to 20: + + - `GET /dapi/v1/historicalTrades` + - `GET /dapi/v1/allForceOrders` + - `GET /dapi/v1/forceOrders` + - `GET /dapi/v1/aggTrades` + +--- + +## 2020-12-08[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +WEBSOCKET + +- New field `e` for event type in payload of streams `@bookTicker` and `!bookTicker` +- New field `P` for estimated settle price in payload of streams `@markPrice`, `@markPrice@1s`, `!markPrice@arr`, and `!markPrice@arr@1s`. +- New stream `_@continuousKline_` for continuous contract kline + +REST API + +- New field "estimatedSettlePrice" in response to `GET /fapi/v1/premiumIndex` + +- New fields in response to `GET /fapi/v1/exchangeInfo`: + + - "pair" + - "contractType" + - "deliveryDate" + - "onboardDate" +- New endpoint `GET /fapi/v1/continuousKlines` to get continuous contract kline data + + +ENUM + +- Contract types: + - PERPETUAL + - CURRENT\_MONTH + - NEXT\_MONTH + - CURRENT\_QUARTER + - NEXT\_QUARTER + +--- + +## 2020-11-27[​](https://developers.binance.com/docs/derivatives/change-log) + +COIN-M Futures + +- New endpoint `GET /dapi/v1/commissionRate` to get user commission rate. + +--- + +## 2020-11-27[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +- New endpoint `GET /fapi/v1/commissionRate` to get user commission rate. + +--- + +## 2020-11-13[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +WEB SOCKET STREAM + +- In order to provide users with more secure and stable services, the update time of `depth@0ms` and `@depth@0ms` is dynamically adjusted according to the total amount of data traffic and other objective conditions. + +--- + +## 2020-11-10[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +- New field "marginAsset" for margin asset in the response to `GET /fapi/v1/exchangeInfo`. +- New field "positionAmt" for position amount in the response to `GET /fapi/v2/account`. + +--- + +## 2020-11-09[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +WEB SOCKET USER DATA STREAM + +Please notice: new streamlined and optimized push rules on event `ACCOUNT_UPDATE` in USER-DATA-STREAM + +- When an asset of a user is changed: + + - Only this asset and its balance information will be pushed + - Other assets and information will no longer be pushed even the balances may not be 0 + - If none of the open positions change, the position "P" will only return an empty `[]` +- When a position or the margin type of a symbol is changed: + + - "P" will push the details in the "BOTH" position of this symbol + - If the change happens in "LONG" or "SHORT" position, the changed "LONG" or "SHORT" position of this symbol will be pushed + - Initialized "LONG" or "SHORT" isolated position of this symbol will also be pushed + - Position information of other symbols will no longer be pushed, even their positions may not be 0 +- In short, the **full** information of assets and positions should be obtained via the related RESTful endpoints(`GET /fapi/v2/account` and `GET /fapi/v2/positionRisk`), and the locally cached asset or position data can be updated via the event `ACCOUNT_UPDATE` in Websocket USER-DATA-STREAM with the information of **changed** asset or position. + +- Please visit [here](https://dev.binance.vision/t/838) to get examples for helping to understand the upgrade. + + +--- + +## 2020-10-27[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +WEB SOCKET STREAM + +- The maximum stream number that a single connection can listen to changes as 200. + +--- + +## 2020-10-10[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +WEBSOCKET + +- New WebSocket streams `@compositeIndex` for composite index symbol information. + +--- + +## 2020-10-09[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +- New endpoint `GET /fapi/v1/indexInfo` to get information of composite index. + +--- + +## 2020-09-18[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +- New endpoint `GET /fapi/v1/apiTradingStatus` to get futures API trading quantitative rules indicators + +--- + +## 2020-09-16[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +- New endpoint `GET /fapi/v1/lvtKlines` to get gistorical BLVT Kline. + The BLVT NAV system is working relatively with Binance Futures, so the endpoint is based on fapi. + +WEBSOCKET + +- New WebSocket streams for BLVT + The BLVT NAV system is working relatively with Binance Futures, so the endpoint is based on futures websocket service. + \_ `@tokenNav` for BLVT Info streams \_ `@nav_kline_` for BLVT NAV Kline streams + +--- + +## 2020-09-09[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +- Some orders that were cancelled/expired will be removed gradually from API endpoints. + - Orders that meet criteria + - order status is `CANCELED` or `EXPIRED`, **AND** + - order has NO filled trade, **AND** + - created time + 7 days < current time + - These endpoints are affected: + - `GET /fapi/v1/order` + - `GET /fapi/v1/allOrders` + +--- + +## 2020-08-16[​](https://developers.binance.com/docs/derivatives/change-log) + +COIN-M Futures + +WEBSOCKET + +- Websocket Request for user data: + - `@account` request for user's account information + - `@balance` request for user's account balance + - `@balance` request for user's position information + +REST + +- New endpoint `GET /dapi/v1/adlQuantile` to get the positions' ADL quantile estimation values + +--- + +## 2020-08-14[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +- New field "indexPrice" in response to endpoint `GET /fapi/v1/premiumIndex`. +- New field "i" for indexPrice in payload of ws streams: + - `@markPrice`, + - `@markPrice@1s`, + - `!markPrice@arr`, + - `!markPrice@arr@1s` + +--- + +## 2020-08-12[​](https://developers.binance.com/docs/derivatives/change-log) + +COIN-M Futures + +- New endpoint `GET /dapi/v1/forceOrders` to get the user's force orderes. + +--- + +## 2020-08-12[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +- New endpoint `GET /fapi/v1/forceOrders` to get the user's force orderes. + +--- + +## 2020-08-11[​](https://developers.binance.com/docs/derivatives/change-log) + +COIN-M Futures + +COIN MARGINED PERPETUAL FUTURES + +- New contract type ("contractType") `PERPETUAL` for coin margined perpetual futures countract. + +- New fields in the reponse to endpoint `GET /dapi/v1/premiumIndex`: + + - `lastFundingRate` for the lasted funding rate of the perpetual futures contract + - `nextFundingTime` for the next funding time of the perpetual futures contract +- New endpoint `GET /dapi/v1/fundingRate` to get funding rate history of perpetual futures + +- New fields in the payload of WSS `@markPrice`, `@markPrice@1s`, `@markPrice`, and `@markPrice@1s`: + + - `r` for the lasted funding rate of the perpetual futures contract + - `T` for the next funding time of the perpetual futures contract + +--- + +## 2020-07-30[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +- New endpoint `GET /fapi/v1/adlQuantile` to get the positions' ADL quantile estimation values + +--- + +## 2020-07-22[​](https://developers.binance.com/docs/derivatives/change-log) + +COIN-M Futures + +- New endpoints of coin margined futures trading data: + - `GET /futures/data/openInterestHist` + - `GET /futures/data/topLongShortAccountRatio` + - `GET /futures/data/topLongShortPositionRatio` + - `GET /futures/data/globalLongShortAccountRatio` + - `GET /futures/data/takerBuySellVol` + - `GET /futures/data/basis` + +--- + +## 2020-07-17[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +- Weights of endpoint `GET /fapi/v1/income` has been changed as 20 + +--- + +## 2020-07-02[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +WEBSOCKET + +- New field "m" for event reason type in event "ACCOUNT\_UPDATE" +- New field "rp" for the realized profit of the trade in event "ORDER\_TRADE\_UPDATE" + +--- + +## 2020-06-15[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +- New fields in responses to `GET /fapi/v2/account` and `GET /fapi/v2/balance`: + - `availableBalance` + - `maxWithdrawAmount` + +--- + +## 2020-06-04[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +- New endpoints of version 2 of fapi, having better performance than the v1 endpoints: + - `GET /fapi/v2/account` + - `GET /fapi/v2/balance` + +--- + +## 2020-06-02[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +- New endpoint `GET /fapi/v2/positionRisk` in version 2 of fapi: + - User can choose to send specific "symbol". + - All symbols in the market can be returned. + - Different responses for "One-way" or "Hedge" position mode. + - Better performance than the v1 endpoint. + +--- + +## 2020-05-18[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +- New parameter `closePosition` for endpoint `POST /fapi/v1/order`: + If a `STOP_MARKET` or `TAKE_PROFIT_MARKET` order with `closePosition=true` is triggered,all of the current long position( if `SELL` order) or current short position( if `BUY` order) will be closed. +- New field `closePosition` in response to endpoints: + - `POST /fapi/v1/order` + - `POST /fapi/v1/batchOrders` + - `GET /fapi/v1/order` + - `DELETE /fapi/v1/order` + - `DELETE /fapi/v1/batchOrders` + - `GET /fapi/v1/openOrder` + - `GET /fapi/v1/openOrders` + - `GET /fapi/v1/allOrders` + +--- + +## 2020-05-18[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +- Some orders that were cancelled/expired will be removed gradually from API endpoints, but they are still available from Web UI. + - Orders that meet criteria + - order status is `CANCELED` or `EXPIRED`, **AND** + - order has NO filled trade, **AND** + - created time + 30 days < current time + - These endpoints are affected: + - `GET /fapi/v1/order` + - `GET /fapi/v1/allOrders` + +--- + +## 2020-05-15[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +- New fields in payloads of `@bookTicker` and `!bookTicker`: + - `E` for event time + - `T` for transaction time + +--- + +## 2020-05-14[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +- New field `time` for transaction time in response to endpoints: + - `GET /fapi/v1/ticker/price` + - `GET /fapi/v1/ticker/bookTicker` + - `GET /fapi/v1/openInterest` + +--- + +## 2020-05-11[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +- New endpoint `POST /fapi/v1/countdownCancelAll` to cancel all open orders of the specified symbol at the end of the specified countdown. + This rest endpoint means to ensure your open orders are canceled in case of an outage. The endpoint should be called repeatedly as heartbeats so that the existing countdown time can be canceled and repalced by a new one. + +--- + +## 2020-05-06[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +REST + +- Endpoint `GET /fapi/v1/leverageBracket` is changed as "USER-DATA". It need to be signed, and timestamp is needed. + +WEB SOCKET USER DATA STREAM + +- Please notice: event `ACCOUNT_UPDATE` in USER-DATA-STREAM will be pushed with only account balance or relative position when "FUNDING FEE" occurs. + - When "FUNDING FEE" occurs in a **crossed position**, `ACCOUNT_UPDATE` will be pushed with only the balance `B`(including the "FUNDING FEE" asset only), without any position `P` message. + - When "FUNDING FEE" occurs in an **isolated position**, `ACCOUNT_UPDATE` will be pushed with only the balance `B`(including the "FUNDING FEE" asset only) and the relative position message `P`( including the isolated position on which the "FUNDING FEE" occurs only, without any other position message). + +--- + +## 2020-04-25[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +- New fields in USER DATA STREAM event `ORDER_TRADE_UPDATE` : + + - `cp` stands for Close-All conditional order + - `AP` for Activation Price with `TRAILING_STOP_MARKET` order + - `cr` for Callback Rate with `TRAILING_STOP_MARKET` order +- New USER DATA STREAM event `MARGIN_CALL`. + + +--- + +## 2020-04-17[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +- New parameter `newOrderRespType` for response type in endpoint `POST /fapi/v1/order`. + `ACK` and `RESULT` are supported. And for `newOrderRespType= 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. + +--- + +## 2020-04-14[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +WEB SOCKET STREAM + +- WebSocket connections have a limit of 10 incoming messages per second. A message is considered: + - A PING frame + - A PONG frame + - A JSON control message (e.g. subscribe, unsubscribe) +- A connection that goes beyond the limit will be disconnected; IPs that are repeatedly disconnected may be banned. +- A single connection can listen to a maximum of 200 streams. + +--- + +## 2020-04-09[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +- New endpoint of futures trading data: `GET /futures/data/takerlongshortRatio` + +--- + +## 2020-04-08[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +- New endpoint `GET /fapi/v1/positionSide/dual` to get current position mode. +- New endpoint `POST /fapi/v1/batchOrders` to place multiple orders. + +--- + +## 2020-04-06[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +- Please notice: event `ACCOUNT_UPDATE` in USER-DATA-STREAM will not be pushed without update of account balances or positions. + + - `ACCOUNT_UPDATE` will be pushed only when update happens on user's account, including changes on balances, positions, or margin type. + - Unfilled orders or cancelled orders will not make the event `ACCOUNT_UPDATE` pushed, since there's no change on positions. + - Only positions of symbols with non-zero isolatd wallet or non-zero position amount will be pushed in the "position" part of the event `ACCOUNT_UPDATE`. +- New endpoint `POST /fapi/v1/positionSide/dual` to change position mode: Hedge Mode or One-way Mode. + +- New parameter `positionSide` in the following endpoints: + + - `POST /fapi/v1/order` + - `POST /fapi/v1/positionMargin` +- New field `positionSide` in the responses to the following endpoints: + + - `POST /fapi/v1/order` + - `GET /fapi/v1/order` + - `DELETE /fapi/v1/order` + - `DELETE /fapi/v1/batchOrders` + - `GET /fapi/v1/openOrder` + - `GET /fapi/v1/openOrders` + - `GET /fapi/v1/allOrders` + - `GET /fapi/v1/account` + - `GET /fapi/v1/positionMargin/history` + - `GET /fapi/v1/positionRisk` + - `GET /fapi/v1/userTrades` +- New field `ps` for "position side"in USER\_DATA\_STREAM events `ACCOUNT_UPDATE` and `ORDER_TRADE_UPDATE`. + + +--- + +## 2020-03-30[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +- New endpoints of futures trading data: + - `GET /futures/data/openInterestHist` + - `GET /futures/data/topLongShortAccountRatio` + - `GET /futures/data/topLongShortPositionRatio` + - `GET /futures/data/globalLongShortAccountRatio` + +## 2020-02-26[​](https://developers.binance.com/docs/derivatives/change-log) + +- New order type: `TRAILING_STOP_MARKET` + +--- + +## 2020-02-20[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +- New endpoint to query specific current open order: `GET /fapi/v1/openOrder` + +--- + +## 2020-02-17[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +- Update time changed as 1000ms for streams `@ticker` and `!ticker@arr` +- New diff depth data with 500ms updates: `@depth@500ms` +- New partial depth data with 500ms updates: `@depth@500ms` + +--- + +## 2020-02-12[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +- New [SDK and Code Demonstration](https://developers.binance.com/docs/derivatives/change-log) on Java + +- Faster mark price websocket data with 1s updates: `@markPrice@1s` and `!markPrice@arr@1s` + + +--- + +## 2020-02-05[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +- New market data endpoint`GET /fapi/v1/leverageBracket` to check notional and leverage brackets. + +--- + +## 2020-01-19[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +- "cumQty" is going to be removed from the responses to `DELETE /fapi/v1/order`, `DELETE /fapi/v1/batchOrders` and other `order` relatived endpoints in the coming weeks. + Please use "executedQty" instead. + +--- + +## 2020-01-17[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +- New [SDK and Code Demonstration](https://developers.binance.com/docs/derivatives/change-log) on Python + +--- + +## 2020-01-06[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +- Faster diff data with real time updates: `@depth@0ms` + +--- + +## 2020-01-03[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +- New endpoints related to isolated position: + + - `POST /fapi/v1/marginType` + - `POST /fapi/v1/positionMargin` + - `GET /fapi/v1/positionMargin/history` +- New field in response to `GET /fapi/v1/positionRisk` related to isolated position: + + - `marginType` + - `isolatedMargin` +- New field in response to `GET /fapi/v1/account`related to isolated position: `isolated` + +- New field in event `ACCOUNT_UPDATE`: + + - "cw" for cross wallet + - "mt" for margin type + - "iw" for isolated wallet (if isolated) + +--- + +## 2019-12-19[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +- New endpoint `GET /fapi/v1/openInterest` to get present open interest of a specific symbol. + +--- + +## 2019-12-18[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +- New event type in user data stream:`listenKeyExpired`. + +--- + +## 2019-12-12[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +- New endpoint `DELETE /fapi/v1/allOpenOrders` to cancel all open orders of a specific symbol. +- New endpoint`DELETE /fapi/v1/batchOrders` to cancel a list of open orders. +- `reduceOnly` has been supported in orders with type: + - `TAKE_PROFIT` + - `TAKE_PROFIT_MARKET` + - `STOP` + - `STOP_MARKET` + +--- + +## 2019-11-29[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +- New endpoint `GET /fapi/v1/allForceOrders` to get all liquidation orders. +- New websocket streams: + - `@forceOrder`for liquidation order streams + - `!forceOrder@arr` for all market liquidation order streams + +--- + +## 2019-11-25[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +- `GET /fapi/v1/account` has new field: `positions` +- Added new field `time` for order creation time in: + - `GET /fapi/v1/openOrders` + - `GET /fapi/v1/order` + - `GET /fapi/v1/allOrders` + +--- + +## 2019-11-15[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +- New websocket streams: + - `!miniTicker@arr`: All market 24hr mini-tickers stream. + - `!ticker@arr`: : All market 24hr tickers stream. + +--- + +## 2019-11-12[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +- WSS now supports live subscribing/unsubscribing to streams. + +--- + +## 2019-11-05[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +- New order type: + - `STOP_MARKET`, + - `TAKE_PROFIT_MARKET`. +- New parameter `workingType` in `POST /fapi/v1/order`: + order with stop price can be triggered by "CONTRACT\_PRICE" or "MARK\_PRICE" +- New keys in USER-DATA-STREAMS: + - in `ORDER_TRADE_UPDATE`: + - "T" as transaction time + - "wt" as workingType + - in `ACCOUNT_UPDATE`: + - "T" as transaction time + +--- + +## 2019-10-28[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +- New rest endpoint for income flow history `GET /fapi/v1/income` + +--- + +## 2019-10-25[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +- Added "up" in event `ACCOUNT_UPDATE` in user data stream: the unrealized PnL of the position. +- Added "R" in event `ORDER_TRADE_UPDATE` in user data stream, showing if the trade is reduce only. + +--- + +## 2019-10-24[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +- New WebSocket streams for booktickers added: `@bookTicker` and `!bookTicker`. +- New WebSocket streams for partial orderbook added: `@depth` and `@depth@100ms` +- Faster diff data with 100ms updates: `@depth@100ms` +- Added `Update Speed`: to `Websocket Market Streams` + +--- + +## 2019-10-18[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +- New endpoint `POST /fapi/v1/leverage` for changing user's initial leverage in specific symbol market. +- Added "leverage" for current initial leverage and "maxNotionalValue" for notional value limit of current initial leverage in response to `GET /fapi/v1/positionRisk`. +- `reduceOnly` now is supported in the `MARKET` orders. + +--- + +## 2019-10-14[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +- Added `GET /fapi/v1/fundingRate` for getting funding fee rate history. + +--- + +## 2019-10-11[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +- Added "m" in event `ORDER_TRADE_UPDATE` in user data stream, showing if the trade is the maker side. + +--- + +## 2019-10-08[​](https://developers.binance.com/docs/derivatives/change-log) + +USDⓈ-M Futures + +- New order parameter `reduceOnly` for `LIMIT` orders. +- New order type `TAKE_PROFIT`. + +--- + +- [2026-01-09](https://developers.binance.com/docs/derivatives/change-log) +- [2026-01-07](https://developers.binance.com/docs/derivatives/change-log) +- [2025-12-29](https://developers.binance.com/docs/derivatives/change-log) +- [2025-12-11](https://developers.binance.com/docs/derivatives/change-log) +- [2025-12-10](https://developers.binance.com/docs/derivatives/change-log) +- [2025-12-09](https://developers.binance.com/docs/derivatives/change-log) +- [2025-11-25](https://developers.binance.com/docs/derivatives/change-log) +- [2025-11-19](https://developers.binance.com/docs/derivatives/change-log) +- [2025-11-18](https://developers.binance.com/docs/derivatives/change-log) +- [2025-11-12](https://developers.binance.com/docs/derivatives/change-log) +- [2025-11-10](https://developers.binance.com/docs/derivatives/change-log) +- [2025-11-06](https://developers.binance.com/docs/derivatives/change-log) +- [2025-10-21](https://developers.binance.com/docs/derivatives/change-log) +- [2025-10-20](https://developers.binance.com/docs/derivatives/change-log) +- [2025-10-14](https://developers.binance.com/docs/derivatives/change-log) +- [2025-10-09](https://developers.binance.com/docs/derivatives/change-log) +- [2025-08-11](https://developers.binance.com/docs/derivatives/change-log) +- [2025-07-25](https://developers.binance.com/docs/derivatives/change-log) +- [2025-07-02](https://developers.binance.com/docs/derivatives/change-log) +- [2025-04-23](https://developers.binance.com/docs/derivatives/change-log) +- [2025-04-15](https://developers.binance.com/docs/derivatives/change-log) +- [2025-02-28](https://developers.binance.com/docs/derivatives/change-log) +- [2025-02-20](https://developers.binance.com/docs/derivatives/change-log) +- [2025-01-20](https://developers.binance.com/docs/derivatives/change-log) +- [2025-01-13](https://developers.binance.com/docs/derivatives/change-log) +- [2025-01-06](https://developers.binance.com/docs/derivatives/change-log) +- [2024-12-19](https://developers.binance.com/docs/derivatives/change-log) +- [2024-12-17](https://developers.binance.com/docs/derivatives/change-log) +- [2024-12-02](https://developers.binance.com/docs/derivatives/change-log) +- [2024-11-04](https://developers.binance.com/docs/derivatives/change-log) +- [2024-11-01](https://developers.binance.com/docs/derivatives/change-log) +- [2024-10-29](https://developers.binance.com/docs/derivatives/change-log) +- [2024-10-24](https://developers.binance.com/docs/derivatives/change-log) +- [2024-10-21](https://developers.binance.com/docs/derivatives/change-log) +- [2024-10-15](https://developers.binance.com/docs/derivatives/change-log) +- [2024-10-14](https://developers.binance.com/docs/derivatives/change-log) +- [2024-10-11](https://developers.binance.com/docs/derivatives/change-log) +- [2024-10-10](https://developers.binance.com/docs/derivatives/change-log) +- [2024-10-08](https://developers.binance.com/docs/derivatives/change-log) +- [2024-09-27](https://developers.binance.com/docs/derivatives/change-log) +- [2024-09-19](https://developers.binance.com/docs/derivatives/change-log) +- [2024-09-06](https://developers.binance.com/docs/derivatives/change-log) +- [2024-09-05](https://developers.binance.com/docs/derivatives/change-log) +- [2024-09-03](https://developers.binance.com/docs/derivatives/change-log) +- [2024-08-26](https://developers.binance.com/docs/derivatives/change-log) +- [2024-08-23](https://developers.binance.com/docs/derivatives/change-log) +- [2024-08-07](https://developers.binance.com/docs/derivatives/change-log) +- [2024-08-06](https://developers.binance.com/docs/derivatives/change-log) +- [2024-07-24](https://developers.binance.com/docs/derivatives/change-log) +- [2024-07-17](https://developers.binance.com/docs/derivatives/change-log) +- [2024-06-19](https://developers.binance.com/docs/derivatives/change-log) +- [2024-05-22](https://developers.binance.com/docs/derivatives/change-log) +- [2024-04-19](https://developers.binance.com/docs/derivatives/change-log) +- [2024-04-09](https://developers.binance.com/docs/derivatives/change-log) +- [2024-04-01](https://developers.binance.com/docs/derivatives/change-log) +- [2024-03-11](https://developers.binance.com/docs/derivatives/change-log) +- [2024-02-09](https://developers.binance.com/docs/derivatives/change-log) +- [2024-01-24](https://developers.binance.com/docs/derivatives/change-log) +- [2024-01-19](https://developers.binance.com/docs/derivatives/change-log) +- [2024-01-11](https://developers.binance.com/docs/derivatives/change-log) +- [2024-01-08](https://developers.binance.com/docs/derivatives/change-log) +- [2023-12-12](https://developers.binance.com/docs/derivatives/change-log) +- [2023-11-15](https://developers.binance.com/docs/derivatives/change-log) +- [2023-11-01](https://developers.binance.com/docs/derivatives/change-log) +- [2023-11-01](https://developers.binance.com/docs/derivatives/change-log) +- [2023-10-19](https://developers.binance.com/docs/derivatives/change-log) +- [2023-10-19](https://developers.binance.com/docs/derivatives/change-log) +- [2023-10-19](https://developers.binance.com/docs/derivatives/change-log) +- [2023-10-16](https://developers.binance.com/docs/derivatives/change-log) +- [2023-10-16](https://developers.binance.com/docs/derivatives/change-log) +- [2023-10-11](https://developers.binance.com/docs/derivatives/change-log) +- [2023-09-25](https://developers.binance.com/docs/derivatives/change-log) +- [2023-09-25](https://developers.binance.com/docs/derivatives/change-log) +- [2023-09-22](https://developers.binance.com/docs/derivatives/change-log) +- [2023-09-20](https://developers.binance.com/docs/derivatives/change-log) +- [2023-09-20](https://developers.binance.com/docs/derivatives/change-log) +- [2023-09-19](https://developers.binance.com/docs/derivatives/change-log) +- [2023-09-07](https://developers.binance.com/docs/derivatives/change-log) +- [2023-09-05](https://developers.binance.com/docs/derivatives/change-log) +- [2023-09-04](https://developers.binance.com/docs/derivatives/change-log) +- [2023-08-31](https://developers.binance.com/docs/derivatives/change-log) +- [2023-08-31](https://developers.binance.com/docs/derivatives/change-log) +- [2023-08-29](https://developers.binance.com/docs/derivatives/change-log) +- [2023-08-29](https://developers.binance.com/docs/derivatives/change-log) +- [2023-08-25](https://developers.binance.com/docs/derivatives/change-log) +- [2023-08-19](https://developers.binance.com/docs/derivatives/change-log) +- [2023-08-18](https://developers.binance.com/docs/derivatives/change-log) +- [2023-08-14](https://developers.binance.com/docs/derivatives/change-log) +- [2023-08-14](https://developers.binance.com/docs/derivatives/change-log) +- [2023-07-28](https://developers.binance.com/docs/derivatives/change-log) +- [2023-07-21](https://developers.binance.com/docs/derivatives/change-log) +- [2023-07-20](https://developers.binance.com/docs/derivatives/change-log) +- [2023-07-19](https://developers.binance.com/docs/derivatives/change-log) +- [2023-07-18](https://developers.binance.com/docs/derivatives/change-log) +- [2023-07-18](https://developers.binance.com/docs/derivatives/change-log) +- [2023-07-13](https://developers.binance.com/docs/derivatives/change-log) +- [2023-07-13](https://developers.binance.com/docs/derivatives/change-log) +- [2023-07-12](https://developers.binance.com/docs/derivatives/change-log) +- [2023-07-11](https://developers.binance.com/docs/derivatives/change-log) +- [2023-07-04](https://developers.binance.com/docs/derivatives/change-log) +- [2023-06-28](https://developers.binance.com/docs/derivatives/change-log) +- [2023-06-22](https://developers.binance.com/docs/derivatives/change-log) +- [2023-06-22](https://developers.binance.com/docs/derivatives/change-log) +- [2023-06-19](https://developers.binance.com/docs/derivatives/change-log) +- [2023-06-16](https://developers.binance.com/docs/derivatives/change-log) +- [2023-06-14](https://developers.binance.com/docs/derivatives/change-log) +- [2023-06-14](https://developers.binance.com/docs/derivatives/change-log) +- [2023-06-01](https://developers.binance.com/docs/derivatives/change-log) +- [2023-05-31](https://developers.binance.com/docs/derivatives/change-log) +- [2023-05-30](https://developers.binance.com/docs/derivatives/change-log) +- [2023-05-05](https://developers.binance.com/docs/derivatives/change-log) +- [2023-05-04](https://developers.binance.com/docs/derivatives/change-log) +- [2023-04-17](https://developers.binance.com/docs/derivatives/change-log) +- [2023-04-17](https://developers.binance.com/docs/derivatives/change-log) +- [2023-03-28](https://developers.binance.com/docs/derivatives/change-log) +- [2023-03-08](https://developers.binance.com/docs/derivatives/change-log) +- [2023-02-02](https://developers.binance.com/docs/derivatives/change-log) +- [2023-01-11](https://developers.binance.com/docs/derivatives/change-log) +- [2023-01-04](https://developers.binance.com/docs/derivatives/change-log) +- [2022-12-16](https://developers.binance.com/docs/derivatives/change-log) +- [2022-12-16](https://developers.binance.com/docs/derivatives/change-log) +- [2022-12-13](https://developers.binance.com/docs/derivatives/change-log) +- [2022-12-09](https://developers.binance.com/docs/derivatives/change-log) +- [2022-11-29](https://developers.binance.com/docs/derivatives/change-log) +- [2022-11-29](https://developers.binance.com/docs/derivatives/change-log) +- [2022-11-18](https://developers.binance.com/docs/derivatives/change-log) +- [2022-11-16](https://developers.binance.com/docs/derivatives/change-log) +- [2022-11-03](https://developers.binance.com/docs/derivatives/change-log) +- [2022-10-13](https://developers.binance.com/docs/derivatives/change-log) +- [2022-10-13](https://developers.binance.com/docs/derivatives/change-log) +- [2022-09-22](https://developers.binance.com/docs/derivatives/change-log) +- [2022-09-22](https://developers.binance.com/docs/derivatives/change-log) +- [2022-09-20](https://developers.binance.com/docs/derivatives/change-log) +- [2022-09-14](https://developers.binance.com/docs/derivatives/change-log) +- [2022-09-05](https://developers.binance.com/docs/derivatives/change-log) +- [2022-08-22](https://developers.binance.com/docs/derivatives/change-log) +- [2022-07-27](https://developers.binance.com/docs/derivatives/change-log) +- [2022-07-27](https://developers.binance.com/docs/derivatives/change-log) +- [2022-06-28](https://developers.binance.com/docs/derivatives/change-log) +- [2022-06-28](https://developers.binance.com/docs/derivatives/change-log) +- [2022-04-28](https://developers.binance.com/docs/derivatives/change-log) +- [2022-04-14](https://developers.binance.com/docs/derivatives/change-log) +- [2022-03-01](https://developers.binance.com/docs/derivatives/change-log) +- [2022-02-18](https://developers.binance.com/docs/derivatives/change-log) +- [2022-02-10](https://developers.binance.com/docs/derivatives/change-log) +- [2021-12-30](https://developers.binance.com/docs/derivatives/change-log) +- [2021-11-02](https://developers.binance.com/docs/derivatives/change-log) +- [2021-08-18](https://developers.binance.com/docs/derivatives/change-log) +- [2021-08-17](https://developers.binance.com/docs/derivatives/change-log) +- [2021-07-23](https://developers.binance.com/docs/derivatives/change-log) +- [2021-07-06](https://developers.binance.com/docs/derivatives/change-log) +- [2021-07-06](https://developers.binance.com/docs/derivatives/change-log) +- [2021-06-15](https://developers.binance.com/docs/derivatives/change-log) +- [2021-05-06](https://developers.binance.com/docs/derivatives/change-log) +- [2021-05-06](https://developers.binance.com/docs/derivatives/change-log) +- [2021-04-27](https://developers.binance.com/docs/derivatives/change-log) +- [2021-04-27](https://developers.binance.com/docs/derivatives/change-log) +- [2021-04-22](https://developers.binance.com/docs/derivatives/change-log) +- [2021-03-10](https://developers.binance.com/docs/derivatives/change-log) +- [2021-03-02](https://developers.binance.com/docs/derivatives/change-log) +- [2021-02-24](https://developers.binance.com/docs/derivatives/change-log) +- [2021-02-22](https://developers.binance.com/docs/derivatives/change-log) +- [2021-01-26](https://developers.binance.com/docs/derivatives/change-log) +- [2021-01-26](https://developers.binance.com/docs/derivatives/change-log) +- [2021-01-21](https://developers.binance.com/docs/derivatives/change-log) +- [2021-01-21](https://developers.binance.com/docs/derivatives/change-log) +- [2021-01-04](https://developers.binance.com/docs/derivatives/change-log) +- [2020-12-30](https://developers.binance.com/docs/derivatives/change-log) +- [2020-12-08](https://developers.binance.com/docs/derivatives/change-log) +- [2020-11-27](https://developers.binance.com/docs/derivatives/change-log) +- [2020-11-27](https://developers.binance.com/docs/derivatives/change-log) +- [2020-11-13](https://developers.binance.com/docs/derivatives/change-log) +- [2020-11-10](https://developers.binance.com/docs/derivatives/change-log) +- [2020-11-09](https://developers.binance.com/docs/derivatives/change-log) +- [2020-10-27](https://developers.binance.com/docs/derivatives/change-log) +- [2020-10-10](https://developers.binance.com/docs/derivatives/change-log) +- [2020-10-09](https://developers.binance.com/docs/derivatives/change-log) +- [2020-09-18](https://developers.binance.com/docs/derivatives/change-log) +- [2020-09-16](https://developers.binance.com/docs/derivatives/change-log) +- [2020-09-09](https://developers.binance.com/docs/derivatives/change-log) +- [2020-08-16](https://developers.binance.com/docs/derivatives/change-log) +- [2020-08-14](https://developers.binance.com/docs/derivatives/change-log) +- [2020-08-12](https://developers.binance.com/docs/derivatives/change-log) +- [2020-08-12](https://developers.binance.com/docs/derivatives/change-log) +- [2020-08-11](https://developers.binance.com/docs/derivatives/change-log) +- [2020-07-30](https://developers.binance.com/docs/derivatives/change-log) +- [2020-07-22](https://developers.binance.com/docs/derivatives/change-log) +- [2020-07-17](https://developers.binance.com/docs/derivatives/change-log) +- [2020-07-02](https://developers.binance.com/docs/derivatives/change-log) +- [2020-06-15](https://developers.binance.com/docs/derivatives/change-log) +- [2020-06-04](https://developers.binance.com/docs/derivatives/change-log) +- [2020-06-02](https://developers.binance.com/docs/derivatives/change-log) +- [2020-05-18](https://developers.binance.com/docs/derivatives/change-log) +- [2020-05-18](https://developers.binance.com/docs/derivatives/change-log) +- [2020-05-15](https://developers.binance.com/docs/derivatives/change-log) +- [2020-05-14](https://developers.binance.com/docs/derivatives/change-log) +- [2020-05-11](https://developers.binance.com/docs/derivatives/change-log) +- [2020-05-06](https://developers.binance.com/docs/derivatives/change-log) +- [2020-04-25](https://developers.binance.com/docs/derivatives/change-log) +- [2020-04-17](https://developers.binance.com/docs/derivatives/change-log) +- [2020-04-14](https://developers.binance.com/docs/derivatives/change-log) +- [2020-04-09](https://developers.binance.com/docs/derivatives/change-log) +- [2020-04-08](https://developers.binance.com/docs/derivatives/change-log) +- [2020-04-06](https://developers.binance.com/docs/derivatives/change-log) +- [2020-03-30](https://developers.binance.com/docs/derivatives/change-log) +- [2020-02-26](https://developers.binance.com/docs/derivatives/change-log) +- [2020-02-20](https://developers.binance.com/docs/derivatives/change-log) +- [2020-02-17](https://developers.binance.com/docs/derivatives/change-log) +- [2020-02-12](https://developers.binance.com/docs/derivatives/change-log) +- [2020-02-05](https://developers.binance.com/docs/derivatives/change-log) +- [2020-01-19](https://developers.binance.com/docs/derivatives/change-log) +- [2020-01-17](https://developers.binance.com/docs/derivatives/change-log) +- [2020-01-06](https://developers.binance.com/docs/derivatives/change-log) +- [2020-01-03](https://developers.binance.com/docs/derivatives/change-log) +- [2019-12-19](https://developers.binance.com/docs/derivatives/change-log) +- [2019-12-18](https://developers.binance.com/docs/derivatives/change-log) +- [2019-12-12](https://developers.binance.com/docs/derivatives/change-log) +- [2019-11-29](https://developers.binance.com/docs/derivatives/change-log) +- [2019-11-25](https://developers.binance.com/docs/derivatives/change-log) +- [2019-11-15](https://developers.binance.com/docs/derivatives/change-log) +- [2019-11-12](https://developers.binance.com/docs/derivatives/change-log) +- [2019-11-05](https://developers.binance.com/docs/derivatives/change-log) +- [2019-10-28](https://developers.binance.com/docs/derivatives/change-log) +- [2019-10-25](https://developers.binance.com/docs/derivatives/change-log) +- [2019-10-24](https://developers.binance.com/docs/derivatives/change-log) +- [2019-10-18](https://developers.binance.com/docs/derivatives/change-log) +- [2019-10-14](https://developers.binance.com/docs/derivatives/change-log) +- [2019-10-11](https://developers.binance.com/docs/derivatives/change-log) +- [2019-10-08](https://developers.binance.com/docs/derivatives/change-log) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_account_rest-api.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_account_rest-api.md new file mode 100644 index 0000000..ac8e88b --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_account_rest-api.md @@ -0,0 +1,12 @@ +--- +title: "New Future Account Transfer | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api" +fetched_at: "2026-01-27T05:28:00.545Z" +--- +!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){try{return new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}}()||function(){try{return window.localStorage.getItem("theme")}catch(t){}}();t(null!==e?e:"light")}(),function(){try{const n=new URLSearchParams(window.location.search).entries();for(var\[t,e\]of n)if(t.startsWith("docusaurus-data-")){var a=t.replace("docusaurus-data-","data-");document.documentElement.setAttribute(a,e)}}catch(t){}}() + +[Skip to main content](https://developers.binance.com/docs/derivatives/usds-margined-futures/general-info) + +# New Future Account Transfer + +Please find details from [here](https://developers.binance.com/docs/wallet/asset/user-universal-transfer). diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_account_rest-api_Account-Information.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_account_rest-api_Account-Information.md new file mode 100644 index 0000000..65bfc67 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_account_rest-api_Account-Information.md @@ -0,0 +1,55 @@ +--- +title: "Account Information | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Account-Information" +fetched_at: "2026-01-27T05:28:00.542Z" +--- +# Account Information (USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Account-Information) + +Get current account information. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Account-Information) + +GET `/dapi/v1/account` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Account-Information) + +**5** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Account-Information) + +Name + +Type + +Mandatory + +Description + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +> - for One-way Mode user, the "positions" will only show the "BOTH" positions +> - for Hedge Mode user, the "positions" will show "BOTH", "LONG", and "SHORT" positions. + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Account-Information) + +``` +{ "assets": [ { "asset": "BTC", // asset name "walletBalance": "0.00241969", // total wallet balance "unrealizedProfit": "0.00000000", // unrealized profit or loss "marginBalance": "0.00241969", // margin balance "maintMargin": "0.00000000", // maintenance margin "initialMargin": "0.00000000", // total intial margin required with the latest mark price "positionInitialMargin": "0.00000000", // positions" margin required with the latest mark price "openOrderInitialMargin": "0.00000000", // open orders" intial margin required with the latest mark price "maxWithdrawAmount": "0.00241969", // available amount for transfer out "crossWalletBalance": "0.00241969", // wallet balance for crossed margin "crossUnPnl": "0.00000000", // total unrealized profit or loss of crossed positions "availableBalance": "0.00241969", // available margin balance "updateTime": 1625474304765 //update time } ], "positions": [ { "symbol": "BTCUSD_201225", "positionAmt":"0", // position amount "initialMargin": "0", "maintMargin": "0", "unrealizedProfit": "0.00000000", "positionInitialMargin": "0", "openOrderInitialMargin": "0", "leverage": "125", "isolated": false, "positionSide": "BOTH", // BOTH means that it is the position of One-way Mode "entryPrice": "0.0", "breakEvenPrice": "0.0", // break-even price "maxQty": "50", // maximum quantity of base asset "updateTime": 0 }, { "symbol": "BTCUSD_201225", "positionAmt":"0", "initialMargin": "0", "maintMargin": "0", "unrealizedProfit": "0.00000000", "positionInitialMargin": "0", "openOrderInitialMargin": "0", "leverage": "125", "isolated": false, "positionSide": "LONG", // LONG or SHORT means that it is the position of Hedge Mode "entryPrice": "0.0", "breakEvenPrice": "0.0", // break-even price "maxQty": "50", "updateTime": 0 }, { "symbol": "BTCUSD_201225", "positionAmt":"0", "initialMargin": "0", "maintMargin": "0", "unrealizedProfit": "0.00000000", "positionInitialMargin": "0", "openOrderInitialMargin": "0", "leverage": "125", "isolated": false, "positionSide": "SHORT", // LONG or SHORT means that it is the position of Hedge Mode "entryPrice": "0.0", "breakEvenPrice": "0.0", // break-even price "maxQty": "50", "notionalValue": "0", "updateTime":1627026881327 } ], "canDeposit": true, "canTrade": true, "canWithdraw": true, "feeTier": 2, "updateTime": 0} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Account-Information) +- [HTTP Request](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Account-Information) +- [Request Weight](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Account-Information) +- [Request Parameters](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Account-Information) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Account-Information) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_account_rest-api_Futures-Account-Balance.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_account_rest-api_Futures-Account-Balance.md new file mode 100644 index 0000000..92f7d7f --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_account_rest-api_Futures-Account-Balance.md @@ -0,0 +1,52 @@ +--- +title: "Futures Account Balance | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Futures-Account-Balance" +fetched_at: "2026-01-27T05:28:00.720Z" +--- +# Futures Account Balance (USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Futures-Account-Balance) + +Check futures account balance + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Futures-Account-Balance) + +GET `/dapi/v1/balance` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Futures-Account-Balance) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Futures-Account-Balance) + +Name + +Type + +Mandatory + +Description + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Futures-Account-Balance) + +``` +[ { "accountAlias": "SgsR", // unique account code "asset": "BTC", "balance": "0.00250000", "withdrawAvailable": "0.00250000", "crossWalletBalance": "0.00241969", "crossUnPnl": "0.00000000", "availableBalance": "0.00241969", "updateTime": 1592468353979 }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Futures-Account-Balance) +- [HTTP Request](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Futures-Account-Balance) +- [Request Weight](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Futures-Account-Balance) +- [Request Parameters](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Futures-Account-Balance) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Futures-Account-Balance) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_account_rest-api_Get-Current-Position-Mode.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_account_rest-api_Get-Current-Position-Mode.md new file mode 100644 index 0000000..6310eb0 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_account_rest-api_Get-Current-Position-Mode.md @@ -0,0 +1,52 @@ +--- +title: "Get Current Position Mode | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Current-Position-Mode" +fetched_at: "2026-01-27T05:28:00.641Z" +--- +# Get Current Position Mode(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Current-Position-Mode) + +Get user's position mode (Hedge Mode or One-way Mode ) on _**EVERY symbol**_ + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Current-Position-Mode) + +GET `/dapi/v1/positionSide/dual` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Current-Position-Mode) + +**30** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Current-Position-Mode) + +Name + +Type + +Mandatory + +Description + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Current-Position-Mode) + +``` +{ "dualSidePosition": true // "true": Hedge Mode; "false": One-way Mode} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Current-Position-Mode) +- [HTTP Request](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Current-Position-Mode) +- [Request Weight](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Current-Position-Mode) +- [Request Parameters](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Current-Position-Mode) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Current-Position-Mode) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_account_rest-api_Get-Download-Id-For-Futures-Order-History.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_account_rest-api_Get-Download-Id-For-Futures-Order-History.md new file mode 100644 index 0000000..f8bac52 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_account_rest-api_Get-Download-Id-For-Futures-Order-History.md @@ -0,0 +1,71 @@ +--- +title: "Get Download Id For Futures Order History | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Download-Id-For-Futures-Order-History" +fetched_at: "2026-01-27T05:28:00.935Z" +--- +# Get Download Id For Futures Order History (USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Download-Id-For-Futures-Order-History) + +Get Download Id For Futures Order History + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Download-Id-For-Futures-Order-History) + +GET `/dapi/v1/order/asyn` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Download-Id-For-Futures-Order-History) + +**5** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Download-Id-For-Futures-Order-History) + +Name + +Type + +Mandatory + +Description + +startTime + +LONG + +YES + +Timestamp in ms + +endTime + +LONG + +YES + +Timestamp in ms + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +> - Request Limitation is 10 times per month, shared by front end download page and rest api +> - The time between `startTime` and `endTime` can not be longer than 1 year + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Download-Id-For-Futures-Order-History) + +``` +{ "avgCostTimestampOfLast30d":7241837, // Average time taken for data download in the past 30 days "downloadId":"546975389218332672",} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Download-Id-For-Futures-Order-History) +- [HTTP Request](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Download-Id-For-Futures-Order-History) +- [Request Weight](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Download-Id-For-Futures-Order-History) +- [Request Parameters](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Download-Id-For-Futures-Order-History) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Download-Id-For-Futures-Order-History) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_account_rest-api_Get-Download-Id-For-Futures-Trade-History.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_account_rest-api_Get-Download-Id-For-Futures-Trade-History.md new file mode 100644 index 0000000..cc9a1d2 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_account_rest-api_Get-Download-Id-For-Futures-Trade-History.md @@ -0,0 +1,71 @@ +--- +title: "Get Download Id For Futures Trade History | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Download-Id-For-Futures-Trade-History" +fetched_at: "2026-01-27T05:28:00.942Z" +--- +# Get Download Id For Futures Trade History (USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Download-Id-For-Futures-Trade-History) + +Get download id for futures trade history + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Download-Id-For-Futures-Trade-History) + +GET `/dapi/v1/trade/asyn` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Download-Id-For-Futures-Trade-History) + +**5** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Download-Id-For-Futures-Trade-History) + +Name + +Type + +Mandatory + +Description + +startTime + +LONG + +YES + +Timestamp in ms + +endTime + +LONG + +YES + +Timestamp in ms + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +> - Request Limitation is 5 times per month, shared by front end download page and rest api +> - The time between `startTime` and `endTime` can not be longer than 1 year + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Download-Id-For-Futures-Trade-History) + +``` +{ "avgCostTimestampOfLast30d":7241837, // Average time taken for data download in the past 30 days "downloadId":"546975389218332672",} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Download-Id-For-Futures-Trade-History) +- [HTTP Request](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Download-Id-For-Futures-Trade-History) +- [Request Weight](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Download-Id-For-Futures-Trade-History) +- [Request Parameters](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Download-Id-For-Futures-Trade-History) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Download-Id-For-Futures-Trade-History) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_account_rest-api_Get-Download-Id-For-Futures-Transaction-History.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_account_rest-api_Get-Download-Id-For-Futures-Transaction-History.md new file mode 100644 index 0000000..7b421c7 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_account_rest-api_Get-Download-Id-For-Futures-Transaction-History.md @@ -0,0 +1,71 @@ +--- +title: "Get Download Id For Futures Transaction History | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Download-Id-For-Futures-Transaction-History" +fetched_at: "2026-01-27T05:28:01.033Z" +--- +# Get Download Id For Futures Transaction History(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Download-Id-For-Futures-Transaction-History) + +Get download id for futures transaction history + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Download-Id-For-Futures-Transaction-History) + +GET `/dapi/v1/income/asyn` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Download-Id-For-Futures-Transaction-History) + +**5** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Download-Id-For-Futures-Transaction-History) + +Name + +Type + +Mandatory + +Description + +startTime + +LONG + +YES + +Timestamp in ms + +endTime + +LONG + +YES + +Timestamp in ms + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +> - Request Limitation is 5 times per month, shared by front end download page and rest api +> - The time between `startTime` and `endTime` can not be longer than 1 year + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Download-Id-For-Futures-Transaction-History) + +``` +{ "avgCostTimestampOfLast30d":7241837, // Average time taken for data download in the past 30 days "downloadId":"546975389218332672",} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Download-Id-For-Futures-Transaction-History) +- [HTTP Request](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Download-Id-For-Futures-Transaction-History) +- [Request Weight](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Download-Id-For-Futures-Transaction-History) +- [Request Parameters](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Download-Id-For-Futures-Transaction-History) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Download-Id-For-Futures-Transaction-History) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_account_rest-api_Get-Future-Account-Transaction-History-List.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_account_rest-api_Get-Future-Account-Transaction-History-List.md new file mode 100644 index 0000000..fecab6d --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_account_rest-api_Get-Future-Account-Transaction-History-List.md @@ -0,0 +1,8 @@ +--- +title: "Get Future Account Transaction History List | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Future-Account-Transaction-History-List" +fetched_at: "2026-01-27T05:28:01.109Z" +--- +# Get Future Account Transaction History List + +Please find details from [here](https://developers.binance.com/docs/wallet/asset/query-user-universal-transfer). diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_account_rest-api_Get-Futures-Order-History-Download-Link-by-Id.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_account_rest-api_Get-Futures-Order-History-Download-Link-by-Id.md new file mode 100644 index 0000000..47f94d3 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_account_rest-api_Get-Futures-Order-History-Download-Link-by-Id.md @@ -0,0 +1,70 @@ +--- +title: "Get Futures Order History Download Link By Id | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Futures-Order-History-Download-Link-by-Id" +fetched_at: "2026-01-27T05:28:01.327Z" +--- +# Get Futures Order History Download Link by Id (USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Futures-Order-History-Download-Link-by-Id) + +Get futures order history download link by Id + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Futures-Order-History-Download-Link-by-Id) + +GET `/dapi/v1/order/asyn/id` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Futures-Order-History-Download-Link-by-Id) + +5 + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Futures-Order-History-Download-Link-by-Id) + +Name + +Type + +Mandatory + +Description + +downloadId + +STRING + +YES + +get by download id api + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +> - Download link expiration: 24h + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Futures-Order-History-Download-Link-by-Id) + +> **Response:** + +``` +{ "downloadId":"545923594199212032", "status":"completed", // Enum:completed,processing "url":"www.binance.com", // The link is mapped to download id "notified":true, // ignore "expirationTimestamp":1645009771000, // The link would expire after this timestamp "isExpired":null,} +``` + +> **OR** (Response when server is processing) + +``` +{ "downloadId":"545923594199212032", "status":"processing", "url":"", "notified":false, "expirationTimestamp":-1 "isExpired":null, } +``` + +- [API Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Futures-Order-History-Download-Link-by-Id) +- [HTTP Request](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Futures-Order-History-Download-Link-by-Id) +- [Request Weight](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Futures-Order-History-Download-Link-by-Id) +- [Request Parameters](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Futures-Order-History-Download-Link-by-Id) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Futures-Order-History-Download-Link-by-Id) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_account_rest-api_Get-Futures-Trade-Download-Link-by-Id.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_account_rest-api_Get-Futures-Trade-Download-Link-by-Id.md new file mode 100644 index 0000000..87492f7 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_account_rest-api_Get-Futures-Trade-Download-Link-by-Id.md @@ -0,0 +1,70 @@ +--- +title: "Get Futures Trade Download Link By Id | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Futures-Trade-Download-Link-by-Id" +fetched_at: "2026-01-27T05:28:01.337Z" +--- +# Get Futures Trade Download Link by Id(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Futures-Trade-Download-Link-by-Id) + +Get futures trade download link by Id + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Futures-Trade-Download-Link-by-Id) + +GET `/dapi/v1/trade/asyn/id` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Futures-Trade-Download-Link-by-Id) + +**5** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Futures-Trade-Download-Link-by-Id) + +Name + +Type + +Mandatory + +Description + +downloadId + +STRING + +YES + +get by download id api + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +> - Download link expiration: 24h + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Futures-Trade-Download-Link-by-Id) + +> **Response:** + +``` +{ "downloadId":"545923594199212032", "status":"completed", // Enum:completed,processing "url":"www.binance.com", // The link is mapped to download id "notified":true, // ignore "expirationTimestamp":1645009771000, // The link would expire after this timestamp "isExpired":null,} +``` + +> **OR** (Response when server is processing) + +``` +{ "downloadId":"545923594199212032", "status":"processing", "url":"", "notified":false, "expirationTimestamp":-1 "isExpired":null, } +``` + +- [API Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Futures-Trade-Download-Link-by-Id) +- [HTTP Request](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Futures-Trade-Download-Link-by-Id) +- [Request Weight](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Futures-Trade-Download-Link-by-Id) +- [Request Parameters](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Futures-Trade-Download-Link-by-Id) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Futures-Trade-Download-Link-by-Id) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_account_rest-api_Get-Futures-Transaction-History-Download-Link-by-Id.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_account_rest-api_Get-Futures-Transaction-History-Download-Link-by-Id.md new file mode 100644 index 0000000..70c74ee --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_account_rest-api_Get-Futures-Transaction-History-Download-Link-by-Id.md @@ -0,0 +1,70 @@ +--- +title: "Get Futures Transaction History Download Link By Id | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Futures-Transaction-History-Download-Link-by-Id" +fetched_at: "2026-01-27T05:28:01.425Z" +--- +# Get Futures Transaction History Download Link by Id (USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Futures-Transaction-History-Download-Link-by-Id) + +Get futures transaction history download link by Id + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Futures-Transaction-History-Download-Link-by-Id) + +GET `/dapi/v1/income/asyn/id` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Futures-Transaction-History-Download-Link-by-Id) + +**5** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Futures-Transaction-History-Download-Link-by-Id) + +Name + +Type + +Mandatory + +Description + +downloadId + +STRING + +YES + +get by download id api + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +> - Download link expiration: 24h + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Futures-Transaction-History-Download-Link-by-Id) + +> **Response:** + +``` +{ "downloadId":"545923594199212032", "status":"completed", // Enum:completed,processing "url":"www.binance.com", // The link is mapped to download id "notified":true, // ignore "expirationTimestamp":1645009771000, // The link would expire after this timestamp "isExpired":null,} +``` + +> **OR** (Response when server is processing) + +``` +{ "downloadId":"545923594199212032", "status":"processing", "url":"", "notified":false, "expirationTimestamp":-1 "isExpired":null, } +``` + +- [API Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Futures-Transaction-History-Download-Link-by-Id) +- [HTTP Request](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Futures-Transaction-History-Download-Link-by-Id) +- [Request Weight](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Futures-Transaction-History-Download-Link-by-Id) +- [Request Parameters](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Futures-Transaction-History-Download-Link-by-Id) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Futures-Transaction-History-Download-Link-by-Id) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_account_rest-api_Get-Income-History.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_account_rest-api_Get-Income-History.md new file mode 100644 index 0000000..92d3307 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_account_rest-api_Get-Income-History.md @@ -0,0 +1,100 @@ +--- +title: "Get Income History | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Income-History" +fetched_at: "2026-01-27T05:28:01.561Z" +--- +# Get Income History(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Income-History) + +Get income history + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Income-History) + +GET `/dapi/v1/income` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Income-History) + +**20** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Income-History) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +NO + +incomeType + +STRING + +NO + +"TRANSFER","WELCOME\_BONUS", "FUNDING\_FEE", "REALIZED\_PNL", "COMMISSION", "INSURANCE\_CLEAR", and "DELIVERED\_SETTELMENT" + +startTime + +LONG + +NO + +Timestamp in ms to get funding from INCLUSIVE. + +endTime + +LONG + +NO + +Timestamp in ms to get funding until INCLUSIVE. + +page + +INT + +NO + +limit + +INT + +NO + +Default 100; max 1000 + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +> - If `incomeType` is not sent, all kinds of flow will be returned +> - "trandId" is unique in the same "incomeType" for a user +> - The time between `startTime` and `endTime` can not be longer than 1 year + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Income-History) + +``` +[ { "symbol": "", // trade symbol, if existing "incomeType": "TRANSFER", // income type "income": "-0.37500000", // income amount "asset": "BTC", // income asset "info":"WITHDRAW", // extra information "time": 1570608000000, "tranId":"9689322392", // transaction id "tradeId":"" // trade id, if existing }, { "symbol": "BTCUSD_200925", "incomeType": "COMMISSION", "income": "-0.01000000", "asset": "BTC", "info":"", "time": 1570636800000, "tranId":"9689322392", "tradeId":"2059192" }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Income-History) +- [HTTP Request](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Income-History) +- [Request Weight](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Income-History) +- [Request Parameters](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Income-History) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Get-Income-History) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_account_rest-api_Notional-Bracket-for-Pair.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_account_rest-api_Notional-Bracket-for-Pair.md new file mode 100644 index 0000000..43d445e --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_account_rest-api_Notional-Bracket-for-Pair.md @@ -0,0 +1,60 @@ +--- +title: "Notional Bracket For Pair | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Notional-Bracket-for-Pair" +fetched_at: "2026-01-27T05:28:01.714Z" +--- +# Notional Bracket for Pair(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Notional-Bracket-for-Pair) + +**Not recommended to continue using this v1 endpoint** + +Get the pair's default notional bracket list, may return ambiguous values when there have been multiple different `symbol` brackets under the `pair`, suggest using the following `GET /dapi/v2/leverageBracket` query instead to get the specific `symbol` notional bracket list. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Notional-Bracket-for-Pair) + +GET `/dapi/v1/leverageBracket` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Notional-Bracket-for-Pair) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Notional-Bracket-for-Pair) + +Name + +Type + +Mandatory + +Description + +pair + +STRING + +NO + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Notional-Bracket-for-Pair) + +``` +[ { "pair": "BTCUSD", "brackets": [ { "bracket": 1, // bracket level "initialLeverage": 125, // the maximum leverage "qtyCap": 50, // upper edge of base asset quantity "qtylFloor": 0, // lower edge of base asset quantity "maintMarginRatio": 0.004 // maintenance margin rate "cum": 0.0 // Auxiliary number for quick calculation }, ] }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Notional-Bracket-for-Pair) +- [HTTP Request](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Notional-Bracket-for-Pair) +- [Request Weight](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Notional-Bracket-for-Pair) +- [Request Parameters](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Notional-Bracket-for-Pair) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Notional-Bracket-for-Pair) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_account_rest-api_Notional-Bracket-for-Symbol.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_account_rest-api_Notional-Bracket-for-Symbol.md new file mode 100644 index 0000000..3a60579 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_account_rest-api_Notional-Bracket-for-Symbol.md @@ -0,0 +1,58 @@ +--- +title: "Notional Bracket For Symbol | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Notional-Bracket-for-Symbol" +fetched_at: "2026-01-27T05:28:01.725Z" +--- +# Notional Bracket for Symbol(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Notional-Bracket-for-Symbol) + +Get the symbol's notional bracket list. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Notional-Bracket-for-Symbol) + +GET `/dapi/v2/leverageBracket` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Notional-Bracket-for-Symbol) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Notional-Bracket-for-Symbol) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +NO + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Notional-Bracket-for-Symbol) + +``` +[ { "symbol": "BTCUSD_PERP", "notionalCoef": 1.50, //user symbol bracket multiplier, only appears when user's symbol bracket is adjusted "brackets": [ { "bracket": 1, // bracket level "initialLeverage": 125, // the maximum leverage "qtyCap": 50, // upper edge of base asset quantity "qtylFloor": 0, // lower edge of base asset quantity "maintMarginRatio": 0.004 // maintenance margin rate "cum": 0.0 // Auxiliary number for quick calculation }, ] }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Notional-Bracket-for-Symbol) +- [HTTP Request](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Notional-Bracket-for-Symbol) +- [Request Weight](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Notional-Bracket-for-Symbol) +- [Request Parameters](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Notional-Bracket-for-Symbol) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Notional-Bracket-for-Symbol) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_account_rest-api_User-Commission-Rate.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_account_rest-api_User-Commission-Rate.md new file mode 100644 index 0000000..ecc9f26 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_account_rest-api_User-Commission-Rate.md @@ -0,0 +1,58 @@ +--- +title: "User Commission Rate | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/User-Commission-Rate" +fetched_at: "2026-01-27T05:28:01.811Z" +--- +# User Commission Rate (USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/User-Commission-Rate) + +Query user commission rate + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/User-Commission-Rate) + +GET `/dapi/v1/commissionRate` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/User-Commission-Rate) + +**20** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/User-Commission-Rate) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/User-Commission-Rate) + +``` +{ "symbol": "BTCUSD_PERP", "makerCommissionRate": "0.00015", // 0.015% "takerCommissionRate": "0.00040" // 0.040%} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/User-Commission-Rate) +- [HTTP Request](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/User-Commission-Rate) +- [Request Weight](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/User-Commission-Rate) +- [Request Parameters](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/User-Commission-Rate) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/User-Commission-Rate) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_account_websocket-api.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_account_websocket-api.md new file mode 100644 index 0000000..a9673c1 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_account_websocket-api.md @@ -0,0 +1,59 @@ +--- +title: "Futures Account Balance | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/account/websocket-api" +fetched_at: "2026-01-27T05:28:01.946Z" +--- +# Futures Account Balance(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/websocket-api) + +Query account balance info + +## Method[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/websocket-api) + +`account.balance` + +## Request[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/websocket-api) + +``` +{ "id": "9328e612-1560-4108-979e-283bf85b5acb", "method": "account.balance", "params": { "apiKey": "", "timestamp": 1727810404936, "signature": "0f04368b2d22aafd0ggc8809ea34297eff602272917b5f01267db4efbc1c9422"  }} +``` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/websocket-api) + +**5** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/websocket-api) + +Name + +Type + +Mandatory + +Description + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/websocket-api) + +``` +{ "id": "9328e612-1560-4108-979e-283bf85b5acb", "status": 200, "result": [ { "accountAlias": "fWAuTiuXoCuXmY", "asset": "WLD", "balance": "0.00000000", "withdrawAvailable": "0.00000000", "crossWalletBalance": "0.00000000", "crossUnPnl": "0.00000000", "availableBalance": "0.00000000", "updateTime": 0 }, // ... ... ], "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 2400, "count": 10 } ]} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/websocket-api) +- [Method](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/websocket-api) +- [Request](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/websocket-api) +- [Request Weight](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/websocket-api) +- [Request Parameters](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/websocket-api) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/websocket-api) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_account_websocket-api_Account-Information.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_account_websocket-api_Account-Information.md new file mode 100644 index 0000000..7002d48 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_account_websocket-api_Account-Information.md @@ -0,0 +1,59 @@ +--- +title: "Account Information | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/account/websocket-api/Account-Information" +fetched_at: "2026-01-27T05:28:02.105Z" +--- +# Account Information(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/websocket-api/Account-Information) + +Get current account information. User in single-asset/ multi-assets mode will see different value, see comments in response section for detail. + +## Method[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/websocket-api/Account-Information) + +`account.status` + +## Request[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/websocket-api/Account-Information) + +``` +{ "id": "baaec739-c5cf-4920-b448-c0b9c5431410", "method": "account.status", "params": { "apiKey": "", "timestamp": 1727785087742, "signature": "0f04368b2d22aafd0ggc8809ea34297eff602272917b5f01267db4efbc1c9422"  }} +``` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/websocket-api/Account-Information) + +**5** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/websocket-api/Account-Information) + +Name + +Type + +Mandatory + +Description + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/websocket-api/Account-Information) + +``` +{ "id": "baaec739-c5cf-4920-b448-c0b9c5431410", "status": 200, "result": { "feeTier": 0, "canTrade": true, "canDeposit": true, "canWithdraw": true, "updateTime": 0, "assets": [ { "asset": "WLD", "walletBalance": "0.00000000", "unrealizedProfit": "0.00000000", "marginBalance": "0.00000000", "maintMargin": "0.00000000", "initialMargin": "0.00000000", "positionInitialMargin": "0.00000000", "openOrderInitialMargin": "0.00000000", "maxWithdrawAmount": "0.00000000", "crossWalletBalance": "0.00000000", "crossUnPnl": "0.00000000", "availableBalance": "0.00000000", "updateTime": 0 }, // ... ... ], "positions": [ { "symbol": "ETHUSD_220930", "initialMargin": "0", "maintMargin": "0", "unrealizedProfit": "0.00000000", "positionInitialMargin": "0", "openOrderInitialMargin": "0", "leverage": "7", "isolated": false, "positionSide": "BOTH", "entryPrice": "0.00000000", "maxQty": "1000", "notionalValue": "0", "isolatedWallet": "0", "updateTime": 0, "positionAmt": "0", "breakEvenPrice": "0.00000000" }, // ... ... ] }, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 2400, "count": 10 } ]} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/websocket-api/Account-Information) +- [Method](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/websocket-api/Account-Information) +- [Request](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/websocket-api/Account-Information) +- [Request Weight](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/websocket-api/Account-Information) +- [Request Parameters](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/websocket-api/Account-Information) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/account/websocket-api/Account-Information) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_common-definition.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_common-definition.md new file mode 100644 index 0000000..5f21d9e --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_common-definition.md @@ -0,0 +1,248 @@ +--- +title: "Common Definition | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/common-definition" +fetched_at: "2026-01-27T05:28:02.113Z" +--- +# Public Endpoints Info + +## Terminology[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/common-definition) + +- `symbol` refers to the symbol name of a contract symbol +- `pair` refers to the underlying symbol of a contracrt symbol +- `base asset` refers to the asset that is the `quantity` of a symbol. +- `quote asset` refers to the asset that is the `price` of a symbol. +- `margin asset` refers to the asset that is the `margin` of a symbol + +## ENUM definitions[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/common-definition) + +**Symbol type:** + +- DELIVERY\_CONTRACT +- PERPETUAL\_CONTRACT + +**Contract type (contractType):** + +- PERPETUAL +- CURRENT\_QUARTER +- NEXT\_QUARTER +- CURRENT\_QUARTER\_DELIVERING // Invalid type, only used for DELIVERING status +- NEXT\_QUARTER\_DELIVERING // Invalid type, only used for DELIVERING status +- PERPETUAL\_DELIVERING + +**Contract status (contractStatus, status):** + +- PENDING\_TRADING +- TRADING +- PRE\_DELIVERING +- DELIVERING +- DELIVERED + +**Order status (status):** + +- NEW +- PARTIALLY\_FILLED +- FILLED +- CANCELED +- EXPIRED + +**Order types (type):** + +- LIMIT +- MARKET +- STOP +- STOP\_MARKET +- TAKE\_PROFIT +- TAKE\_PROFIT\_MARKET +- TRAILING\_STOP\_MARKET + +**Order side (side):** + +- BUY +- SELL + +**Position side (positionSide):** + +- BOTH +- LONG +- SHORT + +**Time in force (timeInForce):** + +- GTC - Good Till Cancel +- IOC - Immediate or Cancel +- FOK - Fill or Kill +- GTX - Good Till Crossing (Post Only) + +**Working Type (workingType)** + +- MARK\_PRICE +- CONTRACT\_PRICE + +**New Order Response Type (newOrderRespType)** + +- ACK +- RESULT + +**Price Match (priceMatch)** + +- NONE: no price match +- OPPONENT: counterparty best price +- OPPONENT\_5: counterparty 5th best price +- OPPONENT\_10: counterparty 10th best price +- OPPONENT\_20: counterparty 20th best price +- QUEUE: the best price on the same side of the order book +- QUEUE\_5: the 5th best price on the same side of the order book +- QUEUE\_10: the 10th best price on the same side of the order book +- QUEUE\_20: the 20th best price on the same side of the order book + +**Self-Trade Prevention mode (selfTradePreventionMode)** + +- NONE: No Self-Trade Prevention +- EXPIRE\_TAKER: expire taker order when STP trigger +- EXPIRE\_BOTH: expire taker and maker order when STP trigger +- EXPIRE\_MAKER: expire maker order when STP trigger + +**Kline/Candlestick chart intervals:** + +m -> minutes; h -> hours; d -> days; w -> weeks; M -> months + +- 1m +- 3m +- 5m +- 15m +- 30m +- 1h +- 2h +- 4h +- 6h +- 8h +- 12h +- 1d +- 3d +- 1w +- 1M + +**Rate limiters (rateLimitType)** + +> REQUEST\_WEIGHT + +``` + { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 6000 } +``` + +> ORDERS + +``` + { "rateLimitType": "ORDERS", "interval": "MINUTE", "intervalNum": 1, "limit": 1200 } +``` + +- REQUEST\_WEIGHT + +- ORDERS + + +**Rate limit intervals (interval)** + +- MINUTE + +# Filters + +Filters define trading rules on a symbol or an exchange. + +## Symbol filters[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/common-definition) + +### PRICE\_FILTER[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/common-definition) + +> **/exchangeInfo format:** + +``` + { "filterType": "PRICE_FILTER", "minPrice": "0.00000100", "maxPrice": "100000.00000000", "tickSize": "0.00000100" } +``` + +The `PRICE_FILTER` defines the `price` rules for a symbol. There are 3 parts: + +- `minPrice` defines the minimum `price`/`stopPrice` allowed; disabled on `minPrice` == 0. +- `maxPrice` defines the maximum `price`/`stopPrice` allowed; disabled on `maxPrice` == 0. +- `tickSize` defines the intervals that a `price`/`stopPrice` can be increased/decreased by; disabled on `tickSize` == 0. + +Any of the above variables can be set to 0, which disables that rule in the `price filter`. In order to pass the `price filter`, the following must be true for `price`/`stopPrice` of the enabled rules: + +- `price` >= `minPrice` +- `price` <= `maxPrice` +- (`price`\-`minPrice`) % `tickSize` == 0 + +### LOT\_SIZE[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/common-definition) + +> **/exchangeInfo format:** + +``` + { "filterType": "LOT_SIZE", "minQty": "0.00100000", "maxQty": "100000.00000000", "stepSize": "0.00100000" } +``` + +The `LOT_SIZE` filter defines the `quantity` (aka "lots" in auction terms) rules for a symbol. There are 3 parts: + +- `minQty` defines the minimum `quantity` allowed. +- `maxQty` defines the maximum `quantity` allowed. +- `stepSize` defines the intervals that a `quantity` can be increased/decreased by. + +In order to pass the `lot size`, the following must be true for `quantity`: + +- `quantity` >= `minQty` +- `quantity` <= `maxQty` +- (`quantity`\-`minQty`) % `stepSize` == 0 + +### MARKET\_LOT\_SIZE[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/common-definition) + +> **/exchangeInfo format:** + +``` + { "filterType": "MARKET_LOT_SIZE", "minQty": "0.00100000", "maxQty": "100000.00000000", "stepSize": "0.00100000" } +``` + +The `MARKET_LOT_SIZE` filter defines the `quantity` (aka "lots" in auction terms) rules for `MARKET` orders on a symbol. There are 3 parts: + +- `minQty` defines the minimum `quantity` allowed. +- `maxQty` defines the maximum `quantity` allowed. +- `stepSize` defines the intervals that a `quantity` can be increased/decreased by. + +In order to pass the `market lot size`, the following must be true for `quantity`: + +- `quantity` >= `minQty` +- `quantity` <= `maxQty` +- (`quantity`\-`minQty`) % `stepSize` == 0 + +### MAX\_NUM\_ORDERS[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/common-definition) + +> **/exchangeInfo format:** + +``` + { "filterType": "MAX_NUM_ORDERS", "limit": 200 } +``` + +The `MAX_NUM_ORDERS` filter defines the maximum number of orders an account is allowed to have open on a symbol. + +Note that both "algo" orders and normal orders are counted for this filter. + +### PERCENT\_PRICE[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/common-definition) + +> **/exchangeInfo format:** + +``` + { "filterType": "PERCENT_PRICE", "multiplierUp": "1.0500", "multiplierDown": "0.9500", "multiplierDecimal": 4 } +``` + +The `PERCENT_PRICE` filter defines valid range for a price based on the mark price. + +In order to pass the `percent price`, the following must be true for `price`: + +- BUY: `price` <= `markPrice` \* `multiplierUp` +- SELL: `price` >= `markPrice` \* `multiplierDown` + +- [Terminology](https://developers.binance.com/docs/derivatives/coin-margined-futures/common-definition) +- [ENUM definitions](https://developers.binance.com/docs/derivatives/coin-margined-futures/common-definition) +- [Symbol filters](https://developers.binance.com/docs/derivatives/coin-margined-futures/common-definition) + - [PRICE\_FILTER](https://developers.binance.com/docs/derivatives/coin-margined-futures/common-definition) + - [LOT\_SIZE](https://developers.binance.com/docs/derivatives/coin-margined-futures/common-definition) + - [MARKET\_LOT\_SIZE](https://developers.binance.com/docs/derivatives/coin-margined-futures/common-definition) + - [MAX\_NUM\_ORDERS](https://developers.binance.com/docs/derivatives/coin-margined-futures/common-definition) + - [PERCENT\_PRICE](https://developers.binance.com/docs/derivatives/coin-margined-futures/common-definition) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_error-code.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_error-code.md new file mode 100644 index 0000000..0cc1c27 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_error-code.md @@ -0,0 +1,823 @@ +--- +title: "Error Code | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code" +fetched_at: "2026-01-27T05:28:02.148Z" +--- +# Error Codes + +> Here is the error JSON payload: + +``` +{ "code":-1121, "msg":"Invalid symbol."} +``` + +Errors consist of two parts: an error code and a message. +Codes are universal,but messages can vary. + +## 10xx - General Server or Network issues[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +### \-1000 UNKNOWN[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- An unknown error occured while processing the request. + +### \-1001 DISCONNECTED[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Internal error; unable to process your request. Please try again. + +### \-1002 UNAUTHORIZED[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- You are not authorized to execute this request. + +### \-1003 TOO\_MANY\_REQUESTS[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Too many requests; current limit is %s requests per minute. Please use the websocket for live updates to avoid polling the API. +- Way too many requests; IP banned until %s. Please use the websocket for live updates to avoid bans. + +### \-1004 DUPLICATE\_IP[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- This IP is already on the white list + +### \-1005 NO\_SUCH\_IP[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- No such IP has been white listed + +### \-1006 UNEXPECTED\_RESP[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- An unexpected response was received from the message bus. Execution status unknown. + +### \-1007 TIMEOUT[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Timeout waiting for response from backend server. Send status unknown; execution status unknown. + +### \-1008 Request Throttled[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Server is currently overloaded with other requests. Please try again in a few minutes. +- Request throttled by system-level protection. Reduce-only/close-position orders are exempt. Please try again. + +### \-1010 ERROR\_MSG\_RECEIVED[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- ERROR\_MSG\_RECEIVED. + +### \-1011 NON\_WHITE\_LIST[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- This IP cannot access this route. + +### \-1013 INVALID\_MESSAGE[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- INVALID\_MESSAGE. + +### \-1014 UNKNOWN\_ORDER\_COMPOSITION[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Unsupported order combination. + +### \-1015 TOO\_MANY\_ORDERS[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Too many new orders. +- Too many new orders; current limit is %s orders per %s. + +### \-1016 SERVICE\_SHUTTING\_DOWN[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- This service is no longer available. + +### \-1020 UNSUPPORTED\_OPERATION[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- This operation is not supported. + +### \-1021 INVALID\_TIMESTAMP[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Timestamp for this request is outside of the recvWindow. +- Timestamp for this request was 1000ms ahead of the server's time. + +### \-1022 INVALID\_SIGNATURE[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Signature for this request is not valid. + +### \-1023 START\_TIME\_GREATER\_THAN\_END\_TIME[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Start time is greater than end time. + +## 11xx - Request issues[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +### \-1100 ILLEGAL\_CHARS[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Illegal characters found in a parameter. +- Illegal characters found in parameter '%s'; legal range is '%s'. + +### \-1101 TOO\_MANY\_PARAMETERS[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Too many parameters sent for this endpoint. +- Too many parameters; expected '%s' and received '%s'. +- Duplicate values for a parameter detected. + +### \-1102 MANDATORY\_PARAM\_EMPTY\_OR\_MALFORMED[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- A mandatory parameter was not sent, was empty/null, or malformed. +- Mandatory parameter '%s' was not sent, was empty/null, or malformed. +- Param '%s' or '%s' must be sent, but both were empty/null! + +### \-1103 UNKNOWN\_PARAM[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- An unknown parameter was sent. + +### \-1104 UNREAD\_PARAMETERS[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Not all sent parameters were read. +- Not all sent parameters were read; read '%s' parameter(s) but was sent '%s'. + +### \-1105 PARAM\_EMPTY[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- A parameter was empty. +- Parameter '%s' was empty. + +### \-1106 PARAM\_NOT\_REQUIRED[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- A parameter was sent when not required. +- Parameter '%s' sent when not required. + +### \-1108 BAD\_ASSET[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Invalid asset. + +### \-1109 BAD\_ACCOUNT[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Invalid account. + +### \-1110 BAD\_INSTRUMENT\_TYPE[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Invalid symbolType. + +### \-1111 BAD\_PRECISION[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Precision is over the maximum defined for this asset. + +### \-1112 NO\_DEPTH[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- No orders on book for symbol. + +### \-1113 WITHDRAW\_NOT\_NEGATIVE[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Withdrawal amount must be negative. + +### \-1114 TIF\_NOT\_REQUIRED[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- TimeInForce parameter sent when not required. + +### \-1115 INVALID\_TIF[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Invalid timeInForce. + +### \-1116 INVALID\_ORDER\_TYPE[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Invalid orderType. + +### \-1117 INVALID\_SIDE[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Invalid side. + +### \-1118 EMPTY\_NEW\_CL\_ORD\_ID[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- New client order ID was empty. + +### \-1119 EMPTY\_ORG\_CL\_ORD\_ID[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Original client order ID was empty. + +### \-1120 BAD\_INTERVAL[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Invalid interval. + +### \-1121 BAD\_SYMBOL[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Invalid symbol. + +### \-1125 INVALID\_LISTEN\_KEY[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- This listenKey does not exist. Please use `POST /fapi/v1/listenKey` to recreate `listenKey` + +### \-1127 MORE\_THAN\_XX\_HOURS[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Lookup interval is too big. +- More than %s hours between startTime and endTime. + +### \-1128 OPTIONAL\_PARAMS\_BAD\_COMBO[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Combination of optional parameters invalid. + +### \-1130 INVALID\_PARAMETER[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Invalid data sent for a parameter. +- Data sent for parameter '%s' is not valid. + +### \-1136 INVALID\_NEW\_ORDER\_RESP\_TYPE[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Invalid newOrderRespType. + +## 20xx - Processing Issues[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +### \-2010 NEW\_ORDER\_REJECTED[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- NEW\_ORDER\_REJECTED + +### \-2011 CANCEL\_REJECTED[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- CANCEL\_REJECTED + +### \-2013 NO\_SUCH\_ORDER[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Order does not exist. + +### \-2014 BAD\_API\_KEY\_FMT[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- API-key format invalid. + +### \-2015 REJECTED\_MBX\_KEY[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Invalid API-key, IP, or permissions for action. + +### \-2016 NO\_TRADING\_WINDOW[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- No trading window could be found for the symbol. Try ticker/24hrs instead. + +### \-2018 BALANCE\_NOT\_SUFFICIENT[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Balance is insufficient. + +### \-2019 MARGIN\_NOT\_SUFFICIEN[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Margin is insufficient. + +### \-2020 UNABLE\_TO\_FILL[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Unable to fill. + +### \-2021 ORDER\_WOULD\_IMMEDIATELY\_TRIGGER[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Order would immediately trigger. + +### \-2022 REDUCE\_ONLY\_REJECT[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- ReduceOnly Order is rejected. +- This indicates the new reduce-only order conflicts with existing open orders; cancel the existing order and resubmit the reduce-only order. + +### \-2023 USER\_IN\_LIQUIDATION[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- User in liquidation mode now. + +### \-2024 POSITION\_NOT\_SUFFICIENT[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Position is not sufficient. + +### \-2025 MAX\_OPEN\_ORDER\_EXCEEDED[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Reach max open order limit. + +### \-2026 REDUCE\_ONLY\_ORDER\_TYPE\_NOT\_SUPPORTED[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- This OrderType is not supported when reduceOnly. + +### \-2027 MAX\_LEVERAGE\_RATIO[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Exceeded the maximum allowable position at current leverage. + +### \-2028 MIN\_LEVERAGE\_RATIO[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Leverage is smaller than permitted: insufficient margin balance. + +## 40xx - Filters and other Issues[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +### \-4000 INVALID\_ORDER\_STATUS[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Invalid order status. + +### \-4001 PRICE\_LESS\_THAN\_ZERO[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Price less than 0. + +### \-4002 PRICE\_GREATER\_THAN\_MAX\_PRICE[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Price greater than max price. + +### \-4003 QTY\_LESS\_THAN\_ZERO[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Quantity less than zero. + +### \-4004 QTY\_LESS\_THAN\_MIN\_QTY[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Quantity less than min quantity. + +### \-4005 QTY\_GREATER\_THAN\_MAX\_QTY[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Quantity greater than max quantity. + +### \-4006 STOP\_PRICE\_LESS\_THAN\_ZERO[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Stop price less than zero. + +### \-4007 STOP\_PRICE\_GREATER\_THAN\_MAX\_PRICE[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Stop price greater than max price. + +### \-4008 TICK\_SIZE\_LESS\_THAN\_ZERO[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Tick size less than zero. + +### \-4009 MAX\_PRICE\_LESS\_THAN\_MIN\_PRICE[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Max price less than min price. + +### \-4010 MAX\_QTY\_LESS\_THAN\_MIN\_QTY[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Max qty less than min qty. + +### \-4011 STEP\_SIZE\_LESS\_THAN\_ZERO[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Step size less than zero. + +### \-4012 MAX\_NUM\_ORDERS\_LESS\_THAN\_ZERO[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Max mum orders less than zero. + +### \-4013 PRICE\_LESS\_THAN\_MIN\_PRICE[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Price less than min price. + +### \-4014 PRICE\_NOT\_INCREASED\_BY\_TICK\_SIZE[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Price not increased by tick size. + +### \-4015 INVALID\_CL\_ORD\_ID\_LEN[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Client order id is not valid. +- Client order id length should not be more than 36 chars + +### \-4016 PRICE\_HIGHTER\_THAN\_MULTIPLIER\_UP[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Price is higher than mark price multiplier cap. + +### \-4017 MULTIPLIER\_UP\_LESS\_THAN\_ZERO[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Multiplier up less than zero. + +### \-4018 MULTIPLIER\_DOWN\_LESS\_THAN\_ZERO[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Multiplier down less than zero. + +### \-4019 COMPOSITE\_SCALE\_OVERFLOW[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Composite scale too large. + +### \-4020 TARGET\_STRATEGY\_INVALID[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Target strategy invalid for orderType '%s',reduceOnly '%b'. + +### \-4021 INVALID\_DEPTH\_LIMIT[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Invalid depth limit. +- '%s' is not valid depth limit. + +### \-4022 WRONG\_MARKET\_STATUS[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- market status sent is not valid. + +### \-4023 QTY\_NOT\_INCREASED\_BY\_STEP\_SIZE[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Qty not increased by step size. + +### \-4024 PRICE\_LOWER\_THAN\_MULTIPLIER\_DOWN[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Price is lower than mark price multiplier floor. + +### \-4025 MULTIPLIER\_DECIMAL\_LESS\_THAN\_ZERO[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Multiplier decimal less than zero. + +### \-4026 COMMISSION\_INVALID[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Commission invalid. +- `%s` less than zero. +- `%s` absolute value greater than `%s` + +### \-4027 INVALID\_ACCOUNT\_TYPE[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Invalid account type. + +### \-4028 INVALID\_LEVERAGE[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Invalid leverage +- Leverage `%s` is not valid +- Leverage `%s` already exist with `%s` + +### \-4029 INVALID\_TICK\_SIZE\_PRECISION[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Tick size precision is invalid. + +### \-4030 INVALID\_STEP\_SIZE\_PRECISION[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Step size precision is invalid. + +### \-4031 INVALID\_WORKING\_TYPE[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Invalid parameter working type +- Invalid parameter working type: `%s` + +### \-4032 EXCEED\_MAX\_CANCEL\_ORDER\_SIZE[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Exceed maximum cancel order size. +- Invalid parameter working type: `%s` + +### \-4033 INSURANCE\_ACCOUNT\_NOT\_FOUND[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Insurance account not found. + +### \-4044 INVALID\_BALANCE\_TYPE[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Balance Type is invalid. + +### \-4045 MAX\_STOP\_ORDER\_EXCEEDED[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Reach max stop order limit. + +### \-4046 NO\_NEED\_TO\_CHANGE\_MARGIN\_TYPE[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- No need to change margin type. + +### \-4047 THERE\_EXISTS\_OPEN\_ORDERS[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Margin type cannot be changed if there exists open orders. + +### \-4048 THERE\_EXISTS\_QUANTITY[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Margin type cannot be changed if there exists position. + +### \-4049 ADD\_ISOLATED\_MARGIN\_REJECT[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Add margin only support for isolated position. + +### \-4050 CROSS\_BALANCE\_INSUFFICIENT[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Cross balance insufficient. + +### \-4051 ISOLATED\_BALANCE\_INSUFFICIENT[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Isolated balance insufficient. + +### \-4052 NO\_NEED\_TO\_CHANGE\_AUTO\_ADD\_MARGIN[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- No need to change auto add margin. + +### \-4053 AUTO\_ADD\_CROSSED\_MARGIN\_REJECT[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Auto add margin only support for isolated position. + +### \-4054 ADD\_ISOLATED\_MARGIN\_NO\_POSITION\_REJECT[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Cannot add position margin: position is 0. + +### \-4055 AMOUNT\_MUST\_BE\_POSITIVE[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Amount must be positive. + +### \-4056 INVALID\_API\_KEY\_TYPE[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Invalid api key type. + +### \-4057 INVALID\_RSA\_PUBLIC\_KEY[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Invalid api public key + +### \-4058 MAX\_PRICE\_TOO\_LARGE[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- maxPrice and priceDecimal too large,please check. + +### \-4059 NO\_NEED\_TO\_CHANGE\_POSITION\_SIDE[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- No need to change position side. + +### \-4060 INVALID\_POSITION\_SIDE[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Invalid position side. + +### \-4061 POSITION\_SIDE\_NOT\_MATCH[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Order's position side does not match user's setting. + +### \-4062 REDUCE\_ONLY\_CONFLICT[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Invalid or improper reduceOnly value. + +### \-4067 POSITION\_SIDE\_CHANGE\_EXISTS\_OPEN\_ORDERS[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Position side cannot be changed if there exists open orders. + +### \-4068 POSITION\_SIDE\_CHANGE\_EXISTS\_QUANTITY[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Position side cannot be changed if there exists position. + +### \-4082 INVALID\_BATCH\_PLACE\_ORDER\_SIZE[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Invalid number of batch place orders. +- Invalid number of batch place orders: %s + +### \-4083 PLACE\_BATCH\_ORDERS\_FAIL[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Fail to place batch orders. + +### \-4084 UPCOMING\_METHOD[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Method is not allowed currently. Upcoming soon. + +### \-4086 INVALID\_PRICE\_SPREAD\_THRESHOLD[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Invalid price spread threshold. + +### \-4087 INVALID\_PAIR[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Invalid pair. + +### \-4088 INVALID\_TIME\_INTERVAL[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Invalid time interval. +- Maximum time interval is %s days. + +### \-4089 REDUCE\_ONLY\_ORDER\_PERMISSION[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- User can only place reduce only order. + +### \-4090 NO\_PLACE\_ORDER\_PERMISSION[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- User can not place order currently. + +### \-4104 INVALID\_CONTRACT\_TYPE[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Invalid contract type. + +### \-4110 INVALID\_CLIENT\_TRAN\_ID\_LEN[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- clientTranId is not valid. +- Client tran id length should be less than 64 chars. + +### \-4111 DUPLICATED\_CLIENT\_TRAN\_ID[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- clientTranId is duplicated. +- Client tran id should be unique within 7 days. + +### \-4112 REDUCE\_ONLY\_MARGIN\_CHECK\_FAILED[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- ReduceOnly Order Failed. Please check your existing position and open orders. +- This indicates that the new reduce-only order, combined with an existing same-side open order, would create an opposite-side position and lead to insufficient margin; please cancel the open order and try again. + +### \-4113 MARKET\_ORDER\_REJECT[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- The counterparty's best price does not meet the PERCENT\_PRICE filter limit. + +### \-4135 INVALID\_ACTIVATION\_PRICE[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Invalid activation price. + +### \-4137 QUANTITY\_EXISTS\_WITH\_CLOSE\_POSITION[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Quantity must be zero with closePosition equals true. + +### \-4138 REDUCE\_ONLY\_MUST\_BE\_TRUE[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Reduce only must be true with closePosition equals true. + +### \-4139 ORDER\_TYPE\_CANNOT\_BE\_MKT[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Order type can not be market if it's unable to cancel. + +### \-4142 STRATEGY\_INVALID\_TRIGGER\_PRICE[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- REJECT: take profit or stop order will be triggered immediately. + +### \-4150 ISOLATED\_LEVERAGE\_REJECT\_WITH\_POSITION[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Leverage reduction is not supported in Isolated Margin Mode with open positions. + +### \-4151 PRICE\_HIGHTER\_THAN\_STOP\_MULTIPLIER\_UP[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Price is higher than stop price multiplier cap. +- Limit price can't be higher than %s. + +### \-4152 PRICE\_LOWER\_THAN\_STOP\_MULTIPLIER\_DOWN[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Price is lower than stop price multiplier floor. +- Limit price can't be lower than %s. + +### \-4154 STOP\_PRICE\_HIGHER\_THAN\_PRICE\_MULTIPLIER\_LIMIT[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Stop price is higher than price multiplier cap. +- Stop price can't be higher than %s + +### \-4155 STOP\_PRICE\_LOWER\_THAN\_PRICE\_MULTIPLIER\_LIMIT[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- PStop price is lower than price multiplier floor. +- Stop price can't be lower than %s + +### \-4178 MIN\_NOTIONAL[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Order's notional must be no smaller than one (unless you choose reduce only) +- Order's notional must be no smaller than %s (unless you choose reduce only) + +### \-4192 COOLING\_OFF\_PERIOD[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Trade forbidden due to Cooling-off Period. + +### \-4194 ADJUST\_LEVERAGE\_KYC\_FAILED[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Intermediate Personal Verification is required for adjusting leverage over 20x. + +### \-4195 ADJUST\_LEVERAGE\_ONE\_MONTH\_FAILED[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- More than 20x leverage is available one month after account registration. + +### \-4196 LIMIT\_ORDER\_ONLY[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Only limit order is supported. + +### \-4197 SAME\_ORDER[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- No need to modify the order. + +### \-4198 EXCEED\_MAX\_MODIFY\_ORDER\_LIMIT[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Exceed maximum modify order limit. + +### \-4199 MOVE\_ORDER\_NOT\_ALLOWED\_SYMBOL\_REASON[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Symbol is not in trading status. Order amendment is not permitted. + +### \-4200 ADJUST\_LEVERAGE\_X\_DAYS\_FAILED[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- More than 20x leverage is available 30 days after Futures account registration. +- More than 20x leverage is available %s days after Futures account registration. + +### \-4201 ADJUST\_LEVERAGE\_KYC\_LIMIT[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Users in this country has limited adjust leverage. +- Users in your location/country can only access a maximum leverage of %s + +### \-4202 ADJUST\_LEVERAGE\_ACCOUNT\_SYMBOL\_FAILED[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Current symbol leverage cannot exceed 20 when using position limit adjustment service. + +### \-4188 ME\_INVALID\_TIMESTAMP[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + +- Timestamp for this request is outside of the ME recvWindow. + +- [10xx - General Server or Network issues](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-1000 UNKNOWN](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-1001 DISCONNECTED](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-1002 UNAUTHORIZED](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-1003 TOO\_MANY\_REQUESTS](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-1004 DUPLICATE\_IP](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-1005 NO\_SUCH\_IP](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-1006 UNEXPECTED\_RESP](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-1007 TIMEOUT](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-1008 Request Throttled](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-1010 ERROR\_MSG\_RECEIVED](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-1011 NON\_WHITE\_LIST](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-1013 INVALID\_MESSAGE](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-1014 UNKNOWN\_ORDER\_COMPOSITION](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-1015 TOO\_MANY\_ORDERS](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-1016 SERVICE\_SHUTTING\_DOWN](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-1020 UNSUPPORTED\_OPERATION](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-1021 INVALID\_TIMESTAMP](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-1022 INVALID\_SIGNATURE](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-1023 START\_TIME\_GREATER\_THAN\_END\_TIME](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) +- [11xx - Request issues](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-1100 ILLEGAL\_CHARS](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-1101 TOO\_MANY\_PARAMETERS](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-1102 MANDATORY\_PARAM\_EMPTY\_OR\_MALFORMED](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-1103 UNKNOWN\_PARAM](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-1104 UNREAD\_PARAMETERS](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-1105 PARAM\_EMPTY](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-1106 PARAM\_NOT\_REQUIRED](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-1108 BAD\_ASSET](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-1109 BAD\_ACCOUNT](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-1110 BAD\_INSTRUMENT\_TYPE](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-1111 BAD\_PRECISION](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-1112 NO\_DEPTH](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-1113 WITHDRAW\_NOT\_NEGATIVE](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-1114 TIF\_NOT\_REQUIRED](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-1115 INVALID\_TIF](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-1116 INVALID\_ORDER\_TYPE](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-1117 INVALID\_SIDE](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-1118 EMPTY\_NEW\_CL\_ORD\_ID](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-1119 EMPTY\_ORG\_CL\_ORD\_ID](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-1120 BAD\_INTERVAL](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-1121 BAD\_SYMBOL](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-1125 INVALID\_LISTEN\_KEY](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-1127 MORE\_THAN\_XX\_HOURS](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-1128 OPTIONAL\_PARAMS\_BAD\_COMBO](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-1130 INVALID\_PARAMETER](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-1136 INVALID\_NEW\_ORDER\_RESP\_TYPE](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) +- [20xx - Processing Issues](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-2010 NEW\_ORDER\_REJECTED](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-2011 CANCEL\_REJECTED](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-2013 NO\_SUCH\_ORDER](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-2014 BAD\_API\_KEY\_FMT](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-2015 REJECTED\_MBX\_KEY](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-2016 NO\_TRADING\_WINDOW](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-2018 BALANCE\_NOT\_SUFFICIENT](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-2019 MARGIN\_NOT\_SUFFICIEN](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-2020 UNABLE\_TO\_FILL](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-2021 ORDER\_WOULD\_IMMEDIATELY\_TRIGGER](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-2022 REDUCE\_ONLY\_REJECT](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-2023 USER\_IN\_LIQUIDATION](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-2024 POSITION\_NOT\_SUFFICIENT](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-2025 MAX\_OPEN\_ORDER\_EXCEEDED](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-2026 REDUCE\_ONLY\_ORDER\_TYPE\_NOT\_SUPPORTED](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-2027 MAX\_LEVERAGE\_RATIO](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-2028 MIN\_LEVERAGE\_RATIO](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) +- [40xx - Filters and other Issues](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4000 INVALID\_ORDER\_STATUS](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4001 PRICE\_LESS\_THAN\_ZERO](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4002 PRICE\_GREATER\_THAN\_MAX\_PRICE](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4003 QTY\_LESS\_THAN\_ZERO](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4004 QTY\_LESS\_THAN\_MIN\_QTY](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4005 QTY\_GREATER\_THAN\_MAX\_QTY](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4006 STOP\_PRICE\_LESS\_THAN\_ZERO](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4007 STOP\_PRICE\_GREATER\_THAN\_MAX\_PRICE](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4008 TICK\_SIZE\_LESS\_THAN\_ZERO](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4009 MAX\_PRICE\_LESS\_THAN\_MIN\_PRICE](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4010 MAX\_QTY\_LESS\_THAN\_MIN\_QTY](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4011 STEP\_SIZE\_LESS\_THAN\_ZERO](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4012 MAX\_NUM\_ORDERS\_LESS\_THAN\_ZERO](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4013 PRICE\_LESS\_THAN\_MIN\_PRICE](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4014 PRICE\_NOT\_INCREASED\_BY\_TICK\_SIZE](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4015 INVALID\_CL\_ORD\_ID\_LEN](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4016 PRICE\_HIGHTER\_THAN\_MULTIPLIER\_UP](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4017 MULTIPLIER\_UP\_LESS\_THAN\_ZERO](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4018 MULTIPLIER\_DOWN\_LESS\_THAN\_ZERO](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4019 COMPOSITE\_SCALE\_OVERFLOW](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4020 TARGET\_STRATEGY\_INVALID](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4021 INVALID\_DEPTH\_LIMIT](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4022 WRONG\_MARKET\_STATUS](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4023 QTY\_NOT\_INCREASED\_BY\_STEP\_SIZE](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4024 PRICE\_LOWER\_THAN\_MULTIPLIER\_DOWN](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4025 MULTIPLIER\_DECIMAL\_LESS\_THAN\_ZERO](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4026 COMMISSION\_INVALID](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4027 INVALID\_ACCOUNT\_TYPE](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4028 INVALID\_LEVERAGE](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4029 INVALID\_TICK\_SIZE\_PRECISION](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4030 INVALID\_STEP\_SIZE\_PRECISION](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4031 INVALID\_WORKING\_TYPE](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4032 EXCEED\_MAX\_CANCEL\_ORDER\_SIZE](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4033 INSURANCE\_ACCOUNT\_NOT\_FOUND](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4044 INVALID\_BALANCE\_TYPE](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4045 MAX\_STOP\_ORDER\_EXCEEDED](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4046 NO\_NEED\_TO\_CHANGE\_MARGIN\_TYPE](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4047 THERE\_EXISTS\_OPEN\_ORDERS](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4048 THERE\_EXISTS\_QUANTITY](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4049 ADD\_ISOLATED\_MARGIN\_REJECT](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4050 CROSS\_BALANCE\_INSUFFICIENT](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4051 ISOLATED\_BALANCE\_INSUFFICIENT](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4052 NO\_NEED\_TO\_CHANGE\_AUTO\_ADD\_MARGIN](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4053 AUTO\_ADD\_CROSSED\_MARGIN\_REJECT](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4054 ADD\_ISOLATED\_MARGIN\_NO\_POSITION\_REJECT](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4055 AMOUNT\_MUST\_BE\_POSITIVE](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4056 INVALID\_API\_KEY\_TYPE](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4057 INVALID\_RSA\_PUBLIC\_KEY](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4058 MAX\_PRICE\_TOO\_LARGE](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4059 NO\_NEED\_TO\_CHANGE\_POSITION\_SIDE](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4060 INVALID\_POSITION\_SIDE](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4061 POSITION\_SIDE\_NOT\_MATCH](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4062 REDUCE\_ONLY\_CONFLICT](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4067 POSITION\_SIDE\_CHANGE\_EXISTS\_OPEN\_ORDERS](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4068 POSITION\_SIDE\_CHANGE\_EXISTS\_QUANTITY](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4082 INVALID\_BATCH\_PLACE\_ORDER\_SIZE](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4083 PLACE\_BATCH\_ORDERS\_FAIL](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4084 UPCOMING\_METHOD](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4086 INVALID\_PRICE\_SPREAD\_THRESHOLD](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4087 INVALID\_PAIR](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4088 INVALID\_TIME\_INTERVAL](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4089 REDUCE\_ONLY\_ORDER\_PERMISSION](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4090 NO\_PLACE\_ORDER\_PERMISSION](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4104 INVALID\_CONTRACT\_TYPE](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4110 INVALID\_CLIENT\_TRAN\_ID\_LEN](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4111 DUPLICATED\_CLIENT\_TRAN\_ID](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4112 REDUCE\_ONLY\_MARGIN\_CHECK\_FAILED](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4113 MARKET\_ORDER\_REJECT](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4135 INVALID\_ACTIVATION\_PRICE](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4137 QUANTITY\_EXISTS\_WITH\_CLOSE\_POSITION](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4138 REDUCE\_ONLY\_MUST\_BE\_TRUE](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4139 ORDER\_TYPE\_CANNOT\_BE\_MKT](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4142 STRATEGY\_INVALID\_TRIGGER\_PRICE](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4150 ISOLATED\_LEVERAGE\_REJECT\_WITH\_POSITION](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4151 PRICE\_HIGHTER\_THAN\_STOP\_MULTIPLIER\_UP](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4152 PRICE\_LOWER\_THAN\_STOP\_MULTIPLIER\_DOWN](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4154 STOP\_PRICE\_HIGHER\_THAN\_PRICE\_MULTIPLIER\_LIMIT](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4155 STOP\_PRICE\_LOWER\_THAN\_PRICE\_MULTIPLIER\_LIMIT](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4178 MIN\_NOTIONAL](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4192 COOLING\_OFF\_PERIOD](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4194 ADJUST\_LEVERAGE\_KYC\_FAILED](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4195 ADJUST\_LEVERAGE\_ONE\_MONTH\_FAILED](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4196 LIMIT\_ORDER\_ONLY](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4197 SAME\_ORDER](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4198 EXCEED\_MAX\_MODIFY\_ORDER\_LIMIT](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4199 MOVE\_ORDER\_NOT\_ALLOWED\_SYMBOL\_REASON](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4200 ADJUST\_LEVERAGE\_X\_DAYS\_FAILED](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4201 ADJUST\_LEVERAGE\_KYC\_LIMIT](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4202 ADJUST\_LEVERAGE\_ACCOUNT\_SYMBOL\_FAILED](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) + - [\-4188 ME\_INVALID\_TIMESTAMP](https://developers.binance.com/docs/derivatives/coin-margined-futures/error-code) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_general-info.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_general-info.md new file mode 100644 index 0000000..c886b4f --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_general-info.md @@ -0,0 +1,416 @@ +--- +title: "General Info | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/general-info" +fetched_at: "2026-01-27T05:28:02.210Z" +--- +# General Info + +## General API Information[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/general-info) + +- The base endpoint is: **[https://dapi.binance.com](https://dapi.binance.com/)** +- All endpoints return either a JSON object or array. +- Data is returned in **ascending** order. Oldest first, newest last. +- All time and timestamp related fields are in milliseconds. +- All data types adopt definition in JAVA. + +### Testnet API Information[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/general-info) + +- Most of the endpoints can be also used in the testnet platform. +- The REST baseurl for **testnet** is "[https://testnet.binancefuture.com](https://testnet.binancefuture.com/)" +- The Websocket baseurl for **testnet** is "wss://dstream.binancefuture.com" + +--- + +## General Information on Endpoints[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/general-info) + +- For `GET` endpoints, parameters must be sent as a `query string`. +- For `POST`, `PUT`, and `DELETE` endpoints, the parameters may be sent as a `query string` or in the `request body` with content type `application/x-www-form-urlencoded`. You may mix parameters between both the `query string` and `request body` if you wish to do so. +- Parameters may be sent in any order. +- If a parameter sent in both the `query string` and `request body`, the `query string` parameter will be used. + +### HTTP Return Codes[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/general-info) + +- HTTP `4XX` return codes are used for for malformed requests; the issue is on the sender's side. +- HTTP `403` return code is used when the WAF Limit (Web Application Firewall) has been violated. +- HTTP `408` return code is used when a timeout has occurred while waiting for a response from the backend server. +- HTTP `429` return code is used when breaking a request rate limit. +- HTTP `418` return code is used when an IP has been auto-banned for continuing to send requests after receiving `429` codes. +- HTTP `5XX` return codes are used for internal errors; the issue is on Binance's side. + 1. If there is an error message **"Request occur unknown error."**, please retry later. +- HTTP `503` return code is used when: + 1. If there is an error message **"Unknown error, please check your request or try again later."** returned in the response, the API successfully sent the request but not get a response within the timeout period. + It is important to **NOT** treat this as a failure operation; the execution status is **UNKNOWN** and could have been a success; + 2. If there is an error message **"Service Unavailable."** returned in the response, it means this is a failure API operation and the service might be unavailable at the moment, you need to retry later. + 3. If there is an error message **"Internal error; unable to process your request. Please try again."** returned in the response, it means this is a failure API operation and you can resend your request if you need. + 4. If the response contains the error message **"Request throttled by system-level protection. Reduce-only/close-position orders are exempt. Please try again." (-1008)**, This indicates the node has exceeded its maximum concurrency and is temporarily throttled. Close-position, reduce-only, and cancel orders are exempt and will not receive this error. + +### HTTP 503 Status: Message Variants & Handling[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/general-info) + +#### A. “Unknown error, please check your request or try again later.” (Execution status **unknown**)[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/general-info) + +- **Meaning**: Request accepted but no response before timeout; **execution may have succeeded**. +- **Handling**: + - **Do not treat as immediate failure**; first verify via **WebSocket updates** or **orderId queries** to avoid duplicates. + - During peaks, prefer **single orders** over batch to reduce uncertainty. +- **Rate-limit counting**: **May or may not** count, check header to verify rate limit info + +#### B. “Service Unavailable.” (Failure)[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/general-info) + +- **Meaning**: Service temporarily unavailable; **100% failure**. +- **Handling**: **Retry with exponential backoff** (e.g., 200ms → 400ms → 800ms, max 3–5 attempts). +- **Rate-limit counting**: **not counted** + +#### C. “Request throttled by system-level protection. Reduce-only/close-position orders are exempt. Please try again.” (**\-1008**, Failure)[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/general-info) + +- **Meaning**: System overload; **100% failure**. +- **Handling**: **Retry with backoff** and **reduce concurrency**; +- **Applicable endpoints**: + - `POST /dapi/v1/order` + - `POST /dapi/v1/batchOrders` + - `POST /dapi/v1/order/test` +- **Rate-limit counting**: **Not counted** (overload protection). +- **Exception integrated here**: When a request **reduces exposure** (Reduce-only / Close-position: `closePosition = true`, or `positionSide = BOTH` with `reduceOnly = true`, or `LONG+SELL`, or `SHORT+BUY`), it is **not affected or prioritized under -1008** to ensure risk reduction. + - Covered endpoints: `POST /dapi/v1/order`、`POST /dapi/v1/batchOrders` (when parameters satisfy the condition) + +### Error Codes and Messages[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/general-info) + +- Any endpoint can return an ERROR + +> _**The error payload is as follows:**_ + +``` +{ "code": -1121, "msg": "Invalid symbol."} +``` + +- Specific error codes and messages defined in [Error Codes](https://developers.binance.com/docs/derivatives/coin-margined-futures/general-info). + +--- + +## LIMITS[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/general-info) + +- The `/dapi/v1/exchangeInfo` `rateLimits` array contains objects related to the exchange's `RAW_REQUEST`, `REQUEST_WEIGHT`, and `ORDER` rate limits. These are further defined in the `ENUM definitions` section under `Rate limiters (rateLimitType)`. +- A `429` will be returned when either rate limit is violated. + +### IP Limits[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/general-info) + +- Every request will contain `X-MBX-USED-WEIGHT-(intervalNum)(intervalLetter)` in the response headers which has the current used weight for the IP for all request rate limiters defined. +- Each route has a `weight` which determines for the number of requests each endpoint counts for. Heavier endpoints and endpoints that do operations on multiple symbols will have a heavier `weight`. +- When a 429 is received, it's your obligation as an API to back off and not spam the API. +- **Repeatedly violating rate limits and/or failing to back off after receiving 429s will result in an automated IP ban (HTTP status 418).** +- IP bans are tracked and **scale in duration** for repeat offenders, **from 2 minutes to 3 days**. +- **The limits on the API are based on the IPs, not the API keys.** + +### Order Rate Limits[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/general-info) + +- Every order response will contain a `X-MBX-ORDER-COUNT-(intervalNum)(intervalLetter)` header which has the current order count for the account for all order rate limiters defined. +- Rejected/unsuccessful orders are not guaranteed to have `X-MBX-ORDER-COUNT-**` headers in the response. +- **The order rate limit is counted against each account**. + +--- + +## Endpoint Security Type[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/general-info) + +- Each endpoint has a security type that determines the how you will interact with it. +- API-keys are passed into the Rest API via the `X-MBX-APIKEY` header. +- API-keys and secret-keys **are case sensitive**. +- API-keys can be configured to only access certain types of secure endpoints. For example, one API-key could be used for TRADE only, while another API-key can access everything except for TRADE routes. +- By default, API-keys can access all secure routes. + +Security Type + +Description + +NONE + +Endpoint can be accessed freely. + +TRADE + +Endpoint requires sending a valid API-Key and signature. + +USER\_DATA + +Endpoint requires sending a valid API-Key and signature. + +USER\_STREAM + +Endpoint requires sending a valid API-Key. + +MARKET\_DATA + +Endpoint requires sending a valid API-Key. + +- `TRADE` and `USER_DATA` endpoints are `SIGNED` endpoints. + +### SIGNED (TRADE and USER\_DATA) Endpoint Security[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/general-info) + +- `SIGNED` endpoints require an additional parameter, `signature`, to be sent in the `query string` or `request body`. +- Endpoints use `HMAC SHA256` signatures. The `HMAC SHA256 signature` is a keyed `HMAC SHA256` operation. Use your `secretKey` as the key and `totalParams` as the value for the HMAC operation. +- The `signature` is **not case sensitive**. +- Please make sure the `signature` is the end part of your `query string` or `request body`. +- `totalParams` is defined as the `query string` concatenated with the `request body`. + +### Timing security[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/general-info) + +- A `SIGNED` endpoint also requires a parameter, `timestamp`, to be sent which should be the millisecond timestamp of when the request was created and sent. +- An additional parameter, `recvWindow`, may be sent to specify the number of milliseconds after `timestamp` the request is valid for. If `recvWindow` is not sent, **it defaults to 5000**. +- If the server determines that the timestamp sent by the client is more than **one second** in the future of the server time, the request will also be rejected. + +> The logic is as follows: + +``` + if (timestamp < (serverTime + 1000) && (serverTime - timestamp) <= recvWindow){ // process request } else { // reject request } +``` + +**Serious trading is about timing.** Networks can be unstable and unreliable, which can lead to requests taking varying amounts of time to reach the servers. With `recvWindow`, you can specify that the request must be processed within a certain number of milliseconds or be rejected by the server. + +### SIGNED Endpoint Examples for POST /dapi/v1/order - HMAC Keys[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/general-info) + +Here is a step-by-step example of how to send a vaild signed payload from the Linux command line using `echo`, `openssl`, and `curl`. + +Key + +Value + +apiKey + +dbefbc809e3e83c283a984c3a1459732ea7db1360ca80c5c2c8867408d28cc83 + +secretKey + +2b5eb11e18796d12d88f13dc27dbbd02c2cc51ff7059765ed9821957d82bb4d9 + +Parameter + +Value + +symbol + +BTCUSD\_200925 + +side + +BUY + +type + +LIMIT + +timeInForce + +GTC + +quantity + +1 + +price + +9000 + +recvWindow + +5000 + +timestamp + +1591702613943 + +#### Example 1: As a query string[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/general-info) + +> **Example 1** + +> **HMAC SHA256 signature:** + +``` + $ echo -n "symbol=BTCUSD_200925&side=BUY&type=LIMIT&quantity=1&price=9000&timeInForce=GTC&recvWindow=5000×tamp=1591702613943" | openssl dgst -sha256 -hmac "2b5eb11e18796d12d88f13dc27dbbd02c2cc51ff7059765ed9821957d82bb4d9" (stdin)= 21fd819734bf0e5c68740eed892909414d693635c5f7fffab1313925ae13556a +``` + +> **curl command:** + +``` + (HMAC SHA256) $ curl -H "X-MBX-APIKEY: dbefbc809e3e83c283a984c3a1459732ea7db1360ca80c5c2c8867408d28cc83" -X POST 'https://dapi.binance.com/dapi/v1/order?symbol=BTCUSD_200925&side=BUY&type=LIMIT&quantity=1&price=9000&timeInForce=GTC&recvWindow=5000×tamp=1591702613943&signature= 21fd819734bf0e5c68740eed892909414d693635c5f7fffab1313925ae13556a' +``` + +- **queryString:** + + symbol=BTCUSD\_200925 + &side=BUY + &type=LIMIT + &timeInForce=GTC + &quantity=1 + &price=9000 + &recvWindow=5000 + ×tamp=1591702613943 + + +#### Example 2: As a request body[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/general-info) + +> **Example 2** + +> **HMAC SHA256 signature:** + +``` + $ echo -n "symbol=BTCUSD_200925&side=BUY&type=LIMIT&quantity=1&price=9000&timeInForce=GTC&recvWindow=5000×tamp=1591702613943" | openssl dgst -sha256 -hmac "2b5eb11e18796d12d88f13dc27dbbd02c2cc51ff7059765ed9821957d82bb4d9" (stdin)= 21fd819734bf0e5c68740eed892909414d693635c5f7fffab1313925ae13556a +``` + +> **curl command:** + +``` + (HMAC SHA256) $ curl -H "X-MBX-APIKEY: dbefbc809e3e83c283a984c3a1459732ea7db1360ca80c5c2c8867408d28cc83" -X POST 'https://dapi.binance.com/dapi/v1/order' -d 'symbol=BTCUSD_200925&side=BUY&type=LIMIT&quantity=1&price=9000&timeInForce=GTC&recvWindow=5000×tamp=1591702613943&signature= 21fd819734bf0e5c68740eed892909414d693635c5f7fffab1313925ae13556a' +``` + +- **requestBody:** + + symbol=BTCUSD\_200925 + &side=BUY + &type=LIMIT + &timeInForce=GTC + &quantity=1 + &price=9000 + &recvWindow=5000 + ×tamp=1591702613943 + + +#### Example 3: Mixed query string and request body[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/general-info) + +> **Example 3** + +> **HMAC SHA256 signature:** + +``` + $ echo -n "symbol=BTCUSD_200925&side=BUY&type=LIMIT&timeInForce=GTCquantity=1&price=9000&recvWindow=5000×tamp= 1591702613943" | openssl dgst -sha256 -hmac "2b5eb11e18796d12d88f13dc27dbbd02c2cc51ff7059765ed9821957d82bb4d9" (stdin)= f3129e7c72c7727037891ad8a86b76a7dc514ba125a536775c8ba403b2d1b222 +``` + +> **curl command:** + +``` + (HMAC SHA256) $ curl -H "X-MBX-APIKEY: dbefbc809e3e83c283a984c3a1459732ea7db1360ca80c5c2c8867408d28cc83" -X POST 'https://dapi.binance.com/dapi/v1/order?symbol=BTCUSD_200925&side=BUY&type=LIMIT&timeInForce=GTC' -d 'quantity=1&price=9000&recvWindow=5000×tamp= 1591702613943&signature=f3129e7c72c7727037891ad8a86b76a7dc514ba125a536775c8ba403b2d1b222' +``` + +- **queryString:** symbol=BTCUSD\_200925&side=BUY&type=LIMIT&timeInForce=GTC +- **requestBody:** quantity=1&price=9000&recvWindow=5000×tamp= 1591702613943 + +Note that the signature is different in example 3. +There is no & between "GTC" and "quantity=1". + +### SIGNED Endpoint Examples for POST /dapi/v1/order - RSA Keys[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/general-info) + +- This will be a step by step process how to create the signature payload to send a valid signed payload. +- We support `PKCS#8` currently. +- To get your API key, you need to upload your RSA Public Key to your account and a corresponding API key will be provided for you. + +For this example, the private key will be referenced as `test-prv-key.pem` + +Key + +Value + +apiKey + +vE3BDAL1gP1UaexugRLtteaAHg3UO8Nza20uexEuW1Kh3tVwQfFHdAiyjjY428o2 + +Parameter + +Value + +symbol + +BTCUSD\_PERP + +side + +SELL + +type + +MARKET + +quantity + +100 + +recvWindow + +9999999 + +timestamp + +1671090801999 + +> **Signature payload (with the listed parameters):** + +``` +timestamp=1671090801999&recvWindow=9999999&symbol=BTCUSD_PERP&side=SELL&type=MARKET&quantity=100 +``` + +**Step 1: Construct the payload** + +Arrange the list of parameters into a string. Separate each parameter with a `&`. + +**Step 2: Compute the signature:** + +2.1 - Encode signature payload as ASCII data. + +> **Step 2.2** + +``` + $ echo -n 'timestamp=1671090801999&recvWindow=9999999&symbol=BTCUSD_PERP&side=SELL&type=MARKET&quantity=100' | openssl dgst -keyform PEM -sha256 -sign ./test-prv-key.pem +``` + +2.2 - Sign payload using RSASSA-PKCS1-v1\_5 algorithm with SHA-256 hash function. + +> **Step 2.3** + +``` +$ echo -n 'timestamp=1671090801999&recvWindow=9999999&symbol=BTCUSD_PERP&side=SELL&type=MARKET&quantity=100' | openssl dgst -keyform PEM -sha256 -sign ./test-prv-key.pem | openssl enc -base64aap36wD5loVXizxvvPI3wz9Cjqwmb3KVbxoym0XeWG1jZq8umqrnSk8H8dkLQeySjgVY91Ufs%2BBGCW%2B4sZjQEpgAfjM76riNxjlD3coGGEsPsT2lG39R%2F1q72zpDs8pYcQ4A692NgHO1zXcgScTGgdkjp%2Brp2bcddKjyz5XBrBM%3D +``` + +2.3 - Encode output as base64 string. + +> **Step 2.4** + +``` +$ echo -n 'timestamp=1671090801999&recvWindow=9999999&symbol=BTCUSD_PERP&side=SELL&type=MARKET&quantity=100' | openssl dgst -keyform PEM -sha256 -sign ./test-prv-key.pem | openssl enc -base64 | tr -d '\n'aap36wD5loVXizxvvPI3wz9Cjqwmb3KVbxoym0XeWG1jZq8umqrnSk8H8dkLQeySjgVY91Ufs%2BBGCW%2B4sZjQEpgAfjM76riNxjlD3coGGEsPsT2lG39R%2F1q72zpDs8pYcQ4A692NgHO1zXcgScTGgdkjp%2Brp2bcddKjyz5XBrBM%3D +``` + +2.4 - Delete any newlines in the signature. + +> **Step 2.5** + +``` +aap36wD5loVXizxvvPI3wz9Cjqwmb3KVbxoym0XeWG1jZq8umqrnSk8H8dkLQeySjgVY91Ufs%2BBGCW%2B4sZjQEpgAfjM76riNxjlD3coGGEsPsT2lG39R%2F1q72zpDs8pYcQ4A692NgHO1zXcgScTGgdkjp%2Brp2bcddKjyz5XBrBM%3D +``` + +2.5 - Since the signature may contain `/` and `=`, this could cause issues with sending the request. So the signature has to be URL encoded. + +> **Step 2.6** + +``` + curl -H "X-MBX-APIKEY: vE3BDAL1gP1UaexugRLtteaAHg3UO8Nza20uexEuW1Kh3tVwQfFHdAiyjjY428o2" -X POST 'https://dapi.binance.com/dapi/v1/order?timestamp=1671090801999&recvWindow=9999999&symbol=BTCUSD_PERP&side=SELL&type=MARKET&quantity=100&signature=aap36wD5loVXizxvvPI3wz9Cjqwmb3KVbxoym0XeWG1jZq8umqrnSk8H8dkLQeySjgVY91Ufs%2BBGCW%2B4sZjQEpgAfjM76riNxjlD3coGGEsPsT2lG39R%2F1q72zpDs8pYcQ4A692NgHO1zXcgScTGgdkjp%2Brp2bcddKjyz5XBrBM%3D' +``` + +2.6 - curl command + +> **Bash script** + +``` +#!/usr/bin/env bash# Set up authentication:apiKey="vE3BDAL1gP1UaexugRLtteaAHg3UO8Nza20uexEuW1Kh3tVwQfFHdAiyjjY428o2" ### REPLACE THIS WITH YOUR API KEY# Set up the request:apiMethod="POST"apiCall="v1/order"apiParams="timestamp=1671090801999&recvWindow=9999999&symbol=BTCUSD_PERP&side=SELL&type=MARKET&quantity=100"function rawurlencode { local value="$1" local len=${#value} local encoded="" local pos c o for (( pos=0 ; pos - Symbol and pair cannot be sent together +> - If a pair is sent,tickers for all symbols of the pair will be returned +> - If either a pair or symbol is sent, tickers for all symbols of all pairs will be returned + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/24hr-Ticker-Price-Change-Statistics) + +``` +[ { "symbol": "BTCUSD_200925", "pair": "BTCUSD", "priceChange": "136.6", "priceChangePercent": "1.436", "weightedAvgPrice": "9547.3", "lastPrice": "9651.6", "lastQty": "1", "openPrice": "9515.0", "highPrice": "9687.0", "lowPrice": "9499.5", "volume": "494109", "baseVolume": "5192.94797687", "openTime": 1591170300000, "closeTime": 1591256718418, "firstId": 600507, // First tradeId "lastId": 697803, // Last tradeId "count": 97297 // Trade count }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/24hr-Ticker-Price-Change-Statistics) +- [HTTP Request](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/24hr-Ticker-Price-Change-Statistics) +- [Request Weight](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/24hr-Ticker-Price-Change-Statistics) +- [Request Parameters](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/24hr-Ticker-Price-Change-Statistics) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/24hr-Ticker-Price-Change-Statistics) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Basis.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Basis.md new file mode 100644 index 0000000..82e532d --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Basis.md @@ -0,0 +1,87 @@ +--- +title: "Basis | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Basis" +fetched_at: "2026-01-27T05:28:02.535Z" +--- +# Basis + +## API Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Basis) + +Query basis + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Basis) + +GET `/futures/data/basis` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Basis) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Basis) + +Name + +Type + +Mandatory + +Description + +pair + +STRING + +YES + +BTCUSD + +contractType + +ENUM + +YES + +CURRENT\_QUARTER, NEXT\_QUARTER, PERPETUAL + +period + +ENUM + +YES + +"5m","15m","30m","1h","2h","4h","6h","12h","1d" + +limit + +LONG + +NO + +Default 30,Max 500 + +startTime + +LONG + +NO + +endTime + +LONG + +NO + +> - If startTime and endTime are not sent, the most recent data is returned. +> - Only the data of the latest 30 days is available. + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Basis) + +``` +[ { "indexPrice": "29269.93972727", "contractType": "CURRENT_QUARTER", "basisRate": "0.0024", "futuresPrice": "29341.3", "annualizedBasisRate": "0.0283", "basis": "71.36027273", "pair": "BTCUSD", "timestamp": 1653381600000 }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Basis) +- [HTTP Request](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Basis) +- [Request Weight](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Basis) +- [Request Parameters](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Basis) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Basis) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Check-Server-time.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Check-Server-time.md new file mode 100644 index 0000000..086d8d1 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Check-Server-time.md @@ -0,0 +1,34 @@ +--- +title: "Check Server Time | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Check-Server-time" +fetched_at: "2026-01-27T05:28:02.607Z" +--- +# Check Server time + +## API Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Check-Server-time) + +Test connectivity to the Rest API and get the current server time. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Check-Server-time) + +GET `/dapi/v1/time` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Check-Server-time) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Check-Server-time) + +NONE + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Check-Server-time) + +``` +{ "serverTime": 1499827319559} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Check-Server-time) +- [HTTP Request](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Check-Server-time) +- [Request Weight](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Check-Server-time) +- [Request Parameters](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Check-Server-time) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Check-Server-time) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Compressed-Aggregate-Trades-List.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Compressed-Aggregate-Trades-List.md new file mode 100644 index 0000000..e75a65e --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Compressed-Aggregate-Trades-List.md @@ -0,0 +1,84 @@ +--- +title: "Compressed Aggregate Trades List | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Compressed-Aggregate-Trades-List" +fetched_at: "2026-01-27T05:28:02.622Z" +--- +# Compressed/Aggregate Trades List + +## API Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Compressed-Aggregate-Trades-List) + +Get compressed, aggregate trades. Market trades that fill in 100ms with the same price and the same taking side will have the quantity aggregated. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Compressed-Aggregate-Trades-List) + +GET `/dapi/v1/aggTrades` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Compressed-Aggregate-Trades-List) + +**20** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Compressed-Aggregate-Trades-List) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +fromId + +LONG + +NO + +ID to get aggregate trades from INCLUSIVE. + +startTime + +LONG + +NO + +Timestamp in ms to get aggregate trades from INCLUSIVE. + +endTime + +LONG + +NO + +Timestamp in ms to get aggregate trades until INCLUSIVE. + +limit + +INT + +NO + +Default 500; max 1000. + +> - support querying futures trade histories that are not older than one year +> - If both `startTime` and `endTime` are sent, time between `startTime` and `endTime` must be less than 1 hour. +> - If `fromId`, `startTime`, and `endTime` are not sent, the most recent aggregate trades will be returned. +> - Only market trades will be aggregated and returned, which means the insurance fund trades and ADL trades won't be aggregated. +> - Sending both `startTime`/`endTime` and `fromId` might cause response timeout, please send either `fromId` or `startTime`/`endTime` + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Compressed-Aggregate-Trades-List) + +``` +[ { "a": 416690, // Aggregate tradeId "p": "9642.4", // Price "q": "3", // Quantity "f": 595259, // First tradeId "l": 595259, // Last tradeId "T": 1591250548649, // Timestamp "m": false, // Was the buyer the maker? }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Compressed-Aggregate-Trades-List) +- [HTTP Request](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Compressed-Aggregate-Trades-List) +- [Request Weight](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Compressed-Aggregate-Trades-List) +- [Request Parameters](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Compressed-Aggregate-Trades-List) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Compressed-Aggregate-Trades-List) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Continuous-Contract-Kline-Candlestick-Data.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Continuous-Contract-Kline-Candlestick-Data.md new file mode 100644 index 0000000..585aa86 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Continuous-Contract-Kline-Candlestick-Data.md @@ -0,0 +1,107 @@ +--- +title: "Continuous Contract Kline Candlestick Data | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Continuous-Contract-Kline-Candlestick-Data" +fetched_at: "2026-01-27T05:28:02.754Z" +--- +# Continuous Contract Kline/Candlestick Data + +## API Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Continuous-Contract-Kline-Candlestick-Data) + +Kline/candlestick bars for a specific contract type. Klines are uniquely identified by their open time. + +> - Contract type: +> - PERPETUAL +> - CURRENT\_QUARTER +> - NEXT\_QUARTER + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Continuous-Contract-Kline-Candlestick-Data) + +GET `/dapi/v1/continuousKlines` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Continuous-Contract-Kline-Candlestick-Data) + +based on parameter `LIMIT` + +LIMIT + +weight + +\[1,100) + +1 + +\[100, 500) + +2 + +\[500, 1000\] + +5 + +> 1000 | 10 + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Continuous-Contract-Kline-Candlestick-Data) + +Name + +Type + +Mandatory + +Description + +pair + +STRING + +YES + +contractType + +ENUM + +YES + +interval + +ENUM + +YES + +startTime + +LONG + +NO + +endTime + +LONG + +NO + +limit + +INT + +NO + +Default 500; max 1500. + +> - The difference between `startTime` and `endTime` can only be up to 200 days +> - Between `startTime` and `endTime`, the most recent `limit` data from `endTime` will be returned: +> - If `startTime` and `endTime` are not sent, current timestamp will be set as `endTime`, and the most recent data will be returned. +> - If `startTime` is sent only, the timestamp of 200 days after `startTime` will be set as `endTime`(up to the current time) +> - If `endTime` is sent only, the timestamp of 200 days before `endTime` will be set as `startTime` + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Continuous-Contract-Kline-Candlestick-Data) + +``` +[ [ 1591258320000, // Open time "9640.7", // Open "9642.4", // High "9640.6", // Low "9642.0", // Close (or latest price) "206", // Volume 1591258379999, // Close time "2.13660389", // Base asset volume 48, // Number of trades "119", // Taker buy volume "1.23424865", // Taker buy base asset volume "0" // Ignore. ]] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Continuous-Contract-Kline-Candlestick-Data) +- [HTTP Request](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Continuous-Contract-Kline-Candlestick-Data) +- [Request Weight](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Continuous-Contract-Kline-Candlestick-Data) +- [Request Parameters](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Continuous-Contract-Kline-Candlestick-Data) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Continuous-Contract-Kline-Candlestick-Data) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Delist-Schedule.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Delist-Schedule.md new file mode 100644 index 0000000..1de6cba --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Delist-Schedule.md @@ -0,0 +1,12 @@ +--- +title: "Delist Schedule | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Delist-Schedule" +fetched_at: "2026-01-27T05:28:02.791Z" +--- +# Delist Schedule + +## API Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Delist-Schedule) + +The Futures team will update the `deliveryDate` in the `Get /dapi/v1/exchangeInfo` endpoint to the delisting time after the delisting announcement is published. Please refer to [Exchange Info](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Exchange-Information) to check the delisting information of contract trading pairs in advance. + +- [API Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Delist-Schedule) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Exchange-Information.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Exchange-Information.md new file mode 100644 index 0000000..146fa3b --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Exchange-Information.md @@ -0,0 +1,34 @@ +--- +title: "Exchange Information | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Exchange-Information" +fetched_at: "2026-01-27T05:28:03.009Z" +--- +# Exchange Information + +## API Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Exchange-Information) + +Current exchange trading rules and symbol information + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Exchange-Information) + +GET `/dapi/v1/exchangeInfo` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Exchange-Information) + +1 + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Exchange-Information) + +NONE + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Exchange-Information) + +``` +{ "exchangeFilters": [], "rateLimits": [ { "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "rateLimitType": "REQUEST_WEIGHT" }, { "interval": "MINUTE", "intervalNum": 1, "limit": 6000, "rateLimitType": "ORDERS" } ], "serverTime": 1565613908500, // Ignore please. If you want to check current server time, please check via "GET /dapi/v1/time" "symbols": [ // contract symbols { "filters": [ { "filterType": "PRICE_FILTER", "maxPrice": "100000", "minPrice": "0.1", "tickSize": "0.1" }, { "filterType": "LOT_SIZE", "maxQty": "100000", "minQty": "1", "stepSize": "1" }, { "filterType": "MARKET_LOT_SIZE", "maxQty": "100000", "minQty": "1", "stepSize": "1" }, { "filterType": "MAX_NUM_ORDERS", "limit": 200 }, { "filterType": "PERCENT_PRICE", "multiplierUp": "1.0500", "multiplierDown": "0.9500", "multiplierDecimal": "4" } ], "OrderType": [ "LIMIT", "MARKET", "STOP", "TAKE_PROFIT", "TRAILING_STOP_MARKET" ], "timeInForce": [ "GTC", "IOC", "FOK", "GTX" ], "liquidationFee": "0.010000", // liquidation fee rate "marketTakeBound": "0.30", // the max price difference rate( from mark price) a market order can make "symbol": "BTCUSD_200925", // contract symbol name "pair": "BTCUSD", // underlying symbol "contractType": "CURRENT_QUARTER", "deliveryDate": 1601020800000, "onboardDate": 1590739200000, "contractStatus": "TRADING", "contractSize": 100, "quoteAsset": "USD", "baseAsset": "BTC", "marginAsset": "BTC", "pricePrecision": 1, // please do not use it as tickSize "quantityPrecision": 0, // please do not use it as stepSize "baseAssetPrecision": 8, "quotePrecision": 8, "equalQtyPrecision": 4, // ignore "triggerProtect": "0.0500", // threshold for algo order with "priceProtect" "maintMarginPercent": "2.5000", // ignore "requiredMarginPercent": "5.0000", // ignore "underlyingType": "COIN", "underlyingSubType": [] } ], "timezone": "UTC"} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Exchange-Information) +- [HTTP Request](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Exchange-Information) +- [Request Weight](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Exchange-Information) +- [Request Parameters](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Exchange-Information) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Exchange-Information) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Get-Funding-Info.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Get-Funding-Info.md new file mode 100644 index 0000000..95cd5ff --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Get-Funding-Info.md @@ -0,0 +1,24 @@ +--- +title: "Get Funding Info | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Get-Funding-Info" +fetched_at: "2026-01-27T05:28:03.020Z" +--- +# Get Funding Rate Info + +## API Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Get-Funding-Info) + +Query funding rate info for symbols that had FundingRateCap/ FundingRateFloor / fundingIntervalHours adjustment + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Get-Funding-Info) + +GET `/dapi/v1/fundingInfo` + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Get-Funding-Info) + +``` +[ { "symbol": "BTCUSD_PERP", "adjustedFundingRateCap": "0.02500000", "adjustedFundingRateFloor": "-0.02500000", "fundingIntervalHours": 8, "disclaimer": false // ignore }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Get-Funding-Info) +- [HTTP Request](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Get-Funding-Info) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Get-Funding-Info) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Get-Funding-Rate-History-of-Perpetual-Futures.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Get-Funding-Rate-History-of-Perpetual-Futures.md new file mode 100644 index 0000000..7c6e865 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Get-Funding-Rate-History-of-Perpetual-Futures.md @@ -0,0 +1,72 @@ +--- +title: "Get Funding Rate History Of Perpetual Futures | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Get-Funding-Rate-History-of-Perpetual-Futures" +fetched_at: "2026-01-27T05:28:03.017Z" +--- +# Get Funding Rate History of Perpetual Futures + +## API Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Get-Funding-Rate-History-of-Perpetual-Futures) + +Get Funding Rate History of Perpetual Futures + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Get-Funding-Rate-History-of-Perpetual-Futures) + +GET `/dapi/v1/fundingRate` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Get-Funding-Rate-History-of-Perpetual-Futures) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Get-Funding-Rate-History-of-Perpetual-Futures) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +startTime + +LONG + +NO + +Timestamp in ms to get funding rate from INCLUSIVE. + +endTime + +LONG + +NO + +Timestamp in ms to get funding rate until INCLUSIVE. + +limit + +INT + +NO + +Default 100; max 1000 + +> - empty array will be returned for delivery symbols. + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Get-Funding-Rate-History-of-Perpetual-Futures) + +``` +[ { "symbol": "BTCUSD_PERP", "fundingTime": 1596038400000, "fundingRate": "-0.00300000" }, { "symbol": "BTCUSD_PERP", "fundingTime": 1596067200000, "fundingRate": "-0.00300000" }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Get-Funding-Rate-History-of-Perpetual-Futures) +- [HTTP Request](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Get-Funding-Rate-History-of-Perpetual-Futures) +- [Request Weight](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Get-Funding-Rate-History-of-Perpetual-Futures) +- [Request Parameters](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Get-Funding-Rate-History-of-Perpetual-Futures) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Get-Funding-Rate-History-of-Perpetual-Futures) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Index-Constituents.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Index-Constituents.md new file mode 100644 index 0000000..1af4b3b --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Index-Constituents.md @@ -0,0 +1,46 @@ +--- +title: "Query Index Price Constituents | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Index-Constituents" +fetched_at: "2026-01-27T05:28:03.049Z" +--- +# Query Index Price Constituents + +## API Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Index-Constituents) + +Query index price constituents + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Index-Constituents) + +GET `/dapi/v1/constituents` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Index-Constituents) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Index-Constituents) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Index-Constituents) + +``` +{ "symbol": "BTCUSD", "time": 1697422647853, "constituents": [ { "exchange": "bitstamp", "symbol": "btcusd" }, { "exchange": "coinbase", "symbol": "BTC-USD" }, { "exchange": "kraken", "symbol": "XBT/USD" }, { "exchange": "binance_cross", "symbol": "BTCUSDC*index(USDCUSD)" } ]} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Index-Constituents) +- [HTTP Request](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Index-Constituents) +- [Request Weight](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Index-Constituents) +- [Request Parameters](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Index-Constituents) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Index-Constituents) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Index-Price-Kline-Candlestick-Data.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Index-Price-Kline-Candlestick-Data.md new file mode 100644 index 0000000..7acd9dd --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Index-Price-Kline-Candlestick-Data.md @@ -0,0 +1,96 @@ +--- +title: "Index Price Kline Candlestick Data | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Index-Price-Kline-Candlestick-Data" +fetched_at: "2026-01-27T05:28:03.266Z" +--- +# Index Price Kline/Candlestick Data + +## API Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Index-Price-Kline-Candlestick-Data) + +Kline/candlestick bars for the index price of a pair. Klines are uniquely identified by their open time. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Index-Price-Kline-Candlestick-Data) + +GET `/dapi/v1/indexPriceKlines` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Index-Price-Kline-Candlestick-Data) + +based on parameter `LIMIT` + +LIMIT + +weight + +\[1,100) + +1 + +\[100, 500) + +2 + +\[500, 1000\] + +5 + +> 1000 | 10 + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Index-Price-Kline-Candlestick-Data) + +Name + +Type + +Mandatory + +Description + +pair + +STRING + +YES + +interval + +ENUM + +YES + +startTime + +LONG + +NO + +endTime + +LONG + +NO + +limit + +INT + +NO + +Default 500; max 1500. + +> - The difference between `startTime` and `endTime` can only be up to 200 days +> - Between `startTime` and `endTime`, the most recent `limit` data from `endTime` will be returned: +> - If `startTime` and `endTime` are not sent, current timestamp will be set as `endTime`, and the most recent data will be returned. +> - If `startTime` is sent only, the timestamp of 200 days after `startTime` will be set as `endTime`(up to the current time) +> - If `endTime` is sent only, the timestamp of 200 days before `endTime` will be set as `startTime` + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Index-Price-Kline-Candlestick-Data) + +``` +[ [ 1591256400000, // Open time "9653.69440000", // Open "9653.69640000", // High "9651.38600000", // Low "9651.55200000", // Close (or latest price) "0 ", // Ignore 1591256459999, // Close time "0", // Ignore 60, // Number of bisic data "0", // Ignore "0", // Ignore "0" // Ignore ]] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Index-Price-Kline-Candlestick-Data) +- [HTTP Request](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Index-Price-Kline-Candlestick-Data) +- [Request Weight](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Index-Price-Kline-Candlestick-Data) +- [Request Parameters](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Index-Price-Kline-Candlestick-Data) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Index-Price-Kline-Candlestick-Data) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Index-Price-and-Mark-Price.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Index-Price-and-Mark-Price.md new file mode 100644 index 0000000..dc1ab99 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Index-Price-and-Mark-Price.md @@ -0,0 +1,54 @@ +--- +title: "Index Price And Mark Price | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Index-Price-and-Mark-Price" +fetched_at: "2026-01-27T05:28:03.276Z" +--- +# Index Price and Mark Price + +## API Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Index-Price-and-Mark-Price) + +Query index price and mark price + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Index-Price-and-Mark-Price) + +GET `/dapi/v1/premiumIndex` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Index-Price-and-Mark-Price) + +**10** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Index-Price-and-Mark-Price) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +NO + +pair + +STRING + +NO + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Index-Price-and-Mark-Price) + +> with symbol + +``` +[ { "symbol": "BTCUSD_PERP", "pair": "BTCUSD", "markPrice": "11029.69574559", // mark price "indexPrice": "10979.14437500", // index price "estimatedSettlePrice": "10981.74168236", // Estimated Settle Price, only useful in the last hour before the settlement starts. "lastFundingRate": "0.00071003", // the lasted funding rate, for perpetual contract symbols only. For delivery symbols, "" will be shown. "interestRate": "0.00010000", // the base asset interest rate, for perpetual contract symbols only. For delivery symbols, "" will be shown. "nextFundingTime": 1596096000000, // For perpetual contract symbols only. For delivery symbols, 0 will be shown "time": 1596094042000 }, { "symbol": "BTCUSD_200925", "pair": "BTCUSD", "markPrice": "12077.01343750", "indexPrice": "10979.10312500", "estimatedSettlePrice": "10981.74168236", "lastFundingRate": "", "interestRate": "", "nextFundingTime": 0, "time": 1596094042000 }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Index-Price-and-Mark-Price) +- [HTTP Request](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Index-Price-and-Mark-Price) +- [Request Weight](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Index-Price-and-Mark-Price) +- [Request Parameters](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Index-Price-and-Mark-Price) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Index-Price-and-Mark-Price) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Kline-Candlestick-Data.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Kline-Candlestick-Data.md new file mode 100644 index 0000000..f2799cd --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Kline-Candlestick-Data.md @@ -0,0 +1,116 @@ +--- +title: "Kline Candlestick Data | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Kline-Candlestick-Data" +fetched_at: "2026-01-27T05:28:03.412Z" +--- +# Kline/Candlestick Data + +## API Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Kline-Candlestick-Data) + +Kline/candlestick bars for a symbol. +Klines are uniquely identified by their open time. + +- Kline/Candlestick chart intervals: + m -> minutes; h -> hours; d -> days; w -> weeks; M -> months + + - 1m + - 3m + - 5m + - 15m + - 30m + - 1h + - 2h + - 4h + - 6h + - 8h + - 12h + - 1d + - 3d + - 1w + - 1M + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Kline-Candlestick-Data) + +GET `/dapi/v1/klines` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Kline-Candlestick-Data) + +based on parameter `LIMIT` + +LIMIT + +weight + +\[1,100) + +1 + +\[100, 500) + +2 + +\[500, 1000\] + +5 + +> 1000 | 10 + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Kline-Candlestick-Data) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +interval + +ENUM + +YES + +startTime + +LONG + +NO + +endTime + +LONG + +NO + +limit + +INT + +NO + +Default 500; max 1500. + +> - The difference between `startTime` and `endTime` can only be up to 200 days +> - Between `startTime` and `endTime`, the most recent `limit` data from `endTime` will be returned: +> - If `startTime` and `endTime` are not sent, current timestamp will be set as `endTime`, and the most recent data will be returned. +> - If `startTime` is sent only, the timestamp of 200 days after `startTime` will be set as `endTime`(up to the current time) +> - If `endTime` is sent only, the timestamp of 200 days before `endTime` will be set as `startTime` + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Kline-Candlestick-Data) + +``` +[ [ 1591258320000, // Open time "9640.7", // Open "9642.4", // High "9640.6", // Low "9642.0", // Close (or latest price) "206", // Volume 1591258379999, // Close time "2.13660389", // Base asset volume 48, // Number of trades "119", // Taker buy volume "1.23424865", // Taker buy base asset volume "0" // Ignore. ]] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Kline-Candlestick-Data) +- [HTTP Request](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Kline-Candlestick-Data) +- [Request Weight](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Kline-Candlestick-Data) +- [Request Parameters](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Kline-Candlestick-Data) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Kline-Candlestick-Data) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Long-Short-Ratio.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Long-Short-Ratio.md new file mode 100644 index 0000000..c30c73b --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Long-Short-Ratio.md @@ -0,0 +1,79 @@ +--- +title: "Long Short Ratio | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Long-Short-Ratio" +fetched_at: "2026-01-27T05:28:03.306Z" +--- +# Long/Short Ratio + +## API Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Long-Short-Ratio) + +Query symbol Long/Short Ratio + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Long-Short-Ratio) + +GET `/futures/data/globalLongShortAccountRatio` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Long-Short-Ratio) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Long-Short-Ratio) + +Name + +Type + +Mandatory + +Description + +pair + +STRING + +YES + +BTCUSD + +period + +ENUM + +YES + +"5m","15m","30m","1h","2h","4h","6h","12h","1d" + +limit + +LONG + +NO + +Default 30,Max 500 + +startTime + +LONG + +NO + +endTime + +LONG + +NO + +> - If startTime and endTime are not sent, the most recent data is returned. +> - Only the data of the latest 30 days is available. + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Long-Short-Ratio) + +``` +[ { "pair": "BTCUSD", "longShortRatio": "0.1960", "longAccount": "0.6622", //66.22% "shortAccount": "0.3378", //33.78% "timestamp": 1583139600000 }, { "pair": "BTCUSD", "longShortRatio": "1.9559", "longAccount": "0.6617", "shortAccount": "0.3382", "timestamp": 1583139900000 }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Long-Short-Ratio) +- [HTTP Request](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Long-Short-Ratio) +- [Request Weight](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Long-Short-Ratio) +- [Request Parameters](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Long-Short-Ratio) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Long-Short-Ratio) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Mark-Price-Kline-Candlestick-Data.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Mark-Price-Kline-Candlestick-Data.md new file mode 100644 index 0000000..c2ca0cc --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Mark-Price-Kline-Candlestick-Data.md @@ -0,0 +1,96 @@ +--- +title: "Mark Price Kline Candlestick Data | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Mark-Price-Kline-Candlestick-Data" +fetched_at: "2026-01-27T05:28:03.523Z" +--- +# Mark Price Kline/Candlestick Data + +## API Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Mark-Price-Kline-Candlestick-Data) + +Kline/candlestick bars for the mark price of a symbol. Klines are uniquely identified by their open time. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Mark-Price-Kline-Candlestick-Data) + +GET `/dapi/v1/markPriceKlines` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Mark-Price-Kline-Candlestick-Data) + +based on parameter `LIMIT` + +LIMIT + +weight + +\[1,100) + +1 + +\[100, 500) + +2 + +\[500, 1000\] + +5 + +> 1000 | 10 + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Mark-Price-Kline-Candlestick-Data) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +interval + +ENUM + +YES + +startTime + +LONG + +NO + +endTime + +LONG + +NO + +limit + +INT + +NO + +Default 500; max 1500. + +> - The difference between `startTime` and `endTime` can only be up to 200 days +> - Between `startTime` and `endTime`, the most recent `limit` data from `endTime` will be returned: +> - If `startTime` and `endTime` are not sent, current timestamp will be set as `endTime`, and the most recent data will be returned. +> - If `startTime` is sent only, the timestamp of 200 days after `startTime` will be set as `endTime`(up to the current time) +> - If `endTime` is sent only, the timestamp of 200 days before `endTime` will be set as `startTime` + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Mark-Price-Kline-Candlestick-Data) + +``` +[ [ 1591256460000, // Open time "9653.29201333", // Open "9654.56401333", // High "9653.07367333", // Low "9653.07367333", // Close (or latest price) "0 ", // Ignore 1591256519999, // Close time "0", // Ignore 60, // Number of bisic data "0", // Ignore "0", // Ignore "0" // Ignore ]] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Mark-Price-Kline-Candlestick-Data) +- [HTTP Request](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Mark-Price-Kline-Candlestick-Data) +- [Request Weight](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Mark-Price-Kline-Candlestick-Data) +- [Request Parameters](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Mark-Price-Kline-Candlestick-Data) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Mark-Price-Kline-Candlestick-Data) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Old-Trades-Lookup.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Old-Trades-Lookup.md new file mode 100644 index 0000000..7e5b755 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Old-Trades-Lookup.md @@ -0,0 +1,64 @@ +--- +title: "Old Trades Lookup | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Old-Trades-Lookup" +fetched_at: "2026-01-27T05:28:03.656Z" +--- +# Old Trades Lookup(MARKET\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Old-Trades-Lookup) + +Get older market historical trades. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Old-Trades-Lookup) + +GET `/dapi/v1/historicalTrades` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Old-Trades-Lookup) + +**20** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Old-Trades-Lookup) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +limit + +INT + +NO + +Default 100; max 500. + +fromId + +LONG + +NO + +TradeId to fetch from. Default gets most recent trades. + +> - Market trades means trades filled in the order book. Only market trades will be returned, which means the insurance fund trades and ADL trades won't be returned. + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Old-Trades-Lookup) + +``` +[ { "id": 595103, "price": "9642.2", "qty": "1", "baseQty": "0.01037108", "time": 1499865549590, "isBuyerMaker": true, }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Old-Trades-Lookup) +- [HTTP Request](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Old-Trades-Lookup) +- [Request Weight](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Old-Trades-Lookup) +- [Request Parameters](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Old-Trades-Lookup) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Old-Trades-Lookup) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Open-Interest-Statistics.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Open-Interest-Statistics.md new file mode 100644 index 0000000..bce5bdf --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Open-Interest-Statistics.md @@ -0,0 +1,87 @@ +--- +title: "Open Interest Statistics | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Open-Interest-Statistics" +fetched_at: "2026-01-27T05:28:03.665Z" +--- +# Open Interest Statistics + +## API Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Open-Interest-Statistics) + +Query open interest stats + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Open-Interest-Statistics) + +GET `/futures/data/openInterestHist` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Open-Interest-Statistics) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Open-Interest-Statistics) + +Name + +Type + +Mandatory + +Description + +pair + +STRING + +YES + +BTCUSD + +contractType + +ENUM + +YES + +ALL, CURRENT\_QUARTER, NEXT\_QUARTER, PERPETUAL + +period + +ENUM + +YES + +"5m","15m","30m","1h","2h","4h","6h","12h","1d" + +limit + +LONG + +NO + +Default 30,Max 500 + +startTime + +LONG + +NO + +endTime + +LONG + +NO + +> - If startTime and endTime are not sent, the most recent data is returned. +> - Only the data of the latest 30 days is available. + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Open-Interest-Statistics) + +``` +[ { "pair": "BTCUSD", "contractType": "CURRENT_QUARTER", "sumOpenInterest": "20403", //unit: cont "sumOpenInterestValue": "176196512.23400000", //unit: base asset "timestamp": 1591261042378 }, { "pair": "BTCUSD", "contractType": "CURRENT_QUARTER", "sumOpenInterest": "20401", "sumOpenInterestValue": "176178704.98700000", "timestamp": 1583128200000 }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Open-Interest-Statistics) +- [HTTP Request](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Open-Interest-Statistics) +- [Request Weight](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Open-Interest-Statistics) +- [Request Parameters](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Open-Interest-Statistics) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Open-Interest-Statistics) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Open-Interest.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Open-Interest.md new file mode 100644 index 0000000..588d8c8 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Open-Interest.md @@ -0,0 +1,46 @@ +--- +title: "Open Interest | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Open-Interest" +fetched_at: "2026-01-27T05:28:03.560Z" +--- +# Open Interest + +## API Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Open-Interest) + +Get present open interest of a specific symbol. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Open-Interest) + +GET `/dapi/v1/openInterest` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Open-Interest) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Open-Interest) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Open-Interest) + +``` +{ "symbol": "BTCUSD_200626", "pair": "BTCUSD", "openInterest": "15004", "contractType": "CURRENT_QUARTER", "time": 1591261042378} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Open-Interest) +- [HTTP Request](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Open-Interest) +- [Request Weight](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Open-Interest) +- [Request Parameters](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Open-Interest) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Open-Interest) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Order-Book.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Order-Book.md new file mode 100644 index 0000000..9076b64 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Order-Book.md @@ -0,0 +1,74 @@ +--- +title: "Order Book | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Order-Book" +fetched_at: "2026-01-27T05:28:03.777Z" +--- +# Order Book + +## API Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Order-Book) + +Query orderbook on specific symbol + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Order-Book) + +GET `/dapi/v1/depth` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Order-Book) + +Adjusted based on the limit: + +Limit + +Weight + +5, 10, 20, 50 + +2 + +100 + +5 + +500 + +10 + +1000 + +20 + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Order-Book) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +limit + +INT + +NO + +Default 500; Valid limits:\[5, 10, 20, 50, 100, 500, 1000\] + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Order-Book) + +``` +{ "lastUpdateId": 16769853, "symbol": "BTCUSD_PERP", // Symbol "pair": "BTCUSD", // Pair "E": 1591250106370, // Message output time "T": 1591250106368, // Transaction time "bids": [ [ "9638.0", // PRICE "431" // QTY ] ], "asks": [ [ "9638.2", "12" ] ]} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Order-Book) +- [HTTP Request](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Order-Book) +- [Request Weight](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Order-Book) +- [Request Parameters](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Order-Book) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Order-Book) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Premium-Index-Kline-Data.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Premium-Index-Kline-Data.md new file mode 100644 index 0000000..ac3bd07 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Premium-Index-Kline-Data.md @@ -0,0 +1,94 @@ +--- +title: "Premium Index Kline Data | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Premium-Index-Kline-Data" +fetched_at: "2026-01-27T05:28:03.812Z" +--- +# Premium index Kline Data + +## API Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Premium-Index-Kline-Data) + +Premium index kline bars of a symbol. Klines are uniquely identified by their open time. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Premium-Index-Kline-Data) + +GET `/dapi/v1/premiumIndexKlines` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Premium-Index-Kline-Data) + +based on parameter `LIMIT` + +LIMIT + +weight + +\[1,100) + +1 + +\[100, 500) + +2 + +\[500, 1000\] + +5 + +\> 1000 + +10 + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Premium-Index-Kline-Data) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +interval + +ENUM + +YES + +startTime + +LONG + +NO + +endTime + +LONG + +NO + +limit + +INT + +NO + +Default 500; max 1500. + +> - If startTime and endTime are not sent, the most recent klines are returned. + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Premium-Index-Kline-Data) + +``` +[ [ 1691603820000, // Open time "-0.00042931", // Open "-0.00023641", // High "-0.00059406", // Low "-0.00043659", // Close "0", // Ignore 1691603879999, // Close time "0", // Ignore 12, // Ignore "0", // Ignore "0", // Ignore "0" // Ignore ]] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Premium-Index-Kline-Data) +- [HTTP Request](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Premium-Index-Kline-Data) +- [Request Weight](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Premium-Index-Kline-Data) +- [Request Parameters](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Premium-Index-Kline-Data) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Premium-Index-Kline-Data) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Recent-Trades-List.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Recent-Trades-List.md new file mode 100644 index 0000000..516ac0f --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Recent-Trades-List.md @@ -0,0 +1,56 @@ +--- +title: "Recent Trades List | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Recent-Trades-List" +fetched_at: "2026-01-27T05:28:04.045Z" +--- +# Recent Trades List + +## API Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Recent-Trades-List) + +Get recent market trades + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Recent-Trades-List) + +GET `/dapi/v1/trades` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Recent-Trades-List) + +5 + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Recent-Trades-List) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +limit + +INT + +NO + +Default 500; max 1000. + +- Market trades means trades filled in the order book. Only market trades will be returned, which means the insurance fund trades and ADL trades won't be returned. + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Recent-Trades-List) + +``` +[ { "id": 28457, "price": "9635.0", "qty": "1", "baseQty": "0.01037883", "time": 1591250192508, "isBuyerMaker": true, }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Recent-Trades-List) +- [HTTP Request](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Recent-Trades-List) +- [Request Weight](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Recent-Trades-List) +- [Request Parameters](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Recent-Trades-List) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Recent-Trades-List) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Symbol-Order-Book-Ticker.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Symbol-Order-Book-Ticker.md new file mode 100644 index 0000000..d0c6f7b --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Symbol-Order-Book-Ticker.md @@ -0,0 +1,56 @@ +--- +title: "Symbol Order Book Ticker | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Symbol-Order-Book-Ticker" +fetched_at: "2026-01-27T05:28:03.926Z" +--- +# Symbol Order Book Ticker + +## API Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Symbol-Order-Book-Ticker) + +Best price/qty on the order book for a symbol or symbols. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Symbol-Order-Book-Ticker) + +GET `/dapi/v1/ticker/bookTicker` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Symbol-Order-Book-Ticker) + +**2** for a single symbol, **5** when the symbol parameter is omitted + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Symbol-Order-Book-Ticker) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +NO + +pair + +STRING + +NO + +> - Symbol and pair cannot be sent together +> - If a pair is sent,tickers for all symbols of the pair will be returned +> - If either a pair or symbol is sent, tickers for all symbols of all pairs will be returned + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Symbol-Order-Book-Ticker) + +``` +[ { "lastUpdateId": 1027024, "symbol": "BTCUSD_200626", "pair": "BTCUSD", "bidPrice": "9650.1", "bidQty": "16", "askPrice": "9650.3", "askQty": "7", "time": 1591257300345 }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Symbol-Order-Book-Ticker) +- [HTTP Request](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Symbol-Order-Book-Ticker) +- [Request Weight](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Symbol-Order-Book-Ticker) +- [Request Parameters](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Symbol-Order-Book-Ticker) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Symbol-Order-Book-Ticker) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Symbol-Price-Ticker.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Symbol-Price-Ticker.md new file mode 100644 index 0000000..5f042ed --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Symbol-Price-Ticker.md @@ -0,0 +1,56 @@ +--- +title: "Symbol Price Ticker | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Symbol-Price-Ticker" +fetched_at: "2026-01-27T05:28:04.184Z" +--- +# Symbol Price Ticker + +## API Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Symbol-Price-Ticker) + +Latest price for a symbol or symbols. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Symbol-Price-Ticker) + +GET `/dapi/v1/ticker/price` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Symbol-Price-Ticker) + +**1** for a single symbol, **2** when the symbol parameter is omitted + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Symbol-Price-Ticker) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +NO + +pair + +STRING + +NO + +> - Symbol and pair cannot be sent together +> - If a pair is sent,tickers for all symbols of the pair will be returned +> - If either a pair or symbol is sent, tickers for all symbols of all pairs will be returned + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Symbol-Price-Ticker) + +``` +[ { "symbol": "BTCUSD_200626", "ps": "9647.8", // pair "price": "9647.8", "time": 1591257246176 }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Symbol-Price-Ticker) +- [HTTP Request](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Symbol-Price-Ticker) +- [Request Weight](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Symbol-Price-Ticker) +- [Request Parameters](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Symbol-Price-Ticker) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Symbol-Price-Ticker) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Taker-Buy-Sell-Volume.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Taker-Buy-Sell-Volume.md new file mode 100644 index 0000000..ce07569 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Taker-Buy-Sell-Volume.md @@ -0,0 +1,87 @@ +--- +title: "Taker Buy Sell Volume | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Taker-Buy-Sell-Volume" +fetched_at: "2026-01-27T05:28:04.064Z" +--- +# Taker Buy/Sell Volume + +## API Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Taker-Buy-Sell-Volume) + +Taker Buy Volume: the total volume of buy orders filled by takers within the period. Taker Sell Volume: the total volume of sell orders filled by takers within the period. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Taker-Buy-Sell-Volume) + +GET `/futures/data/takerBuySellVol` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Taker-Buy-Sell-Volume) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Taker-Buy-Sell-Volume) + +Name + +Type + +Mandatory + +Description + +pair + +STRING + +YES + +BTCUSD + +contractType + +ENUM + +YES + +ALL, CURRENT\_QUARTER, NEXT\_QUARTER, PERPETUAL + +period + +ENUM + +YES + +"5m","15m","30m","1h","2h","4h","6h","12h","1d" + +limit + +LONG + +NO + +Default 30,Max 500 + +startTime + +LONG + +NO + +endTime + +LONG + +NO + +> - If startTime and endTime are not sent, the most recent data is returned. +> - Only the data of the latest 30 days is available. + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Taker-Buy-Sell-Volume) + +``` +[ { "pair": "BTCUSD", "contractType": "CURRENT_QUARTER", "takerBuyVol": "387", //unit: cont "takerSellVol": "248", //unit: cont "takerBuyVolValue": "2342.1220", //unit: base asset "takerSellVolValue": "4213.9800", //unit: base asset "timestamp": 1591261042378 }, { "pair": "BTCUSD", "contractType": "CURRENT_QUARTER", "takerBuyVol": "234", //unit: cont "takerSellVol": "121", //unit: cont "takerBuyVolValue": "4563.1320", //unit: base asset "takerSellVolValue": "3313.3940", //unit: base asset "timestamp": 1585615200000 }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Taker-Buy-Sell-Volume) +- [HTTP Request](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Taker-Buy-Sell-Volume) +- [Request Weight](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Taker-Buy-Sell-Volume) +- [Request Parameters](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Taker-Buy-Sell-Volume) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Taker-Buy-Sell-Volume) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Top-Long-Short-Account-Ratio.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Top-Long-Short-Account-Ratio.md new file mode 100644 index 0000000..811deae --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Top-Long-Short-Account-Ratio.md @@ -0,0 +1,77 @@ +--- +title: "Top Trader Long Short Account Ratio | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Top-Long-Short-Account-Ratio" +fetched_at: "2026-01-27T05:28:04.309Z" +--- +# Top Trader Long/Short Ratio (Accounts) + +## API Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Top-Long-Short-Account-Ratio) + +The proportion of net long and net short accounts to total accounts of the top 20% users with the highest margin balance. Each account is counted once only. Long Account % = Accounts of top traders with net long positions / Total accounts of top traders with open positions Short Account % = Accounts of top traders with net short positions / Total accounts of top traders with open positions Long/Short Ratio (Accounts) = Long Account % / Short Account % + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Top-Long-Short-Account-Ratio) + +GET `/futures/data/topLongShortAccountRatio` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Top-Long-Short-Account-Ratio) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Top-Long-Short-Account-Ratio) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +period + +ENUM + +YES + +"5m","15m","30m","1h","2h","4h","6h","12h","1d" + +limit + +LONG + +NO + +default 30, max 500 + +startTime + +LONG + +NO + +endTime + +LONG + +NO + +> - If startTime and endTime are not sent, the most recent data is returned. +> - Only the data of the latest 30 days is available. + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Top-Long-Short-Account-Ratio) + +``` +[ { "pair": "BTCUSD", "longShortRatio": "1.8105", "longAccount": "0.6442", //64.42% "shortAccount": "0.3558", //35.58% "timestamp": 1591261042378 }, { "pair": "BTCUSD", "longShortRatio": "1.1110", "longAccount": "0.5263", "shortAccount": "0.4737", "timestamp": 1592870400000 }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Top-Long-Short-Account-Ratio) +- [HTTP Request](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Top-Long-Short-Account-Ratio) +- [Request Weight](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Top-Long-Short-Account-Ratio) +- [Request Parameters](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Top-Long-Short-Account-Ratio) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Top-Long-Short-Account-Ratio) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Top-Trader-Long-Short-Ratio.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Top-Trader-Long-Short-Ratio.md new file mode 100644 index 0000000..d0cfa3b --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_market-data_rest-api_Top-Trader-Long-Short-Ratio.md @@ -0,0 +1,79 @@ +--- +title: "Top Trader Long Short Position Ratio | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Top-Trader-Long-Short-Ratio" +fetched_at: "2026-01-27T05:28:04.350Z" +--- +# Top Trader Long/Short Ratio (Positions) + +## API Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Top-Trader-Long-Short-Ratio) + +The proportion of net long and net short positions to total open positions of the top 20% users with the highest margin balance. Long Position % = Long positions of top traders / Total open positions of top traders Short Position % = Short positions of top traders / Total open positions of top traders Long/Short Ratio (Positions) = Long Position % / Short Position % + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Top-Trader-Long-Short-Ratio) + +GET `/futures/data/topLongShortPositionRatio` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Top-Trader-Long-Short-Ratio) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Top-Trader-Long-Short-Ratio) + +Name + +Type + +Mandatory + +Description + +pair + +STRING + +YES + +BTCUSD + +period + +ENUM + +YES + +"5m","15m","30m","1h","2h","4h","6h","12h","1d" + +limit + +LONG + +NO + +Default 30,Max 500 + +startTime + +LONG + +NO + +endTime + +LONG + +NO + +> - If startTime and endTime are not sent, the most recent data is returned. +> - Only the data of the latest 30 days is available. + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Top-Trader-Long-Short-Ratio) + +``` +[ { "pair": "BTCUSD", "longShortRatio": "0.7869", "longPosition": "0.6442", //64.42% "shortPosition": "0.4404", //44.04% "timestamp": 1592870400000 }, { "pair": "BTCUSD", "longShortRatio": "1.1231", "longPosition": "0.2363", "shortPosition": "0.4537", "timestamp": 1592956800000 }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Top-Trader-Long-Short-Ratio) +- [HTTP Request](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Top-Trader-Long-Short-Ratio) +- [Request Weight](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Top-Trader-Long-Short-Ratio) +- [Request Parameters](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Top-Trader-Long-Short-Ratio) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Top-Trader-Long-Short-Ratio) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_portfolio-margin-endpoints.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_portfolio-margin-endpoints.md new file mode 100644 index 0000000..a591434 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_portfolio-margin-endpoints.md @@ -0,0 +1,54 @@ +--- +title: "Classic Portfolio Margin Account Information | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/portfolio-margin-endpoints" +fetched_at: "2026-01-27T05:28:04.311Z" +--- +# Classic Portfolio Margin Account Information (USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/portfolio-margin-endpoints) + +Get Classic Portfolio Margin current account information. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/portfolio-margin-endpoints) + +GET `/dapi/v1/pmAccountInfo` + +## Request Weight(IP)[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/portfolio-margin-endpoints) + +**5** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/portfolio-margin-endpoints) + +Name + +Type + +Mandatory + +Description + +asset + +STRING + +YES + +recvWindow + +LONG + +NO + +> - maxWithdrawAmount is for asset transfer out to the spot wallet. + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/portfolio-margin-endpoints) + +``` +{ "maxWithdrawAmountUSD": "25347.92083245", // Classic Portfolio margin maximum virtual amount for transfer out in USD "asset": "BTC", // asset name "maxWithdrawAmount": "1.33663654", // maximum amount for transfer out} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/portfolio-margin-endpoints) +- [HTTP Request](https://developers.binance.com/docs/derivatives/coin-margined-futures/portfolio-margin-endpoints) +- [Request Weight(IP)](https://developers.binance.com/docs/derivatives/coin-margined-futures/portfolio-margin-endpoints) +- [Request Parameters](https://developers.binance.com/docs/derivatives/coin-margined-futures/portfolio-margin-endpoints) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/portfolio-margin-endpoints) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api.md new file mode 100644 index 0000000..b380c24 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api.md @@ -0,0 +1,251 @@ +--- +title: "New Order | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api" +fetched_at: "2026-01-27T05:28:04.582Z" +--- +# New Order (TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api) + +Send in a new order. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api) + +POST `/dapi/v1/order` + +## Request Weight(IP)[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api) + +1 on 1min order rate limit(X-MBX-ORDER-COUNT-1M) +0 on IP rate limit(x-mbx-used-weight-1m) + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +side + +ENUM + +YES + +positionSide + +ENUM + +NO + +Default `BOTH` for One-way Mode ; `LONG` or `SHORT` for Hedge Mode. It must be sent in Hedge Mode. + +type + +ENUM + +YES + +timeInForce + +ENUM + +NO + +quantity + +DECIMAL + +NO + +quantity measured by contract number, Cannot be sent with `closePosition`\=`true` + +reduceOnly + +STRING + +NO + +"true" or "false". default "false". Cannot be sent in Hedge Mode; cannot be sent with `closePosition`\=`true`(Close-All) + +price + +DECIMAL + +NO + +newClientOrderId + +STRING + +NO + +A unique id among open orders. Automatically generated if not sent. Can only be string following the rule: `^[\.A-Z\:/a-z0-9_-]{1,36}$` + +stopPrice + +DECIMAL + +NO + +Used with `STOP/STOP_MARKET` or `TAKE_PROFIT/TAKE_PROFIT_MARKET` orders. + +closePosition + +STRING + +NO + +`true`, `false`;Close-All,used with `STOP_MARKET` or `TAKE_PROFIT_MARKET`. + +activationPrice + +DECIMAL + +NO + +Used with `TRAILING_STOP_MARKET` orders, default as the latest price(supporting different `workingType`) + +callbackRate + +DECIMAL + +NO + +Used with `TRAILING_STOP_MARKET` orders, min 0.1, max 10 where 1 for 1% + +workingType + +ENUM + +NO + +stopPrice triggered by: "MARK\_PRICE", "CONTRACT\_PRICE". Default "CONTRACT\_PRICE" + +priceProtect + +STRING + +NO + +"TRUE" or "FALSE", default "FALSE". Used with `STOP/STOP_MARKET` or `TAKE_PROFIT/TAKE_PROFIT_MARKET` orders. + +newOrderRespType + +ENUM + +NO + +"ACK", "RESULT", default "ACK" + +priceMatch + +ENUM + +NO + +only avaliable for `LIMIT`/`STOP`/`TAKE_PROFIT` order; can be set to `OPPONENT`/ `OPPONENT_5`/ `OPPONENT_10`/ `OPPONENT_20`: /`QUEUE`/ `QUEUE_5`/ `QUEUE_10`/ `QUEUE_20`; Can't be passed together with `price` + +selfTradePreventionMode + +ENUM + +NO + +`EXPIRE_TAKER`:expire taker order when STP triggers/ `EXPIRE_MAKER`:expire taker order when STP triggers/ `EXPIRE_BOTH`:expire both orders when STP triggers; default `EXPIRE_MAKER` + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +Additional mandatory parameters based on `type`: + +Type + +Additional mandatory parameters + +`LIMIT` + +`timeInForce`, `quantity`, `price` + +`MARKET` + +`quantity` + +`STOP/TAKE_PROFIT` + +`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 parameter`priceProtect`is 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 /dapi/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` parameter +> - 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`. +> + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api) + +``` +{ "clientOrderId": "testOrder", "cumQty": "0", "cumBase": "0", "executedQty": "0", "orderId": 22542179, "avgPrice": "0.0", "origQty": "10", "price": "0", "reduceOnly": false, "side": "BUY", "positionSide": "SHORT", "status": "NEW", "stopPrice": "9300", // please ignore when order type is TRAILING_STOP_MARKET "closePosition": false, // if Close-All "symbol": "BTCUSD_200925", "pair": "BTCUSD", "timeInForce": "GTC", "type": "TRAILING_STOP_MARKET", "origType": "TRAILING_STOP_MARKET", "activatePrice": "9020", // activation price, only return with TRAILING_STOP_MARKET order "priceRate": "0.3", // callback rate, only return with TRAILING_STOP_MARKET order "updateTime": 1566818724722, "workingType": "CONTRACT_PRICE", "priceProtect": false, // if conditional order trigger is protected "priceMatch": "NONE", //price match mode "selfTradePreventionMode": "NONE", //self trading preventation mode} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api) +- [HTTP Request](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api) +- [Request Weight(IP)](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api) +- [Request Parameters](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api_Account-Trade-List.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api_Account-Trade-List.md new file mode 100644 index 0000000..0fe88d2 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api_Account-Trade-List.md @@ -0,0 +1,107 @@ +--- +title: "Query Account Trade List | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Account-Trade-List" +fetched_at: "2026-01-27T05:28:04.620Z" +--- +# Account Trade List (USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Account-Trade-List) + +Get trades for a specific account and symbol. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Account-Trade-List) + +GET `/dapi/v1/userTrades` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Account-Trade-List) + +**20** with symbol,**40** with pair + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Account-Trade-List) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +NO + +pair + +STRING + +NO + +orderId + +STRING + +NO + +startTime + +LONG + +NO + +endTime + +LONG + +NO + +fromId + +LONG + +NO + +Trade id to fetch from. Default gets most recent trades. + +limit + +INT + +NO + +Default 50; max 1000 + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +> - Either symbol or pair must be sent +> - Symbol and pair cannot be sent together +> - Pair and fromId cannot be sent together +> - OrderId can only be sent together with symbol +> - If a pair is sent,tickers for all symbols of the pair will be returned +> - The parameter `fromId` cannot be sent with `startTime` or `endTime` +> - 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. + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Account-Trade-List) + +``` +[ { 'symbol': 'BTCUSD_200626', 'id': 6, 'orderId': 28, 'pair': 'BTCUSD', 'side': 'SELL', 'price': '8800', 'qty': '1', 'realizedPnl': '0', 'marginAsset': 'BTC', 'baseQty': '0.01136364', 'commission': '0.00000454', 'commissionAsset': 'BTC', 'time': 1590743483586, 'positionSide': 'BOTH', 'buyer': false, 'maker': false }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Account-Trade-List) +- [HTTP Request](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Account-Trade-List) +- [Request Weight](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Account-Trade-List) +- [Request Parameters](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Account-Trade-List) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Account-Trade-List) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api_All-Orders.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api_All-Orders.md new file mode 100644 index 0000000..e314ad2 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api_All-Orders.md @@ -0,0 +1,102 @@ +--- +title: "Query All Orders | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/All-Orders" +fetched_at: "2026-01-27T05:28:04.567Z" +--- +# All Orders (USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/All-Orders) + +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 + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/All-Orders) + +GET `/dapi/v1/allOrders` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/All-Orders) + +**20** with symbol, **40** with pair + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/All-Orders) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +NO + +pair + +STRING + +NO + +orderId + +LONG + +NO + +startTime + +LONG + +NO + +endTime + +LONG + +NO + +limit + +INT + +NO + +Default 50; max 100. + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +**Notes:** + +> - Either `symbol` or `pair` must be sent. +> - `pair` can't be sent with `orderId` +> - If `orderId` is set, it will get orders >= that `orderId`. Otherwise most recent orders are returned. +> - 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). + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/All-Orders) + +``` +[ { "avgPrice": "0.0", "clientOrderId": "abc", "cumBase": "0", "executedQty": "0", "orderId": 1917641, "origQty": "0.40", "origType": "TRAILING_STOP_MARKET", "price": "0", "reduceOnly": false, "side": "BUY", "positionSide": "SHORT", "status": "NEW", "stopPrice": "9300", // please ignore when order type is TRAILING_STOP_MARKET "closePosition": false, // if Close-All "symbol": "BTCUSD_200925", "pair": "BTCUSD", "time": 1579276756075, // order time "timeInForce": "GTC", "type": "TRAILING_STOP_MARKET", "activatePrice": "9020", // activation price, only return with TRAILING_STOP_MARKET order "priceRate": "0.3", // callback rate, only return with TRAILING_STOP_MARKET order "updateTime": 1579276756075, // update time "workingType": "CONTRACT_PRICE", "priceProtect": false, // if conditional order trigger is protected "priceMatch": "NONE", //price match mode "selfTradePreventionMode": "NONE", //self trading preventation mode }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/All-Orders) +- [HTTP Request](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/All-Orders) +- [Request Weight](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/All-Orders) +- [Request Parameters](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/All-Orders) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/All-Orders) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api_Auto-Cancel-All-Open-Orders.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api_Auto-Cancel-All-Open-Orders.md new file mode 100644 index 0000000..33d8c84 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api_Auto-Cancel-All-Open-Orders.md @@ -0,0 +1,72 @@ +--- +title: "Auto Cancel All Open Orders | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Auto-Cancel-All-Open-Orders" +fetched_at: "2026-01-27T05:28:04.736Z" +--- +# Auto-Cancel All Open Orders (TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Auto-Cancel-All-Open-Orders) + +Cancel all open orders of the specified symbol at the end of the specified countdown. This rest endpoint means to ensure your open orders are canceled in case of an outage. The endpoint should be called repeatedly as heartbeats so that the existing countdown time can be canceled and repalced by a new one. 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. + +- 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. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Auto-Cancel-All-Open-Orders) + +POST `/dapi/v1/countdownCancelAll` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Auto-Cancel-All-Open-Orders) + +**10** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Auto-Cancel-All-Open-Orders) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +countdownTime + +LONG + +YES + +countdown time, 1000 for 1 second. 0 to cancel the timer + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Auto-Cancel-All-Open-Orders) + +``` +{ "symbol": "BTCUSD_200925", "countdownTime": "100000"} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Auto-Cancel-All-Open-Orders) +- [HTTP Request](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Auto-Cancel-All-Open-Orders) +- [Request Weight](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Auto-Cancel-All-Open-Orders) +- [Request Parameters](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Auto-Cancel-All-Open-Orders) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Auto-Cancel-All-Open-Orders) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api_Cancel-All-Open-Orders.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api_Cancel-All-Open-Orders.md new file mode 100644 index 0000000..c8f728e --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api_Cancel-All-Open-Orders.md @@ -0,0 +1,58 @@ +--- +title: "Cancel All Open Orders | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Cancel-All-Open-Orders" +fetched_at: "2026-01-27T05:28:04.824Z" +--- +# Cancel All Open Orders(TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Cancel-All-Open-Orders) + +Cancel All Open Orders + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Cancel-All-Open-Orders) + +DELETE `/dapi/v1/allOpenOrders` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Cancel-All-Open-Orders) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Cancel-All-Open-Orders) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Cancel-All-Open-Orders) + +``` +{ "code": 200, "msg": "The operation of cancel all open order is done."} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Cancel-All-Open-Orders) +- [HTTP Request](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Cancel-All-Open-Orders) +- [Request Weight](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Cancel-All-Open-Orders) +- [Request Parameters](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Cancel-All-Open-Orders) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Cancel-All-Open-Orders) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api_Cancel-Multiple-Orders.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api_Cancel-Multiple-Orders.md new file mode 100644 index 0000000..9fbff9c --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api_Cancel-Multiple-Orders.md @@ -0,0 +1,78 @@ +--- +title: "Cancel Multiple Orders | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Cancel-Multiple-Orders" +fetched_at: "2026-01-27T05:28:04.848Z" +--- +# Cancel Multiple Orders(TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Cancel-Multiple-Orders) + +Cancel Multiple Orders + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Cancel-Multiple-Orders) + +DELETE `/dapi/v1/batchOrders` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Cancel-Multiple-Orders) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Cancel-Multiple-Orders) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +orderIdList + +LIST + +NO + +max length 10 +e.g. \[1234567,2345678\] + +origClientOrderIdList + +LIST + +NO + +max length 10 +e.g. \["my\_id\_1","my\_id\_2"\], encode the double quotes. No space after comma. + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +> - Either `orderIdList` or `origClientOrderIdList` must be sent. + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Cancel-Multiple-Orders) + +``` +[ { "avgPrice": "0.0", "clientOrderId": "myOrder1", "cumQty": "0", "cumBase": "0", "executedQty": "0", "orderId": 283194212, "origQty": "11", "origType": "TRAILING_STOP_MARKET", "price": "0", "reduceOnly": false, "side": "BUY", "positionSide": "SHORT", "status": "CANCELED", "stopPrice": "9300", // please ignore when order type is TRAILING_STOP_MARKET "closePosition": false, // if Close-All "symbol": "BTCUSD_200925", "pair": "BTCUSD", "timeInForce": "GTC", "type": "TRAILING_STOP_MARKET", "activatePrice": "9020", // activation price, only return with TRAILING_STOP_MARKET order "priceRate": "0.3", // callback rate, only return with TRAILING_STOP_MARKET order "workingType": "CONTRACT_PRICE", "priceProtect": false, // if conditional order trigger is protected "priceMatch": "NONE", //price match mode "selfTradePreventionMode": "NONE", //self trading preventation mode "updateTime": 1571110484038 }, { "code": -2011, "msg": "Unknown order sent." }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Cancel-Multiple-Orders) +- [HTTP Request](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Cancel-Multiple-Orders) +- [Request Weight](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Cancel-Multiple-Orders) +- [Request Parameters](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Cancel-Multiple-Orders) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Cancel-Multiple-Orders) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api_Cancel-Order.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api_Cancel-Order.md new file mode 100644 index 0000000..a2c4cf1 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api_Cancel-Order.md @@ -0,0 +1,69 @@ +--- +title: "Cancel Order | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Cancel-Order" +fetched_at: "2026-01-27T05:28:04.885Z" +--- +# Cancel Order (TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Cancel-Order) + +Cancel an active order. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Cancel-Order) + +DELETE `/dapi/v1/order` + +**Weight:** **1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Cancel-Order) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +orderId + +LONG + +NO + +origClientOrderId + +STRING + +NO + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +> - Either `orderId` or `origClientOrderId` must be sent. + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Cancel-Order) + +``` +{ "avgPrice": "0.0", "clientOrderId": "myOrder1", "cumQty": "0", "cumBase": "0", "executedQty": "0", "orderId": 283194212, "origQty": "11", "origType": "TRAILING_STOP_MARKET", "price": "0", "reduceOnly": false, "side": "BUY", "positionSide": "SHORT", "status": "CANCELED", "stopPrice": "9300", // please ignore when order type is TRAILING_STOP_MARKET "closePosition": false, // if Close-All "symbol": "BTCUSD_200925", "pair": "BTCUSD", "timeInForce": "GTC", "type": "TRAILING_STOP_MARKET", "activatePrice": "9020", // activation price, only return with TRAILING_STOP_MARKET order "priceRate": "0.3", // callback rate, only return with TRAILING_STOP_MARKET order "updateTime": 1571110484038, "workingType": "CONTRACT_PRICE", "priceProtect": false, // if conditional order trigger is protected "priceMatch": "NONE", //price match mode "selfTradePreventionMode": "NONE" //self trading preventation mode} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Cancel-Order) +- [HTTP Request](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Cancel-Order) +- [Request Parameters](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Cancel-Order) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Cancel-Order) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api_Change-Initial-Leverage.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api_Change-Initial-Leverage.md new file mode 100644 index 0000000..f9060a1 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api_Change-Initial-Leverage.md @@ -0,0 +1,67 @@ +--- +title: "Change Initial Leverage | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Change-Initial-Leverage" +fetched_at: "2026-01-27T05:28:04.988Z" +--- +# Change Initial Leverage (TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Change-Initial-Leverage) + +Change user's initial leverage in the specific symbol market. +For Hedge Mode, LONG and SHORT positions of one symbol use the same initial leverage and share a total notional value. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Change-Initial-Leverage) + +POST `/dapi/v1/leverage` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Change-Initial-Leverage) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Change-Initial-Leverage) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +leverage + +INT + +YES + +target initial leverage: int from 1 to 125 + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Change-Initial-Leverage) + +``` +{ "leverage": 21, "maxQty": "1000", // maximum quantity of base asset "symbol": "BTCUSD_200925"} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Change-Initial-Leverage) +- [HTTP Request](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Change-Initial-Leverage) +- [Request Weight](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Change-Initial-Leverage) +- [Request Parameters](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Change-Initial-Leverage) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Change-Initial-Leverage) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api_Change-Margin-Type.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api_Change-Margin-Type.md new file mode 100644 index 0000000..ee721fc --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api_Change-Margin-Type.md @@ -0,0 +1,67 @@ +--- +title: "Change Margin Type | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Change-Margin-Type" +fetched_at: "2026-01-27T05:28:05.211Z" +--- +# Change Margin Type (TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Change-Margin-Type) + +Change user's margin type in the specific symbol market.For Hedge Mode, LONG and SHORT positions of one symbol use the same margin type. +With ISOLATED margin type, margins of the LONG and SHORT positions are isolated from each other. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Change-Margin-Type) + +POST `/dapi/v1/marginType` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Change-Margin-Type) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Change-Margin-Type) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +marginType + +ENUM + +YES + +ISOLATED, CROSSED + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Change-Margin-Type) + +``` +{ "code": 200, "msg": "success"} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Change-Margin-Type) +- [HTTP Request](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Change-Margin-Type) +- [Request Weight](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Change-Margin-Type) +- [Request Parameters](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Change-Margin-Type) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Change-Margin-Type) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api_Change-Position-Mode.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api_Change-Position-Mode.md new file mode 100644 index 0000000..17d2cc0 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api_Change-Position-Mode.md @@ -0,0 +1,60 @@ +--- +title: "Change Position Mode | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Change-Position-Mode" +fetched_at: "2026-01-27T05:28:05.099Z" +--- +# Change Position Mode(TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Change-Position-Mode) + +Change user's position mode (Hedge Mode or One-way Mode ) on _**EVERY symbol**_ + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Change-Position-Mode) + +POST `/dapi/v1/positionSide/dual` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Change-Position-Mode) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Change-Position-Mode) + +Name + +Type + +Mandatory + +Description + +dualSidePosition + +STRING + +YES + +"true": Hedge Mode; "false": One-way Mode + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Change-Position-Mode) + +``` +{ "code": 200, "msg": "success"} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Change-Position-Mode) +- [HTTP Request](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Change-Position-Mode) +- [Request Weight](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Change-Position-Mode) +- [Request Parameters](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Change-Position-Mode) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Change-Position-Mode) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api_Current-All-Open-Orders.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api_Current-All-Open-Orders.md new file mode 100644 index 0000000..ed12d70 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api_Current-All-Open-Orders.md @@ -0,0 +1,64 @@ +--- +title: "Query Current All Open Orders | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Current-All-Open-Orders" +fetched_at: "2026-01-27T05:28:05.137Z" +--- +# Current All Open Orders (USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Current-All-Open-Orders) + +Get all open orders on a symbol. **Careful** when accessing this with no symbol. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Current-All-Open-Orders) + +GET `/dapi/v1/openOrders` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Current-All-Open-Orders) + +**1** for a single symbol, **40** for mutltiple symbols + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Current-All-Open-Orders) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +NO + +pair + +STRING + +NO + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Current-All-Open-Orders) + +``` +[ { "avgPrice": "0.0", "clientOrderId": "abc", "cumBase": "0", "executedQty": "0", "orderId": 1917641, "origQty": "0.40", "origType": "TRAILING_STOP_MARKET", "price": "0", "reduceOnly": false, "side": "BUY", "positionSide": "SHORT", "status": "NEW", "stopPrice": "9300", // please ignore when order type is TRAILING_STOP_MARKET "closePosition": false, // if Close-All "symbol": "BTCUSD_200925", "pair": "BTCUSD", "time": 1579276756075, // order time "timeInForce": "GTC", "type": "TRAILING_STOP_MARKET", "activatePrice": "9020", // activation price, only return with TRAILING_STOP_MARKET order "priceRate": "0.3", // callback rate, only return with TRAILING_STOP_MARKET order "updateTime": 1579276756075, // update time "workingType": "CONTRACT_PRICE", "priceProtect": false, // if conditional order trigger is protected "priceMatch": "NONE", //price match mode "selfTradePreventionMode": "NONE" //self trading preventation mode }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Current-All-Open-Orders) +- [HTTP Request](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Current-All-Open-Orders) +- [Request Weight](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Current-All-Open-Orders) +- [Request Parameters](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Current-All-Open-Orders) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Current-All-Open-Orders) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api_Get-Order-Modify-History.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api_Get-Order-Modify-History.md new file mode 100644 index 0000000..c1b0c79 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api_Get-Order-Modify-History.md @@ -0,0 +1,97 @@ +--- +title: "Get Order Modify History | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Get-Order-Modify-History" +fetched_at: "2026-01-27T05:28:05.239Z" +--- +# Get Order Modify History (USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Get-Order-Modify-History) + +Get order modification history + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Get-Order-Modify-History) + +GET `/dapi/v1/orderAmendment` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Get-Order-Modify-History) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Get-Order-Modify-History) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +orderId + +LONG + +NO + +origClientOrderId + +STRING + +NO + +startTime + +LONG + +NO + +Timestamp in ms to get modification history from INCLUSIVE + +endTime + +LONG + +NO + +Timestamp in ms to get modification history until INCLUSIVE + +limit + +INT + +NO + +Default 50; max 100 + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +> - 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 + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Get-Order-Modify-History) + +``` +[ { "amendmentId": 5363, // Order modification ID "symbol": "BTCUSD_PERP", "pair": "BTCUSD", "orderId": 20072994037, "clientOrderId": "LJ9R4QZDihCaS8UAOOLpgW", "time": 1629184560899, // Order modification time "amendment": { "price": { "before": "30004", "after": "30003.2" }, "origQty": { "before": "1", "after": "1" }, "count": 3 // Order modification count, representing the number of times the order has been modified } }, { "amendmentId": 5361, "symbol": "BTCUSD_PERP", "pair": "BTCUSD", "orderId": 20072994037, "clientOrderId": "LJ9R4QZDihCaS8UAOOLpgW", "time": 1629184533946, "amendment": { "price": { "before": "30005", "after": "30004" }, "origQty": { "before": "1", "after": "1" }, "count": 2 } }, { "amendmentId": 5325, "symbol": "BTCUSD_PERP", "pair": "BTCUSD", "orderId": 20072994037, "clientOrderId": "LJ9R4QZDihCaS8UAOOLpgW", "time": 1629182711787, "amendment": { "price": { "before": "30002", "after": "30005" }, "origQty": { "before": "1", "after": "1" }, "count": 1 } }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Get-Order-Modify-History) +- [HTTP Request](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Get-Order-Modify-History) +- [Request Weight](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Get-Order-Modify-History) +- [Request Parameters](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Get-Order-Modify-History) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Get-Order-Modify-History) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api_Get-Position-Margin-Change-History.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api_Get-Position-Margin-Change-History.md new file mode 100644 index 0000000..4ddb23c --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api_Get-Position-Margin-Change-History.md @@ -0,0 +1,86 @@ +--- +title: "Get Position Margin Change History | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Get-Position-Margin-Change-History" +fetched_at: "2026-01-27T05:28:05.356Z" +--- +# Get Position Margin Change History(TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Get-Position-Margin-Change-History) + +Get position margin change history + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Get-Position-Margin-Change-History) + +GET `/dapi/v1/positionMargin/history` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Get-Position-Margin-Change-History) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Get-Position-Margin-Change-History) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +type + +INT + +NO + +1: Add position margin,2: Reduce position margin + +startTime + +LONG + +NO + +endTime + +LONG + +NO + +limit + +INT + +NO + +Default: 50 + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Get-Position-Margin-Change-History) + +``` +[ { "amount": "23.36332311", "asset": "BTC", "symbol": "BTCUSD_200925", "time": 1578047897183, "type": 1, "positionSide": "BOTH" }, { "amount": "100", "asset": "BTC", "symbol": "BTCUSD_200925", "time": 1578047900425, "type": 1, "positionSide": "LONG" }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Get-Position-Margin-Change-History) +- [HTTP Request](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Get-Position-Margin-Change-History) +- [Request Weight](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Get-Position-Margin-Change-History) +- [Request Parameters](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Get-Position-Margin-Change-History) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Get-Position-Margin-Change-History) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api_Modify-Isolated-Position-Margin.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api_Modify-Isolated-Position-Margin.md new file mode 100644 index 0000000..10ba6df --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api_Modify-Isolated-Position-Margin.md @@ -0,0 +1,82 @@ +--- +title: "Modify Isolated Position Margin | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Modify-Isolated-Position-Margin" +fetched_at: "2026-01-27T05:28:05.388Z" +--- +# Modify Isolated Position Margin(TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Modify-Isolated-Position-Margin) + +Modify Isolated Position Margin + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Modify-Isolated-Position-Margin) + +POST `/dapi/v1/positionMargin` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Modify-Isolated-Position-Margin) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Modify-Isolated-Position-Margin) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +positionSide + +ENUM + +NO + +Default `BOTH` for One-way Mode ; `LONG` or `SHORT` for Hedge Mode. It must be sent with Hedge Mode. + +amount + +DECIMAL + +YES + +type + +INT + +YES + +1: Add position margin,2: Reduce position margin + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +> - Only for isolated symbol + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Modify-Isolated-Position-Margin) + +``` +{ "amount": 100.0, "code": 200, "msg": "Successfully modify position margin.", "type": 1} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Modify-Isolated-Position-Margin) +- [HTTP Request](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Modify-Isolated-Position-Margin) +- [Request Weight](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Modify-Isolated-Position-Margin) +- [Request Parameters](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Modify-Isolated-Position-Margin) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Modify-Isolated-Position-Margin) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api_Modify-Multiple-Orders.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api_Modify-Multiple-Orders.md new file mode 100644 index 0000000..12e3f29 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api_Modify-Multiple-Orders.md @@ -0,0 +1,127 @@ +--- +title: "Modify Multiple Orders | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Modify-Multiple-Orders" +fetched_at: "2026-01-27T05:28:05.471Z" +--- +# Modify Multiple Orders(TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Modify-Multiple-Orders) + +Modify Multiple Orders + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Modify-Multiple-Orders) + +PUT `/dapi/v1/batchOrders` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Modify-Multiple-Orders) + +**5** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Modify-Multiple-Orders) + +Name + +Type + +Mandatory + +Description + +batchOrders + +list + +YES + +order list. Max 5 orders + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +**Where `batchOrders` is the list of order parameters in JSON** + +Name + +Type + +Mandatory + +Description + +orderId + +LONG + +NO + +origClientOrderId + +STRING + +NO + +symbol + +STRING + +YES + +side + +ENUM + +YES + +`SELL`, `BUY` + +quantity + +DECIMAL + +NO + +Order quantity, cannot be sent with `closePosition=true` + +price + +DECIMAL + +NO + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +> - 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 + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Modify-Multiple-Orders) + +``` +[ { "orderId": 20072994037, "symbol": "BTCUSD_PERP", "pair": "BTCUSD", "status": "NEW", "clientOrderId": "LJ9R4QZDihCaS8UAOOLpgW", "price": "30005", "avgPrice": "0.0", "origQty": "1", "executedQty": "0", "cumQty": "0", "cumBase": "0", "timeInForce": "GTC", "type": "LIMIT", "reduceOnly": false, "closePosition": false, "side": "BUY", "positionSide": "LONG", "stopPrice": "0", "workingType": "CONTRACT_PRICE", "priceProtect": false, "origType": "LIMIT", "priceMatch": "NONE", //price match mode "selfTradePreventionMode": "NONE", //self trading preventation mode "updateTime": 1629182711600 }, { "code": -2022, "msg": "ReduceOnly Order is rejected." }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Modify-Multiple-Orders) +- [HTTP Request](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Modify-Multiple-Orders) +- [Request Weight](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Modify-Multiple-Orders) +- [Request Parameters](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Modify-Multiple-Orders) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Modify-Multiple-Orders) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api_Modify-Order.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api_Modify-Order.md new file mode 100644 index 0000000..2166738 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api_Modify-Order.md @@ -0,0 +1,108 @@ +--- +title: "Modify Order | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Modify-Order" +fetched_at: "2026-01-27T05:28:05.637Z" +--- +# Modify Order (TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Modify-Order) + +Order modify function, currently only LIMIT order modification is supported, modified orders will be reordered in the match queue + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Modify-Order) + +PUT `/dapi/v1/order` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Modify-Order) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Modify-Order) + +Name + +Type + +Mandatory + +Description + +orderId + +LONG + +NO + +origClientOrderId + +STRING + +NO + +symbol + +STRING + +YES + +side + +ENUM + +YES + +`SELL`, `BUY` + +quantity + +DECIMAL + +NO + +Order quantity, cannot be sent with `closePosition=true` + +price + +DECIMAL + +NO + +priceMatch + +ENUM + +NO + +only avaliable for `LIMIT`/`STOP`/`TAKE_PROFIT` order; can be set to `OPPONENT`/ `OPPONENT_5`/ `OPPONENT_10`/ `OPPONENT_20`: /`QUEUE`/ `QUEUE_5`/ `QUEUE_10`/ `QUEUE_20`; Can't be passed together with `price` + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +> - Either `orderId` or `origClientOrderId` must be sent, and the `orderId` will prevail if both are sent. +> - Either `quantity` or `price` must be sent. +> - 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 + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Modify-Order) + +``` +{ "orderId": 20072994037, "symbol": "BTCUSD_PERP", "pair": "BTCUSD", "status": "NEW", "clientOrderId": "LJ9R4QZDihCaS8UAOOLpgW", "price": "30005", "avgPrice": "0.0", "origQty": "1", "executedQty": "0", "cumQty": "0", "cumBase": "0", "timeInForce": "GTC", "type": "LIMIT", "reduceOnly": false, "closePosition": false, "side": "BUY", "positionSide": "LONG", "stopPrice": "0", "workingType": "CONTRACT_PRICE", "priceProtect": false, "origType": "LIMIT", "priceMatch": "NONE", //price match mode "selfTradePreventionMode": "NONE", //self trading preventation mode "updateTime": 1629182711600} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Modify-Order) +- [HTTP Request](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Modify-Order) +- [Request Weight](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Modify-Order) +- [Request Parameters](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Modify-Order) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Modify-Order) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api_Place-Multiple-Orders.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api_Place-Multiple-Orders.md new file mode 100644 index 0000000..9f96c17 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api_Place-Multiple-Orders.md @@ -0,0 +1,201 @@ +--- +title: "Place Multiple Orders | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Place-Multiple-Orders" +fetched_at: "2026-01-27T05:28:05.750Z" +--- +# Place Multiple Orders(TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Place-Multiple-Orders) + +Place multiple orders + +- Parameter 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. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Place-Multiple-Orders) + +POST `/dapi/v1/batchOrders` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Place-Multiple-Orders) + +**5** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Place-Multiple-Orders) + +Name + +Type + +Mandatory + +Description + +batchOrders + +LIST + +YES + +order list. Max 5 orders + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +**Where `batchOrders` is the list of order parameters in JSON** + +- **Example:** /dapi/v1/batchOrders?batchOrders=\[{"type":"LIMIT","timeInForce":"GTC", + "symbol":"BTCUSD\_PERP","side":"BUY","price":"10001","quantity":"1"}\] + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +side + +ENUM + +YES + +positionSide + +ENUM + +NO + +Default `BOTH` for One-way Mode ; `LONG` or `SHORT` for Hedge Mode. It must be sent with Hedge Mode. + +type + +ENUM + +YES + +timeInForce + +ENUM + +NO + +quantity + +DECIMAL + +YES + +reduceOnly + +STRING + +NO + +"true" or "false". default "false". + +price + +DECIMAL + +NO + +newClientOrderId + +STRING + +NO + +A unique id among open orders. Automatically generated if not sent. Can only be string following the rule: `^[\.A-Z\:/a-z0-9_-]{1,36}$` + +stopPrice + +DECIMAL + +NO + +Used with `STOP/STOP_MARKET` or `TAKE_PROFIT/TAKE_PROFIT_MARKET` orders. + +activationPrice + +DECIMAL + +NO + +Used with `TRAILING_STOP_MARKET` orders, default as the latest price(supporting different `workingType`) + +callbackRate + +DECIMAL + +NO + +Used with `TRAILING_STOP_MARKET` orders, min 0.1, max 4 where 1 for 1% + +workingType + +ENUM + +NO + +stopPrice triggered by: "MARK\_PRICE", "CONTRACT\_PRICE". Default "CONTRACT\_PRICE" + +priceProtect + +STRING + +NO + +"TRUE" or "FALSE", default "FALSE". Used with `STOP/STOP_MARKET` or `TAKE_PROFIT/TAKE_PROFIT_MARKET` orders. + +newOrderRespType + +ENUM + +NO + +"ACK", "RESULT", default "ACK" + +priceMatch + +ENUM + +NO + +only avaliable for `LIMIT`/`STOP`/`TAKE_PROFIT` order; can be set to `OPPONENT`/ `OPPONENT_5`/ `OPPONENT_10`/ `OPPONENT_20`: /`QUEUE`/ `QUEUE_5`/ `QUEUE_10`/ `QUEUE_20`; Can't be passed together with `price` + +selfTradePreventionMode + +ENUM + +NO + +`EXPIRE_TAKER`:expire taker order when STP triggers/ `EXPIRE_MAKER`:expire taker order when STP triggers/ `EXPIRE_BOTH`:expire both orders when STP triggers; default `EXPIRE_MAKER` + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Place-Multiple-Orders) + +``` +[ { "clientOrderId": "testOrder", "cumQty": "0", "cumBase": "0", "executedQty": "0", "orderId": 22542179, "avgPrice": "0.0", "origQty": "10", "price": "0", "reduceOnly": false, "side": "BUY", "positionSide": "SHORT", "status": "NEW", "stopPrice": "9300", // please ignore when order type is TRAILING_STOP_MARKET "symbol": "BTCUSD_200925", "pair": "BTCUSD", "timeInForce": "GTC", "type": "TRAILING_STOP_MARKET", "origType": "TRAILING_STOP_MARKET", "activatePrice": "9020", // activation price, only return with TRAILING_STOP_MARKET order "priceRate": "0.3", // callback rate, only return with TRAILING_STOP_MARKET order "updateTime": 1566818724722, "workingType": "CONTRACT_PRICE", "priceProtect": false, // if conditional order trigger is protected "priceMatch": "NONE", //price match mode "selfTradePreventionMode": "NONE" //self trading preventation mode }, { "code": -2022, "msg": "ReduceOnly Order is rejected." }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Place-Multiple-Orders) +- [HTTP Request](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Place-Multiple-Orders) +- [Request Weight](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Place-Multiple-Orders) +- [Request Parameters](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Place-Multiple-Orders) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Place-Multiple-Orders) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api_Position-ADL-Quantile-Estimation.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api_Position-ADL-Quantile-Estimation.md new file mode 100644 index 0000000..842eec9 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api_Position-ADL-Quantile-Estimation.md @@ -0,0 +1,65 @@ +--- +title: "Position Adl Quantile Estimation | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Position-ADL-Quantile-Estimation" +fetched_at: "2026-01-27T05:28:05.655Z" +--- +# Position ADL Quantile Estimation(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Position-ADL-Quantile-Estimation) + +Query 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. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Position-ADL-Quantile-Estimation) + +GET `/dapi/v1/adlQuantile` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Position-ADL-Quantile-Estimation) + +**5** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Position-ADL-Quantile-Estimation) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +NO + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Position-ADL-Quantile-Estimation) + +``` +[ { "symbol": "BTCUSD_200925", "adlQuantile": { // if the positions of the symbol are crossed margined in Hedge Mode, "LONG" and "SHORT" will be returned a same quantile value, and "HEDGE" will be returned instead of "BOTH". "LONG": 3, "SHORT": 3, "HEDGE": 0 // only a sign, ignore the value } }, { "symbol": "BTCUSD_201225", "adlQuantile": { // for positions of the symbol are in One-way Mode or isolated margined in Hedge Mode "LONG": 1, // adl quantile for "LONG" position in hedge mode "SHORT": 2, // adl qauntile for "SHORT" position in hedge mode "BOTH": 0 // adl qunatile for position in one-way mode } } ] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Position-ADL-Quantile-Estimation) +- [HTTP Request](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Position-ADL-Quantile-Estimation) +- [Request Weight](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Position-ADL-Quantile-Estimation) +- [Request Parameters](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Position-ADL-Quantile-Estimation) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Position-ADL-Quantile-Estimation) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api_Position-Information.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api_Position-Information.md new file mode 100644 index 0000000..c194bf9 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api_Position-Information.md @@ -0,0 +1,72 @@ +--- +title: "Position Information | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Position-Information" +fetched_at: "2026-01-27T05:28:05.731Z" +--- +# Position Information(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Position-Information) + +Get current account information. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Position-Information) + +GET `/dapi/v1/positionRisk` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Position-Information) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Position-Information) + +Name + +Type + +Mandatory + +Description + +marginAsset + +STRING + +NO + +pair + +STRING + +NO + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +> - If neither `marginAsset` nor `pair` is sent, positions of all symbols with `TRADING` status will be returned. +> - for One-way Mode user, the response will only show the "BOTH" positions +> - for Hedge Mode user, the response will show "BOTH", "LONG", and "SHORT" positions. + +**Note** + +> Please use with user data stream `ACCOUNT_UPDATE` to meet your timeliness and accuracy needs. + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Position-Information) + +``` +[ { "symbol": "BTCUSD_201225", "positionAmt": "0", "entryPrice": "0.0", "breakEvenPrice": "0.0", // break-even price "markPrice": "0.00000000", "unRealizedProfit": "0.00000000", "liquidationPrice": "0", "leverage": "125", "maxQty": "50", // maximum quantity of base asset "marginType": "cross", "isolatedMargin": "0.00000000", "isAutoAddMargin": "false", "positionSide": "BOTH", "updateTime": 0 }, { "symbol": "BTCUSD_201225", "positionAmt": "1", "entryPrice": "11707.70000003", "breakEvenPrice": "11707.80000005", // break-even price "markPrice": "11788.66626667", "unRealizedProfit": "0.00005866", "liquidationPrice": "11667.63509587", "leverage": "125", "maxQty": "50", "marginType": "cross", "isolatedMargin": "0.00000000", "isAutoAddMargin": "false", "positionSide": "LONG", "updateTime": 1627026881327 }, { "symbol": "BTCUSD_201225", "positionAmt": "0", "entryPrice": "0.0", "breakEvenPrice": "0.0", // break-even price "markPrice": "0.00000000", "unRealizedProfit": "0.00000000", "liquidationPrice": "0", "leverage": "125", "maxQty": "50", "marginType": "cross", "isolatedMargin": "0.00000000", "isAutoAddMargin": "false", "positionSide": "SHORT", "updateTime":1627026881327 }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Position-Information) +- [HTTP Request](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Position-Information) +- [Request Weight](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Position-Information) +- [Request Parameters](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Position-Information) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Position-Information) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api_Query-Current-Open-Order.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api_Query-Current-Open-Order.md new file mode 100644 index 0000000..d145131 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api_Query-Current-Open-Order.md @@ -0,0 +1,73 @@ +--- +title: "Query Current Open Order | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Query-Current-Open-Order" +fetched_at: "2026-01-27T05:28:05.895Z" +--- +# Query Current Open Order(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Query-Current-Open-Order) + +Query Current Open Order + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Query-Current-Open-Order) + +GET `/dapi/v1/openOrder` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Query-Current-Open-Order) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Query-Current-Open-Order) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +orderId + +LONG + +NO + +origClientOrderId + +STRING + +NO + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +> - Either`orderId` or `origClientOrderId` must be sent +> - If the queried order has been filled or cancelled, the error message "Order does not exist" will be returned. + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Query-Current-Open-Order) + +``` +{ "avgPrice": "0.0", "clientOrderId": "abc", "cumBase": "0", "executedQty": "0", "orderId": 1917641, "origQty": "0.40", "origType": "TRAILING_STOP_MARKET", "price": "0", "reduceOnly": false, "side": "BUY", "positionSide": "SHORT", "status": "NEW", "stopPrice": "9300", // please ignore when order type is TRAILING_STOP_MARKET "closePosition": false, // if Close-All "symbol": "BTCUSD_200925", "pair": "BTCUSD" "time": 1579276756075, // order time "timeInForce": "GTC", "type": "TRAILING_STOP_MARKET", "activatePrice": "9020", // activation price, only return with TRAILING_STOP_MARKET order "priceRate": "0.3", // callback rate, only return with TRAILING_STOP_MARKET order "updateTime": 1579276756075, "workingType": "CONTRACT_PRICE", "priceProtect": false // if conditional order trigger is protected "priceMatch": "NONE", // price match mode "selfTradePreventionMode": "NONE" // self trading preventation mode } +``` + +- [API Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Query-Current-Open-Order) +- [HTTP Request](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Query-Current-Open-Order) +- [Request Weight](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Query-Current-Open-Order) +- [Request Parameters](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Query-Current-Open-Order) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Query-Current-Open-Order) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api_Query-Order.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api_Query-Order.md new file mode 100644 index 0000000..55a65dc --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api_Query-Order.md @@ -0,0 +1,76 @@ +--- +title: "Query Order | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Query-Order" +fetched_at: "2026-01-27T05:28:05.913Z" +--- +# Query Order (USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Query-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 + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Query-Order) + +GET `/dapi/v1/order` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Query-Order) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Query-Order) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +orderId + +LONG + +NO + +origClientOrderId + +STRING + +NO + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +> - Either `orderId` or `origClientOrderId` must be sent. + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Query-Order) + +``` +{ "avgPrice": "0.0", "clientOrderId": "abc", "cumBase": "0", "executedQty": "0", "orderId": 1917641, "origQty": "0.40", "origType": "TRAILING_STOP_MARKET", "price": "0", "reduceOnly": false, "side": "BUY", "positionSide": "SHORT", "status": "NEW", "stopPrice": "9300", // please ignore when order type is TRAILING_STOP_MARKET "closePosition": false, // if Close-All "symbol": "BTCUSD_200925", "pair": "BTCUSD", "time": 1579276756075, // order time "timeInForce": "GTC", "type": "TRAILING_STOP_MARKET", "activatePrice": "9020", // activation price, only return with TRAILING_STOP_MARKET order "priceRate": "0.3", // callback rate, only return with TRAILING_STOP_MARKET order "updateTime": 1579276756075, // update time "workingType": "CONTRACT_PRICE", "priceProtect": false, // if conditional order trigger is protected "priceMatch": "NONE", //price match mode "selfTradePreventionMode": "NONE" //self trading preventation mode} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Query-Order) +- [HTTP Request](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Query-Order) +- [Request Weight](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Query-Order) +- [Request Parameters](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Query-Order) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Query-Order) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api_Users-Force-Orders.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api_Users-Force-Orders.md new file mode 100644 index 0000000..738502c --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_rest-api_Users-Force-Orders.md @@ -0,0 +1,41 @@ +--- +title: "Query Users Force Orders | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Users-Force-Orders" +fetched_at: "2026-01-27T05:28:05.996Z" +--- +# User's Force Orders(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Users-Force-Orders) + +User's Force Orders + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Users-Force-Orders) + +GET `/dapi/v1/forceOrders` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Users-Force-Orders) + +**20** with symbol, **50** without symbol + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Users-Force-Orders) + +``` +Name | Type | Mandatory | Description +``` + +\------------- | ------ | --------- | ----------------------------------------------------------- symbol | STRING | NO | autoCloseType | ENUM | NO | "LIQUIDATION" for liquidation orders, "ADL" for ADL orders. startTime | LONG | NO | endTime | LONG | NO | limit | INT | NO | Default 50; max 100. recvWindow | LONG | NO | timestamp | LONG | YES | + +> - If "autoCloseType" is not sent, orders with both of the types will be returned +> - If "startTime" is not sent, data within 200 days before "endTime" can be queried + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Users-Force-Orders) + +``` +[ { "orderId": 165123080, "symbol": "BTCUSD_200925", "pair": "BTCUSD", "status": "FILLED", "clientOrderId": "autoclose-1596542005017000006", "price": "11326.9", "avgPrice": "11326.9", "origQty": "1", "executedQty": "1", "cumBase": "0.00882854", "timeInForce": "IOC", "type": "LIMIT", "reduceOnly": false, "closePosition": false, "side": "SELL", "positionSide": "BOTH", "stopPrice": "0", "workingType": "CONTRACT_PRICE", "priceProtect": false, "origType": "LIMIT", "time": 1596542005019, "updateTime": 1596542005050 }, { "orderId": 207251986, "symbol": "BTCUSD_200925", "pair": "BTCUSD", "status": "FILLED", "clientOrderId": "autoclose-1597307316020000006", "price": "11619.4", "avgPrice": "11661.2", "origQty": "1", "executedQty": "1", "cumBase": "0.00857544", "timeInForce": "IOC", "type": "LIMIT", "reduceOnly": false, "closePosition": false, "side": "SELL", "positionSide": "LONG", "stopPrice": "0", "workingType": "CONTRACT_PRICE", "priceProtect": false, "origType": "LIMIT", "time": 1597307316022, "updateTime": 1597307316035 }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Users-Force-Orders) +- [HTTP Request](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Users-Force-Orders) +- [Request Weight](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Users-Force-Orders) +- [Request Parameters](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Users-Force-Orders) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Users-Force-Orders) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_websocket-api.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_websocket-api.md new file mode 100644 index 0000000..ddeeac8 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_websocket-api.md @@ -0,0 +1,251 @@ +--- +title: "New Order | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api" +fetched_at: "2026-01-27T05:28:06.014Z" +--- +# New Order(TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api) + +Send in a new order. + +## Method[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api) + +`order.place` + +## Request[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api) + +``` +{ "id": "60fa4366-f96e-42fe-a82b-f819952c6db4", "method": "order.place", "params": { "apiKey": "", "price": "50000", "quantity": 1, "side": "BUY", "symbol": "BTCUSD_PERP", "timeInForce": "GTC", "timestamp": 1728413737111, "type": "LIMIT", "signature": "0f04368b2d22aafd0ggc8809ea34297eff602272917b5f01267db4efbc1c9422" }} +``` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api) + +**0** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api) + +Name + +Type + +Mandatory + + Description + +symbol + +STRING + +YES + +side + +ENUM + +YES + +BUY or SELL + +positionSide + +ENUM + +NO + +Default `BOTH` for One-way Mode; `LONG` or `SHORT` for Hedge Mode. It must be sent in Hedge Mode. + +type + +ENUM + +YES + +`LIMIT`, `MARKET`, `STOP`, `STOP_MARKET`, `TAKE_PROFIT`, `TAKE_PROFIT_MARKET`, `TRAILING_STOP_MARKET` + +timeInForce + +ENUM + +NO + +quantity + +DECIMAL + +NO + +Quantity measured by contract number, Cannot be sent with `closePosition`\=`true` + +reduceOnly + +STRING + +NO + +`true` or `false`. default `false`. Cannot be sent in Hedge Mode; cannot be sent with `closePosition`\=`true` (Close-All) + +price + +DECIMAL + +NO + +newClientOrderId + +STRING + +NO + +A unique id among open orders. Automatically generated if not sent. Can only be string following the rule: `^[\.A-Z\:/a-z0-9_-]{1,36}$` + +stopPrice + +DECIMAL + +NO + +Used with `STOP/STOP_MARKET` or `TAKE_PROFIT/TAKE_PROFIT_MARKET` orders. + +closePosition + +STRING + +NO + +`true`, `false`;Close-All,used with `STOP_MARKET` or `TAKE_PROFIT_MARKET`. + +activationPrice + +DECIMAL + +NO + +Used with `TRAILING_STOP_MARKET` orders, default as the latest price(supporting different workingType) + +callbackRate + +DECIMAL + +NO + +Used with `TRAILING_STOP_MARKET` orders, min 0.1, max 10 where 1 for 1% + +workingType + +ENUM + +NO + +stopPrice triggered by: "MARK\_PRICE", "CONTRACT\_PRICE". Default "CONTRACT\_PRICE" + +priceProtect + +ENUM + +NO + +"TRUE" or "FALSE", default "FALSE". Used with `STOP/STOP_MARKET` or `TAKE_PROFIT/TAKE_PROFIT_MARKET` orders. + +newOrderRespType + +ENUM + +NO + +`ACK`,`RESULT`, default `ACK` + +priceMatch + +ENUM + +NO + +only available for `LIMIT`/`STOP`/`TAKE_PROFIT` order; can be set to `OPPONENT`/ `OPPONENT_5`/ `OPPONENT_10`/ `OPPONENT_20`: /`QUEUE`/ `QUEUE_5`/ `QUEUE_10`/ `QUEUE_20`; Can't be passed together with `price` + +selfTradePreventionMode + +ENUM + +NO + +`NONE`: No STP / `EXPIRE_TAKER`:expire taker order when STP triggers/ `EXPIRE_MAKER`:expire taker order when STP triggers/ `EXPIRE_BOTH`:expire both orders when STP triggers; default `NONE` + +recvWindow + +INT + +NO + +timestamp + +INT + +YES + +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 parameter `priceProtect` is 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 /dapi/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` parameter + - 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 + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api) + +``` +{ "id": "60fa4366-f96e-42fe-a82b-f819952c6db4", "status": 200, "result": { "orderId": 333245211, "symbol": "BTCUSD_PERP", "pair": "BTCUSD", "status": "NEW", "clientOrderId": "5SztZiGFAxgAqw4J9EN9fA", "price": "50000", "avgPrice": "0.00", "origQty": "1", "executedQty": "0", "cumQty": "0", "cumBase": "0", "timeInForce": "GTC", "type": "LIMIT", "reduceOnly": false, "closePosition": false, "side": "BUY", "positionSide": "BOTH", "stopPrice": "0", "workingType": "CONTRACT_PRICE", "priceProtect": false, "origType": "LIMIT", "updateTime": 1728413795125 }, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 2400, "count": 6 }, { "rateLimitType": "ORDERS", "interval": "MINUTE", "intervalNum": 1, "limit": 1200, "count": 1 } ]} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api) +- [Method](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api) +- [Request](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api) +- [Request Weight](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api) +- [Request Parameters](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_websocket-api_Cancel-Order.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_websocket-api_Cancel-Order.md new file mode 100644 index 0000000..c9fdba2 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_websocket-api_Cancel-Order.md @@ -0,0 +1,79 @@ +--- +title: "Cancel Order | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api/Cancel-Order" +fetched_at: "2026-01-27T05:28:06.150Z" +--- +# Cancel Order (TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api/Cancel-Order) + +Cancel an active order. + +## Method[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api/Cancel-Order) + +`order.cancel` + +## Request[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api/Cancel-Order) + +``` +{ "id": "a8627ea5-8b9f-452f-90ae-4136f2b442e2", "method": "order.cancel", "params": { "apiKey": "", "orderId": 333245211, "symbol": "BTCUSD_PERP", "timestamp": 1728416090517, "signature": "0f04368b2d22aafd0ggc8809ea34297eff602272917b5f01267db4efbc1c9422"  }} +``` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api/Cancel-Order) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api/Cancel-Order) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +orderId + +LONG + +NO + +origClientOrderId + +STRING + +NO + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +> - Either `orderId` or `origClientOrderId` must be sent. + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api/Cancel-Order) + +``` +{ "id": "a8627ea5-8b9f-452f-90ae-4136f2b442e2", "status": 200, "result": { "orderId": 333245211, "symbol": "BTCUSD_PERP", "pair": "BTCUSD", "status": "CANCELED", "clientOrderId": "5SztZiGFAxgAqw4J9EN9fA", "price": "51000", "avgPrice": "0.00", "origQty": "1", "executedQty": "0", "cumQty": "0", "cumBase": "0", "timeInForce": "GTC", "type": "LIMIT", "reduceOnly": false, "closePosition": false, "side": "BUY", "positionSide": "BOTH", "stopPrice": "0", "workingType": "CONTRACT_PRICE", "priceProtect": false, "origType": "LIMIT", "updateTime": 1728416138285 }, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 2400, "count": 6 } ]} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api/Cancel-Order) +- [Method](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api/Cancel-Order) +- [Request](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api/Cancel-Order) +- [Request Weight](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api/Cancel-Order) +- [Request Parameters](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api/Cancel-Order) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api/Cancel-Order) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_websocket-api_Modify-Order.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_websocket-api_Modify-Order.md new file mode 100644 index 0000000..7b078be --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_websocket-api_Modify-Order.md @@ -0,0 +1,115 @@ +--- +title: "Modify Order | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api/Modify-Order" +fetched_at: "2026-01-27T05:28:06.318Z" +--- +# Modify Order (TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api/Modify-Order) + +Order modify function, currently only LIMIT order modification is supported, modified orders will be reordered in the match queue + +## Method[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api/Modify-Order) + +`order.modify` + +## Request[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api/Modify-Order) + +``` +{ "id": "88601d02-bd0d-430d-8733-2708a569ebda", "method": "order.modify", "params": { "apiKey": "", "orderId": 333245211, "price": "51000", "quantity": 1, "side": "BUY", "symbol": "BTCUSD_PERP", "timestamp": 1728415697189, "signature": "0f04368b2d22aafd0ggc8809ea34297eff602272917b5f01267db4efbc1c9422"  }} +``` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api/Modify-Order) + +1 on 10s order rate limit(X-MBX-ORDER-COUNT-10S); 1 on 1min order rate limit(X-MBX-ORDER-COUNT-1M); 1 on IP rate limit(x-mbx-used-weight-1m) + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api/Modify-Order) + +Name + +Type + +Mandatory + +Description + +orderId + +LONG + +NO + +origClientOrderId + +STRING + +NO + +symbol + +STRING + +YES + +side + +ENUM + +YES + +`SELL`, `BUY` + +quantity + +DECIMAL + +YES + +Order quantity, cannot be sent with `closePosition=true` + +price + +DECIMAL + +YES + +priceMatch + +ENUM + +NO + +only avaliable for `LIMIT`/`STOP`/`TAKE_PROFIT` order; can be set to `OPPONENT`/ `OPPONENT_5`/ `OPPONENT_10`/ `OPPONENT_20`: /`QUEUE`/ `QUEUE_5`/ `QUEUE_10`/ `QUEUE_20`; Can't be passed together with `price` + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +> - 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 + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api/Modify-Order) + +``` +{ "id": "88601d02-bd0d-430d-8733-2708a569ebda", "status": 200, "result": { "orderId": 333245211, "symbol": "BTCUSD_PERP", "pair": "BTCUSD", "status": "NEW", "clientOrderId": "5SztZiGFAxgAqw4J9EN9fA", "price": "51000", "avgPrice": "0.00", "origQty": "1", "executedQty": "0", "cumQty": "0", "cumBase": "0", "timeInForce": "GTC", "type": "LIMIT", "reduceOnly": false, "closePosition": false, "side": "BUY", "positionSide": "BOTH", "stopPrice": "0", "workingType": "CONTRACT_PRICE", "priceProtect": false, "origType": "LIMIT", "updateTime": 1728415765493 }, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 2400, "count": 6 }, { "rateLimitType": "ORDERS", "interval": "MINUTE", "intervalNum": 1, "limit": 1200, "count": 1 } ]} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api/Modify-Order) +- [Method](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api/Modify-Order) +- [Request](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api/Modify-Order) +- [Request Weight](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api/Modify-Order) +- [Request Parameters](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api/Modify-Order) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api/Modify-Order) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_websocket-api_Position-Information.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_websocket-api_Position-Information.md new file mode 100644 index 0000000..c28b610 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_websocket-api_Position-Information.md @@ -0,0 +1,75 @@ +--- +title: "Position Information | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api/Position-Information" +fetched_at: "2026-01-27T05:28:06.392Z" +--- +# Position Information(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api/Position-Information) + +Get current position information. + +## Method[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api/Position-Information) + +`account.position` + +## Request[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api/Position-Information) + +``` +{ "id": "233b8741-a96d-48e8-8ce1-160f43548aeb", "method": "account.position", "params": { "apiKey": "", "pair": "BTCUSD", "timestamp": 1727825241779, "signature": "0f04368b2d22aafd0ggc8809ea34297eff602272917b5f01267db4efbc1c9422"  }} +``` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api/Position-Information) + +**5** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api/Position-Information) + +Name + +Type + +Mandatory + +Description + +marginAsset + +STRING + +NO + +pair + +STRING + +NO + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +**Note** + +> - Please use with user data stream `ACCOUNT_UPDATE` to meet your timeliness and accuracy needs. + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api/Position-Information) + +``` +{ "id": "233b8741-a96d-48e8-8ce1-160f43548aeb", "status": 200, "result": [ { "symbol": "BTCUSD_PERP", "positionAmt": "0", "entryPrice": "0.00000000", "markPrice": "62297.60417296", "unRealizedProfit": "0.00000000", "liquidationPrice": "0", "leverage": "7", "maxQty": "100", "marginType": "cross", "isolatedMargin": "0.00000000", "isAutoAddMargin": "false", "positionSide": "BOTH", "notionalValue": "0", "isolatedWallet": "0", "updateTime": 1726731195634, "breakEvenPrice": "0.00000000" }, // ... ... ], "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 2400, "count": 10 } ]} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api/Position-Information) +- [Method](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api/Position-Information) +- [Request](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api/Position-Information) +- [Request Weight](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api/Position-Information) +- [Request Parameters](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api/Position-Information) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api/Position-Information) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_websocket-api_Query-Order.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_websocket-api_Query-Order.md new file mode 100644 index 0000000..392dbfb --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_trade_websocket-api_Query-Order.md @@ -0,0 +1,86 @@ +--- +title: "Query Order | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api/Query-Order" +fetched_at: "2026-01-27T05:28:06.284Z" +--- +# Query Order (USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api/Query-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 + +## Method[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api/Query-Order) + +`order.status` + +## Request[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api/Query-Order) + +``` +{ "id": "0ce5d070-a5e5-4ff2-b57f-1556741a4204", "method": "order.status", "params": { "apiKey": "HMOchcfii9ZRZnhjp2XjGXhsOBd6msAhKz9joQaWwZ7arcJTlD2hGPHQj1lGdTjR", "orderId": 328999071, "symbol": "BTCUSD_PERP", "timestamp": 1703441060152, "signature": "ba48184fc38a71d03d2b5435bd67c1206e3191e989fe99bda1bc643a880dfdbf" }} +``` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api/Query-Order) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api/Query-Order) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +orderId + +LONG + +NO + +origClientOrderId + +STRING + +NO + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +Notes: + +> - Either `orderId` or `origClientOrderId` must be sent. +> - `orderId` is self-increment for each specific `symbol` + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api/Query-Order) + +``` +{ "id": "0ce5d070-a5e5-4ff2-b57f-1556741a4204", "status": 200, "result": { "orderId": 328999071, "symbol": "BTCUSD_PERP", "pair": "BTCUSD", "status": "NEW", "clientOrderId": "ArY8Ng1rln0s9x3fclmAHy", "price": "58000", "avgPrice": "0.00", "origQty": "1", "executedQty": "0", "cumBase": "0", "timeInForce": "GTC", "type": "LIMIT", "reduceOnly": false, "closePosition": false, "side": "BUY", "positionSide": "LONG", "stopPrice": "0", "workingType": "CONTRACT_PRICE", "priceProtect": false, "origType": "LIMIT", "selfTradePreventionMode": "EXPIRE_TAKER", "time": 1733740063619, "updateTime": 1733740063619, "priceMatch": "NONE" }, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 2400, "count": 6 } ]} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api/Query-Order) +- [Method](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api/Query-Order) +- [Request](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api/Query-Order) +- [Request Weight](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api/Query-Order) +- [Request Parameters](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api/Query-Order) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api/Query-Order) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_user-data-streams.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_user-data-streams.md new file mode 100644 index 0000000..9673570 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_user-data-streams.md @@ -0,0 +1,38 @@ +--- +title: "Connect | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams" +fetched_at: "2026-01-27T05:28:06.403Z" +--- +# User Data Streams Connect + +- The base API endpoint is: **[https://dapi.binance.com](https://dapi.binance.com/)** + +- A User Data Stream `listenKey` is valid for 60 minutes after creation. + +- Doing a `PUT` on a `listenKey` will extend its validity for 60 minutes, if response `-1125` error "This listenKey does not exist." Please use `POST /dapi/v1/listenKey` to recreate `listenKey`. + +- Doing a `DELETE` on a `listenKey` will close the stream and invalidate the `listenKey`. + +- Doing a `POST` on an account with an active `listenKey` will return the currently active `listenKey` and extend its validity for 60 minutes. + +- There are two connection methods for Websocket: + + - Base Url 1: **wss://dstream.binance.com** + + - User Data Streams are accessed at **/ws/** + + - Example: `wss://dstream.binance.com/ws/XaEAKTsQSRLZAGH9tuIu37plSRsdjmlAVBoNYPUITlTAko1WI22PgmBMpI1rS8Yh` + + - Base Url 2: **wss://dstream-auth.binance.com** + + - User Data Streams are accessed at **/ws/?listenKey=** + + - ** must be a valid listenKey when you establish a connection** + + - Example: + + - `wss://dstream-auth.binance.com/ws/XaEAKTsQSRLZAGH9tuIu37plSRsdjmlAVBoNYPUITlTAko1WI22PgmBMpI1rS8Yh?listenKey=XaEAKTsQSRLZAGH9tuIu37plSRsdjmlAVBoNYPUITlTAko1WI22PgmBMpI1rS8Yh` + +- For one connection(one user data), the user data stream payloads can guaranteed to be in order during heavy periods; **Strongly recommend you order your updates using E** + +- A single connection is only valid for 24 hours; expect to be disconnected at the 24 hour mark diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_user-data-streams_Close-User-Data-Stream-Wsp.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_user-data-streams_Close-User-Data-Stream-Wsp.md new file mode 100644 index 0000000..416e85d --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_user-data-streams_Close-User-Data-Stream-Wsp.md @@ -0,0 +1,55 @@ +--- +title: "Close User Data Stream(Websocket API) | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Close-User-Data-Stream-Wsp" +fetched_at: "2026-01-27T05:28:06.577Z" +--- +# Close User Data Stream (USER\_STREAM) + +## API Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Close-User-Data-Stream-Wsp) + +Close out a user data stream. + +## Method[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Close-User-Data-Stream-Wsp) + +`userDataStream.stop` + +## Request[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Close-User-Data-Stream-Wsp) + +``` +{ "id": "819e1b1b-8c06-485b-a13e-131326c69599", "method": "userDataStream.stop", "params": { "apiKey": "vmPUZE6mv9SD5VNHk9HlWFsOr9aLE2zvsw0MuIgwCIPy8atIco14y7Ju91duEh8A" }} +``` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Close-User-Data-Stream-Wsp) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Close-User-Data-Stream-Wsp) + +Name + +Type + +Mandatory + + Description + +`apiKey` + +STRING + +NO + +Required if session is not authenticated via `session.logon` + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Close-User-Data-Stream-Wsp) + +``` +{ "id": "819e1b1b-8c06-485b-a13e-131326c69599", "status": 200, "result": {}, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 2400, "count": 2 } ]} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Close-User-Data-Stream-Wsp) +- [Method](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Close-User-Data-Stream-Wsp) +- [Request](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Close-User-Data-Stream-Wsp) +- [Request Weight](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Close-User-Data-Stream-Wsp) +- [Request Parameters](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Close-User-Data-Stream-Wsp) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Close-User-Data-Stream-Wsp) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_user-data-streams_Close-User-Data-Stream.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_user-data-streams_Close-User-Data-Stream.md new file mode 100644 index 0000000..d38d85f --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_user-data-streams_Close-User-Data-Stream.md @@ -0,0 +1,34 @@ +--- +title: "Close User Data Stream | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Close-User-Data-Stream" +fetched_at: "2026-01-27T05:28:06.545Z" +--- +# Close User Data Stream(USER\_STREAM) + +## API Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Close-User-Data-Stream) + +Close out a user data stream. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Close-User-Data-Stream) + +DELETE `/dapi/v1/listenKey` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Close-User-Data-Stream) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Close-User-Data-Stream) + +None + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Close-User-Data-Stream) + +``` +{} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Close-User-Data-Stream) +- [HTTP Request](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Close-User-Data-Stream) +- [Request Weight](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Close-User-Data-Stream) +- [Request Parameters](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Close-User-Data-Stream) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Close-User-Data-Stream) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_user-data-streams_Event-Account-Configuration-Update.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_user-data-streams_Event-Account-Configuration-Update.md new file mode 100644 index 0000000..516b142 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_user-data-streams_Event-Account-Configuration-Update.md @@ -0,0 +1,24 @@ +--- +title: "Event Account Configuration Update | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Event-Account-Configuration-Update" +fetched_at: "2026-01-27T05:28:06.648Z" +--- +# Event: Account Configuration Update (Leverage Update) + +## Event Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Event-Account-Configuration-Update) + +When the account configuration is changed, the event type will be pushed as `ACCOUNT_CONFIG_UPDATE` When the leverage of a trade pair changes, the payload will contain the object `ac` to represent the account configuration of the trade pair, where `s` represents the specific trade pair and `l` represents the leverage + +## Event Name[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Event-Account-Configuration-Update) + +`ACCOUNT_CONFIG_UPDATE` + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Event-Account-Configuration-Update) + +``` +{ "e":"ACCOUNT_CONFIG_UPDATE", // Event Type "E":1611646737479, // Event Time "T":1611646737476, // Transaction Time "ac":{ "s":"BTCUSD_PERP", // symbol "l":25 // leverage }} +``` + +- [Event Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Event-Account-Configuration-Update) +- [Event Name](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Event-Account-Configuration-Update) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Event-Account-Configuration-Update) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_user-data-streams_Event-Balance-and-Position-Update.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_user-data-streams_Event-Balance-and-Position-Update.md new file mode 100644 index 0000000..ab36a57 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_user-data-streams_Event-Balance-and-Position-Update.md @@ -0,0 +1,47 @@ +--- +title: "Event Balance And Position Update | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Event-Balance-and-Position-Update" +fetched_at: "2026-01-27T05:28:06.670Z" +--- +# Event: Balance and Position Update + +## Event Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Event-Balance-and-Position-Update) + +Event type is `ACCOUNT_UPDATE`. + +- When balance or position get updated, this event will be pushed. + + - `ACCOUNT_UPDATE` will be pushed only when update happens on user's account, including changes on balances, positions, or margin type. + - Unfilled orders or cancelled orders will not make the event `ACCOUNT_UPDATE` pushed, since there's no change on positions. + - "position" in `ACCOUNT_UPDATE`: All symbols will be pushed. +- The field "m" represents the reason type for the event and may shows the following possible types: + + - DEPOSIT + - WITHDRAW + - ORDER + - FUNDING\_FEE + - ADJUSTMENT + - INSURANCE\_CLEAR + - ADMIN\_DEPOSIT + - ADMIN\_WITHDRAW + - MARGIN\_TRANSFER + - MARGIN\_TYPE\_CHANGE + - ASSET\_TRANSFER + - COIN\_SWAP\_DEPOSIT + - COIN\_SWAP\_WITHDRAW +- The field "bc" represents the balance change except for PnL and commission. + + +## Event Name[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Event-Balance-and-Position-Update) + +`ACCOUNT_UPDATE` + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Event-Balance-and-Position-Update) + +``` +{ "e": "ACCOUNT_UPDATE", // Event Type "E": 1564745798939, // Event Time "T": 1564745798938 , // Transaction "i": "SfsR", // Account Alias "a": // Update Data { "m":"ORDER", // Event reason type "B":[ // Balances { "a":"BTC", // Asset "wb":"122624.12345678", // Wallet Balance "cw":"100.12345678", // Cross Wallet Balance "bc":"50.12345678" // Balance Change except PnL and Commission }, { "a":"ETH", "wb":"1.00000000", "cw":"0.00000000", "bc":"-49.12345678" } ], "P":[ { "s":"BTCUSD_200925", // Symbol "pa":"0", // Position Amount "ep":"0.0", // Entry Price "bep":"0.0", // Break-Even Price "cr":"200", // (Pre-fee) Accumulated Realized "up":"0", // Unrealized PnL "mt":"isolated", // Margin Type "iw":"0.00000000", // Isolated Wallet (if isolated position) "ps":"BOTH" // Position Side }, { "s":"BTCUSD_200925", "pa":"20", "ep":"6563.6", "bep":"6563.7", "cr":"0", "up":"2850.21200000", "mt":"isolated", "iw":"13200.70726908", "ps":"LONG" }, { "s":"BTCUSD_200925", "pa":"-10", "ep":"6563.8" "bep":"6563.6",, "cr":"-45.04000000", "up":"-1423.15600000", "mt":"isolated", "iw":"6570.42511771", "ps":"SHORT" } ] }} +``` + +- [Event Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Event-Balance-and-Position-Update) +- [Event Name](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Event-Balance-and-Position-Update) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Event-Balance-and-Position-Update) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_user-data-streams_Event-GRID-UPDATE.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_user-data-streams_Event-GRID-UPDATE.md new file mode 100644 index 0000000..55526de --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_user-data-streams_Event-GRID-UPDATE.md @@ -0,0 +1,31 @@ +--- +title: "Event Grid Update | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Event-GRID-UPDATE" +fetched_at: "2026-01-27T05:28:06.805Z" +--- +# Event: GRID\_UPDATE + +## Event Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Event-GRID-UPDATE) + +`GRID_UPDATE` update when a sub order of a grid is filled or partially filled. + +**Strategy Status** + +- NEW +- WORKING +- CANCELLED +- EXPIRED + +## Event Name[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Event-GRID-UPDATE) + +`GRID_UPDATE` + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Event-GRID-UPDATE) + +``` +{ "e": "GRID_UPDATE", // Event Type "T": 1669262908216, // Transaction Time "E": 1669262908218, // Event Time "gu": { "si": 176057039, // Strategy ID "st": "GRID", // Strategy Type "ss": "WORKING", // Strategy Status "s": "BTCUSDT", // Symbol "r": "-0.00300716", // Realized PNL "up": "16720", // Unmatched Average Price "uq": "-0.001", // Unmatched Qty "uf": "-0.00300716", // Unmatched Fee "mp": "0.0", // Matched PNL "ut": 1669262908197 // Update Time }} +``` + +- [Event Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Event-GRID-UPDATE) +- [Event Name](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Event-GRID-UPDATE) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Event-GRID-UPDATE) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_user-data-streams_Event-Margin-Call.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_user-data-streams_Event-Margin-Call.md new file mode 100644 index 0000000..675f37f --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_user-data-streams_Event-Margin-Call.md @@ -0,0 +1,26 @@ +--- +title: "Event Margin Call | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Event-Margin-Call" +fetched_at: "2026-01-27T05:28:06.838Z" +--- +# Event: Margin Call + +## Event Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Event-Margin-Call) + +- When the user's position risk ratio is too high, this stream will be pushed. +- This message is only used as risk guidance information and is not recommended for investment strategies. +- In the case of a highly volatile market, there may be the possibility that the user's position has been liquidated at the same time when this stream is pushed out. + +## Event Name[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Event-Margin-Call) + +`MARGIN_CALL` + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Event-Margin-Call) + +``` +{ "e":"MARGIN_CALL", // Event Type "E":1587727187525, // Event Time "i": "SfsR", // Account Alias "cw":"3.16812045", // Cross Wallet Balance. Only pushed with crossed position margin call "p":[ // Position(s) of Margin Call { "s":"BTCUSD_200925", // Symbol "ps":"LONG", // Position Side "pa":"132", // Position Amount "mt":"CROSSED", // Margin Type "iw":"0", // Isolated Wallet (if isolated position) "mp":"9187.17127000", // Mark Price "up":"-1.166074", // Unrealized PnL "mm":"1.614445" // Maintenance Margin Required } ]} +``` + +- [Event Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Event-Margin-Call) +- [Event Name](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Event-Margin-Call) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Event-Margin-Call) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_user-data-streams_Event-Order-Update.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_user-data-streams_Event-Order-Update.md new file mode 100644 index 0000000..dd8e699 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_user-data-streams_Event-Order-Update.md @@ -0,0 +1,92 @@ +--- +title: "Event Order Update | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Event-Order-Update" +fetched_at: "2026-01-27T05:28:06.914Z" +--- +# Event: Order Update + +## Event Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Event-Order-Update) + +When new order created, modified, order status changed will push such event. event type is `ORDER_TRADE_UPDATE`. + +**Side** + +- BUY +- SELL + +**Position side:** + +- BOTH +- LONG +- SHORT + +**Order Type** + +- MARKET +- LIMIT +- STOP +- TAKE\_PROFIT +- LIQUIDATION + +**Execution Type** + +- NEW +- CANCELED +- CALCULATED - Liquidation Execution +- EXPIRED +- TRADE +- AMENDMENT - Order Modified + +**Order Status** + +- NEW +- PARTIALLY\_FILLED +- FILLED +- CANCELED +- EXPIRED +- EXPIRED\_IN\_MATCH + +**Time in force** + +- GTC +- IOC +- FOK +- GTX + +**Liquidation and ADL:** + +- If user gets liquidated due to insufficient margin balance: + + - `c` shows as "autoclose-XXX",`X` shows as "NEW" +- If user has enough margin balance but gets ADL: + + - `c` shows as “adl\_autoclose”,`X` shows as “NEW” + +**Expiry Reason** + +- `0`: None, the default value +- `1`: Order has expired to prevent users from inadvertently trading against themselves +- `2`: IOC order could not be filled completely, remaining quantity is canceled +- `3`: IOC order could not be filled completely to prevent users from inadvertently trading against themselves, remaining quantity is canceled +- `4`: Order has been canceled, as it's knocked out by another higher priority RO (market) order or reversed positions would be opened +- `5`: Order has expired when the account was liquidated +- `6`: Order has expired as GTE condition unsatisfied +- `7`: Order has been canceled as the symbol is delisted +- `8`: The initial order has expired after the stop order is triggered +- `9`: Market order could not be filled completely, remaining quantity is canceled +- `10`: FOK order could not be filled completely, the order is canceled +- `11`: Order has been canceled, as it's failed Post-only check. + +## Event Name[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Event-Order-Update) + +`ORDER_TRADE_UPDATE` + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Event-Order-Update) + +``` +{ "e":"ORDER_TRADE_UPDATE", // Event Type "E":1591274595442, // Event Time "T":1591274595442, // Transaction Time "i":"SfsR", // Account Alias "o":{ "s":"BTCUSD_200925", // Symbol "c":"TEST", // Client Order Id // special client order id: // starts with "autoclose-": liquidation order // "adl_autoclose": ADL auto close order // "delivery_autoclose-": settlement order for delisting or delivery "S":"SELL", // Side "o":"TRAILING_STOP_MARKET", // Order Type "f":"GTC", // Time in Force "q":"2", // Original Quantity "p":"0", // Original Price "ap":"0", // Average Price "sp":"9103.1", // Stop Price. Please ignore with TRAILING_STOP_MARKET order "x":"NEW", // Execution Type "X":"NEW", // Order Status "i":8888888, // Order Id "l":"0", // Order Last Filled Quantity "z":"0", // Order Filled Accumulated Quantity "L":"0", // Last Filled Price "ma": "BTC", // Margin Asset "N":"BTC", // Commission Asset of the trade, will not push if no commission "n":"0", // Commission of the trade, will not push if no commission "T":1591274595442, // Order Trade Time "t":0, // Trade Id "rp": "0", // Realized Profit of the trade "b":"0", // Bid quantity of base asset "a":"0", // Ask quantity of base asset "m":false, // Is this trade the maker side? "R":false, // Is this reduce only "wt":"CONTRACT_PRICE", // Stop Price Working Type "ot":"TRAILING_STOP_MARKET",// Original Order Type "ps":"LONG", // Position Side "cp":false, // If Close-All, pushed with conditional order "AP":"9476.8", // Activation Price, only puhed with TRAILING_STOP_MARKET order "cr":"5.0", // Callback Rate, only puhed with TRAILING_STOP_MARKET order "pP": false, // If conditional order trigger is protected "V":"EXPIRE_TAKER", // STP mode "pm":"OPPONENT", // Price match mode "er":"0" // Expiry Reason }} +``` + +- [Event Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Event-Order-Update) +- [Event Name](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Event-Order-Update) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Event-Order-Update) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_user-data-streams_Event-STRATEGY-UPDATE.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_user-data-streams_Event-STRATEGY-UPDATE.md new file mode 100644 index 0000000..2f12230 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_user-data-streams_Event-STRATEGY-UPDATE.md @@ -0,0 +1,49 @@ +--- +title: "Event Strategy Update | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Event-STRATEGY-UPDATE" +fetched_at: "2026-01-27T05:28:06.931Z" +--- +# Event: STRATEGY\_UPDATE + +## Event Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Event-STRATEGY-UPDATE) + +`STRATEGY_UPDATE` update when a strategy is created/cancelled/expired, ...etc. + +**Strategy Status** + +- NEW +- WORKING +- CANCELLED +- EXPIRED + +**opCode** + +- 8001: The strategy params have been updated +- 8002: User cancelled the strategy +- 8003: User manually placed or cancelled an order +- 8004: The stop limit of this order reached +- 8005: User position liquidated +- 8006: Max open order limit reached +- 8007: New grid order +- 8008: Margin not enough +- 8009: Price out of bounds +- 8010: Market is closed or paused +- 8011: Close position failed, unable to fill +- 8012: Exceeded the maximum allowable notional value at current leverage +- 8013: Grid expired due to incomplete KYC verification or access from a restricted jurisdiction +- 8014: User can only place reduce only order +- 8015: User position empty or liquidated + +## Event Name[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Event-STRATEGY-UPDATE) + +`STRATEGY_UPDATE` + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Event-STRATEGY-UPDATE) + +``` +{ "e": "STRATEGY_UPDATE", // Event Type "T": 1669261797627, // Transaction Time "E": 1669261797628, // Event Time "su": { "si": 176054594, // Strategy ID "st": "GRID", // Strategy Type "ss": "NEW", // Strategy Status "s": "BTCUSDT", // Symbol "ut": 1669261797627, // Update Time "c": 8007 // opCode }} +``` + +- [Event Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Event-STRATEGY-UPDATE) +- [Event Name](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Event-STRATEGY-UPDATE) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Event-STRATEGY-UPDATE) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_user-data-streams_Event-User-Data-Stream-Expired.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_user-data-streams_Event-User-Data-Stream-Expired.md new file mode 100644 index 0000000..d0e413e --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_user-data-streams_Event-User-Data-Stream-Expired.md @@ -0,0 +1,30 @@ +--- +title: "Event User Data Stream Expired | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Event-User-Data-Stream-Expired" +fetched_at: "2026-01-27T05:28:07.191Z" +--- +# Event: User Data Stream Expired + +## Event Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Event-User-Data-Stream-Expired) + +When the `listenKey` used for the user data stream turns expired, this event will be pushed. + +**Notice:** + +> - This event is not related to the websocket disconnection. +> - This event will be received only when a valid `listenKey` in connection got expired. +> - No more user data event will be updated after this event received until a new valid `listenKey` used. + +## Event Name[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Event-User-Data-Stream-Expired) + +`listenKeyExpired` + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Event-User-Data-Stream-Expired) + +``` +{ 'e': 'listenKeyExpired', // event type 'E': 1576653824250 // event time "listenKey":"WsCMN0a4KHUPTQuX6IUnqEZfB1inxmv1qR4kbf1LuEjur5VdbzqvyxqG9TSjVVxv"} +``` + +- [Event Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Event-User-Data-Stream-Expired) +- [Event Name](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Event-User-Data-Stream-Expired) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Event-User-Data-Stream-Expired) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_user-data-streams_Keepalive-User-Data-Stream-Wsp.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_user-data-streams_Keepalive-User-Data-Stream-Wsp.md new file mode 100644 index 0000000..b1f26e3 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_user-data-streams_Keepalive-User-Data-Stream-Wsp.md @@ -0,0 +1,55 @@ +--- +title: "Keepalive User Data Stream(Websocket API) | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Keepalive-User-Data-Stream-Wsp" +fetched_at: "2026-01-27T05:28:07.307Z" +--- +# Keepalive User Data Stream (USER\_STREAM) + +## API Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Keepalive-User-Data-Stream-Wsp) + +Keepalive a user data stream to prevent a time out. User data streams will close after 60 minutes. It's recommended to send a ping about every 60 minutes. + +## Method[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Keepalive-User-Data-Stream-Wsp) + +`userDataStream.ping` + +## Request[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Keepalive-User-Data-Stream-Wsp) + +``` +{ "id": "815d5fce-0880-4287-a567-80badf004c74", "method": "userDataStream.ping", "params": { "apiKey": "vmPUZE6mv9SD5VNHk9HlWFsOr9aLE2zvsw0MuIgwCIPy8atIco14y7Ju91duEh8A"  }} +``` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Keepalive-User-Data-Stream-Wsp) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Keepalive-User-Data-Stream-Wsp) + +Name + +Type + +Mandatory + + Description + +`apiKey` + +STRING + +NO + +Required if session is not authenticated via `session.logon` + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Keepalive-User-Data-Stream-Wsp) + +``` +{ "id": "815d5fce-0880-4287-a567-80badf004c74", "status": 200, "result": { "listenKey": "3HBntNTepshgEdjIwSUIBgB9keLyOCg5qv3n6bYAtktG8ejcaW5HXz9Vx1JgIieg" }, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 2400, "count": 2 } ]} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Keepalive-User-Data-Stream-Wsp) +- [Method](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Keepalive-User-Data-Stream-Wsp) +- [Request](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Keepalive-User-Data-Stream-Wsp) +- [Request Weight](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Keepalive-User-Data-Stream-Wsp) +- [Request Parameters](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Keepalive-User-Data-Stream-Wsp) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Keepalive-User-Data-Stream-Wsp) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_user-data-streams_Keepalive-User-Data-Stream.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_user-data-streams_Keepalive-User-Data-Stream.md new file mode 100644 index 0000000..e30412b --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_user-data-streams_Keepalive-User-Data-Stream.md @@ -0,0 +1,34 @@ +--- +title: "Keepalive User Data Stream | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Keepalive-User-Data-Stream" +fetched_at: "2026-01-27T05:28:07.092Z" +--- +# Keepalive User Data Stream (USER\_STREAM) + +## API Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Keepalive-User-Data-Stream) + +Keepalive a user data stream to prevent a time out. User data streams will close after 60 minutes. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Keepalive-User-Data-Stream) + +PUT `/dapi/v1/listenKey` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Keepalive-User-Data-Stream) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Keepalive-User-Data-Stream) + +None + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Keepalive-User-Data-Stream) + +``` +{ "listenKey": "vmNt6gl1so8bXVsaAY153FG5tf63QaODxUarKUM8V8rY4ElSwEe431DNIYNKOkQp"} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Keepalive-User-Data-Stream) +- [HTTP Request](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Keepalive-User-Data-Stream) +- [Request Weight](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Keepalive-User-Data-Stream) +- [Request Parameters](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Keepalive-User-Data-Stream) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Keepalive-User-Data-Stream) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_user-data-streams_Start-User-Data-Stream-Wsp.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_user-data-streams_Start-User-Data-Stream-Wsp.md new file mode 100644 index 0000000..1a4a956 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_user-data-streams_Start-User-Data-Stream-Wsp.md @@ -0,0 +1,55 @@ +--- +title: "Start User Data Stream(Websocket API) | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Start-User-Data-Stream-Wsp" +fetched_at: "2026-01-27T05:28:07.410Z" +--- +# Start User Data Stream (USER\_STREAM) + +## API Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Start-User-Data-Stream-Wsp) + +Start a new user data stream. The stream will close after 60 minutes unless a keepalive is sent. If the account has an active `listenKey`, that `listenKey` will be returned and its validity will be extended for 60 minutes. + +## Method[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Start-User-Data-Stream-Wsp) + +`userDataStream.start` + +## Request[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Start-User-Data-Stream-Wsp) + +``` +{ "id": "d3df8a61-98ea-4fe0-8f4e-0fcea5d418b0", "method": "userDataStream.start", "params": { "apiKey": "vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A" }} +``` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Start-User-Data-Stream-Wsp) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Start-User-Data-Stream-Wsp) + +Name + +Type + +Mandatory + + Description + +`apiKey` + +STRING + +NO + +Required if session is not authenticated via session.logon + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Start-User-Data-Stream-Wsp) + +``` +{ "id": "d3df8a61-98ea-4fe0-8f4e-0fcea5d418b0", "status": 200, "result": { "listenKey": "xs0mRXdAKlIPDRFrlPcw0qI41Eh3ixNntmymGyhrhgqo7L6FuLaWArTD7RLP" }, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 2400, "count": 8 } ]} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Start-User-Data-Stream-Wsp) +- [Method](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Start-User-Data-Stream-Wsp) +- [Request](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Start-User-Data-Stream-Wsp) +- [Request Weight](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Start-User-Data-Stream-Wsp) +- [Request Parameters](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Start-User-Data-Stream-Wsp) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Start-User-Data-Stream-Wsp) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_user-data-streams_Start-User-Data-Stream.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_user-data-streams_Start-User-Data-Stream.md new file mode 100644 index 0000000..00f77fd --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_user-data-streams_Start-User-Data-Stream.md @@ -0,0 +1,34 @@ +--- +title: "Start User Data Stream | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Start-User-Data-Stream" +fetched_at: "2026-01-27T05:28:07.324Z" +--- +# Start User Data Stream (USER\_STREAM) + +## API Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Start-User-Data-Stream) + +Start a new user data stream. The stream will close after 60 minutes unless a keepalive is sent. If the account has an active `listenKey`, that `listenKey` will be returned and its validity will be extended for 60 minutes. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Start-User-Data-Stream) + +POST `/dapi/v1/listenKey` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Start-User-Data-Stream) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Start-User-Data-Stream) + +None + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Start-User-Data-Stream) + +``` +{ "listenKey": "pqia91ma19a5s61cv6a81va65sdf19v8a65a1a5s61cv6a81va65sdf19v8a65a1"} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Start-User-Data-Stream) +- [HTTP Request](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Start-User-Data-Stream) +- [Request Weight](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Start-User-Data-Stream) +- [Request Parameters](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Start-User-Data-Stream) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Start-User-Data-Stream) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-api-general-info.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-api-general-info.md new file mode 100644 index 0000000..01398a7 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-api-general-info.md @@ -0,0 +1,338 @@ +--- +title: "Websocket API General Info | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-api-general-info" +fetched_at: "2026-01-27T05:28:07.643Z" +--- +# WebSocket API General Info + +- The base endpoint is: **`wss://ws-dapi.binance.com/ws-dapi/v1`** + - The base endpoint for testnet is: `wss://testnet.binancefuture.com/ws-dapi/v1` +- A single connection to the API is only valid for 24 hours; expect to be disconnected after the 24-hour mark. +- Websocket server will send a ping frame every 3 minutes. + - If the websocket server does not receive a `pong frame` back from the connection within a 10 minute period, the connection will be disconnected. + - When you receive a ping, you must send a pong with a copy of ping's payload as soon as possible. + - Unsolicited pong frames are allowed, but will not prevent disconnection. **It is recommended that the payload for these pong frames are empty.** +- **Signature payload must be generated by taking all request params except for the signature and sorting them by name in alphabetical order.** +- Lists are returned in **chronological order**, unless noted otherwise. +- All timestamps are in **milliseconds in UTC**, unless noted otherwise. +- All field names and values are **case-sensitive**, unless noted otherwise. +- **`INT` parameters such as timestamp are expected as JSON integers, not strings.** +- **`DECIMAL` parameters such as price are expected as JSON strings, not floats.** +- **User Data Stream requests - you will need to establish a separate WebSocket connection to listen to [user data streams](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams)** + +## WebSocket API Request format[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-api-general-info) + +Requests must be sent as JSON in **text frames**, one request per frame. + +> Example of request: + +``` +{ "id": "60fa4366-f96e-42fe-a82b-f819952c6db4", "method": "order.place", "params": { "apiKey": "", "price": "50000", "quantity": 1, "side": "BUY", "symbol": "BTCUSD_PERP", "timeInForce": "GTC", "timestamp": 1728413737111, "type": "LIMIT", "signature": "996962a19802b5a09d7bc6ab1524227894533322a2f8a1f8934991689cabf8fe",  }} +``` + +Request fields: + +Name + +Type + +Mandatory + + Description + +`id` + +INT/STRING/null + +YES + +Arbitrary ID used to match responses to requests + +`method` + +STRING + +YES + +Request method name + +`params` + +OBJECT + +NO + +Request parameters. May be omitted if there are no parameters + +   + +- Request `id` is truly arbitrary. You can use UUIDs, sequential IDs, current timestamp, etc. The server does not interpret `id` in any way, simply echoing it back in the response. + +You can freely reuse IDs within a session. However, be careful to not send more than one request at a time with the same ID, since otherwise it might be impossible to tell the responses apart.   + +- Request method names may be prefixed with explicit version: e.g., "`v3/order.place`". +- The order of `params` is not significant. + +## Response format[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-api-general-info) + +Responses are returned as JSON in text frames, one response per frame. + +> Example of successful response: + +``` +{ "id": "60fa4366-f96e-42fe-a82b-f819952c6db4", "status": 200, "result": { "orderId": 333245211, "symbol": "BTCUSD_PERP", "pair": "BTCUSD", "status": "NEW", "clientOrderId": "5SztZiGFAxgAqw4J9EN9fA", "price": "50000", "avgPrice": "0.00", "origQty": "1", "executedQty": "0", "cumQty": "0", "cumBase": "0", "timeInForce": "GTC", "type": "LIMIT", "reduceOnly": false, "closePosition": false, "side": "BUY", "positionSide": "BOTH", "stopPrice": "0", "workingType": "CONTRACT_PRICE", "priceProtect": false, "origType": "LIMIT", "updateTime": 1728413795125 }, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 2400, "count": 6 }, { "rateLimitType": "ORDERS", "interval": "MINUTE", "intervalNum": 1, "limit": 1200, "count": 1 } ]} +``` + +> Example of failed response: + +``` +{ "id": "9ca10e58-7452-467e-9454-f669bb9c764e", "status": 400, "error": { "code": -1102, "msg": "Mandatory parameter 'quantity' was not sent, was empty/null, or malformed." }, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 2400, "count": 1 }, { "rateLimitType": "ORDERS", "interval": "MINUTE", "intervalNum": 1, "limit": 1200, "count": 1 } ]} +``` + +Response fields: + +Name + +Type + +Mandatory + + Description + +`id` + +INT/STRING/null + +YES + +Same as in the original request + +`status` + +INT + +YES + +Response status. See status codes + +`result` + +OBJECT/ARRAY + +YES + +Response content. Present if request succeeded + +`error` + +OBJECT + +YES + +Error description. Present if request failed + +`rateLimits` + +ARRAY + +NO + +Rate limiting status. See Rate limits + +## WebSocket API Rate limits[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-api-general-info) + +- Rate limits are the same as on REST API and are shared with REST API. +- WebSocket handshake attempt costs 5 weight. +- Rate limit for ping/pong frames: maximum 5 per second. +- Rate limit information is included in responses by default, see the `rateLimits` field. +- `rateLimits` field visibility can be controlled with `returnRateLimits` boolean parameter in connection string or individual requests. +- E.g., use `wss://ws-dapi.binance.com/ws-dapi/v1?returnRateLimits=false` to hide `rateLimits` in responses by default. With that, you can pass extra `"returnRateLimits": true` parameter in requests to show rate limit in response when it is otherwise hidden by default. + +## WebSocket API Authenticate after connection[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-api-general-info) + +You can authenticate an already established connection using session authentication requests: + +- `session.logon` - authenticate, or change the API key associated with the connection +- `session.status` - check connection status and the current API key +- `session.logout` - forget the API key associated with the connection + +## WebSocket API API key revocation[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-api-general-info) + +If during an active session the API key becomes invalid for any reason (e.g. IP address is not whitelisted, API key was deleted, API key doesn't have correct permissions, etc), after the next request the session will be revoked with the following error message: + +``` +{ "id": null, "status": 401, "error": { "code": -2015, "msg": "Invalid API-key, IP, or permissions for action." }} +``` + +## WebSocket API Authorize ad hoc requests[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-api-general-info) + +Only one API key can be authenticated with the WebSocket connection. The authenticated API key is used by default for requests that require an apiKey parameter. However, you can always specify the apiKey and signature explicitly for individual requests, overriding the authenticated API key and using a different one to authorize a specific request. + +For example, you might want to authenticate your USER\_DATA key to be used by default, but specify the TRADE key with an explicit signature when placing orders. + +## WebSocket API Authentication request[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-api-general-info) + +Authenticate WebSocket connection using the provided API key. + +After calling `session.logon`, you can omit `apiKey` and `signature` parameters for future requests that require them. + +Note that only one API key can be authenticated. Calling `session.logon` multiple times changes the current authenticated API key. + +**Weight:** 2 + +**Method**: "session.logon" + +**Parameters** + +Name + +Type + +Mandatory + + Description + +`apiKey` + +STRING + +YES + +`recvWindow` + +INT + +NO + +`signature` + +STRING + +YES + +`timestamp` + +INT + +YES + +**Note**: + +> Only _Ed25519_ keys are supported for this feature. + +### Log in with API key (SIGNED)[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-api-general-info) + +> **Request** + +``` +{ "id": "c174a2b1-3f51-4580-b200-8528bd237cb7", "method": "session.logon", "params": { "apiKey": "vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A", "signature": "1cf54395b336b0a9727ef27d5d98987962bc47aca6e13fe978612d0adee066ed", "timestamp": 1649729878532 }} +``` + +> **Response** + +``` +{ "id": "c174a2b1-3f51-4580-b200-8528bd237cb7", "status": 200, "result": { "apiKey": "vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A", "authorizedSince": 1649729878532, "connectedSince": 1649729873021, "returnRateLimits": true, "serverTime": 1649729878630 }, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 2400, "count": 2 } ]} +``` + +### Query session status[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-api-general-info) + +Query the status of the WebSocket connection, inspecting which API key (if any) is used to authorize requests. + +**Weight:** 2 + +**Method**: "session.status" + +**Parameters**: None + +> **Request** + +``` +{ "id": "b50c16cd-62c9-4e29-89e4-37f10111f5bf", "method": "session.status"} +``` + +> **Response** + +``` +{ "id": "b50c16cd-62c9-4e29-89e4-37f10111f5bf", "status": 200, "result": { // if the connection is not authenticated, "apiKey" and "authorizedSince" will be shown as null "apiKey": "vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A", "authorizedSince": 1649729878532, "connectedSince": 1649729873021, "returnRateLimits": true, "serverTime": 1649730611671 }, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 2400, "count": 4 } ]} +``` + +### Log out of the session[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-api-general-info) + +Forget the API key previously authenticated. If the connection is not authenticated, this request does nothing. + +Note that the WebSocket connection stays open after `session.logout` request. You can continue using the connection, but now you will have to explicitly provide the `apiKey` and `signature` parameters where needed. + +**Weight:** 2 + +**Method**: "session.logout" + +**Parameters**: None + +## SIGNED (TRADE and USER\_DATA) Endpoint Security[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-api-general-info) + +### SIGNED request example (Ed25519)[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-api-general-info) + +Parameter + +Value + +symbol + +BTCUSD\_PERP + +side + +SELL + +type + +LIMIT + +timeInForce + +GTC + +quantity + +1 + +price + +0.2 + +timestamp + +1668481559918 + +> **Request** + +``` +{ "id": "c174a2b1-3f51-4580-b200-8528bd237cb7", "method": "session.logout"} +``` + +> **Response** + +``` +{ "id": "c174a2b1-3f51-4580-b200-8528bd237cb7", "status": 200, "result": { "apiKey": null, "authorizedSince": null, "connectedSince": 1649729873021, "returnRateLimits": false, "serverTime": 1649730611671 }, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 2400, "count": 6 } ]} +``` + +A sample code in Python to show how to sign the payload with an Ed25519 key is available below. + +``` +#!/usr/bin/env python3import base64import timeimport jsonfrom cryptography.hazmat.primitives.serialization import load_pem_private_keyfrom websocket import create_connection# Set up authenticationAPI_KEY='put your own API Key here'PRIVATE_KEY_PATH='test-prv-key.pem'# Load the private key.# In this example the key is expected to be stored without encryption,# but we recommend using a strong password for improved security.with open(PRIVATE_KEY_PATH, 'rb') as f: private_key = load_pem_private_key(data=f.read(), password=None)# Set up the request parametersparams = { 'apiKey': API_KEY, 'symbol': 'BTCUSD_PERP', 'side': 'SELL', 'type': 'LIMIT', 'timeInForce': 'GTC', 'quantity': '1.0000000', 'price': '0.20'}# Timestamp the requesttimestamp = int(time.time() * 1000) # UNIX timestamp in millisecondsparams['timestamp'] = timestamp# Sign the requestpayload = '&'.join([f'{param}={value}' for param, value in sorted(params.items())])signature = base64.b64encode(private_key.sign(payload.encode('ASCII')))params['signature'] = signature.decode('ASCII')# Send the requestrequest = { 'id': 'my_new_order', 'method': 'order.place', 'params': params}ws = create_connection("wss://ws-dapi.binance.com/ws-dapi/v1")ws.send(json.dumps(request))result = ws.recv()ws.close()print(result) +``` + +A sample code in Python to show how to sign the payload with an Ed25519 key is available on the right side. + +- [WebSocket API Request format](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-api-general-info) +- [Response format](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-api-general-info) +- [WebSocket API Rate limits](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-api-general-info) +- [WebSocket API Authenticate after connection](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-api-general-info) +- [WebSocket API API key revocation](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-api-general-info) +- [WebSocket API Authorize ad hoc requests](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-api-general-info) +- [WebSocket API Authentication request](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-api-general-info) + - [Log in with API key (SIGNED)](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-api-general-info) + - [Query session status](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-api-general-info) + - [Log out of the session](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-api-general-info) +- [SIGNED (TRADE and USER\_DATA) Endpoint Security](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-api-general-info) + - [SIGNED request example (Ed25519)](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-api-general-info) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams.md new file mode 100644 index 0000000..c58e33b --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams.md @@ -0,0 +1,31 @@ +--- +title: "Connect | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams" +fetched_at: "2026-01-27T05:28:07.568Z" +--- +# Websocket Market Streams + +- There are two connection methods for Websocket: + + - Base Url: **wss://dstream.binance.com** + - Streams can be access either in a single raw stream or a combined stream + - Raw streams are accessed at **/ws/** + - Combined streams are accessed at **/stream?streams=//** + - Example: + - `wss://dstream.binance.com/ws/bnbusdt@aggTrade` + - `wss://dstream.binance.com/stream?streams=bnbusdt@aggTrade/btcusdt@markPrice` +- Combined stream events are wrapped as follows: **{"stream":"","data":}** + +- All symbols for streams are **lowercase** + +- A single connection is only valid for 24 hours; expect to be disconnected at the 24 hour mark + +- The websocket server will send a `ping frame` every 3 minutes. If the websocket server does not receive a `pong frame` back from the connection within a 10 minute period, the connection will be disconnected. Unsolicited `pong frames` are allowed(Client can send `pong frames` with frequency higher than 10 minutes). + +- WebSocket connections have a limit of 10 incoming messages per second. + +- A connection that goes beyond the limit will be disconnected; IPs that are repeatedly disconnected may be banned. + +- A single connection can listen to a maximum of **1024** streams. + +- Considering the possible data latency from RESTful endpoints during an extremely volatile market, it is highly recommended to get the order status, position, etc from the Websocket user data stream. diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams_Aggregate-Trade-Streams.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams_Aggregate-Trade-Streams.md new file mode 100644 index 0000000..26cb31a --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams_Aggregate-Trade-Streams.md @@ -0,0 +1,29 @@ +--- +title: "Aggregate Trade Streams | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Aggregate-Trade-Streams" +fetched_at: "2026-01-27T05:28:07.577Z" +--- +# Aggregate Trade Streams + +## Stream Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Aggregate-Trade-Streams) + +The Aggregate Trade Streams push market trade information that is aggregated for fills with same price and taking side every 100 milliseconds. + +## Stream Name[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Aggregate-Trade-Streams) + +`@aggTrade` + +## Update Speed[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Aggregate-Trade-Streams) + +**100ms** + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Aggregate-Trade-Streams) + +``` +{ "e":"aggTrade", // Event type "E":1591261134288, // Event time "a":424951, // Aggregate trade ID "s":"BTCUSD_200626", // Symbol "p":"9643.5", // Price "q":"2", // Quantity "f":606073, // First trade ID "l":606073, // Last trade ID "T":1591261134199, // Trade time "m":false // Is the buyer the market maker?} +``` + +- [Stream Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Aggregate-Trade-Streams) +- [Stream Name](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Aggregate-Trade-Streams) +- [Update Speed](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Aggregate-Trade-Streams) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Aggregate-Trade-Streams) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams_All-Book-Tickers-Stream.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams_All-Book-Tickers-Stream.md new file mode 100644 index 0000000..d962dfd --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams_All-Book-Tickers-Stream.md @@ -0,0 +1,29 @@ +--- +title: "All Book Tickers Stream | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/All-Book-Tickers-Stream" +fetched_at: "2026-01-27T05:28:07.841Z" +--- +# All Book Tickers Stream + +## Stream Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/All-Book-Tickers-Stream) + +Pushes any update to the best bid or ask's price or quantity in real-time for all symbols. + +## Stream Name[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/All-Book-Tickers-Stream) + +`!bookTicker` + +## Update Speed[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/All-Book-Tickers-Stream) + +`Real-time` + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/All-Book-Tickers-Stream) + +``` +{ "e":"bookTicker", // Event type "u":17242169, // Order book update Id "s":"BTCUSD_200626", // Symbol "ps":"BTCUSD", // Pair "b":"9548.1", // Best bid price "B":"52", // Best bid qty "a":"9548.5", // Best ask price "A":"11", // Best ask qty "T":1591268628155, // Transaction time "E":1591268628166 // Event time} +``` + +- [Stream Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/All-Book-Tickers-Stream) +- [Stream Name](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/All-Book-Tickers-Stream) +- [Update Speed](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/All-Book-Tickers-Stream) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/All-Book-Tickers-Stream) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams_All-Market-Liquidation-Order-Streams.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams_All-Market-Liquidation-Order-Streams.md new file mode 100644 index 0000000..71aeb15 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams_All-Market-Liquidation-Order-Streams.md @@ -0,0 +1,29 @@ +--- +title: "All Market Liquidation Order Streams | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/All-Market-Liquidation-Order-Streams" +fetched_at: "2026-01-27T05:28:07.844Z" +--- +# All Market Liquidation Order Streams + +## Stream Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/All-Market-Liquidation-Order-Streams) + +The All Liquidation Order Snapshot Streams push force liquidation order information for all symbols in the market. For each symbol,only the latest one liquidation order within 1000ms will be pushed as the snapshot. If no liquidation happens in the interval of 1000ms, no stream will be pushed. + +## Stream Name[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/All-Market-Liquidation-Order-Streams) + +`!forceOrder@arr` + +## Update Speed[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/All-Market-Liquidation-Order-Streams) + +**1000ms** + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/All-Market-Liquidation-Order-Streams) + +``` +{ "e":"forceOrder", // Event Type "E": 1591154240950, // Event Time "o":{ "s":"BTCUSD_200925",  // Symbol "ps": "BTCUSD", // Pair "S":"SELL", // Side "o":"LIMIT", // Order Type "f":"IOC", // Time in Force "q":"1", // Original Quantity "p":"9425.5", // Price "ap":"9496.5", // Average Price "X":"FILLED", // Order Status "l":"1", // Order Last Filled Quantity "z":"1", // Order Filled Accumulated Quantity "T": 1591154240949, // Order Trade Time }} +``` + +- [Stream Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/All-Market-Liquidation-Order-Streams) +- [Stream Name](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/All-Market-Liquidation-Order-Streams) +- [Update Speed](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/All-Market-Liquidation-Order-Streams) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/All-Market-Liquidation-Order-Streams) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams_All-Market-Mini-Tickers-Stream.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams_All-Market-Mini-Tickers-Stream.md new file mode 100644 index 0000000..2ac781e --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams_All-Market-Mini-Tickers-Stream.md @@ -0,0 +1,29 @@ +--- +title: "All Market Mini Tickers Stream | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/All-Market-Mini-Tickers-Stream" +fetched_at: "2026-01-27T05:28:07.845Z" +--- +# All Market Mini Tickers Stream + +## Stream Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/All-Market-Mini-Tickers-Stream) + +24hr rolling window mini-ticker statistics for all symbols. These are NOT the statistics of the UTC day, but a 24hr rolling window from requestTime to 24hrs before. Note that only tickers that have changed will be present in the array. + +## Stream Name[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/All-Market-Mini-Tickers-Stream) + +`!miniTicker@arr` + +## Update Speed[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/All-Market-Mini-Tickers-Stream) + +**1000ms** + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/All-Market-Mini-Tickers-Stream) + +``` +[ { "e":"24hrMiniTicker", // Event type "E":1591267704450, // Event time "s":"BTCUSD_200626", // Symbol "ps":"BTCUSD", // Pair "c":"9561.7", // Close price "o":"9580.9", // Open price "h":"10000.0", // High price "l":"7000.0", // Low price "v":"487476", // Total traded volume "q":"33264343847.22378500" // Total traded base asset volume }] +``` + +- [Stream Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/All-Market-Mini-Tickers-Stream) +- [Stream Name](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/All-Market-Mini-Tickers-Stream) +- [Update Speed](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/All-Market-Mini-Tickers-Stream) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/All-Market-Mini-Tickers-Stream) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams_All-Market-Tickers-Streams.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams_All-Market-Tickers-Streams.md new file mode 100644 index 0000000..1485f76 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams_All-Market-Tickers-Streams.md @@ -0,0 +1,29 @@ +--- +title: "All Market Tickers Streams | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/All-Market-Tickers-Streams" +fetched_at: "2026-01-27T05:28:07.963Z" +--- +# All Market Tickers Streams + +## Stream Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/All-Market-Tickers-Streams) + +24hr rolling window ticker statistics for all symbols. These are NOT the statistics of the UTC day, but a 24hr rolling window from requestTime to 24hrs before. Note that only tickers that have changed will be present in the array. + +## Stream Name[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/All-Market-Tickers-Streams) + +`!ticker@arr` + +## Update Speed[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/All-Market-Tickers-Streams) + +**1000ms** + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/All-Market-Tickers-Streams) + +``` +[ { "e":"24hrTicker", // Event type "E":1591268262453, // Event time "s":"BTCUSD_200626", // Symbol "ps":"BTCUSD", // Pair "p":"-43.4", // Price change "P":"-0.452", // Price change percent "w":"0.00147974", // Weighted average price "c":"9548.5", // Last price "Q":"2", // Last quantity "o":"9591.9", // Open price "h":"10000.0", // High price "l":"7000.0", // Low price "v":"487850", // Total traded volume "q":"32968676323.46222700", // Total traded base asset volume "O":1591181820000, // Statistics open time "C":1591268262442, // Statistics close time "F":512014, // First trade ID "L":615289, // Last trade Id "n":103272 // Total number of trades }] +``` + +- [Stream Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/All-Market-Tickers-Streams) +- [Stream Name](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/All-Market-Tickers-Streams) +- [Update Speed](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/All-Market-Tickers-Streams) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/All-Market-Tickers-Streams) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams_Continuous-Contract-Kline-Candlestick-Streams.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams_Continuous-Contract-Kline-Candlestick-Streams.md new file mode 100644 index 0000000..df3548f --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams_Continuous-Contract-Kline-Candlestick-Streams.md @@ -0,0 +1,55 @@ +--- +title: "Continuous Contract Kline Candlestick Streams | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Continuous-Contract-Kline-Candlestick-Streams" +fetched_at: "2026-01-27T05:28:08.093Z" +--- +# Continuous Contract Kline/Candlestick Streams + +## Stream Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Continuous-Contract-Kline-Candlestick-Streams) + +Kline update every second + +**Contract type:** + +- perpetual +- current\_quarter +- next\_quarter + +**Kline/Candlestick chart intervals:** + +m -> minutes; h -> hours; d -> days; w -> weeks; M -> months + +- 1m +- 3m +- 5m +- 15m +- 30m +- 1h +- 2h +- 4h +- 6h +- 8h +- 12h +- 1d +- 3d +- 1w +- 1M + +**Stream Name:** +`_@continuousKline_` + +e.g. "btcusd\_next\_quarter@continuousKline\_1m" + +## Update Speed[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Continuous-Contract-Kline-Candlestick-Streams) + +**250ms** + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Continuous-Contract-Kline-Candlestick-Streams) + +``` +{ "e":"continuous_kline", // Event type "E":1591261542539, // Event time "ps":"BTCUSD", // Pair "ct":"NEXT_QUARTER" // Contract type "k":{ "t":1591261500000, // Kline start time "T":1591261559999, // Kline close time "i":"1m", // Interval "f":606400, // First update ID "L":606430, // Last update ID "o":"9638.9", // Open price "c":"9639.8", // Close price "h":"9639.8", // High price "l":"9638.6", // Low price "v":"156", // volume "n":31, // Number of trades "x":false, // Is this kline closed? "q":"1.61836886", // Base asset volume "V":"73", // Taker buy volume "Q":"0.75731156", // Taker buy base asset volume "B":"0" // Ignore }} +``` + +- [Stream Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Continuous-Contract-Kline-Candlestick-Streams) +- [Update Speed](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Continuous-Contract-Kline-Candlestick-Streams) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Continuous-Contract-Kline-Candlestick-Streams) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams_Contract-Info-Stream.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams_Contract-Info-Stream.md new file mode 100644 index 0000000..9c5c62b --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams_Contract-Info-Stream.md @@ -0,0 +1,29 @@ +--- +title: "Contract Info Stream | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Contract-Info-Stream" +fetched_at: "2026-01-27T05:28:08.089Z" +--- +# Contract Info Stream + +## Stream Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Contract-Info-Stream) + +ContractInfo stream pushes when contract info updates(listing/settlement/contract bracket update). `bks` field only shows up when bracket gets updated. + +## Stream Name[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Contract-Info-Stream) + +`!contractInfo` + +## Update Speed[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Contract-Info-Stream) + +**Real-time** + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Contract-Info-Stream) + +``` +{ "e":"contractInfo", // Event Type "E":1669647330375, // Event Time "s":"APTUSD_PERP", // Symbol "ps":"APTUSD", // Pair "ct":"PERPETUAL", // Contract type "dt":4133404800000, // Delivery date time "ot":1666594800000, // onboard date time "cs":"TRADING", // Contract status "bks":[ { "bs":1, // Notional bracket "bnf":0, // Floor notional of this bracket "bnc":5000, // Cap notional of this bracket "mmr":0.01, // Maintenance ratio for this bracket "cf":0, // Auxiliary number for quick calculation "mi":21, // Min leverage for this bracket "ma":50 // Max leverage for this bracket }, { "bs":2, "bnf":5000, "bnc":25000, "mmr":0.025, "cf":75, "mi":11, "ma":20 } ]} +``` + +- [Stream Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Contract-Info-Stream) +- [Stream Name](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Contract-Info-Stream) +- [Update Speed](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Contract-Info-Stream) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Contract-Info-Stream) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams_Diff-Book-Depth-Streams.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams_Diff-Book-Depth-Streams.md new file mode 100644 index 0000000..cf7c342 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams_Diff-Book-Depth-Streams.md @@ -0,0 +1,29 @@ +--- +title: "Diff Book Depth Streams | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Diff-Book-Depth-Streams" +fetched_at: "2026-01-27T05:28:08.101Z" +--- +# Diff. Book Depth Streams + +## Stream Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Diff-Book-Depth-Streams) + +Bids and asks, pushed every 250 milliseconds, 500 milliseconds, or 100 milliseconds + +## Stream Name[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Diff-Book-Depth-Streams) + +`@depth` OR `@depth@500ms` OR `@depth@100ms` + +## Update Speed[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Diff-Book-Depth-Streams) + +**250ms** or **500ms** or **100ms** + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Diff-Book-Depth-Streams) + +``` +{ "e": "depthUpdate", // Event type "E": 1591270260907, // Event time "T": 1591270260891, // Transction time "s": "BTCUSD_200626", // Symbol "ps": "BTCUSD", // Pair "U": 17285681, // First update ID in event "u": 17285702, // Final update ID in event "pu": 17285675, // Final update Id in last stream(ie `u` in last stream) "b": [ // Bids to be updated [ "9517.6", // Price level to be updated "10" // Quantity ] ], "a": [ // Asks to be updated [ "9518.5", // Price level to be updated "45" // Quantity ] ]} +``` + +- [Stream Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Diff-Book-Depth-Streams) +- [Stream Name](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Diff-Book-Depth-Streams) +- [Update Speed](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Diff-Book-Depth-Streams) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Diff-Book-Depth-Streams) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams_How-to-manage-a-local-order-book-correctly.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams_How-to-manage-a-local-order-book-correctly.md new file mode 100644 index 0000000..c8671ae --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams_How-to-manage-a-local-order-book-correctly.md @@ -0,0 +1,21 @@ +--- +title: "How To Manage A Local Order Book Correctly | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/How-to-manage-a-local-order-book-correctly" +fetched_at: "2026-01-27T05:28:08.211Z" +--- +# How to manage a local order book correctly + +1. Open a stream to **wss://dstream.binance.com/stream?streams=btcusd\_200925@depth**. +2. Buffer the events you receive from the stream. For same price, latest received update covers the previous one. +3. Get a depth snapshot from **[https://dapi.binance.com/dapi/v1/depth?symbol=BTCUSD\_200925&limit=1000](https://dapi.binance.com/dapi/v1/depth?symbol=BTCUSD_200925&limit=1000)** . +4. Drop any event where `u` is < `lastUpdateId` in the snapshot +5. The first processed event should have `U` `<= ``lastUpdateId` **AND** `u` >`= ``lastUpdateId` + +- U = firstUpdateId (the first update ID) from the WebSocket stream. +- u = finalUpdateId (the last update ID) from the WebSocket stream. +- lastUpdateId = the update ID you got from the REST depth snapshot. + +6. While listening to the stream, each new event's `pu` should be equal to the previous event's `u`, otherwise initialize the process from step 3. +7. The data in each event is the **absolute** quantity for a price level +8. If the quantity is 0, **remove** the price level +9. Receiving an event that removes a price level that is not in your local order book can happen and is normal. diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams_Index-Kline-Candlestick-Streams.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams_Index-Kline-Candlestick-Streams.md new file mode 100644 index 0000000..95ed235 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams_Index-Kline-Candlestick-Streams.md @@ -0,0 +1,51 @@ +--- +title: "Index Kline Candlestick Streams | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Index-Kline-Candlestick-Streams" +fetched_at: "2026-01-27T05:28:08.345Z" +--- +# Index Kline/Candlestick Streams + +## Stream Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Index-Kline-Candlestick-Streams) + +Index Kline/Candlestick Streams + +**Kline/Candlestick chart intervals:** + +m -> minutes; h -> hours; d -> days; w -> weeks; M -> months + +- 1m +- 3m +- 5m +- 15m +- 30m +- 1h +- 2h +- 4h +- 6h +- 8h +- 12h +- 1d +- 3d +- 1w +- 1M + +## Stream Name[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Index-Kline-Candlestick-Streams) + +`@indexPriceKline_` + +e.g. "btcusd@indexPriceKline\_1m" + +## Update Speed[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Index-Kline-Candlestick-Streams) + +**250ms** + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Index-Kline-Candlestick-Streams) + +``` +{ "e":"indexPrice_kline", // Event Name "E":1591267070033, // Event Time "ps":"BTCUSD", // Pair "k":{ "t":1591267020000, // Kline start time "T":1591267079999, // Kline close time "s":"0", // ignore "i":"1m", // Interval "f":1591267020000, // ignore "L":1591267070000, // ignore "o":"9542.21900000", // Open price "c":"9542.50440000", // Close price "h":"9542.71640000", // High price "l":"9542.21040000", // Low price "v":"0", // ignore "n":51, // Number of basic data "x":false, // Is this kline closed? "q":"0", // ignore "V":"0", // ignore "Q":"0", // ignore "B":"0" // ignore }} +``` + +- [Stream Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Index-Kline-Candlestick-Streams) +- [Stream Name](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Index-Kline-Candlestick-Streams) +- [Update Speed](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Index-Kline-Candlestick-Streams) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Index-Kline-Candlestick-Streams) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams_Index-Price-Stream.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams_Index-Price-Stream.md new file mode 100644 index 0000000..3c82ca8 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams_Index-Price-Stream.md @@ -0,0 +1,29 @@ +--- +title: "Index Price Stream | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Index-Price-Stream" +fetched_at: "2026-01-27T05:28:08.396Z" +--- +# Index Price Stream + +## Stream Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Index-Price-Stream) + +Index Price Stream + +## Stream Name[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Index-Price-Stream) + +`@indexPrice` OR `@indexPrice@1s` + +## Update Speed[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Index-Price-Stream) + +**3000ms** OR **1000ms** + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Index-Price-Stream) + +``` + { "e": "indexPriceUpdate", // Event type "E": 1591261236000, // Event time "i": "BTCUSD", // Pair "p": "9636.57860000", // Index Price } +``` + +- [Stream Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Index-Price-Stream) +- [Stream Name](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Index-Price-Stream) +- [Update Speed](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Index-Price-Stream) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Index-Price-Stream) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams_Individual-Symbol-Book-Ticker-Streams.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams_Individual-Symbol-Book-Ticker-Streams.md new file mode 100644 index 0000000..806756b --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams_Individual-Symbol-Book-Ticker-Streams.md @@ -0,0 +1,29 @@ +--- +title: "Individual Symbol Book Ticker Streams | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Individual-Symbol-Book-Ticker-Streams" +fetched_at: "2026-01-27T05:28:08.403Z" +--- +# Individual Symbol Book Ticker Streams + +## Stream Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Individual-Symbol-Book-Ticker-Streams) + +Pushes any update to the best bid or ask's price or quantity in real-time for a specified symbol. + +## Stream Name[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Individual-Symbol-Book-Ticker-Streams) + +`@bookTicker` + +## Update Speed[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Individual-Symbol-Book-Ticker-Streams) + +**Real-time** + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Individual-Symbol-Book-Ticker-Streams) + +``` +{ "e":"bookTicker", // Event type "u":17242169, // Order book update Id "s":"BTCUSD_200626", // Symbol "ps":"BTCUSD", // Pair "b":"9548.1", // Best bid price "B":"52", // Best bid qty "a":"9548.5", // Best ask price "A":"11", // Best ask qty "T":1591268628155, // Transaction time "E":1591268628166 // Event time} +``` + +- [Stream Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Individual-Symbol-Book-Ticker-Streams) +- [Stream Name](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Individual-Symbol-Book-Ticker-Streams) +- [Update Speed](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Individual-Symbol-Book-Ticker-Streams) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Individual-Symbol-Book-Ticker-Streams) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams_Individual-Symbol-Mini-Ticker-Stream.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams_Individual-Symbol-Mini-Ticker-Stream.md new file mode 100644 index 0000000..fe1fbf3 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams_Individual-Symbol-Mini-Ticker-Stream.md @@ -0,0 +1,29 @@ +--- +title: "Individual Symbol Mini Ticker Stream | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Individual-Symbol-Mini-Ticker-Stream" +fetched_at: "2026-01-27T05:28:08.467Z" +--- +# Individual Symbol Mini Ticker Stream + +## Stream Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Individual-Symbol-Mini-Ticker-Stream) + +24hr rolling window mini-ticker statistics for a single symbol. These are NOT the statistics of the UTC day, but a 24hr rolling window from requestTime to 24hrs before. + +## Stream Name[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Individual-Symbol-Mini-Ticker-Stream) + +`@miniTicker` + +## Update Speed[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Individual-Symbol-Mini-Ticker-Stream) + +**500ms** + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Individual-Symbol-Mini-Ticker-Stream) + +``` +{ "e":"24hrMiniTicker", // Event type "E":1591267704450, // Event time "s":"BTCUSD_200626", // Symbol "ps":"BTCUSD", // Pair "c":"9561.7", // Close price "o":"9580.9", // Open price "h":"10000.0", // High price "l":"7000.0", // Low price "v":"487476", // Total traded volume "q":"33264343847.22378500" // Total traded base asset volume} +``` + +- [Stream Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Individual-Symbol-Mini-Ticker-Stream) +- [Stream Name](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Individual-Symbol-Mini-Ticker-Stream) +- [Update Speed](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Individual-Symbol-Mini-Ticker-Stream) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Individual-Symbol-Mini-Ticker-Stream) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams_Individual-Symbol-Ticker-Streams.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams_Individual-Symbol-Ticker-Streams.md new file mode 100644 index 0000000..e517d95 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams_Individual-Symbol-Ticker-Streams.md @@ -0,0 +1,29 @@ +--- +title: "Individual Symbol Ticker Streams | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Individual-Symbol-Ticker-Streams" +fetched_at: "2026-01-27T05:28:08.598Z" +--- +# Individual Symbol Ticker Streams + +## Stream Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Individual-Symbol-Ticker-Streams) + +24hr rolling window ticker statistics for a single symbol. These are NOT the statistics of the UTC day, but a 24hr rolling window from requestTime to 24hrs before. + +## Stream Name[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Individual-Symbol-Ticker-Streams) + +`@ticker` + +## Update Speed[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Individual-Symbol-Ticker-Streams) + +**500ms** + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Individual-Symbol-Ticker-Streams) + +``` +{ "e":"24hrTicker", // Event type "E":1591268262453, // Event time "s":"BTCUSD_200626", // Symbol "ps":"BTCUSD", // Pair "p":"-43.4", // Price change "P":"-0.452", // Price change percent "w":"0.00147974", // Weighted average price "c":"9548.5", // Last price "Q":"2", // Last quantity "o":"9591.9", // Open price "h":"10000.0", // High price "l":"7000.0", // Low price "v":"487850", // Total traded volume "q":"32968676323.46222700", // Total traded base asset volume "O":1591181820000, // Statistics open time "C":1591268262442, // Statistics close time "F":512014, // First trade ID "L":615289, // Last trade Id "n":103272 // Total number of trades} +``` + +- [Stream Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Individual-Symbol-Ticker-Streams) +- [Stream Name](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Individual-Symbol-Ticker-Streams) +- [Update Speed](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Individual-Symbol-Ticker-Streams) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Individual-Symbol-Ticker-Streams) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams_Kline-Candlestick-Streams.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams_Kline-Candlestick-Streams.md new file mode 100644 index 0000000..d30705b --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams_Kline-Candlestick-Streams.md @@ -0,0 +1,49 @@ +--- +title: "Kline Candlestick Streams | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Kline-Candlestick-Streams" +fetched_at: "2026-01-27T05:28:08.653Z" +--- +# Kline/Candlestick Streams + +## Stream Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Kline-Candlestick-Streams) + +The Kline/Candlestick Stream push updates to the current klines/candlestick every 250 milliseconds (if existing). + +**Kline/Candlestick chart intervals:** m -> minutes; h -> hours; d -> days; w -> weeks; M -> months + +- 1m +- 3m +- 5m +- 15m +- 30m +- 1h +- 2h +- 4h +- 6h +- 8h +- 12h +- 1d +- 3d +- 1w +- 1M + +## Stream Name[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Kline-Candlestick-Streams) + +`@kline_` + +e.g. "btcusd\_200626@kline\_1m" + +## Update Speed[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Kline-Candlestick-Streams) + +**250ms** + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Kline-Candlestick-Streams) + +``` +{ "e":"kline", // Event type "E":1591261542539, // Event time "s":"BTCUSD_200626", // Symbol "k":{ "t":1591261500000, // Kline start time "T":1591261559999, // Kline close time "s":"BTCUSD_200626", // Symbol "i":"1m", // Interval "f":606400, // First trade ID "L":606430, // Last trade ID "o":"9638.9", // Open price "c":"9639.8", // Close price "h":"9639.8", // High price "l":"9638.6", // Low price "v":"156", // volume "n":31, // Number of trades "x":false, // Is this kline closed? "q":"1.61836886", // Base asset volume "V":"73", // Taker buy volume "Q":"0.75731156", // Taker buy base asset volume "B":"0" // Ignore }} +``` + +- [Stream Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Kline-Candlestick-Streams) +- [Stream Name](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Kline-Candlestick-Streams) +- [Update Speed](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Kline-Candlestick-Streams) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Kline-Candlestick-Streams) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams_Liquidation-Order-Streams.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams_Liquidation-Order-Streams.md new file mode 100644 index 0000000..d2efc71 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams_Liquidation-Order-Streams.md @@ -0,0 +1,31 @@ +--- +title: "Liquidation Order Streams | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Liquidation-Order-Streams" +fetched_at: "2026-01-27T05:28:08.663Z" +--- +# Liquidation Order Streams + +## Stream Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Liquidation-Order-Streams) + +The Liquidation Order Snapshot Streams push force liquidation order information for specific symbol. + +For each symbol,only the latest one liquidation order within 1000ms will be pushed as the snapshot. If no liquidation happens in the interval of 1000ms, no stream will be pushed. + +## Stream Name[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Liquidation-Order-Streams) + +`@forceOrder` + +## Update Speed[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Liquidation-Order-Streams) + +**1000ms** + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Liquidation-Order-Streams) + +``` +{ "e":"forceOrder", // Event Type "E": 1591154240950, // Event Time "o":{ "s":"BTCUSD_200925",  // Symbol "ps": "BTCUSD", // Pair "S":"SELL", // Side "o":"LIMIT", // Order Type "f":"IOC", // Time in Force "q":"1", // Original Quantity "p":"9425.5", // Price "ap":"9496.5", // Average Price "X":"FILLED", // Order Status "l":"1", // Order Last Filled Quantity "z":"1", // Order Filled Accumulated Quantity "T": 1591154240949, // Order Trade Time }} +``` + +- [Stream Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Liquidation-Order-Streams) +- [Stream Name](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Liquidation-Order-Streams) +- [Update Speed](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Liquidation-Order-Streams) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Liquidation-Order-Streams) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams_Live-Subscribing-Unsubscribing-to-streams.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams_Live-Subscribing-Unsubscribing-to-streams.md new file mode 100644 index 0000000..9f64f91 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams_Live-Subscribing-Unsubscribing-to-streams.md @@ -0,0 +1,87 @@ +--- +title: "Live Subscribing Unsubscribing To Streams | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Live-Subscribing-Unsubscribing-to-streams" +fetched_at: "2026-01-27T05:28:08.730Z" +--- +# Live Subscribing/Unsubscribing to streams + +- The following data can be sent through the websocket instance in order to subscribe/unsubscribe from streams. Examples can be seen below. +- The `id` used in the JSON payloads is an unsigned INT used as an identifier to uniquely identify the messages going back and forth. + +## Subscribe to a stream[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Live-Subscribing-Unsubscribing-to-streams) + +> **Request** + +``` +{ "method": "SUBSCRIBE", "params": [ "btcusd_200925@aggTrade", "btcusd_200925@depth" ], "id": 1 } +``` + +> **Response** + +``` +{ "result": null, "id": 1} +``` + +## Unsubscribe to a stream[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Live-Subscribing-Unsubscribing-to-streams) + +> **Request** + +``` +{ "method": "UNSUBSCRIBE", "params": [ "btcusd_200925@depth" ], "id": 312 } +``` + +> **Response** + +``` +{ "result": null, "id": 312} +``` + +## Listing Subscriptions[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Live-Subscribing-Unsubscribing-to-streams) + +> **Request** + +``` +{ "method": "LIST_SUBSCRIPTIONS", "id": 3 } +``` + +> **Response** + +``` +{ "result": [ "btcusd_200925@aggTrade" ], "id": 3} +``` + +## Setting Properties[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Live-Subscribing-Unsubscribing-to-streams) + +Currently, the only property can be set is to set whether `combined` stream payloads are enabled are not. The combined property is set to `false` when connecting using `/ws/` ("raw streams") and `true` when connecting using `/stream/`. + +> **Request** + +``` +{ "method": "SET_PROPERTY", "params": [ "combined", true ], "id": 5 } +``` + +> **Response** + +``` +{ "result": null, "id": 5} +``` + +## Retrieving Properties[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Live-Subscribing-Unsubscribing-to-streams) + +> **Request** + +``` +{ "method": "GET_PROPERTY", "params": [ "combined" ], "id": 2 } +``` + +> **Response** + +``` +{ "result": true, // Indicates that combined is set to true. "id": 2} +``` + +- [Subscribe to a stream](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Live-Subscribing-Unsubscribing-to-streams) +- [Unsubscribe to a stream](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Live-Subscribing-Unsubscribing-to-streams) +- [Listing Subscriptions](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Live-Subscribing-Unsubscribing-to-streams) +- [Setting Properties](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Live-Subscribing-Unsubscribing-to-streams) +- [Retrieving Properties](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Live-Subscribing-Unsubscribing-to-streams) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams_Mark-Price-Kline-Candlestick-Streams.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams_Mark-Price-Kline-Candlestick-Streams.md new file mode 100644 index 0000000..d810c93 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams_Mark-Price-Kline-Candlestick-Streams.md @@ -0,0 +1,51 @@ +--- +title: "Mark Price Kline Candlestick Streams | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Mark-Price-Kline-Candlestick-Streams" +fetched_at: "2026-01-27T05:28:08.861Z" +--- +# Mark Price Kline/Candlestick Streams + +## Stream Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Mark-Price-Kline-Candlestick-Streams) + +Mark Price Kline/Candlestick Streams + +**Kline/Candlestick chart intervals:** + +m -> minutes; h -> hours; d -> days; w -> weeks; M -> months + +- 1m +- 3m +- 5m +- 15m +- 30m +- 1h +- 2h +- 4h +- 6h +- 8h +- 12h +- 1d +- 3d +- 1w +- 1M + +## Stream Name[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Mark-Price-Kline-Candlestick-Streams) + +`@markPriceKline_` + +e.g. "btcusd\_200626@markPriceKline\_1m" + +## Update Speed[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Mark-Price-Kline-Candlestick-Streams) + +**250ms** + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Mark-Price-Kline-Candlestick-Streams) + +``` +{ "e":"markPrice_kline", // Event Name "E":1591267398004, // Event Time "ps":"BTCUSD", // Pair "k":{ "t":1591267380000, // Kline start time "T":1591267439999, // Kline close time "s":"BTCUSD_200626", // Symbol "i":"1m", // Interval "f":1591267380000, // ignore "L":1591267398000, // ignore "o":"9539.67161333", // Open price "c":"9540.82761333", // Close price "h":"9540.82761333", // High price "l":"9539.66961333", // Low price "v":"0", // ignore "n":19, // Number of basic data "x":false, // Is this kline closed? "q":"0", // ignore "V":"0", // ignore "Q":"0", // ignore "B":"0" // ignore }} +``` + +- [Stream Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Mark-Price-Kline-Candlestick-Streams) +- [Stream Name](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Mark-Price-Kline-Candlestick-Streams) +- [Update Speed](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Mark-Price-Kline-Candlestick-Streams) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Mark-Price-Kline-Candlestick-Streams) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams_Mark-Price-Stream.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams_Mark-Price-Stream.md new file mode 100644 index 0000000..4a826a6 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams_Mark-Price-Stream.md @@ -0,0 +1,29 @@ +--- +title: "Mark Price Stream | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Mark-Price-Stream" +fetched_at: "2026-01-27T05:28:08.918Z" +--- +# Mark Price Stream + +## Stream Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Mark-Price-Stream) + +Mark price update stream + +## Stream Name[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Mark-Price-Stream) + +`@markPrice` OR `@markPrice@1s` + +## Update Speed[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Mark-Price-Stream) + +**3000ms** OR **1000ms** + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Mark-Price-Stream) + +``` +{ "e":"markPriceUpdate", // Event type "E":1596095725000, // Event time "s":"BTCUSD_201225", // Symbol "p":"10934.62615417", // Mark Price "P":"10962.17178236", // Estimated Settle Price, only useful in the last hour before the settlement starts. "i":"10933.62615417", // Index Price "r":"", // funding rate for perpetual symbol, "" will be shown for delivery symbol "T":0 // next funding time for perpetual symbol, 0 will be shown for delivery symbol} +``` + +- [Stream Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Mark-Price-Stream) +- [Stream Name](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Mark-Price-Stream) +- [Update Speed](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Mark-Price-Stream) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Mark-Price-Stream) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams_Mark-Price-of-All-Symbols-of-a-Pair.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams_Mark-Price-of-All-Symbols-of-a-Pair.md new file mode 100644 index 0000000..35e8f54 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams_Mark-Price-of-All-Symbols-of-a-Pair.md @@ -0,0 +1,29 @@ +--- +title: "Mark Price Of All Symbols Of A Pair | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Mark-Price-of-All-Symbols-of-a-Pair" +fetched_at: "2026-01-27T05:28:08.926Z" +--- +# Mark Price of All Symbols of a Pair + +## Stream Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Mark-Price-of-All-Symbols-of-a-Pair) + +Mark Price of All Symbols of a Pair + +## Stream Name[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Mark-Price-of-All-Symbols-of-a-Pair) + +`@markPrice` OR `@markPrice@1s` + +## Update Speed[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Mark-Price-of-All-Symbols-of-a-Pair) + +**3000ms** OR **1000ms** + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Mark-Price-of-All-Symbols-of-a-Pair) + +``` +[ { "e":"markPriceUpdate", // Event type "E":1596095725000, // Event time "s":"BTCUSD_201225", // Symbol "p":"10934.62615417", // Mark Price "P":"10962.17178236", // Estimated Settle Price, only useful in the last hour before the settlement starts. "i":"10933.62615417", // Index Price "r":"", // funding rate for perpetual symbol, "" will be shown for delivery symbol "T":0 // next funding time for perpetual symbol, 0 will be shown for delivery symbol }, { "e":"markPriceUpdate", "E":1596095725000, "s":"BTCUSD_PERP", "p":"11012.31359011", "P":"10962.17178236", "i":"10933.62615417", // Index Price "r":"0.00000000", "T":1596096000000 }] +``` + +- [Stream Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Mark-Price-of-All-Symbols-of-a-Pair) +- [Stream Name](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Mark-Price-of-All-Symbols-of-a-Pair) +- [Update Speed](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Mark-Price-of-All-Symbols-of-a-Pair) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Mark-Price-of-All-Symbols-of-a-Pair) diff --git a/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams_Partial-Book-Depth-Streams.md b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams_Partial-Book-Depth-Streams.md new file mode 100644 index 0000000..1752025 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_coin-margined-futures_websocket-market-streams_Partial-Book-Depth-Streams.md @@ -0,0 +1,29 @@ +--- +title: "Partial Book Depth Streams | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Partial-Book-Depth-Streams" +fetched_at: "2026-01-27T05:28:09.054Z" +--- +# Partial Book Depth Streams + +## Stream Description[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Partial-Book-Depth-Streams) + +Top **** bids and asks, Valid **** are 5, 10, or 20. + +## Stream Name[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Partial-Book-Depth-Streams) + +`@depth` OR `@depth@500ms` OR `@depth@100ms`. + +## Update Speed[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Partial-Book-Depth-Streams) + +**250ms**, **500ms** or **100ms** + +## Response Example[​](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Partial-Book-Depth-Streams) + +``` +{ "e":"depthUpdate", // Event type "E":1591269996801, // Event time "T":1591269996646, // Transaction time "s":"BTCUSD_200626", // Symbol "ps":"BTCUSD", // Pair "U":17276694, "u":17276701, "pu":17276678, "b":[ // Bids to be updated [ "9523.0", // Price Level "5" // Quantity ], [ "9522.8", "8" ], [ "9522.6", "2" ], [ "9522.4", "1" ], [ "9522.0", "5" ] ], "a":[ // Asks to be updated [ "9524.6", // Price level to be "2" // Quantity ], [ "9524.7", "3" ], [ "9524.9", "16" ], [ "9525.1", "10" ], [ "9525.3", "6" ] ]} +``` + +- [Stream Description](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Partial-Book-Depth-Streams) +- [Stream Name](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Partial-Book-Depth-Streams) +- [Update Speed](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Partial-Book-Depth-Streams) +- [Response Example](https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Partial-Book-Depth-Streams) diff --git a/docs/binance/binance_derivatives/docs_derivatives_options-trading_account.md b/docs/binance/binance_derivatives/docs_derivatives_options-trading_account.md new file mode 100644 index 0000000..abd4408 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_options-trading_account.md @@ -0,0 +1,52 @@ +--- +title: "Option Margin Account Information | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/options-trading/account" +fetched_at: "2026-01-27T05:28:09.171Z" +--- +# Option Margin Account Information (USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/options-trading/account) + +Get current account information. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/options-trading/account) + +GET `/eapi/v1/marginAccount` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/options-trading/account) + +**3** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/options-trading/account) + +Name + +Type + +Mandatory + +Description + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/options-trading/account) + +``` +{ "asset": [ { "asset": "USDT", // Asset type "marginBalance": "99998.87365244", // Account balance "equity": "99998.87365244", // Account equity "available": "96883.72734374", // Available funds "initialMargin": "3115.14630870", // Initial margin "maintMargin": "0.00000000", // Maintenance margin "unrealizedPNL": "0.00000000", // Unrealized profit/loss "adjustedEquity": "99998.87365244" // margin balance + qualified Long Position Value } ], "greek": [ { "underlying": "BTCUSDT", // Option Underlying "delta": "0", // Account delta "theta": "0", // Account theta "gamma": "0", // Account gamma "vega": "0" // Account vega } ], "time": 1762843368098, "canTrade": true, "canDeposit": true, "canWithdraw": true, "reduceOnly": false}   +``` + +- [API Description](https://developers.binance.com/docs/derivatives/options-trading/account) +- [HTTP Request](https://developers.binance.com/docs/derivatives/options-trading/account) +- [Request Weight](https://developers.binance.com/docs/derivatives/options-trading/account) +- [Request Parameters](https://developers.binance.com/docs/derivatives/options-trading/account) +- [Response Example](https://developers.binance.com/docs/derivatives/options-trading/account) diff --git a/docs/binance/binance_derivatives/docs_derivatives_options-trading_account_Account-Funding-Flow.md b/docs/binance/binance_derivatives/docs_derivatives_options-trading_account_Account-Funding-Flow.md new file mode 100644 index 0000000..7c5a329 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_options-trading_account_Account-Funding-Flow.md @@ -0,0 +1,92 @@ +--- +title: "Account Funding Flow | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/options-trading/account/Account-Funding-Flow" +fetched_at: "2026-01-27T05:28:09.229Z" +--- +# Account Funding Flow (USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/options-trading/account/Account-Funding-Flow) + +Query account funding flows. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/options-trading/account/Account-Funding-Flow) + +GET `/eapi/v1/bill` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/options-trading/account/Account-Funding-Flow) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/options-trading/account/Account-Funding-Flow) + +Name + +Type + +Mandatory + +Description + +currency + +STRING + +YES + +Asset type, only support USDT as of now + +recordId + +LONG + +NO + +Return the recordId and subsequent data, the latest data is returned by default, e.g 100000 + +startTime + +LONG + +NO + +Start Time, e.g 1593511200000 + +endTime + +LONG + +NO + +End Time, e.g 1593512200000 + +limit + +INT + +NO + +Number of result sets returned Default:100 Max:1000 + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/options-trading/account/Account-Funding-Flow) + +``` +[ { "id": 1125899906842624000, "asset": "USDT", // Asset type "amount": "-0.552", // Amount (positive numbers represent inflow, negative numbers represent outflow) "type": "FEE", // type (fees) "createDate": 1592449456000, // Time }, { "id": 1125899906842624000, "asset": "USDT", // Asset type "amount": "100", // Amount (positive numbers represent inflow, negative numbers represent outflow) "type": "CONTRACT", // type (buy/sell contracts) "createDate": 1592449456000, // Time }, { "id": 1125899906842624000, "asset": "USDT", // Asset type "amount": "10000", // Amount (positive numbers represent inflow, negative numbers represent outflow) "type": "TRANSFER", // type(Funds transfer) "createDate": 1592448410000, // Time }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/options-trading/account/Account-Funding-Flow) +- [HTTP Request](https://developers.binance.com/docs/derivatives/options-trading/account/Account-Funding-Flow) +- [Request Weight](https://developers.binance.com/docs/derivatives/options-trading/account/Account-Funding-Flow) +- [Request Parameters](https://developers.binance.com/docs/derivatives/options-trading/account/Account-Funding-Flow) +- [Response Example](https://developers.binance.com/docs/derivatives/options-trading/account/Account-Funding-Flow) diff --git a/docs/binance/binance_derivatives/docs_derivatives_options-trading_account_Funds-Transfer.md b/docs/binance/binance_derivatives/docs_derivatives_options-trading_account_Funds-Transfer.md new file mode 100644 index 0000000..3ff4c61 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_options-trading_account_Funds-Transfer.md @@ -0,0 +1,16 @@ +--- +title: "Funds Transfer | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/options-trading/account/Funds-Transfer" +fetched_at: "2026-01-27T05:28:09.319Z" +--- +!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){try{return new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}}()||function(){try{return window.localStorage.getItem("theme")}catch(t){}}();t(null!==e?e:"light")}(),function(){try{const n=new URLSearchParams(window.location.search).entries();for(var\[t,e\]of n)if(t.startsWith("docusaurus-data-")){var a=t.replace("docusaurus-data-","data-");document.documentElement.setAttribute(a,e)}}catch(t){}}() + +[Skip to main content](https://developers.binance.com/docs/derivatives/usds-margined-futures/general-info) + +# Funds Transfer(TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/options-trading/account/Funds-Transfer) + +Please find details from [here](https://developers.binance.com/docs/wallet/asset/user-universal-transfer). + +- [API Description](https://developers.binance.com/docs/derivatives/options-trading/account/Funds-Transfer) diff --git a/docs/binance/binance_derivatives/docs_derivatives_options-trading_common-definition.md b/docs/binance/binance_derivatives/docs_derivatives_options-trading_common-definition.md new file mode 100644 index 0000000..e071c80 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_options-trading_common-definition.md @@ -0,0 +1,150 @@ +--- +title: "Common Definition | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/options-trading/common-definition" +fetched_at: "2026-01-27T05:28:09.314Z" +--- +# Public Endpoints Info + +## Terminology[​](https://developers.binance.com/docs/derivatives/options-trading/common-definition) + +- `symbol` refers to the symbol name of a options contract symbol +- `underlying` refers to the underlying symbol of a options contract symbol +- `quoteAsset` refers to the asset that is the price of a symbol. +- `settleAsset` refers to the settlement asset when options are exercised + +## ENUM definitions[​](https://developers.binance.com/docs/derivatives/options-trading/common-definition) + +**Options contract type** + +- CALL +- PUT + +**Order side (side)** + +- BUY +- SELL + +**Position side (positionSide)** + +- LONG +- SHORT + +**Time in force (timeInForce)** + +- GTC - Good Till Cancel +- IOC - Immediate or Cancel +- FOK - Fill or Kill +- GTX - Post only + +**Response Type (newOrderRespType)** + +- ACK +- RESULT + +**Order types (type)** + +- LIMIT + +**Order status (status)** + +- NEW +- REJECTED +- PARTIALLY\_FILLED +- FILLED +- CANCELED +- EXPIRED + +**Kline/Candlestick chart intervals:** + +m -> minutes; h -> hours; d -> days; w -> weeks; M -> months + +- 1m +- 3m +- 5m +- 15m +- 30m +- 1h +- 2h +- 4h +- 6h +- 8h +- 12h +- 1d +- 3d +- 1w +- 1M + +**Rate limiters (rateLimitType)** + +> REQUEST\_WEIGHT + +``` + { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 2400 } +``` + +> ORDERS + +``` + { "rateLimitType": "ORDERS", "interval": "MINUTE", "intervalNum": 1, "limit": 1200 } +``` + +- REQUEST\_WEIGHT + +- ORDERS + + +**Rate limit intervals (interval)** + +- MINUTE + +# Filters + +Filters define trading rules on a symbol or an exchange. + +## Symbol filters[​](https://developers.binance.com/docs/derivatives/options-trading/common-definition) + +### PRICE\_FILTER[​](https://developers.binance.com/docs/derivatives/options-trading/common-definition) + +> **/exchangeInfo format:** + +``` +{ "filterType": "PRICE_FILTER", "minPrice": "793.112", "maxPrice": "1189.668", "tickSize": "5.000"} +``` + +The `PRICE_FILTER` defines the `price` rules for a symbol. There are 3 parts: + +- `minPrice` defines the minimum `price` allowed; disabled on `minPrice` == 0. +- `maxPrice` defines the maximum `price` allowed; disabled on `maxPrice` == 0. +- `tickSize` defines the intervals that a `price` can be increased/decreased by; disabled on `tickSize` == 0. + +Any of the above variables can be set to 0, which disables that rule in the `price filter`. In order to pass the `price filter`, the following must be true for `price`/`stopPrice` of the enabled rules: + +- sell order `price` >= `minPrice` +- buy order `price` <= `maxPrice` +- (`price`\-`minPrice`) % `tickSize` == 0 + +### LOT\_SIZE[​](https://developers.binance.com/docs/derivatives/options-trading/common-definition) + +> **/exchangeInfo format:** + +``` +{ "filterType": "LOT_SIZE", "minQty": "0.0001", "maxQty": "1000", "stepSize": "0.0100"} +``` + +The `LOT_SIZE` filter defines the `quantity` (aka "lots" in auction terms) rules for a symbol. There are 3 parts: + +- `minQty` defines the minimum `quantity` allowed. +- `maxQty` defines the maximum `quantity` allowed. +- `stepSize` defines the intervals that a `quantity` can be increased/decreased by. + +In order to pass the `lot size`, the following must be true for `quantity`: + +- `quantity` >= `minQty` +- `quantity` <= `maxQty` +- (`quantity`\-`minQty`) % `stepSize` == 0 + +- [Terminology](https://developers.binance.com/docs/derivatives/options-trading/common-definition) +- [ENUM definitions](https://developers.binance.com/docs/derivatives/options-trading/common-definition) +- [Symbol filters](https://developers.binance.com/docs/derivatives/options-trading/common-definition) + - [PRICE\_FILTER](https://developers.binance.com/docs/derivatives/options-trading/common-definition) + - [LOT\_SIZE](https://developers.binance.com/docs/derivatives/options-trading/common-definition) diff --git a/docs/binance/binance_derivatives/docs_derivatives_options-trading_error-code.md b/docs/binance/binance_derivatives/docs_derivatives_options-trading_error-code.md new file mode 100644 index 0000000..5122681 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_options-trading_error-code.md @@ -0,0 +1,651 @@ +--- +title: "Error Code | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/options-trading/error-code" +fetched_at: "2026-01-27T05:28:09.524Z" +--- +# Error Codes + +> Here is the error JSON payload: + +``` +{ "code":-1121, "msg":"Invalid symbol."} +``` + +Errors consist of two parts: an error code and a message. +Codes are universal,but messages can vary. + +## 10xx - General Server or Network issues[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +### \-1000 UNKNOWN[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- An unknown error occurred while processing the request. + +### \-1001 DISCONNECTED[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Internal error; unable to process your request. Please try again. + +### \-1002 UNAUTHORIZED[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- You are not authorized to execute this request. + +### \-1008 TOO\_MANY\_REQUESTS[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Too many requests queued. +- Too much request weight used; please use the websocket for live updates to avoid polling the API. +- Too much request weight used; current limit is %s request weight per %s %s. Please use the websocket for live updates to avoid polling the API. +- Way too much request weight used; IP banned until %s. Please use the websocket for live updates to avoid bans. + +### \-1014 UNKNOWN\_ORDER\_COMPOSITION[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Unsupported order combination. + +### \-1015 TOO\_MANY\_ORDERS[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Too many new orders. +- Too many new orders; current limit is %s orders per %s. + +### \-1016 SERVICE\_SHUTTING\_DOWN[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- This service is no longer available. + +### \-1020 UNSUPPORTED\_OPERATION[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- This operation is not supported. + +### \-1021 INVALID\_TIMESTAMP[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Timestamp for this request is outside of the recvWindow. +- Timestamp for this request was 1000ms ahead of the server's time. + +### \-1022 INVALID\_SIGNATURE[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Signature for this request is not valid. + +## 11xx - 2xxx Request issues[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +### \-1100 ILLEGAL\_CHARS[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Illegal characters found in a parameter. +- Illegal characters found in a parameter. %s +- Illegal characters found in parameter `%s`; legal range is `%s`. + +### \-1101 TOO\_MANY\_PARAMETERS[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Too many parameters sent for this endpoint. +- Too many parameters; expected `%s` and received `%s`. +- Duplicate values for a parameter detected. + +### \-1102 MANDATORY\_PARAM\_EMPTY\_OR\_MALFORMED[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- A mandatory parameter was not sent, was empty/null, or malformed. +- Mandatory parameter `%s` was not sent, was empty/null, or malformed. +- Param `%s` or `%s` must be sent, but both were empty/null! + +### \-1103 UNKNOWN\_PARAM[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- An unknown parameter was sent. + +### \-1104 UNREAD\_PARAMETERS[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Not all sent parameters were read. +- Not all sent parameters were read; read `%s` parameter(s) but was sent `%s`. + +### \-1105 PARAM\_EMPTY[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- A parameter was empty. +- Parameter `%s` was empty. + +### \-1106 PARAM\_NOT\_REQUIRED[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- A parameter was sent when not required. +- Parameter `%s` sent when not required. + +### \-1111 BAD\_PRECISION[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Precision is over the maximum defined for this asset. + +### \-1115 INVALID\_TIF[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Invalid timeInForce. + +### \-1116 INVALID\_ORDER\_TYPE[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Invalid orderType. + +### \-1117 INVALID\_SIDE[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Invalid side. + +### \-1118 EMPTY\_NEW\_CL\_ORD\_ID[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- New client order ID was empty. + +### \-1119 EMPTY\_ORG\_CL\_ORD\_ID[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Original client order ID was empty. + +### \-1120 BAD\_INTERVAL[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Invalid interval. + +### \-1121 BAD\_SYMBOL[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Invalid symbol. + +### \-1125 INVALID\_LISTEN\_KEY[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- This listenKey does not exist. + +### \-1127 MORE\_THAN\_XX\_HOURS[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Lookup interval is too big. +- More than %s hours between startTime and endTime. + +### \-1128 BAD\_CONTRACT[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Invalid underlying + +### \-1129 BAD\_CURRENCY[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Invalid asset。 + +### \-1130 INVALID\_PARAMETER[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Invalid data sent for a parameter. +- Data sent for paramter `%s` is not valid. + +### \-1131 BAD\_RECV\_WINDOW[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- recvWindow must be less than 60000 + +### \-2010 NEW\_ORDER\_REJECTED[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- NEW\_ORDER\_REJECTED + +### \-2013 NO\_SUCH\_ORDER[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Order does not exist. + +### \-2014 BAD\_API\_KEY\_FMT[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- API-key format invalid. + +### \-2015 INVALID\_API\_KEY[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Invalid API-key, IP, or permissions for action. + +### \-2018 BALANCE\_NOT\_SUFFICIENT[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Balance is insufficient. + +### \-2027 OPTION\_MARGIN\_NOT\_SUFFICIENT[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Option margin is insufficient. + +## 3xxx-5xxx Filters and other issues[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +### \-3029 TRANSFER\_FAILED[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Asset transfer fail. + +### \-4001 PRICE\_LESS\_THAN\_ZERO[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Price less than 0. + +### \-4002 PRICE\_GREATER\_THAN\_MAX\_PRICE[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Price greater than max price. + +### \-4003 QTY\_LESS\_THAN\_ZERO[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Quantity less than zero. + +### \-4004 QTY\_LESS\_THAN\_MIN\_QTY[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Quantity less than min quantity. + +### \-4005 QTY\_GREATER\_THAN\_MAX\_QTY[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Quantity greater than max quantity. + +### \-4013 PRICE\_LESS\_THAN\_MIN\_PRICE[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Price less than min price. + +### \-4029 INVALID\_TICK\_SIZE\_PRECISION[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Tick size precision is invalid. + +### \-4030 INVALID\_QTY\_PRECISION[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Step size precision is invalid. + +### \-4055 AMOUNT\_MUST\_BE\_POSITIVE[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Amount must be positive. + +### \-4056 INVALID\_AMOUNT[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Amount is invalid. + +### \-4078 OPTIONS\_COMMON\_ERROR[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- options internal error + +### \-5001 USER\_EXIST[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Option user already exist + +### \-5002 USER\_NOT\_ACCESS[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Option user not access + +### \-5003 BAD\_INVITE\_CODE[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Invalid invite code + +### \-5004 USED\_INVITE\_CODE[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Invite code has bean used + +### \-5005 BLACK\_COUNTRY[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Black country + +### \-5006 ITEMS\_EXIST[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Items '%s' already exist + +### \-5007 USER\_API\_EXIST[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- User api already exist + +### \-5008 KYC\_NOT\_PASS[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- User kyc not pass + +### \-5009 IP\_COUNTRY\_BLACK[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Restricted jurisdiction ip address + +### \-5010 NOT\_ENOUGH\_POSITION[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- User doesn't have enough position to sell + +### \-6001 INVALID\_MMP\_WINDOW\_TIME\_LIMIT[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Invalid mmp window time limit + +### \-6002 INVALID\_MMP\_FROZEN\_TIME\_LIMIT[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Invalid mmp frozen time limit + +### \-6003 INVALID\_UNDERLYING[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Invalid underlying + +### \-6004 MMP\_UNDERLYING\_NOT\_FOUND[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Underlying not found + +### \-6005 IS\_NOT\_MARKET\_MAKER[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- It is not market maker + +### \-6006 MMP\_RULES\_NOT\_EXISTING[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Mmp rules are not existing + +### \-6007 MMP\_ERROR\_UNKNOWN[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Mmp unknown error + +### \-6008 INVALID\_LIMIT[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- parameter 'limit' is invalid. + +### \-6009 INVALID\_COUNTDOWN\_TIME[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- countdownTime must be no less than 5000 or equal to 0 + +### \-6010 OPEN\_INTEREST\_ERR\_DATA[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- open interest error data. + +### \-6011 EXCEED\_MAXIMUM\_BATCH\_ORDERS[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Maximum 10 orders in one batchOrder request. + +### \-6012 EXCEED\_MAXIMUM\_BLOCK\_ORDER\_LEGS[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Exceed maximum number of legs in one block order request. + +### \-6013 BLOCK\_ORDER\_LEGS\_WITH\_DUPLICATE\_SYMBOL[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Duplicate symbol in one block order request. + +### \-6014 GRFQ\_INVALID\_LEGS[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Invalid legs + +### \-6015 GRFQ\_QTY\_IS\_NOT\_MULTIPLE\_OF\_MINIMUM\_QTY[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Quantity is not multiple of minimum quantity + +### \-6016 GRFQ\_QUOTE\_NOT\_FOUND[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Quote is not found + +### \-6017 GRFQ\_QUOTE\_NOT\_ENOUGH\_QTY\_LEFT[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Not enough quantity left + +### \-6018 GRFQ\_QUOTE\_REQUEST\_NOT\_FOUND[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Quote request is not found + +### \-6019 GRFQ\_QUOTE\_INVALID\_EXPIRE\_TIME[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Invalid quote expire time + +### \-6020 GRFQ\_QUOTE\_EXPIRED[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Quote expired + +### \-6021 GRFQ\_INVALID\_SIDE[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Invalid side + +### \-6022 GRFQ\_INVALID\_USER[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Not Global RFQ user + +### \-6023 SELF\_TRADE\_PREVENTION[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Self trade prevention + +### \-6024 CHANGE\_USER\_FLAG\_FAILED[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Change user flag failed + +### \-6025 GRFQ\_INVALID\_QUOTE\_PRICE[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Invalid quote price + +### \-6026 INVALID\_QTY[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Invalid qty + +### \-6027 INVALID\_PRICE[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Invalid price + +### \-6028 ORDER\_IS\_FINAL[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Order is in final state + +### \-6029 PARAMETER\_IS\_REQUIRED[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- %s is required + +### \-6030 INVALID\_TIME\_INTERVAL[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Invalid time interval. + +### \-6031 START\_TIME\_GREATER\_THAN\_END\_TIME[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Start time is greater than end time. + +### \-6032 HAS\_OPEN\_ORDER[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Has open order. + +### \-6033 HAS\_NEGATIVE\_BALANCE[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Has negative balance. + +### \-6034 HAS\_POSITION[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Has position. + +### \-6035 NO\_NEED\_TO\_CHANGE[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- No need to change. + +### \-6036 NO\_PERMISSION\_TO\_CHANGE[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- no permission to change. + +### \-6037 NO\_RECORDS\_FOUND[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- No records found. + +### \-6038 SCALE\_NOT\_MATCH[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- scale not match. + +### \-6039 INVALID\_STEP\_SIZE\_PRECISION[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Step size precision is invalid. + +### \-6040 INVALID\_QTYLIMIT\_DELTALIMIT[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Invalid qtyLimit or deltaLimit. + +### \-6041 START\_TRADING\_MUST\_SLOWLY[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Start Trading Must Slowly.. + +### \-6042 INDEX\_COMMISSION\_NOT\_MATCH[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Index Commission Not Match.. + +### \-6043 INDEX\_RISKPARAMETER\_NOT\_MATCH[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Index RiskParameter Not Match.. + +### \-6044 CLI\_ORD\_ID\_ERROR[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- clientOrderId is duplicated + +### \-6045 REDUCE\_ONLY\_REJECT[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Reduce-only order rejected. The new reduce-only order conflicts with existing open orders. Please cancel the conflicting orders and resubmit. + +### \-6046 FOK\_ORDER\_REJECT[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Due to the order could not be filled immediately, the FOK order has been rejected. + +### \-6047 GTX\_ORDER\_REJECT[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Due to the order could not be executed as maker, the Post Only order will be rejected. + +### \-6048 INVALID\_BLOCK\_ORDER[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Block order parameter is invalid + +### \-6049 SYMBOL\_NOT\_TRADING[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- this symbol is not in trading status + +### \-6050 MAX\_OPEN\_ORDERS\_ON\_SYMBOL\_EXCEEDED[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Maximum open orders reached for this symbol. Please cancel existing orders and try again. + +### \-6051 MAX\_OPEN\_ORDERS\_ON\_INDEX\_EXCEEDED[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Maximum open orders reached for this underlying. Please cancel existing orders and try again. + +### \-6052 MAX\_SHORT\_POSITION\_ON\_SYMBOL\_EXCEEDED[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Maximum short position size reached for this symbol + +### \-6053 MAX\_SHORT\_POSITION\_ON\_INDEX\_EXCEEDED[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Maximum short position size reached for this underlying + +### \-6054 MAX\_QUANTITY\_ON\_SINGLE\_ORDER\_EXCEEDED[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Quantity greater than max quantity + +### \-6055 USER\_LIQUIDATING[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- User is in liquidation process + +### \-6056 REDUCE\_ONLY\_MARGIN\_CHECK\_FAILED[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Reduce-only order failed. Your new reduce-only order, when combined with existing same-side open orders, would flip your position and cause insufficient margin. Please cancel those open orders and try again. + +### \-6057 WRITER\_CANT\_NAKED\_SELL[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- The current symbol is not eligible for option writing. + +### \-6058 MMP\_TRIGGERED[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- MMP triggered. Please reset MMP config + +### \-6059 USER\_IN\_LIQUIDATION[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- User is in liquidation process + +### \-6060 LOCKED\_BALANCE\_NOT\_FOUND[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- OTC order fail due to unable to lock balance + +### \-6061 LOCKED\_OTC\_ORDER\_NOT\_FOUNT[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- OTC order fail due to unable to lock order + +### \-6062 INVALID\_USER\_STATUS[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Operation is not supported for current user status + +### \-6063 CANCEL\_REJECTED[​](https://developers.binance.com/docs/derivatives/options-trading/error-code) + +- Cancel rejected by system + +- [10xx - General Server or Network issues](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-1000 UNKNOWN](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-1001 DISCONNECTED](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-1002 UNAUTHORIZED](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-1008 TOO\_MANY\_REQUESTS](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-1014 UNKNOWN\_ORDER\_COMPOSITION](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-1015 TOO\_MANY\_ORDERS](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-1016 SERVICE\_SHUTTING\_DOWN](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-1020 UNSUPPORTED\_OPERATION](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-1021 INVALID\_TIMESTAMP](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-1022 INVALID\_SIGNATURE](https://developers.binance.com/docs/derivatives/options-trading/error-code) +- [11xx - 2xxx Request issues](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-1100 ILLEGAL\_CHARS](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-1101 TOO\_MANY\_PARAMETERS](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-1102 MANDATORY\_PARAM\_EMPTY\_OR\_MALFORMED](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-1103 UNKNOWN\_PARAM](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-1104 UNREAD\_PARAMETERS](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-1105 PARAM\_EMPTY](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-1106 PARAM\_NOT\_REQUIRED](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-1111 BAD\_PRECISION](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-1115 INVALID\_TIF](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-1116 INVALID\_ORDER\_TYPE](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-1117 INVALID\_SIDE](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-1118 EMPTY\_NEW\_CL\_ORD\_ID](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-1119 EMPTY\_ORG\_CL\_ORD\_ID](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-1120 BAD\_INTERVAL](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-1121 BAD\_SYMBOL](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-1125 INVALID\_LISTEN\_KEY](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-1127 MORE\_THAN\_XX\_HOURS](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-1128 BAD\_CONTRACT](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-1129 BAD\_CURRENCY](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-1130 INVALID\_PARAMETER](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-1131 BAD\_RECV\_WINDOW](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-2010 NEW\_ORDER\_REJECTED](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-2013 NO\_SUCH\_ORDER](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-2014 BAD\_API\_KEY\_FMT](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-2015 INVALID\_API\_KEY](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-2018 BALANCE\_NOT\_SUFFICIENT](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-2027 OPTION\_MARGIN\_NOT\_SUFFICIENT](https://developers.binance.com/docs/derivatives/options-trading/error-code) +- [3xxx-5xxx Filters and other issues](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-3029 TRANSFER\_FAILED](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-4001 PRICE\_LESS\_THAN\_ZERO](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-4002 PRICE\_GREATER\_THAN\_MAX\_PRICE](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-4003 QTY\_LESS\_THAN\_ZERO](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-4004 QTY\_LESS\_THAN\_MIN\_QTY](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-4005 QTY\_GREATER\_THAN\_MAX\_QTY](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-4013 PRICE\_LESS\_THAN\_MIN\_PRICE](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-4029 INVALID\_TICK\_SIZE\_PRECISION](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-4030 INVALID\_QTY\_PRECISION](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-4055 AMOUNT\_MUST\_BE\_POSITIVE](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-4056 INVALID\_AMOUNT](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-4078 OPTIONS\_COMMON\_ERROR](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-5001 USER\_EXIST](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-5002 USER\_NOT\_ACCESS](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-5003 BAD\_INVITE\_CODE](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-5004 USED\_INVITE\_CODE](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-5005 BLACK\_COUNTRY](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-5006 ITEMS\_EXIST](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-5007 USER\_API\_EXIST](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-5008 KYC\_NOT\_PASS](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-5009 IP\_COUNTRY\_BLACK](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-5010 NOT\_ENOUGH\_POSITION](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-6001 INVALID\_MMP\_WINDOW\_TIME\_LIMIT](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-6002 INVALID\_MMP\_FROZEN\_TIME\_LIMIT](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-6003 INVALID\_UNDERLYING](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-6004 MMP\_UNDERLYING\_NOT\_FOUND](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-6005 IS\_NOT\_MARKET\_MAKER](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-6006 MMP\_RULES\_NOT\_EXISTING](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-6007 MMP\_ERROR\_UNKNOWN](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-6008 INVALID\_LIMIT](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-6009 INVALID\_COUNTDOWN\_TIME](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-6010 OPEN\_INTEREST\_ERR\_DATA](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-6011 EXCEED\_MAXIMUM\_BATCH\_ORDERS](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-6012 EXCEED\_MAXIMUM\_BLOCK\_ORDER\_LEGS](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-6013 BLOCK\_ORDER\_LEGS\_WITH\_DUPLICATE\_SYMBOL](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-6014 GRFQ\_INVALID\_LEGS](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-6015 GRFQ\_QTY\_IS\_NOT\_MULTIPLE\_OF\_MINIMUM\_QTY](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-6016 GRFQ\_QUOTE\_NOT\_FOUND](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-6017 GRFQ\_QUOTE\_NOT\_ENOUGH\_QTY\_LEFT](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-6018 GRFQ\_QUOTE\_REQUEST\_NOT\_FOUND](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-6019 GRFQ\_QUOTE\_INVALID\_EXPIRE\_TIME](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-6020 GRFQ\_QUOTE\_EXPIRED](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-6021 GRFQ\_INVALID\_SIDE](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-6022 GRFQ\_INVALID\_USER](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-6023 SELF\_TRADE\_PREVENTION](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-6024 CHANGE\_USER\_FLAG\_FAILED](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-6025 GRFQ\_INVALID\_QUOTE\_PRICE](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-6026 INVALID\_QTY](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-6027 INVALID\_PRICE](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-6028 ORDER\_IS\_FINAL](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-6029 PARAMETER\_IS\_REQUIRED](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-6030 INVALID\_TIME\_INTERVAL](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-6031 START\_TIME\_GREATER\_THAN\_END\_TIME](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-6032 HAS\_OPEN\_ORDER](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-6033 HAS\_NEGATIVE\_BALANCE](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-6034 HAS\_POSITION](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-6035 NO\_NEED\_TO\_CHANGE](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-6036 NO\_PERMISSION\_TO\_CHANGE](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-6037 NO\_RECORDS\_FOUND](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-6038 SCALE\_NOT\_MATCH](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-6039 INVALID\_STEP\_SIZE\_PRECISION](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-6040 INVALID\_QTYLIMIT\_DELTALIMIT](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-6041 START\_TRADING\_MUST\_SLOWLY](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-6042 INDEX\_COMMISSION\_NOT\_MATCH](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-6043 INDEX\_RISKPARAMETER\_NOT\_MATCH](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-6044 CLI\_ORD\_ID\_ERROR](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-6045 REDUCE\_ONLY\_REJECT](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-6046 FOK\_ORDER\_REJECT](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-6047 GTX\_ORDER\_REJECT](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-6048 INVALID\_BLOCK\_ORDER](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-6049 SYMBOL\_NOT\_TRADING](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-6050 MAX\_OPEN\_ORDERS\_ON\_SYMBOL\_EXCEEDED](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-6051 MAX\_OPEN\_ORDERS\_ON\_INDEX\_EXCEEDED](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-6052 MAX\_SHORT\_POSITION\_ON\_SYMBOL\_EXCEEDED](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-6053 MAX\_SHORT\_POSITION\_ON\_INDEX\_EXCEEDED](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-6054 MAX\_QUANTITY\_ON\_SINGLE\_ORDER\_EXCEEDED](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-6055 USER\_LIQUIDATING](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-6056 REDUCE\_ONLY\_MARGIN\_CHECK\_FAILED](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-6057 WRITER\_CANT\_NAKED\_SELL](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-6058 MMP\_TRIGGERED](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-6059 USER\_IN\_LIQUIDATION](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-6060 LOCKED\_BALANCE\_NOT\_FOUND](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-6061 LOCKED\_OTC\_ORDER\_NOT\_FOUNT](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-6062 INVALID\_USER\_STATUS](https://developers.binance.com/docs/derivatives/options-trading/error-code) + - [\-6063 CANCEL\_REJECTED](https://developers.binance.com/docs/derivatives/options-trading/error-code) diff --git a/docs/binance/binance_derivatives/docs_derivatives_options-trading_general-info.md b/docs/binance/binance_derivatives/docs_derivatives_options-trading_general-info.md new file mode 100644 index 0000000..5abf911 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_options-trading_general-info.md @@ -0,0 +1,276 @@ +--- +title: "General Info | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/options-trading/general-info" +fetched_at: "2026-01-27T05:28:09.628Z" +--- +# General Info + +## General API Information[​](https://developers.binance.com/docs/derivatives/options-trading/general-info) + +- Some endpoints will require an API Key. Please refer to [this page](https://www.binance.com/en/support/articles/360002502072) +- The base endpoint is: \*\*[https://eapi.binance.com](https://eapi.binance.com/) +- All endpoints return either a JSON object or array. +- Data is returned in ascending order. Oldest first, newest last. +- All time and timestamp related fields are in milliseconds. + +### Testnet API Information[​](https://developers.binance.com/docs/derivatives/options-trading/general-info) + +- Most of the endpoints can be used in the testnet platform. +- The REST base url for **testnet** is "[https://testnet.binancefuture.com](https://testnet.binancefuture.com/)" +- The Websocket base url for **testnet** is: + - High Performance Market Data url path:"wss://fstream.binancefuture.com/public/" + - Market Data url path: "wss://fstream.binancefuture.com/market/" + - Private Data url path: "wss://fstream.binancefuture.com/private/" +- After generating an API key on the testnet, users can use this API key directly for testnet options trading. + +### HTTP Return Codes[​](https://developers.binance.com/docs/derivatives/options-trading/general-info) + +- HTTP `4XX` return codes are used for for malformed requests; the issue is on the sender's side. +- HTTP `403` return code is used when the WAF Limit (Web Application Firewall) has been violated. +- HTTP `429` return code is used when breaking a request rate limit. +- HTTP `418` return code is used when an IP has been auto-banned for continuing to send requests after receiving `429` codes. +- HTTP `5XX` return codes are used for internal errors; the issue is on Binance's side. +- HTTP `503` return code is used when: + 1. If there is an error message **"Unknown error, please check your request or try again later."** returned in the response, the API successfully sent the request but not get a response within the timeout period. + It is important to **NOT** treat this as a failure operation; the execution status is **UNKNOWN** and could have been a success; + 2. If there is an error message **"Service Unavailable."** returned in the response, it means this is a failure API operation and the service might be unavailable at the moment, you need to retry later. + 3. If there is an error message **"Internal error; unable to process your request. Please try again."** returned in the response, it means this is a failure API operation and you can resend your request if you need. + +### Error Codes and Messages[​](https://developers.binance.com/docs/derivatives/options-trading/general-info) + +- Any endpoint can return an ERROR + +> **_The error payload is as follows:_** + +``` +{ "code": -1121, "msg": "Invalid symbol."} +``` + +- Specific error codes and messages defined in [Error Codes](https://developers.binance.com/docs/derivatives/options-trading/general-info). + +### General Information on Endpoints[​](https://developers.binance.com/docs/derivatives/options-trading/general-info) + +- For `GET` endpoints, parameters must be sent as a `query string` without setting content type in the http headers. +- For `POST`, `PUT`, and `DELETE` endpoints, the parameters may be sent as a `query string` or in the `request body` with content type `application/x-www-form-urlencoded`. You may mix parameters between both the `query string` and `request body` if you wish to do so. +- Parameters may be sent in any order. +- If a parameter sent in both the `query string` and `request body`, the `query string` parameter will be used. + +## LIMITS[​](https://developers.binance.com/docs/derivatives/options-trading/general-info) + +- The `/eapi/v1/exchangeInfo` `rateLimits` array contains objects related to the exchange's `RAW_REQUEST`, `REQUEST_WEIGHT`, and `ORDER` rate limits. These are further defined in the `ENUM definitions` section under `Rate limiters (rateLimitType)`. +- A `429` will be returned when either rate limit is violated. + +### IP Limits[​](https://developers.binance.com/docs/derivatives/options-trading/general-info) + +- Every request will contain `X-MBX-USED-WEIGHT-(intervalNum)(intervalLetter)` in the response headers which has the current used weight for the IP for all request rate limiters defined. +- Each route has a `weight` which determines for the number of requests each endpoint counts for. Heavier endpoints and endpoints that do operations on multiple symbols will have a heavier `weight`. +- When a 429 is received, it's your obligation as an API to back off and not spam the API. +- **Repeatedly violating rate limits and/or failing to back off after receiving 429s will result in an automated IP ban (HTTP status 418).** +- IP bans are tracked and **scale in duration** for repeat offenders, **from 2 minutes to 3 days**. +- **The limits on the API are based on the IPs, not the API keys.** + +### Order Rate Limits[​](https://developers.binance.com/docs/derivatives/options-trading/general-info) + +- Every order response will contain a `X-MBX-ORDER-COUNT-(intervalNum)(intervalLetter)` header which has the current order count for the account for all order rate limiters defined. +- Rejected/unsuccessful orders are not guaranteed to have `X-MBX-ORDER-COUNT-**` headers in the response. +- **The order rate limit is counted against each account**. + +## Endpoint Security Type[​](https://developers.binance.com/docs/derivatives/options-trading/general-info) + +- Each endpoint has a security type that determines the how you will interact with it. +- API-keys are passed into the Rest API via the `X-MBX-APIKEY` header. +- API-keys and secret-keys **are case sensitive**. +- API-keys can be configured to only access certain types of secure endpoints. For example, one API-key could be used for TRADE only, while another API-key can access everything except for TRADE routes. +- By default, API-keys can access all secure routes. + +Security Type + +Description + +NONE + +Endpoint can be accessed freely. + +TRADE + +Endpoint requires sending a valid API-Key and signature. + +USER\_DATA + +Endpoint requires sending a valid API-Key and signature. + +USER\_STREAM + +Endpoint requires sending a valid API-Key. + +MARKET\_DATA + +Endpoint requires sending a valid API-Key. + +- `TRADE` and `USER_DATA` endpoints are `SIGNED` endpoints. + +## SIGNED (TRADE and USER\_DATA) Endpoint Security[​](https://developers.binance.com/docs/derivatives/options-trading/general-info) + +- `SIGNED` endpoints require an additional parameter, `signature`, to be sent in the `query string` or `request body`. +- Endpoints use `HMAC SHA256` signatures. The `HMAC SHA256 signature` is a keyed `HMAC SHA256` operation. Use your `secretKey` as the key and `totalParams` as the value for the HMAC operation. +- The `signature` is **not case sensitive**. +- Please make sure the `signature` is the end part of your `query string` or `request body`. +- `totalParams` is defined as the `query string` concatenated with the `request body`. + +### Timing Security[​](https://developers.binance.com/docs/derivatives/options-trading/general-info) + +- A `SIGNED` endpoint also requires a parameter, `timestamp`, to be sent which should be the millisecond timestamp of when the request was created and sent. +- An additional parameter, `recvWindow`, may be sent to specify the number of milliseconds after `timestamp` the request is valid for. If `recvWindow` is not sent, **it defaults to 5000**. + +> The logic is as follows: + +``` +if (timestamp < serverTime + 1000 && serverTime - timestamp <= recvWindow) { // process request} else { // reject request} +``` + +**Serious trading is about timing.** Networks can be unstable and unreliable, which can lead to requests taking varying amounts of time to reach the servers. With `recvWindow`, you can specify that the request must be processed within a certain number of milliseconds or be rejected by the server. + +### SIGNED Endpoint Examples for POST /eapi/v1/order[​](https://developers.binance.com/docs/derivatives/options-trading/general-info) + +Here is a step-by-step example of how to send a vaild signed payload from the Linux command line using `echo`, `openssl`, and `curl`. + +Key + +Value + +apiKey + +dbefbc809e3e83c283a984c3a1459732ea7db1360ca80c5c2c8867408d28cc83 + +secretKey + +2b5eb11e18796d12d88f13dc27dbbd02c2cc51ff7059765ed9821957d82bb4d9 + +Parameter + +Value + +symbol + +BTCUSDT + +side + +BUY + +type + +LIMIT + +timeInForce + +GTC + +quantity + +1 + +price + +9000 + +recvWindow + +5000 + +timestamp + +1591702613943 + +#### Example 1: As a query string[​](https://developers.binance.com/docs/derivatives/options-trading/general-info) + +> **Example 1** + +> **HMAC SHA256 signature:** + +``` + $ echo -n "symbol=BTC-210129-40000-C&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=2000&recvWindow=5000×tamp=1611825601400" | openssl dgst -sha256 -hmac "YtP1BudNOWZE1ag5uzCkh4hIC7qSmQOu797r5EJBFGhxBYivjj8HIX0iiiPof5yG" (stdin)= 7c12045972f6140e765e0f2b67d28099718df805732676494238f50be830a7d7 +``` + +> **curl command:** + +``` + (HMAC SHA256) $ curl -H "X-MBX-APIKEY: 22BjeOROKiXJ3NxbR3zjh3uoGcaflPu3VMyBXAg8Jj2J1xVSnY0eB4dzacdE9IWn" -X POST 'https://eapi.binance.com/eapi/v1/order' -d 'symbol=BTC-210129-40000-C&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=2000&recvWindow=5000×tamp=1611825601400&signature=7c12045972f6140e765e0f2b67d28099718df805732676494238f50be830a7d7' +``` + +- **requestBody:** + +symbol=BTC-210129-40000-C +&side=BUY +&type=LIMIT +&timeInForce=GTC +&quantity=1 +&price=2000 +&recvWindow=5000 +×tamp=1611825601400 + +#### Example 2: As a request body[​](https://developers.binance.com/docs/derivatives/options-trading/general-info) + +> **Example 2** + +> **HMAC SHA256 signature:** + +``` + $ echo -n "symbol=BTC-210129-40000-C&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=2000&recvWindow=5000×tamp=1611825601400" | openssl dgst -sha256 -hmac "YtP1BudNOWZE1ag5uzCkh4hIC7qSmQOu797r5EJBFGhxBYivjj8HIX0iiiPof5yG" (stdin)= 7c12045972f6140e765e0f2b67d28099718df805732676494238f50be830a7d7 +``` + +> **curl command:** + +``` + (HMAC SHA256) $ curl -H "X-MBX-APIKEY: 22BjeOROKiXJ3NxbR3zjh3uoGcaflPu3VMyBXAg8Jj2J1xVSnY0eB4dzacdE9IWn" -X POST 'https://eapi.binance.com/eapi/v1/order?symbol=BTC-210129-40000-C&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=2000&recvWindow=5000×tamp=1611825601400&signature=7c12045972f6140e765e0f2b67d28099718df805732676494238f50be830a7d7' +``` + +- **queryString:** + +symbol=BTC-210129-40000-C +&side=BUY +&type=LIMIT +&timeInForce=GTC +&quantity=1 +&price=2000 +&recvWindow=5000 +×tamp=1611825601400 + +#### Example 3: Mixed query string and request body[​](https://developers.binance.com/docs/derivatives/options-trading/general-info) + +> **Example 3** + +> **HMAC SHA256 signature:** + +``` + $ echo -n "symbol=BTC-210129-40000-C&side=BUY&type=LIMIT&timeInForce=GTCquantity=0.01&price=2000&recvWindow=5000×tamp=1611825601400" | openssl dgst -sha256 -hmac "YtP1BudNOWZE1ag5uzCkh4hIC7qSmQOu797r5EJBFGhxBYivjj8HIX0iiiPof5yG" (stdin)= fa6045c54fb02912b766442be1f66fab619217e551a4fb4f8a1ee000df914d8e +``` + +> **curl command:** + +``` + (HMAC SHA256) $ curl -H "X-MBX-APIKEY: 22BjeOROKiXJ3NxbR3zjh3uoGcaflPu3VMyBXAg8Jj2J1xVSnY0eB4dzacdE9IWn" -X POST 'https://eapi.binance.com/eapi/v1/order?symbol=BTC-210129-40000-C&side=BUY&type=LIMIT&timeInForce=GTC' -d 'quantity=0.01&price=2000&recvWindow=5000×tamp=1611825601400&signature=fa6045c54fb02912b766442be1f66fab619217e551a4fb4f8a1ee000df914d8e' +``` + +- **queryString:** + +symbol=BTC-210129-40000-C&side=BUY&type=LIMIT&timeInForce=GTC + +- **requestBody:** + +quantity=1&price=2000&recvWindow=5000×tamp=1611825601400 + +Note that the signature is different in example 3. There is no & between "GTC" and "quantity=1". + +- [General API Information](https://developers.binance.com/docs/derivatives/options-trading/general-info) + - [Testnet API Information](https://developers.binance.com/docs/derivatives/options-trading/general-info) + - [HTTP Return Codes](https://developers.binance.com/docs/derivatives/options-trading/general-info) + - [Error Codes and Messages](https://developers.binance.com/docs/derivatives/options-trading/general-info) + - [General Information on Endpoints](https://developers.binance.com/docs/derivatives/options-trading/general-info) +- [LIMITS](https://developers.binance.com/docs/derivatives/options-trading/general-info) + - [IP Limits](https://developers.binance.com/docs/derivatives/options-trading/general-info) + - [Order Rate Limits](https://developers.binance.com/docs/derivatives/options-trading/general-info) +- [Endpoint Security Type](https://developers.binance.com/docs/derivatives/options-trading/general-info) +- [SIGNED (TRADE and USER\_DATA) Endpoint Security](https://developers.binance.com/docs/derivatives/options-trading/general-info) + - [Timing Security](https://developers.binance.com/docs/derivatives/options-trading/general-info) + - [SIGNED Endpoint Examples for POST /eapi/v1/order](https://developers.binance.com/docs/derivatives/options-trading/general-info) diff --git a/docs/binance/binance_derivatives/docs_derivatives_options-trading_market-data.md b/docs/binance/binance_derivatives/docs_derivatives_options-trading_market-data.md new file mode 100644 index 0000000..db3f977 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_options-trading_market-data.md @@ -0,0 +1,34 @@ +--- +title: "Check Server Time | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/options-trading/market-data" +fetched_at: "2026-01-27T05:28:09.567Z" +--- +# Check Server Time + +## API Description[​](https://developers.binance.com/docs/derivatives/options-trading/market-data) + +Test connectivity to the Rest API and get the current server time. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/options-trading/market-data) + +GET `/eapi/v1/time` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/options-trading/market-data) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/options-trading/market-data) + +NONE + +## Response Example[​](https://developers.binance.com/docs/derivatives/options-trading/market-data) + +``` +{ "serverTime": 1499827319559} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/options-trading/market-data) +- [HTTP Request](https://developers.binance.com/docs/derivatives/options-trading/market-data) +- [Request Weight](https://developers.binance.com/docs/derivatives/options-trading/market-data) +- [Request Parameters](https://developers.binance.com/docs/derivatives/options-trading/market-data) +- [Response Example](https://developers.binance.com/docs/derivatives/options-trading/market-data) diff --git a/docs/binance/binance_derivatives/docs_derivatives_options-trading_market-data_24hr-Ticker-Price-Change-Statistics.md b/docs/binance/binance_derivatives/docs_derivatives_options-trading_market-data_24hr-Ticker-Price-Change-Statistics.md new file mode 100644 index 0000000..461e932 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_options-trading_market-data_24hr-Ticker-Price-Change-Statistics.md @@ -0,0 +1,48 @@ +--- +title: "24hr Ticker Price Change Statistics | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/options-trading/market-data/24hr-Ticker-Price-Change-Statistics" +fetched_at: "2026-01-27T05:28:09.634Z" +--- +# 24hr Ticker Price Change Statistics + +## API Description[​](https://developers.binance.com/docs/derivatives/options-trading/market-data/24hr-Ticker-Price-Change-Statistics) + +24 hour rolling window price change statistics. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/options-trading/market-data/24hr-Ticker-Price-Change-Statistics) + +GET `/eapi/v1/ticker` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/options-trading/market-data/24hr-Ticker-Price-Change-Statistics) + +**5** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/options-trading/market-data/24hr-Ticker-Price-Change-Statistics) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +NO + +Option trading pair, e.g BTC-200730-9000-C + +## Response Example[​](https://developers.binance.com/docs/derivatives/options-trading/market-data/24hr-Ticker-Price-Change-Statistics) + +``` +[ { "symbol": "BTC-200730-9000-C", "priceChange": "-16.2038", //24-hour price change "priceChangePercent": "-0.0162", //24-hour percent price change "lastPrice": "1000", //Last trade price "lastQty": "1000", //Last trade amount "open": "1016.2038", //24-hour open price "high": "1016.2038", //24-hour high "low": "0", //24-hour low "volume": "5", //Trading volume(contracts) "amount": "1", //Trade amount(in quote asset) "bidPrice":"999.34", //The best buy price "askPrice":"1000.23", //The best sell price "openTime": 1592317127349, //Time the first trade occurred within the last 24 hours "closeTime": 1592380593516, //Time the last trade occurred within the last 24 hours "firstTradeId": 1, //First trade ID "tradeCount": 5, //Number of trades "strikePrice": "9000", //Strike price "exercisePrice": "3000.3356" //return estimated settlement price one hour before exercise, return index price at other times }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/options-trading/market-data/24hr-Ticker-Price-Change-Statistics) +- [HTTP Request](https://developers.binance.com/docs/derivatives/options-trading/market-data/24hr-Ticker-Price-Change-Statistics) +- [Request Weight](https://developers.binance.com/docs/derivatives/options-trading/market-data/24hr-Ticker-Price-Change-Statistics) +- [Request Parameters](https://developers.binance.com/docs/derivatives/options-trading/market-data/24hr-Ticker-Price-Change-Statistics) +- [Response Example](https://developers.binance.com/docs/derivatives/options-trading/market-data/24hr-Ticker-Price-Change-Statistics) diff --git a/docs/binance/binance_derivatives/docs_derivatives_options-trading_market-data_Exchange-Information.md b/docs/binance/binance_derivatives/docs_derivatives_options-trading_market-data_Exchange-Information.md new file mode 100644 index 0000000..3176953 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_options-trading_market-data_Exchange-Information.md @@ -0,0 +1,34 @@ +--- +title: "Exchange Information | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/options-trading/market-data/Exchange-Information" +fetched_at: "2026-01-27T05:28:09.855Z" +--- +# Exchange Information + +## API Description[​](https://developers.binance.com/docs/derivatives/options-trading/market-data/Exchange-Information) + +Current exchange trading rules and symbol information + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/options-trading/market-data/Exchange-Information) + +GET `/eapi/v1/exchangeInfo` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/options-trading/market-data/Exchange-Information) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/options-trading/market-data/Exchange-Information) + +NONE + +## Response Example[​](https://developers.binance.com/docs/derivatives/options-trading/market-data/Exchange-Information) + +``` +{ "timezone": "UTC", // Time zone used by the server "serverTime": 1592387337630, // Current system time "optionContracts": [ // Option contract underlying asset info { "baseAsset": "BTC", // Base currency "quoteAsset": "USDT", // Quotation asset "underlying": "BTCUSDT", // Name of the underlying asset of the option contract "settleAsset": "USDT" // Settlement currency } ], "optionAssets": [ // Option asset info { "name": "USDT" // Asset name } ], "optionSymbols": [ // Option trading pair info { "expiryDate": 1660521600000, // expiry time "filters": [ { "filterType": "PRICE_FILTER", "minPrice": "0.02", "maxPrice": "80000.01", "tickSize": "0.01" }, { "filterType": "LOT_SIZE", "minQty": "0.01", "maxQty": "100", "stepSize": "0.01" } ], "symbol": "BTC-220815-50000-C", // Trading pair name "side": "CALL", // Direction: CALL long, PUT short "strikePrice": "50000", // Strike price "underlying": "BTCUSDT", // Underlying asset of the contract "unit": 1, // Contract unit, the quantity of the underlying asset represented by a single contract. "liquidationFeeRate": "0.0019000",// liquidation fee rate "minQty": "0.01", // Minimum order quantity "maxQty": "100", // Maximum order quantity "initialMargin": "0.15", // Initial Magin Ratio "maintenanceMargin": "0.075", // Maintenance Margin Ratio "minInitialMargin": "0.1", // Min Initial Margin Ratio "minMaintenanceMargin": "0.05", // Min Maintenance Margin Ratio "priceScale": 2, // price precision "quantityScale": 2, // quantity precision "quoteAsset": "USDT", // Quotation asset "status": "TRADING" // Trading Status } ], "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 2400 }, { "rateLimitType": "ORDERS", "interval": "MINUTE", "intervalNum": 1, "limit": 1200 }, { "rateLimitType": "ORDERS", "interval": "SECOND", "intervalNum": 10, "limit": 300 } ]} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/options-trading/market-data/Exchange-Information) +- [HTTP Request](https://developers.binance.com/docs/derivatives/options-trading/market-data/Exchange-Information) +- [Request Weight](https://developers.binance.com/docs/derivatives/options-trading/market-data/Exchange-Information) +- [Request Parameters](https://developers.binance.com/docs/derivatives/options-trading/market-data/Exchange-Information) +- [Response Example](https://developers.binance.com/docs/derivatives/options-trading/market-data/Exchange-Information) diff --git a/docs/binance/binance_derivatives/docs_derivatives_options-trading_market-data_Historical-Exercise-Records.md b/docs/binance/binance_derivatives/docs_derivatives_options-trading_market-data_Historical-Exercise-Records.md new file mode 100644 index 0000000..9b1272a --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_options-trading_market-data_Historical-Exercise-Records.md @@ -0,0 +1,75 @@ +--- +title: "Historical Exercise Records | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/options-trading/market-data/Historical-Exercise-Records" +fetched_at: "2026-01-27T05:28:09.828Z" +--- +# Historical Exercise Records + +## API Description[​](https://developers.binance.com/docs/derivatives/options-trading/market-data/Historical-Exercise-Records) + +Get historical exercise records. + +- REALISTIC\_VALUE\_STRICKEN -> Exercised +- EXTRINSIC\_VALUE\_EXPIRED -> Expired OTM + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/options-trading/market-data/Historical-Exercise-Records) + +GET `/eapi/v1/exerciseHistory` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/options-trading/market-data/Historical-Exercise-Records) + +**3** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/options-trading/market-data/Historical-Exercise-Records) + +Name + +Type + +Mandatory + +Description + +underlying + +STRING + +NO + +Underlying index like BTCUSDT + +startTime + +LONG + +NO + +Start Time + +endTime + +LONG + +NO + +End Time + +limit + +INT + +NO + +Number of records Default:100 Max:100 + +## Response Example[​](https://developers.binance.com/docs/derivatives/options-trading/market-data/Historical-Exercise-Records) + +``` +[ { "symbol": "BTC-220121-60000-P", // symbol "strikePrice": "60000", // strike price "realStrikePrice": "38844.69652571", // real strike price "expiryDate": 1642752000000, // Exercise time "strikeResult": "REALISTIC_VALUE_STRICKEN" // strike result }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/options-trading/market-data/Historical-Exercise-Records) +- [HTTP Request](https://developers.binance.com/docs/derivatives/options-trading/market-data/Historical-Exercise-Records) +- [Request Weight](https://developers.binance.com/docs/derivatives/options-trading/market-data/Historical-Exercise-Records) +- [Request Parameters](https://developers.binance.com/docs/derivatives/options-trading/market-data/Historical-Exercise-Records) +- [Response Example](https://developers.binance.com/docs/derivatives/options-trading/market-data/Historical-Exercise-Records) diff --git a/docs/binance/binance_derivatives/docs_derivatives_options-trading_market-data_Kline-Candlestick-Data.md b/docs/binance/binance_derivatives/docs_derivatives_options-trading_market-data_Kline-Candlestick-Data.md new file mode 100644 index 0000000..ff8e37c --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_options-trading_market-data_Kline-Candlestick-Data.md @@ -0,0 +1,82 @@ +--- +title: "Kline Candlestick Data | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/options-trading/market-data/Kline-Candlestick-Data" +fetched_at: "2026-01-27T05:28:09.879Z" +--- +# Kline/Candlestick Data + +## API Description[​](https://developers.binance.com/docs/derivatives/options-trading/market-data/Kline-Candlestick-Data) + +Kline/candlestick bars for an option symbol. Klines are uniquely identified by their open time. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/options-trading/market-data/Kline-Candlestick-Data) + +GET `/eapi/v1/klines` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/options-trading/market-data/Kline-Candlestick-Data) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/options-trading/market-data/Kline-Candlestick-Data) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +Option trading pair, e.g BTC-200730-9000-C + +interval + +STRING + +YES + +Time interval + +startTime + +LONG + +NO + +Start Time 1592317127349 + +endTime + +LONG + +NO + +End Time + +limit + +INT + +NO + +Number of records Default:500 Max:1500 + +> - If startTime and endTime are not sent, the most recent klines are returned. + +## Response Example[​](https://developers.binance.com/docs/derivatives/options-trading/market-data/Kline-Candlestick-Data) + +``` +[ [ 1762779600000, // Open time "1300.000", // Open "1300.000", // High "1300.000", // Low "1300.000", // Close "0.1000", // Volume 1762780499999, // Close time "130.0000000", // Quote asset volume 1, // Number of trades "0.1000", // Taker buy base asset volume "130.0000000", // Taker buy quote asset volume "0" // Ignore. ],] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/options-trading/market-data/Kline-Candlestick-Data) +- [HTTP Request](https://developers.binance.com/docs/derivatives/options-trading/market-data/Kline-Candlestick-Data) +- [Request Weight](https://developers.binance.com/docs/derivatives/options-trading/market-data/Kline-Candlestick-Data) +- [Request Parameters](https://developers.binance.com/docs/derivatives/options-trading/market-data/Kline-Candlestick-Data) +- [Response Example](https://developers.binance.com/docs/derivatives/options-trading/market-data/Kline-Candlestick-Data) diff --git a/docs/binance/binance_derivatives/docs_derivatives_options-trading_market-data_Open-Interest.md b/docs/binance/binance_derivatives/docs_derivatives_options-trading_market-data_Open-Interest.md new file mode 100644 index 0000000..69aca41 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_options-trading_market-data_Open-Interest.md @@ -0,0 +1,56 @@ +--- +title: "Open Interest | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/options-trading/market-data/Open-Interest" +fetched_at: "2026-01-27T05:28:09.887Z" +--- +# Open Interest + +## API Description[​](https://developers.binance.com/docs/derivatives/options-trading/market-data/Open-Interest) + +Get open interest for specific underlying asset on specific expiration date. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/options-trading/market-data/Open-Interest) + +GET `/eapi/v1/openInterest` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/options-trading/market-data/Open-Interest) + +**0** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/options-trading/market-data/Open-Interest) + +Name + +Type + +Mandatory + +Description + +underlyingAsset + +STRING + +YES + +underlying asset, e.g ETH/BTC + +expiration + +STRING + +YES + +expiration date, e.g 221225 + +## Response Example[​](https://developers.binance.com/docs/derivatives/options-trading/market-data/Open-Interest) + +``` +[ { "symbol": "ETH-221119-1175-P", "sumOpenInterest": "4.01", "sumOpenInterestUsd": "4880.2985615624", "timestamp": "1668754020000" }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/options-trading/market-data/Open-Interest) +- [HTTP Request](https://developers.binance.com/docs/derivatives/options-trading/market-data/Open-Interest) +- [Request Weight](https://developers.binance.com/docs/derivatives/options-trading/market-data/Open-Interest) +- [Request Parameters](https://developers.binance.com/docs/derivatives/options-trading/market-data/Open-Interest) +- [Response Example](https://developers.binance.com/docs/derivatives/options-trading/market-data/Open-Interest) diff --git a/docs/binance/binance_derivatives/docs_derivatives_options-trading_market-data_Option-Mark-Price.md b/docs/binance/binance_derivatives/docs_derivatives_options-trading_market-data_Option-Mark-Price.md new file mode 100644 index 0000000..f28631f --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_options-trading_market-data_Option-Mark-Price.md @@ -0,0 +1,48 @@ +--- +title: "Option Mark Price | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/options-trading/market-data/Option-Mark-Price" +fetched_at: "2026-01-27T05:28:10.164Z" +--- +# Option Mark Price + +## API Description[​](https://developers.binance.com/docs/derivatives/options-trading/market-data/Option-Mark-Price) + +Option mark price and greek info. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/options-trading/market-data/Option-Mark-Price) + +GET `/eapi/v1/mark` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/options-trading/market-data/Option-Mark-Price) + +**5** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/options-trading/market-data/Option-Mark-Price) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +NO + +Option trading pair, e.g BTC-200730-9000-C + +## Response Example[​](https://developers.binance.com/docs/derivatives/options-trading/market-data/Option-Mark-Price) + +``` +[ { "symbol": "BTC-200730-9000-C", "markPrice": "1343.2883", // Mark price "bidIV": "1.40000077", // Implied volatility Buy "askIV": "1.50000153", // Implied volatility Sell "markIV": "1.45000000" // Implied volatility mark "delta": "0.55937056", // delta "theta": "3739.82509871", // theta "gamma": "0.00010969", // gamma "vega": "978.58874732", // vega "highPriceLimit": "1618.241", // Current highest buy price "lowPriceLimit": "1068.3356" // Current lowest sell price "riskFreeInterest": "0.1" // risk free rate }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/options-trading/market-data/Option-Mark-Price) +- [HTTP Request](https://developers.binance.com/docs/derivatives/options-trading/market-data/Option-Mark-Price) +- [Request Weight](https://developers.binance.com/docs/derivatives/options-trading/market-data/Option-Mark-Price) +- [Request Parameters](https://developers.binance.com/docs/derivatives/options-trading/market-data/Option-Mark-Price) +- [Response Example](https://developers.binance.com/docs/derivatives/options-trading/market-data/Option-Mark-Price) diff --git a/docs/binance/binance_derivatives/docs_derivatives_options-trading_market-data_Order-Book.md b/docs/binance/binance_derivatives/docs_derivatives_options-trading_market-data_Order-Book.md new file mode 100644 index 0000000..07271da --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_options-trading_market-data_Order-Book.md @@ -0,0 +1,74 @@ +--- +title: "Order Book | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/options-trading/market-data/Order-Book" +fetched_at: "2026-01-27T05:28:10.166Z" +--- +# Order Book + +## API Description[​](https://developers.binance.com/docs/derivatives/options-trading/market-data/Order-Book) + +Check orderbook depth on specific symbol + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/options-trading/market-data/Order-Book) + +GET `/eapi/v1/depth` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/options-trading/market-data/Order-Book) + +limit + +weight + +5, 10, 20, 50 + +1 + +100 + +5 + +500 + +10 + +1000 + +20 + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/options-trading/market-data/Order-Book) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +Option trading pair, e.g BTC-200730-9000-C + +limit + +INT + +NO + +Default:100 Max:1000.Optional value:\[10, 20, 50, 100, 500, 1000\] + +## Response Example[​](https://developers.binance.com/docs/derivatives/options-trading/market-data/Order-Book) + +``` +{ "bids": [ // Buy order [ "1000.000", // Price "0.1000" // Quantity ] ], "asks": [ // Sell order [ "1900.000", // Price "0.1000" // Quantity ] ], "T": 1762780909676, // transaction time "lastUpdateId": 361 // update id} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/options-trading/market-data/Order-Book) +- [HTTP Request](https://developers.binance.com/docs/derivatives/options-trading/market-data/Order-Book) +- [Request Weight](https://developers.binance.com/docs/derivatives/options-trading/market-data/Order-Book) +- [Request Parameters](https://developers.binance.com/docs/derivatives/options-trading/market-data/Order-Book) +- [Response Example](https://developers.binance.com/docs/derivatives/options-trading/market-data/Order-Book) diff --git a/docs/binance/binance_derivatives/docs_derivatives_options-trading_market-data_Recent-Block-Trade-List.md b/docs/binance/binance_derivatives/docs_derivatives_options-trading_market-data_Recent-Block-Trade-List.md new file mode 100644 index 0000000..9e728ec --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_options-trading_market-data_Recent-Block-Trade-List.md @@ -0,0 +1,56 @@ +--- +title: "Recent Block Trades List | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/options-trading/market-data/Recent-Block-Trade-List" +fetched_at: "2026-01-27T05:28:10.331Z" +--- +# Recent Block Trades List + +## API Description[​](https://developers.binance.com/docs/derivatives/options-trading/market-data/Recent-Block-Trade-List) + +Get recent block trades + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/options-trading/market-data/Recent-Block-Trade-List) + +GET `/eapi/v1/blockTrades` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/options-trading/market-data/Recent-Block-Trade-List) + +**5** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/options-trading/market-data/Recent-Block-Trade-List) + +Name + +Type + +Mandatory + + Description + +symbol + +STRING + +NO + +Option trading pair, e.g. BTC-200730-9000-C + +limit + +INT + +NO + +Number of records; Default: 100 and Max: 500 + +## Response Example[​](https://developers.binance.com/docs/derivatives/options-trading/market-data/Recent-Block-Trade-List) + +``` +[ { "id": 1125899906901081078, "tradeId": 389, "symbol": "ETH-250725-1200-P", "price": "342.40", "qty": "-2167.20", "quoteQty": "-4.90", "side": -1, "time": 1733950676483 }, { "id": 1125899906901080972, "tradeId": 161, "symbol": "XRP-250904-0.086-P", "price": "3.0", "qty": "-6.0", "quoteQty": "-2.02", "side": -1, "time": 1733950488444 }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/options-trading/market-data/Recent-Block-Trade-List) +- [HTTP Request](https://developers.binance.com/docs/derivatives/options-trading/market-data/Recent-Block-Trade-List) +- [Request Weight](https://developers.binance.com/docs/derivatives/options-trading/market-data/Recent-Block-Trade-List) +- [Request Parameters](https://developers.binance.com/docs/derivatives/options-trading/market-data/Recent-Block-Trade-List) +- [Response Example](https://developers.binance.com/docs/derivatives/options-trading/market-data/Recent-Block-Trade-List) diff --git a/docs/binance/binance_derivatives/docs_derivatives_options-trading_market-data_Recent-Trades-List.md b/docs/binance/binance_derivatives/docs_derivatives_options-trading_market-data_Recent-Trades-List.md new file mode 100644 index 0000000..b0806e6 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_options-trading_market-data_Recent-Trades-List.md @@ -0,0 +1,56 @@ +--- +title: "Recent Trades List | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/options-trading/market-data/Recent-Trades-List" +fetched_at: "2026-01-27T05:28:10.168Z" +--- +# Recent Trades List + +## API Description[​](https://developers.binance.com/docs/derivatives/options-trading/market-data/Recent-Trades-List) + +Get recent market trades + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/options-trading/market-data/Recent-Trades-List) + +GET `/eapi/v1/trades` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/options-trading/market-data/Recent-Trades-List) + +**5** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/options-trading/market-data/Recent-Trades-List) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +Option trading pair, e.g BTC-200730-9000-C + +limit + +INT + +NO + +Number of records Default:100 Max:500 + +## Response Example[​](https://developers.binance.com/docs/derivatives/options-trading/market-data/Recent-Trades-List) + +``` +[ { "id": 2323857420768529130, "tradeId": 1, // TradeId "symbol": "BTC-251123-126000-C", // Completed trade price "price": "1300", // Completed trade quantity "qty": "0.1", // Completed trade quantity "quoteQty": "130", // Completed trade amount "side": -1, // Completed trade direction(-1 Sell,1 Buy) "time": 1762780453623 // Time }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/options-trading/market-data/Recent-Trades-List) +- [HTTP Request](https://developers.binance.com/docs/derivatives/options-trading/market-data/Recent-Trades-List) +- [Request Weight](https://developers.binance.com/docs/derivatives/options-trading/market-data/Recent-Trades-List) +- [Request Parameters](https://developers.binance.com/docs/derivatives/options-trading/market-data/Recent-Trades-List) +- [Response Example](https://developers.binance.com/docs/derivatives/options-trading/market-data/Recent-Trades-List) diff --git a/docs/binance/binance_derivatives/docs_derivatives_options-trading_market-data_Symbol-Price-Ticker.md b/docs/binance/binance_derivatives/docs_derivatives_options-trading_market-data_Symbol-Price-Ticker.md new file mode 100644 index 0000000..7b17311 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_options-trading_market-data_Symbol-Price-Ticker.md @@ -0,0 +1,48 @@ +--- +title: "Symbol Price Ticker | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/options-trading/market-data/Symbol-Price-Ticker" +fetched_at: "2026-01-27T05:28:10.415Z" +--- +# Index Price + +## API Description[​](https://developers.binance.com/docs/derivatives/options-trading/market-data/Symbol-Price-Ticker) + +Get spot index price for option underlying. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/options-trading/market-data/Symbol-Price-Ticker) + +GET `/eapi/v1/index` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/options-trading/market-data/Symbol-Price-Ticker) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/options-trading/market-data/Symbol-Price-Ticker) + +Name + +Type + +Mandatory + +Description + +underlying + +STRING + +YES + +Spot pair(Option contract underlying asset, e.g BTCUSDT) + +## Response Example[​](https://developers.binance.com/docs/derivatives/options-trading/market-data/Symbol-Price-Ticker) + +``` +{   "time": 1656647305000,   "indexPrice": "105917.75" // Current index price} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/options-trading/market-data/Symbol-Price-Ticker) +- [HTTP Request](https://developers.binance.com/docs/derivatives/options-trading/market-data/Symbol-Price-Ticker) +- [Request Weight](https://developers.binance.com/docs/derivatives/options-trading/market-data/Symbol-Price-Ticker) +- [Request Parameters](https://developers.binance.com/docs/derivatives/options-trading/market-data/Symbol-Price-Ticker) +- [Response Example](https://developers.binance.com/docs/derivatives/options-trading/market-data/Symbol-Price-Ticker) diff --git a/docs/binance/binance_derivatives/docs_derivatives_options-trading_market-data_Test-Connectivity.md b/docs/binance/binance_derivatives/docs_derivatives_options-trading_market-data_Test-Connectivity.md new file mode 100644 index 0000000..6d54018 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_options-trading_market-data_Test-Connectivity.md @@ -0,0 +1,34 @@ +--- +title: "Test Connectivity | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/options-trading/market-data/Test-Connectivity" +fetched_at: "2026-01-27T05:28:10.419Z" +--- +# Test Connectivity + +## API Description[​](https://developers.binance.com/docs/derivatives/options-trading/market-data/Test-Connectivity) + +Test connectivity to the Rest API. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/options-trading/market-data/Test-Connectivity) + +GET `/eapi/v1/ping` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/options-trading/market-data/Test-Connectivity) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/options-trading/market-data/Test-Connectivity) + +NONE + +## Response Example[​](https://developers.binance.com/docs/derivatives/options-trading/market-data/Test-Connectivity) + +``` +{} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/options-trading/market-data/Test-Connectivity) +- [HTTP Request](https://developers.binance.com/docs/derivatives/options-trading/market-data/Test-Connectivity) +- [Request Weight](https://developers.binance.com/docs/derivatives/options-trading/market-data/Test-Connectivity) +- [Request Parameters](https://developers.binance.com/docs/derivatives/options-trading/market-data/Test-Connectivity) +- [Response Example](https://developers.binance.com/docs/derivatives/options-trading/market-data/Test-Connectivity) diff --git a/docs/binance/binance_derivatives/docs_derivatives_options-trading_market-maker-block-trade.md b/docs/binance/binance_derivatives/docs_derivatives_options-trading_market-maker-block-trade.md new file mode 100644 index 0000000..5d7fc76 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_options-trading_market-maker-block-trade.md @@ -0,0 +1,70 @@ +--- +title: "New Block Trade Order | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade" +fetched_at: "2026-01-27T05:28:10.418Z" +--- +# New Block Trade Order (TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade) + +Send in a new block trade order. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade) + +POST `eapi/v1/block/order/create` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade) + +**5** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade) + +Name + +Type + +Mandatory + +Description + +liquidity + +STRING + +YES + +Taker or Maker + +legs + +LIST + +YES + +Max 1 (only single leg supported), list of legs parameters in JSON; example: eapi/v1/block/order/create?orders=\[{"symbol":"BTC-210115-35000-C", "price":"100","quantity":"0.0002","side":"BUY","type":"LIMIT"}\] + +recvWindow + +INT + +NO + +The value cannot be greater than 60000 + +timestamp + +INT + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade) + +``` +{ "blockTradeSettlementKey": "3668822b8-1baa-6a2f-adb8-d3de6289b361", "expireTime": 1730171888109, "liquidity": "TAKER", "status": "RECEIVED", "legs": [ { "symbol": "BNB-241101-700-C", "side": "BUY", "quantity": "1.2", "price": "2.8" } ]} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade) +- [HTTP Request](https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade) +- [Request Weight](https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade) +- [Request Parameters](https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade) +- [Response Example](https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade) diff --git a/docs/binance/binance_derivatives/docs_derivatives_options-trading_market-maker-block-trade_Accept-Block-Trade-Order.md b/docs/binance/binance_derivatives/docs_derivatives_options-trading_market-maker-block-trade_Accept-Block-Trade-Order.md new file mode 100644 index 0000000..9dee690 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_options-trading_market-maker-block-trade_Accept-Block-Trade-Order.md @@ -0,0 +1,60 @@ +--- +title: "Accept Block Trade Order | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Accept-Block-Trade-Order" +fetched_at: "2026-01-27T05:28:10.582Z" +--- +# Accept Block Trade Order (TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Accept-Block-Trade-Order) + +Accept a block trade order + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Accept-Block-Trade-Order) + +POST `/eapi/v1/block/order/execute` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Accept-Block-Trade-Order) + +**5** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Accept-Block-Trade-Order) + +Name + +Type + +Mandatory + + Description + +blockOrderMatchingKey + +STRING + +YES + +recvWindow + +LONG + +NO + +The value cannot be greater than 60000 + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Accept-Block-Trade-Order) + +``` +{ "blockTradeSettlementKey": "7d046e6e-a429-4335-ab9d-6a681febcde5",   "expireTime": 1730172115801, "liquidity": "MAKER", "status": "ACCEPTED", "createTime": 1730170315803, "legs": [ { "symbol": "BNB-241101-700-C", "side": "SELL", "quantity": "1.2", "price": "2.8" } ]} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Accept-Block-Trade-Order) +- [HTTP Request](https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Accept-Block-Trade-Order) +- [Request Weight](https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Accept-Block-Trade-Order) +- [Request Parameters](https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Accept-Block-Trade-Order) +- [Response Example](https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Accept-Block-Trade-Order) diff --git a/docs/binance/binance_derivatives/docs_derivatives_options-trading_market-maker-block-trade_Account-Block-Trade-List.md b/docs/binance/binance_derivatives/docs_derivatives_options-trading_market-maker-block-trade_Account-Block-Trade-List.md new file mode 100644 index 0000000..2e43eda --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_options-trading_market-maker-block-trade_Account-Block-Trade-List.md @@ -0,0 +1,72 @@ +--- +title: "Account Block Trade List | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Account-Block-Trade-List" +fetched_at: "2026-01-27T05:28:10.663Z" +--- +# Account Block Trade List (USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Account-Block-Trade-List) + +Gets block trades for a specific account. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Account-Block-Trade-List) + +GET `/eapi/v1/block/user-trades` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Account-Block-Trade-List) + +**5** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Account-Block-Trade-List) + +Name + +Type + +Mandatory + + Description + +endTime + +LONG + +NO + +startTime + +LONG + +NO + +underlying + +STRING + +NO + +recvWindow + +LONG + +NO + +The value cannot be greater than 60000 + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Account-Block-Trade-List) + +``` +[ { "parentOrderId": "4675011431944499201", "crossType": "USER_BLOCK", "legs": [ { "createTime": 1730170445600, "updateTime": 1730170445600, "symbol": "BNB-241101-700-C", "orderId": "4675011431944499203", "orderPrice": 2.8, "orderQuantity": 1.2, "orderStatus": "FILLED", "executedQty": 1.2, "executedAmount": 3.36, "fee": 0.336, "orderType": "PREV_QUOTED", "orderSide": "BUY", "id": "1125899906900937837", "tradeId": 1, "tradePrice": 2.8, "tradeQty": 1.2, "tradeTime": 1730170445600, "liquidity": "TAKER", "commission": 0.336 } ], "blockTradeSettlementKey": "7d085e6e-a229-2335-ab9d-6a581febcd25" }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Account-Block-Trade-List) +- [HTTP Request](https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Account-Block-Trade-List) +- [Request Weight](https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Account-Block-Trade-List) +- [Request Parameters](https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Account-Block-Trade-List) +- [Response Example](https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Account-Block-Trade-List) diff --git a/docs/binance/binance_derivatives/docs_derivatives_options-trading_market-maker-block-trade_Cancel-Block-Trade-Order.md b/docs/binance/binance_derivatives/docs_derivatives_options-trading_market-maker-block-trade_Cancel-Block-Trade-Order.md new file mode 100644 index 0000000..9af9044 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_options-trading_market-maker-block-trade_Cancel-Block-Trade-Order.md @@ -0,0 +1,60 @@ +--- +title: "Cancel Block Trade Order | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Cancel-Block-Trade-Order" +fetched_at: "2026-01-27T05:28:10.666Z" +--- +# Cancel Block Trade Order (TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Cancel-Block-Trade-Order) + +Cancel a block trade order. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Cancel-Block-Trade-Order) + +DELETE `eapi/v1/block/order/create` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Cancel-Block-Trade-Order) + +**5** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Cancel-Block-Trade-Order) + +Name + +Type + +Mandatory + + Description + +blockOrderMatchingKey + +STRING + +YES + +recvWindow + +INT + +NO + +The value cannot be greater than 60000 + +timestamp + +INT + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Cancel-Block-Trade-Order) + +``` +{} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Cancel-Block-Trade-Order) +- [HTTP Request](https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Cancel-Block-Trade-Order) +- [Request Weight](https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Cancel-Block-Trade-Order) +- [Request Parameters](https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Cancel-Block-Trade-Order) +- [Response Example](https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Cancel-Block-Trade-Order) diff --git a/docs/binance/binance_derivatives/docs_derivatives_options-trading_market-maker-block-trade_Extend-Block-Trade-Order.md b/docs/binance/binance_derivatives/docs_derivatives_options-trading_market-maker-block-trade_Extend-Block-Trade-Order.md new file mode 100644 index 0000000..7f56236 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_options-trading_market-maker-block-trade_Extend-Block-Trade-Order.md @@ -0,0 +1,60 @@ +--- +title: "Extend Block Trade Order | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Extend-Block-Trade-Order" +fetched_at: "2026-01-27T05:28:10.808Z" +--- +# Extend Block Trade Order (TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Extend-Block-Trade-Order) + +Extends a block trade expire time by 30 mins from the current time. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Extend-Block-Trade-Order) + +PUT `/eapi/v1/block/order/create`  + +## Request Weight[​](https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Extend-Block-Trade-Order) + +**5** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Extend-Block-Trade-Order) + +Name + +Type + +Mandatory + + Description + +blockOrderMatchingKey + +STRING + +YES + +recvWindow + +INT + +NO + +The value cannot be greater than 60000 + +timestamp + +INT + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Extend-Block-Trade-Order) + +``` +{ "blockTradeSettlementKey": "3668822b8-1baa-6a2f-adb8-d3de6289b361",   "expireTime": 1730172007000, "liquidity": "TAKER", "status": "RECEIVED", "createTime": 1730170088111, "legs": [ { "symbol": "BNB-241101-700-C", "side": "BUY", "quantity": "1.2", "price": "2.8" } ]} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Extend-Block-Trade-Order) +- [HTTP Request](https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Extend-Block-Trade-Order) +- [Request Weight](https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Extend-Block-Trade-Order) +- [Request Parameters](https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Extend-Block-Trade-Order) +- [Response Example](https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Extend-Block-Trade-Order) diff --git a/docs/binance/binance_derivatives/docs_derivatives_options-trading_market-maker-block-trade_Query-Block-Trade-Detail.md b/docs/binance/binance_derivatives/docs_derivatives_options-trading_market-maker-block-trade_Query-Block-Trade-Detail.md new file mode 100644 index 0000000..997dbda --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_options-trading_market-maker-block-trade_Query-Block-Trade-Detail.md @@ -0,0 +1,60 @@ +--- +title: "Query Block Trade Details | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Query-Block-Trade-Detail" +fetched_at: "2026-01-27T05:28:10.836Z" +--- +# Query Block Trade Details (USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Query-Block-Trade-Detail) + +Query block trade details; returns block trade details from counterparty's perspective. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Query-Block-Trade-Detail) + +GET `/eapi/v1/block/order/execute` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Query-Block-Trade-Detail) + +**5** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Query-Block-Trade-Detail) + +Name + +Type + +Mandatory + + Description + +blockOrderMatchingKey + +STRING + +YES + +recvWindow + +LONG + +NO + +The value cannot be greater than 60000 + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Query-Block-Trade-Detail) + +``` +{ "blockTradeSettlementKey": "12b96c28-ba05-8906-c89t-703215cfb2e6", "expireTime": 1730171860460, "liquidity": "MAKER", "status": "RECEIVED", "createTime": 1730170060462, "legs": [ { "symbol": "BNB-241101-700-C", "side": "SELL", "quantity": "1.66", "price": "20" } ]} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Query-Block-Trade-Detail) +- [HTTP Request](https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Query-Block-Trade-Detail) +- [Request Weight](https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Query-Block-Trade-Detail) +- [Request Parameters](https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Query-Block-Trade-Detail) +- [Response Example](https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Query-Block-Trade-Detail) diff --git a/docs/binance/binance_derivatives/docs_derivatives_options-trading_market-maker-block-trade_Query-Block-Trade-Order.md b/docs/binance/binance_derivatives/docs_derivatives_options-trading_market-maker-block-trade_Query-Block-Trade-Order.md new file mode 100644 index 0000000..f1458e3 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_options-trading_market-maker-block-trade_Query-Block-Trade-Order.md @@ -0,0 +1,80 @@ +--- +title: "Query Block Trade Order | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Query-Block-Trade-Order" +fetched_at: "2026-01-27T05:28:10.925Z" +--- +# Query Block Trade Order (TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Query-Block-Trade-Order) + +Check block trade order status. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Query-Block-Trade-Order) + +GET `/eapi/v1/block/order/orders` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Query-Block-Trade-Order) + +**5** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Query-Block-Trade-Order) + +Name + +Type + +Mandatory + + Description + +blockOrderMatchingKey + +STRING + +NO + +If specified, returns the specific block trade associated with the blockOrderMatchingKey + +endTime + +LONG + +NO + +startTime + +LONG + +NO + +underlying + +STRING + +NO + +recvWindow + +LONG + +NO + +The value cannot be greater than 60000 + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Query-Block-Trade-Order) + +``` +[ { "blockTradeSettlementKey": "7d046e6e-a429-4335-ab9d-6a681febcde5", "expireTime": 1730172115801, "liquidity": "TAKER", "status": "RECEIVED", "createTime": 1730170315803, "legs": [ { "symbol": "BNB-241101-700-C", "side": "BUY", "quantity": "1.2", "price": "2.8" } ] }, { "blockTradeSettlementKey": "28b96c28-ba05-6906-a47c-703215cfbfe6", "expireTime": 1730171860460, "liquidity": "TAKER", "status": "RECEIVED", "createTime": 1730170060462, "legs": [ { "symbol": "BNB-241101-700-C", "side": "BUY", "quantity": "1.66", "price": "20" } ] }]   +``` + +- [API Description](https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Query-Block-Trade-Order) +- [HTTP Request](https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Query-Block-Trade-Order) +- [Request Weight](https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Query-Block-Trade-Order) +- [Request Parameters](https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Query-Block-Trade-Order) +- [Response Example](https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Query-Block-Trade-Order) diff --git a/docs/binance/binance_derivatives/docs_derivatives_options-trading_market-maker-endpoints.md b/docs/binance/binance_derivatives/docs_derivatives_options-trading_market-maker-endpoints.md new file mode 100644 index 0000000..07ae97f --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_options-trading_market-maker-endpoints.md @@ -0,0 +1,60 @@ +--- +title: "Get Market Maker Protection Config | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints" +fetched_at: "2026-01-27T05:28:10.914Z" +--- +# Get Market Maker Protection Config (TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints) + +Get config for MMP. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints) + +GET `/eapi/v1/mmp (HMAC SHA256)` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints) + +Name + +Type + +Mandatory + +Description + +underlying + +STRING + +TRUE + +underlying, e.g BTCUSDT + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints) + +``` +{ "underlyingId": 2, "underlying": "BTCUSDT", "windowTimeInMilliseconds": 3000, "frozenTimeInMilliseconds": 300000, "qtyLimit": "2", "deltaLimit": "2.3", "lastTriggerTime": 0} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints) +- [HTTP Request](https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints) +- [Request Weight](https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints) +- [Request Parameters](https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints) +- [Response Example](https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints) diff --git a/docs/binance/binance_derivatives/docs_derivatives_options-trading_market-maker-endpoints_Auto-Cancel-All-Open-Orders-Heartbeat.md b/docs/binance/binance_derivatives/docs_derivatives_options-trading_market-maker-endpoints_Auto-Cancel-All-Open-Orders-Heartbeat.md new file mode 100644 index 0000000..fb51011 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_options-trading_market-maker-endpoints_Auto-Cancel-All-Open-Orders-Heartbeat.md @@ -0,0 +1,62 @@ +--- +title: "Auto Cancel All Open Orders Heartbeat | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints/Auto-Cancel-All-Open-Orders-Heartbeat" +fetched_at: "2026-01-27T05:28:11.063Z" +--- +# Auto-Cancel All Open Orders (Kill-Switch) Heartbeat (TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints/Auto-Cancel-All-Open-Orders-Heartbeat) + +This endpoint resets the time from which the countdown will begin to the time this messaged is received. It should be called repeatedly as heartbeats. Multiple heartbeats can be updated at once by specifying the underlying symbols as a list (ex. BTCUSDT,ETHUSDT) in the underlyings parameter. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints/Auto-Cancel-All-Open-Orders-Heartbeat) + +POST `/eapi/v1/countdownCancelAllHeartBeat` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints/Auto-Cancel-All-Open-Orders-Heartbeat) + +10 + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints/Auto-Cancel-All-Open-Orders-Heartbeat) + +Name + +Type + +Mandatory + +Description + +underlyings + +STRING + +YES + +Option Underlying Symbols, e.g BTCUSDT,ETHUSDT + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +> - The response will only include underlying symbols where the heartbeat has been successfully updated. + +## Response Example[​](https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints/Auto-Cancel-All-Open-Orders-Heartbeat) + +``` +{ "underlyings":["BTCUSDT","ETHUSDT"]} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints/Auto-Cancel-All-Open-Orders-Heartbeat) +- [HTTP Request](https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints/Auto-Cancel-All-Open-Orders-Heartbeat) +- [Request Weight](https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints/Auto-Cancel-All-Open-Orders-Heartbeat) +- [Request Parameters](https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints/Auto-Cancel-All-Open-Orders-Heartbeat) +- [Response Example](https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints/Auto-Cancel-All-Open-Orders-Heartbeat) diff --git a/docs/binance/binance_derivatives/docs_derivatives_options-trading_market-maker-endpoints_Get-Auto-Cancel-All-Open-Orders-Config.md b/docs/binance/binance_derivatives/docs_derivatives_options-trading_market-maker-endpoints_Get-Auto-Cancel-All-Open-Orders-Config.md new file mode 100644 index 0000000..18e93d3 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_options-trading_market-maker-endpoints_Get-Auto-Cancel-All-Open-Orders-Config.md @@ -0,0 +1,62 @@ +--- +title: "Get Auto Cancel All Open Orders Config | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints/Get-Auto-Cancel-All-Open-Orders-Config" +fetched_at: "2026-01-27T05:28:11.146Z" +--- +# Get Auto-Cancel All Open Orders (Kill-Switch) Config (TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints/Get-Auto-Cancel-All-Open-Orders-Config) + +This endpoint returns the auto-cancel parameters for each underlying symbol. Note only active auto-cancel parameters will be returned, if countdownTime is set to 0 (ie. countdownTime has been turned off), the underlying symbol and corresponding countdownTime parameter will not be returned in the response. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints/Get-Auto-Cancel-All-Open-Orders-Config) + +GET `/eapi/v1/countdownCancelAll`  + +## Request Weight[​](https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints/Get-Auto-Cancel-All-Open-Orders-Config) + +1 + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints/Get-Auto-Cancel-All-Open-Orders-Config) + +Name + +Type + +Mandatory + +Description + +underlying + +STRING + +NO + +Option underlying, e.g BTCUSDT + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +> - countdownTime = 0 means the function is disabled. + +## Response Example[​](https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints/Get-Auto-Cancel-All-Open-Orders-Config) + +``` +{ "underlying": "ETHUSDT", "countdownTime": 100000} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints/Get-Auto-Cancel-All-Open-Orders-Config) +- [HTTP Request](https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints/Get-Auto-Cancel-All-Open-Orders-Config) +- [Request Weight](https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints/Get-Auto-Cancel-All-Open-Orders-Config) +- [Request Parameters](https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints/Get-Auto-Cancel-All-Open-Orders-Config) +- [Response Example](https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints/Get-Auto-Cancel-All-Open-Orders-Config) diff --git a/docs/binance/binance_derivatives/docs_derivatives_options-trading_market-maker-endpoints_Reset-Market-Maker-Protection-Config.md b/docs/binance/binance_derivatives/docs_derivatives_options-trading_market-maker-endpoints_Reset-Market-Maker-Protection-Config.md new file mode 100644 index 0000000..9f16aaa --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_options-trading_market-maker-endpoints_Reset-Market-Maker-Protection-Config.md @@ -0,0 +1,60 @@ +--- +title: "Reset Market Maker Protection Config | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints/Reset-Market-Maker-Protection-Config" +fetched_at: "2026-01-27T05:28:11.171Z" +--- +# Reset Market Maker Protection Config (TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints/Reset-Market-Maker-Protection-Config) + +Reset MMP, start MMP order again. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints/Reset-Market-Maker-Protection-Config) + +POST `/eapi/v1/mmpReset` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints/Reset-Market-Maker-Protection-Config) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints/Reset-Market-Maker-Protection-Config) + +Name + +Type + +Mandatory + +Description + +underlying + +STRING + +TRUE + +underlying, e.g BTCUSDT + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints/Reset-Market-Maker-Protection-Config) + +``` +{ "underlyingId": 2, "underlying": "BTCUSDT", "windowTimeInMilliseconds": 3000, "frozenTimeInMilliseconds": 300000, "qtyLimit": "2", "deltaLimit": "2.3", "lastTriggerTime": 0} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints/Reset-Market-Maker-Protection-Config) +- [HTTP Request](https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints/Reset-Market-Maker-Protection-Config) +- [Request Weight](https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints/Reset-Market-Maker-Protection-Config) +- [Request Parameters](https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints/Reset-Market-Maker-Protection-Config) +- [Response Example](https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints/Reset-Market-Maker-Protection-Config) diff --git a/docs/binance/binance_derivatives/docs_derivatives_options-trading_market-maker-endpoints_Set-Auto-Cancel-All-Open-Orders-Config.md b/docs/binance/binance_derivatives/docs_derivatives_options-trading_market-maker-endpoints_Set-Auto-Cancel-All-Open-Orders-Config.md new file mode 100644 index 0000000..08b583c --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_options-trading_market-maker-endpoints_Set-Auto-Cancel-All-Open-Orders-Config.md @@ -0,0 +1,72 @@ +--- +title: "Set Auto Cancel All Open Orders Config | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints/Set-Auto-Cancel-All-Open-Orders-Config" +fetched_at: "2026-01-27T05:28:11.323Z" +--- +# Set Auto-Cancel All Open Orders (Kill-Switch) Config (TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints/Set-Auto-Cancel-All-Open-Orders-Config) + +This endpoint sets the parameters of the auto-cancel feature which cancels all open orders (both market maker protection and non market maker protection order types) of the underlying symbol at the end of the specified countdown time period if no heartbeat message is sent. After the countdown time period, all open orders will be cancelled and new orders will be rejected with error code -2010 until either a heartbeat message is sent or the auto-cancel feature is turned off by setting countdownTime to 0. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints/Set-Auto-Cancel-All-Open-Orders-Config) + +POST `/eapi/v1/countdownCancelAll` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints/Set-Auto-Cancel-All-Open-Orders-Config) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints/Set-Auto-Cancel-All-Open-Orders-Config) + +Name + +Type + +Mandatory + +Description + +underlying + +STRING + +YES + +Option underlying, e.g BTCUSDT + +countdownTime + +LONG + +YES + +Countdown time in milliseconds (ex. 1,000 for 1 second). 0 to disable the timer. Negative values (ex. -10000) are not accepted. Minimum acceptable value is 5,000  + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +> - This rest endpoint sets up the parameters to cancel your open orders in case of an outage or disconnection. +> - Example usage: Call this endpoint with a countdownTime value of 10000 (10 seconds) to turn on the auto-cancel feature. If the corresponding countdownCancelAllHeartBeat endpoint is not called within 10 seconds with the specified underlying symbol, all open 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 1000 milliseconds, **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. + +## Response Example[​](https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints/Set-Auto-Cancel-All-Open-Orders-Config) + +``` +{  "underlying": "ETHUSDT",  "countdownTime": 30000} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints/Set-Auto-Cancel-All-Open-Orders-Config) +- [HTTP Request](https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints/Set-Auto-Cancel-All-Open-Orders-Config) +- [Request Weight](https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints/Set-Auto-Cancel-All-Open-Orders-Config) +- [Request Parameters](https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints/Set-Auto-Cancel-All-Open-Orders-Config) +- [Response Example](https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints/Set-Auto-Cancel-All-Open-Orders-Config) diff --git a/docs/binance/binance_derivatives/docs_derivatives_options-trading_market-maker-endpoints_Set-Market-Maker-Protection-Config.md b/docs/binance/binance_derivatives/docs_derivatives_options-trading_market-maker-endpoints_Set-Market-Maker-Protection-Config.md new file mode 100644 index 0000000..dde3383 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_options-trading_market-maker-endpoints_Set-Market-Maker-Protection-Config.md @@ -0,0 +1,92 @@ +--- +title: "Set Market Maker Protection Config | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints/Set-Market-Maker-Protection-Config" +fetched_at: "2026-01-27T05:28:11.379Z" +--- +# Set Market Maker Protection Config (TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints/Set-Market-Maker-Protection-Config) + +Set config for MMP. Market Maker Protection(MMP) is a set of protection mechanism for option market maker, this mechanism is able to prevent mass trading in short period time. Once market maker's account branches the threshold, the Market Maker Protection will be triggered. When Market Maker Protection triggers, all the current MMP orders will be canceled, new MMP orders will be rejected. Market maker can use this time to reevaluate market and modify order price. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints/Set-Market-Maker-Protection-Config) + +POST `/eapi/v1/mmpSet` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints/Set-Market-Maker-Protection-Config) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints/Set-Market-Maker-Protection-Config) + +Name + +Type + +Mandatory + +Description + +underlying + +STRING + +TRUE + +underlying, e.g BTCUSDT + +windowTimeInMilliseconds + +LONG + +TRUE + +MMP Interval in milliseconds; Range (0,5000\] + +frozenTimeInMilliseconds + +LONG + +TRUE + +MMP frozen time in milliseconds, if set to 0 manual reset is required + +qtyLimit + +DECIMAL + +TRUE + +quantity limit + +deltaLimit + +DECIMAL + +TRUE + +net delta limit + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints/Set-Market-Maker-Protection-Config) + +``` +{ "underlyingId": 2, "underlying": "BTCUSDT", "windowTimeInMilliseconds": 3000, "frozenTimeInMilliseconds": 300000, "qtyLimit": "2", "deltaLimit": "2.3", "lastTriggerTime": 0} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints/Set-Market-Maker-Protection-Config) +- [HTTP Request](https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints/Set-Market-Maker-Protection-Config) +- [Request Weight](https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints/Set-Market-Maker-Protection-Config) +- [Request Parameters](https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints/Set-Market-Maker-Protection-Config) +- [Response Example](https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints/Set-Market-Maker-Protection-Config) diff --git a/docs/binance/binance_derivatives/docs_derivatives_options-trading_trade.md b/docs/binance/binance_derivatives/docs_derivatives_options-trading_trade.md new file mode 100644 index 0000000..31e8065 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_options-trading_trade.md @@ -0,0 +1,145 @@ +--- +title: "New Order | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/options-trading/trade" +fetched_at: "2026-01-27T05:28:11.463Z" +--- +# New Order (TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/options-trading/trade) + +Send a new order. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/options-trading/trade) + +POST `/eapi/v1/order` + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/options-trading/trade) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +Option trading pair, e.g BTC-200730-9000-C + +side + +ENUM + +YES + +Buy/sell direction: SELL, BUY + +type + +ENUM + +YES + +Order Type: LIMIT(only support limit) + +quantity + +DECIMAL + +YES + +Order Quantity + +price + +DECIMAL + +NO + +Order Price + +timeInForce + +ENUM + +NO + +Time in force method(Default GTC) + +reduceOnly + +BOOLEAN + +NO + +Reduce Only(Default false) + +postOnly + +BOOLEAN + +NO + +Post Only(Default false) + +newOrderRespType + +ENUM + +NO + +"ACK", "RESULT", Default "ACK" + +clientOrderId + +STRING + +NO + +User-defined order ID cannot be repeated in pending orders + +isMmp + +BOOLEAN + +NO + +is market maker protection order, true/false + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +Some parameters are mandatory depending on the order type as follows: + +Type + +Mandatory parameters + +LIMIT + +timeInForce, quantity, price + +## Response Example[​](https://developers.binance.com/docs/derivatives/options-trading/trade) + +``` +{ "orderId": 4611875134427365377, // System order number "symbol": "BTC-200730-9000-C", // Option trading pair "price": "100", // Order Price "quantity": "1", // Order Quantity "executedQty": "0", // Number of executed quantity "side": "BUY", // Buy/sell direction "type": "LIMIT", // Order type "timeInForce": "GTC", // Time in force method "reduceOnly": false, // Order is reduce only Y/N "createTime": 1592465880683, // Order Time "updateTime": 1566818724722, // Update time "status": "NEW", // Order status "avgPrice": "0", // Average price of completed trade "source": "API",  "clientOrderId": "", // Client order ID "priceScale": 2, "quantityScale": 2, "optionSide": "CALL", "quoteAsset": "USDT", "mmp": false} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/options-trading/trade) +- [HTTP Request](https://developers.binance.com/docs/derivatives/options-trading/trade) +- [Request Parameters](https://developers.binance.com/docs/derivatives/options-trading/trade) +- [Response Example](https://developers.binance.com/docs/derivatives/options-trading/trade) diff --git a/docs/binance/binance_derivatives/docs_derivatives_options-trading_trade_Account-Trade-List.md b/docs/binance/binance_derivatives/docs_derivatives_options-trading_trade_Account-Trade-List.md new file mode 100644 index 0000000..3b8b468 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_options-trading_trade_Account-Trade-List.md @@ -0,0 +1,92 @@ +--- +title: "Account Trade List | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/options-trading/trade/Account-Trade-List" +fetched_at: "2026-01-27T05:28:11.430Z" +--- +# Account Trade List (USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/options-trading/trade/Account-Trade-List) + +Get trades for a specific account and symbol. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/options-trading/trade/Account-Trade-List) + +`GET /eapi/v1/userTrades (HMAC SHA256)` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/options-trading/trade/Account-Trade-List) + +**5** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/options-trading/trade/Account-Trade-List) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +NO + +Option symbol, e.g BTC-200730-9000-C + +fromId + +LONG + +NO + +Trade id to fetch from. Default gets most recent trades, e.g 4611875134427365376 + +startTime + +LONG + +NO + +Start time, e.g 1593511200000 + +endTime + +LONG + +NO + +End time, e.g 1593512200000 + +limit + +INT + +NO + +Default 100; max 1000 + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/options-trading/trade/Account-Trade-List) + +``` +[ { "id": 4611875134427365377, // unique id "tradeId": 239, // trade id "orderId": 4611875134427365377, // order id "symbol": "BTC-200730-9000-C", // option symbol "price": "100", // trade price "quantity": "1", // trade quantity "fee": "0", // fee(negative is fee deduction) "realizedProfit": "0.00000000",     // realized profit/loss "side": "BUY", // order side "type": "LIMIT", // order type "liquidity": "TAKER", // TAKER or MAKER     "time": 1592465880683 // trade time "priceScale": 2, "quantityScale": 2, "optionSide": "CALL", "quoteAsset": "USDT" } ] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/options-trading/trade/Account-Trade-List) +- [HTTP Request](https://developers.binance.com/docs/derivatives/options-trading/trade/Account-Trade-List) +- [Request Weight](https://developers.binance.com/docs/derivatives/options-trading/trade/Account-Trade-List) +- [Request Parameters](https://developers.binance.com/docs/derivatives/options-trading/trade/Account-Trade-List) +- [Response Example](https://developers.binance.com/docs/derivatives/options-trading/trade/Account-Trade-List) diff --git a/docs/binance/binance_derivatives/docs_derivatives_options-trading_trade_Cancel-All-Option-Orders-By-Underlying.md b/docs/binance/binance_derivatives/docs_derivatives_options-trading_trade_Cancel-All-Option-Orders-By-Underlying.md new file mode 100644 index 0000000..6f308d9 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_options-trading_trade_Cancel-All-Option-Orders-By-Underlying.md @@ -0,0 +1,60 @@ +--- +title: "Cancel All Option Orders By Underlying | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/options-trading/trade/Cancel-All-Option-Orders-By-Underlying" +fetched_at: "2026-01-27T05:28:11.628Z" +--- +# Cancel All Option Orders By Underlying (TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/options-trading/trade/Cancel-All-Option-Orders-By-Underlying) + +Cancel all active orders on specified underlying. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/options-trading/trade/Cancel-All-Option-Orders-By-Underlying) + +DELETE `/eapi/v1/allOpenOrdersByUnderlying` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/options-trading/trade/Cancel-All-Option-Orders-By-Underlying) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/options-trading/trade/Cancel-All-Option-Orders-By-Underlying) + +Name + +Type + +Mandatory + +Description + +underlying + +STRING + +YES + +Option underlying, e.g BTCUSDT + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/options-trading/trade/Cancel-All-Option-Orders-By-Underlying) + +``` +{ "code": 0, "msg": "success",} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/options-trading/trade/Cancel-All-Option-Orders-By-Underlying) +- [HTTP Request](https://developers.binance.com/docs/derivatives/options-trading/trade/Cancel-All-Option-Orders-By-Underlying) +- [Request Weight](https://developers.binance.com/docs/derivatives/options-trading/trade/Cancel-All-Option-Orders-By-Underlying) +- [Request Parameters](https://developers.binance.com/docs/derivatives/options-trading/trade/Cancel-All-Option-Orders-By-Underlying) +- [Response Example](https://developers.binance.com/docs/derivatives/options-trading/trade/Cancel-All-Option-Orders-By-Underlying) diff --git a/docs/binance/binance_derivatives/docs_derivatives_options-trading_trade_Cancel-Multiple-Option-Orders.md b/docs/binance/binance_derivatives/docs_derivatives_options-trading_trade_Cancel-Multiple-Option-Orders.md new file mode 100644 index 0000000..930f9ce --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_options-trading_trade_Cancel-Multiple-Option-Orders.md @@ -0,0 +1,78 @@ +--- +title: "Cancel Multiple Option Orders | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/options-trading/trade/Cancel-Multiple-Option-Orders" +fetched_at: "2026-01-27T05:28:11.687Z" +--- +# Cancel Multiple Option Orders (TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/options-trading/trade/Cancel-Multiple-Option-Orders) + +Cancel multiple orders. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/options-trading/trade/Cancel-Multiple-Option-Orders) + +DELETE `/eapi/v1/batchOrders` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/options-trading/trade/Cancel-Multiple-Option-Orders) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/options-trading/trade/Cancel-Multiple-Option-Orders) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +Option trading pair, e.g BTC-200730-9000-C + +orderIds + +LIST + +NO + +Order ID, e.g \[4611875134427365377,4611875134427365378\] + +clientOrderIds + +LIST + +NO + +User-defined order ID, e.g \["my\_id\_1","my\_id\_2"\] + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +> - At least one instance of `orderId` and `clientOrderId` must be sent. + +## Response Example[​](https://developers.binance.com/docs/derivatives/options-trading/trade/Cancel-Multiple-Option-Orders) + +``` +[ { "orderId": 4611875134427365377, // System order number "symbol": "BTC-200730-9000-C", // Option trading pair "price": "100", // Order Price "quantity": "1", // Order Quantity "executedQty": "0", // Number of completed quantity "side": "BUY", // Buy/sell direction "type": "LIMIT", // Order type "timeInForce": "GTC", // Time in force method "reduceOnly": false, // Order is reduce only Y/N "createTime": 1592465880683, // Order Time "updateTime": 1566818724722, // Update time "status": "NEW", // Order status "avgPrice": "0", // Average price of completed trade "source": "API", "clientOrderId": "", // Client order ID "priceScale": 3, "quantityScale": 4, "optionSide": "CALL", "quoteAsset": "USDT", "mmp": false  }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/options-trading/trade/Cancel-Multiple-Option-Orders) +- [HTTP Request](https://developers.binance.com/docs/derivatives/options-trading/trade/Cancel-Multiple-Option-Orders) +- [Request Weight](https://developers.binance.com/docs/derivatives/options-trading/trade/Cancel-Multiple-Option-Orders) +- [Request Parameters](https://developers.binance.com/docs/derivatives/options-trading/trade/Cancel-Multiple-Option-Orders) +- [Response Example](https://developers.binance.com/docs/derivatives/options-trading/trade/Cancel-Multiple-Option-Orders) diff --git a/docs/binance/binance_derivatives/docs_derivatives_options-trading_trade_Cancel-Option-Order.md b/docs/binance/binance_derivatives/docs_derivatives_options-trading_trade_Cancel-Option-Order.md new file mode 100644 index 0000000..421cfc7 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_options-trading_trade_Cancel-Option-Order.md @@ -0,0 +1,75 @@ +--- +title: "Cancel Option Order | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/options-trading/trade/Cancel-Option-Order" +fetched_at: "2026-01-27T05:28:11.820Z" +--- +# Cancel Option Order (TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/options-trading/trade/Cancel-Option-Order) + +Cancel an active order. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/options-trading/trade/Cancel-Option-Order) + +DELETE `/eapi/v1/order` + +**Weight:** **1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/options-trading/trade/Cancel-Option-Order) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +Option trading pair, e.g BTC-200730-9000-C + +orderId + +LONG + +NO + +Order ID, e.g 4611875134427365377 + +clientOrderId + +STRING + +NO + +User-defined order ID, e.g 10000 + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +> - At least one instance of `orderId` and `clientOrderId` must be sent. + +## Response Example[​](https://developers.binance.com/docs/derivatives/options-trading/trade/Cancel-Option-Order) + +``` +{ "orderId": 4611875134427365377, // System order number "symbol": "BTC-200730-9000-C", // Option trading pair "price": "100", // Order Price "quantity": "1", // Order Quantity "executedQty": "0", // Number of executed quantity "side": "BUY", // Buy/sell direction "type": "LIMIT", // Order type "timeInForce": "GTC", // Time in force method "reduceOnly": false, // Order is reduce only Y/N "createDate": 1592465880683, // Order Time "updateTime": 1566818724722, // Update time "status": "ACCEPTED", // Order status "avgPrice": "0", // Average price of completed trade "source": "API", "clientOrderId": "",                // Client order ID "priceScale": 4, "quantityScale": 4, "optionSide": "CALL", "quoteAsset": "USDT", "mmp": false} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/options-trading/trade/Cancel-Option-Order) +- [HTTP Request](https://developers.binance.com/docs/derivatives/options-trading/trade/Cancel-Option-Order) +- [Request Parameters](https://developers.binance.com/docs/derivatives/options-trading/trade/Cancel-Option-Order) +- [Response Example](https://developers.binance.com/docs/derivatives/options-trading/trade/Cancel-Option-Order) diff --git a/docs/binance/binance_derivatives/docs_derivatives_options-trading_trade_Cancel-all-Option-orders-on-specific-symbol.md b/docs/binance/binance_derivatives/docs_derivatives_options-trading_trade_Cancel-all-Option-orders-on-specific-symbol.md new file mode 100644 index 0000000..d36f1d9 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_options-trading_trade_Cancel-all-Option-orders-on-specific-symbol.md @@ -0,0 +1,60 @@ +--- +title: "Cancel All Option Orders On Specific Symbol | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/options-trading/trade/Cancel-all-Option-orders-on-specific-symbol" +fetched_at: "2026-01-27T05:28:11.719Z" +--- +# Cancel all Option orders on specific symbol (TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/options-trading/trade/Cancel-all-Option-orders-on-specific-symbol) + +Cancel all active order on a symbol. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/options-trading/trade/Cancel-all-Option-orders-on-specific-symbol) + +DELETE `/eapi/v1/allOpenOrders` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/options-trading/trade/Cancel-all-Option-orders-on-specific-symbol) + +**5** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/options-trading/trade/Cancel-all-Option-orders-on-specific-symbol) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +Option trading pair, e.g BTC-200730-9000-C + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/options-trading/trade/Cancel-all-Option-orders-on-specific-symbol) + +``` +{ "code": "0", "msg": "success"} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/options-trading/trade/Cancel-all-Option-orders-on-specific-symbol) +- [HTTP Request](https://developers.binance.com/docs/derivatives/options-trading/trade/Cancel-all-Option-orders-on-specific-symbol) +- [Request Weight](https://developers.binance.com/docs/derivatives/options-trading/trade/Cancel-all-Option-orders-on-specific-symbol) +- [Request Parameters](https://developers.binance.com/docs/derivatives/options-trading/trade/Cancel-all-Option-orders-on-specific-symbol) +- [Response Example](https://developers.binance.com/docs/derivatives/options-trading/trade/Cancel-all-Option-orders-on-specific-symbol) diff --git a/docs/binance/binance_derivatives/docs_derivatives_options-trading_trade_Option-Position-Information.md b/docs/binance/binance_derivatives/docs_derivatives_options-trading_trade_Option-Position-Information.md new file mode 100644 index 0000000..0baead2 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_options-trading_trade_Option-Position-Information.md @@ -0,0 +1,60 @@ +--- +title: "Option Position Information | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/options-trading/trade/Option-Position-Information" +fetched_at: "2026-01-27T05:28:11.882Z" +--- +# Option Position Information (USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/options-trading/trade/Option-Position-Information) + +Get current position information. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/options-trading/trade/Option-Position-Information) + +GET `/eapi/v1/position` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/options-trading/trade/Option-Position-Information) + +**5** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/options-trading/trade/Option-Position-Information) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +NO + +Option trading pair, e.g BTC-200730-9000-C + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/options-trading/trade/Option-Position-Information) + +``` +[ { "entryPrice": "1000", // Average entry price "symbol": "BTC-200730-9000-C", // Option trading pair "side": "SHORT", // Position direction "quantity": "-0.1", // Number of positions (positive numbers represent long positions, negative number represent short positions) "markValue": "105.00138", // Current market value "unrealizedPNL": "-5.00138", // Unrealized profit/loss "markPrice": "1050.0138", // Mark price "strikePrice": "9000", // Strike price "expiryDate": 1593511200000, // Exercise time "priceScale": 2, "quantityScale": 2, "optionSide": "CALL", // option type "quoteAsset": "USDT", // quote asset "time": 1762872654561, // last update time "bidQuantity": "0.0000", // buy order qty "askQuantity": "0.0000" // sell order qty }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/options-trading/trade/Option-Position-Information) +- [HTTP Request](https://developers.binance.com/docs/derivatives/options-trading/trade/Option-Position-Information) +- [Request Weight](https://developers.binance.com/docs/derivatives/options-trading/trade/Option-Position-Information) +- [Request Parameters](https://developers.binance.com/docs/derivatives/options-trading/trade/Option-Position-Information) +- [Response Example](https://developers.binance.com/docs/derivatives/options-trading/trade/Option-Position-Information) diff --git a/docs/binance/binance_derivatives/docs_derivatives_options-trading_trade_Place-Multiple-Orders.md b/docs/binance/binance_derivatives/docs_derivatives_options-trading_trade_Place-Multiple-Orders.md new file mode 100644 index 0000000..633052c --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_options-trading_trade_Place-Multiple-Orders.md @@ -0,0 +1,175 @@ +--- +title: "Place Multiple Orders | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/options-trading/trade/Place-Multiple-Orders" +fetched_at: "2026-01-27T05:28:11.943Z" +--- +# Place Multiple Orders(TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/options-trading/trade/Place-Multiple-Orders) + +Send multiple option orders. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/options-trading/trade/Place-Multiple-Orders) + +POST `/eapi/v1/batchOrders` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/options-trading/trade/Place-Multiple-Orders) + +**5** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/options-trading/trade/Place-Multiple-Orders) + +Name + +Type + +Mandatory + +Description + +orders + +LIST + +YES + +order list. Max 10 orders + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +**Where `orders` is the list of order parameters in JSON:** + +- **example:** /eapi/v1/batchOrders?orders=\[{"symbol":"BTC-210115-35000-C", "price":"100","quantity":"0.0002","side":"BUY","type":"LIMIT"}\] + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +Option trading pair, e.g BTC-200730-9000-C + +side + +ENUM + +YES + +Buy/sell direction: SELL, BUY + +type + +ENUM + +YES + +Order Type: LIMIT (Only support LIMIT) + +quantity + +DECIMAL + +YES + +Order Quantity + +price + +DECIMAL + +NO + +Order Price + +timeInForce + +ENUM + +NO + +Time in force method(Default GTC) + +reduceOnly + +BOOLEAN + +NO + +Reduce Only(Default false) + +postOnly + +BOOLEAN + +NO + +Post Only(Default false) + +newOrderRespType + +ENUM + +NO + +"ACK", "RESULT", Default "ACK" + +clientOrderId + +STRING + +NO + +User-defined order ID cannot be repeated in pending orders + +isMmp + +BOOLEAN + +NO + +is market maker protection order, true/false + +  + +Some parameters are mandatory depending on the order type as follows: + +Type + +Mandatory parameters + +LIMIT + +timeInForce, quantity, price + +> - Parameter rules are same with New Order +> - Batch orders are processed concurrently, and the order of matching is not guaranteed. + +## Response Example[​](https://developers.binance.com/docs/derivatives/options-trading/trade/Place-Multiple-Orders) + +``` +[ { "orderId": 4611875134427365377, // System order number "symbol": "BTC-200730-9000-C", // Option trading pair "price": "100", // Order Price "quantity": "1", // Order Quantity "executedQty": "0", // Number of executed quantity "side": "BUY", // Buy/sell direction "type": "LIMIT", // Order type "timeInForce": "GTC", // Time in force method "reduceOnly": false, // Order is reduce only Y/N "createTime": 1592465880683, // Order Time "updateTime": 1566818724722, // Update time "status": "NEW", // Order status "avgPrice": "0", // Average price of completed trade "source": "API",   "clientOrderId": "", // Client order ID "priceScale": 2, "quantityScale": 2, "optionSide": "CALL", "quoteAsset": "USDT", "mmp": false } ] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/options-trading/trade/Place-Multiple-Orders) +- [HTTP Request](https://developers.binance.com/docs/derivatives/options-trading/trade/Place-Multiple-Orders) +- [Request Weight](https://developers.binance.com/docs/derivatives/options-trading/trade/Place-Multiple-Orders) +- [Request Parameters](https://developers.binance.com/docs/derivatives/options-trading/trade/Place-Multiple-Orders) +- [Response Example](https://developers.binance.com/docs/derivatives/options-trading/trade/Place-Multiple-Orders) diff --git a/docs/binance/binance_derivatives/docs_derivatives_options-trading_trade_Query-Current-Open-Option-Orders.md b/docs/binance/binance_derivatives/docs_derivatives_options-trading_trade_Query-Current-Open-Option-Orders.md new file mode 100644 index 0000000..4983105 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_options-trading_trade_Query-Current-Open-Option-Orders.md @@ -0,0 +1,84 @@ +--- +title: "Query Current Open Option Orders | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/options-trading/trade/Query-Current-Open-Option-Orders" +fetched_at: "2026-01-27T05:28:12.099Z" +--- +# Query Current Open Option Orders (USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/options-trading/trade/Query-Current-Open-Option-Orders) + +Query current all open orders, status: ACCEPTED PARTIALLY\_FILLED + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/options-trading/trade/Query-Current-Open-Option-Orders) + +GET `/eapi/v1/openOrders` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/options-trading/trade/Query-Current-Open-Option-Orders) + +**1** for a single symbol; **40** when the symbol parameter is omitted + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/options-trading/trade/Query-Current-Open-Option-Orders) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +NO + +return all orders if don't pass, Option trading pair, e.g BTC-200730-9000-C, + +orderId + +LONG + +NO + +Returns the orderId and subsequent orders, the most recent order is returned by default + +startTime + +LONG + +NO + +Start Time + +endTime + +LONG + +NO + +End Time + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/options-trading/trade/Query-Current-Open-Option-Orders) + +``` +[ { "orderId": 4611875134427365377, // System order number "symbol": "BTC-200730-9000-C", // Option trading pair "price": "100", // Order Price "quantity": "1", // Order Quantity "executedQty": "0", // Number of completed trades "side": "BUY", // Buy/sell direction "type": "LIMIT", // Order type "timeInForce": "GTC", // Time in force method "reduceOnly": false, // Order is reduce only Y/N   "createTime": 1592465880683, // Order Time "updateTime": 1592465880683, // Update Time    "status": "NEW", // Order status "avgPrice": "0", // Average price of completed trade "clientOrderId": "", // Client order ID "priceScale": 2, "quantityScale": 2, "optionSide": "CALL", "quoteAsset": "USDT", "mmp": false  }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/options-trading/trade/Query-Current-Open-Option-Orders) +- [HTTP Request](https://developers.binance.com/docs/derivatives/options-trading/trade/Query-Current-Open-Option-Orders) +- [Request Weight](https://developers.binance.com/docs/derivatives/options-trading/trade/Query-Current-Open-Option-Orders) +- [Request Parameters](https://developers.binance.com/docs/derivatives/options-trading/trade/Query-Current-Open-Option-Orders) +- [Response Example](https://developers.binance.com/docs/derivatives/options-trading/trade/Query-Current-Open-Option-Orders) diff --git a/docs/binance/binance_derivatives/docs_derivatives_options-trading_trade_Query-Option-Order-History.md b/docs/binance/binance_derivatives/docs_derivatives_options-trading_trade_Query-Option-Order-History.md new file mode 100644 index 0000000..aae8b38 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_options-trading_trade_Query-Option-Order-History.md @@ -0,0 +1,92 @@ +--- +title: "Query Option Order History | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/options-trading/trade/Query-Option-Order-History" +fetched_at: "2026-01-27T05:28:12.093Z" +--- +# Query Option Order History (TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/options-trading/trade/Query-Option-Order-History) + +Query all finished orders within 5 days, finished status: CANCELLED FILLED REJECTED. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/options-trading/trade/Query-Option-Order-History) + +GET `/eapi/v1/historyOrders` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/options-trading/trade/Query-Option-Order-History) + +**3** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/options-trading/trade/Query-Option-Order-History) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +Option trading pair + +orderId + +LONG + +NO + +Returns the orderId and subsequent orders, the most recent order is returned by default + +startTime + +LONG + +NO + +Start Time, e.g 1593511200000 + +endTime + +LONG + +NO + +End Time, e.g 1593512200000 + +limit + +INT + +NO + +Number of result sets returned Default:100 Max:1000 + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/options-trading/trade/Query-Option-Order-History) + +``` +[ { "orderId": 4611922413427359795, "symbol": "BTC-220715-2000-C", "price": "18000.00000000", "quantity": "-0.50000000", "executedQty": "-0.50000000", "side": "SELL", "type": "LIMIT", "timeInForce": "GTC", "reduceOnly": false, "createTime": 1657867694244, "updateTime": 1657867888216, "status": "FILLED", "avgPrice": "18000.00000000", "clientOrderId": "", "priceScale": 2, "quantityScale": 2, "optionSide": "CALL", "quoteAsset": "USDT", "mmp": false }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/options-trading/trade/Query-Option-Order-History) +- [HTTP Request](https://developers.binance.com/docs/derivatives/options-trading/trade/Query-Option-Order-History) +- [Request Weight](https://developers.binance.com/docs/derivatives/options-trading/trade/Query-Option-Order-History) +- [Request Parameters](https://developers.binance.com/docs/derivatives/options-trading/trade/Query-Option-Order-History) +- [Response Example](https://developers.binance.com/docs/derivatives/options-trading/trade/Query-Option-Order-History) diff --git a/docs/binance/binance_derivatives/docs_derivatives_options-trading_trade_Query-Single-Order.md b/docs/binance/binance_derivatives/docs_derivatives_options-trading_trade_Query-Single-Order.md new file mode 100644 index 0000000..543150a --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_options-trading_trade_Query-Single-Order.md @@ -0,0 +1,89 @@ +--- +title: "Query Single Order | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/options-trading/trade/Query-Single-Order" +fetched_at: "2026-01-27T05:28:12.131Z" +--- +# Query Single Order (TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/options-trading/trade/Query-Single-Order) + +Check an order status. + +- These orders will not be found: + - order status is `CANCELED` or `REJECTED`, **AND** + - order has NO filled trade, **AND** + - created time + 3 days < current time + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/options-trading/trade/Query-Single-Order) + +GET `/eapi/v1/order` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/options-trading/trade/Query-Single-Order) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/options-trading/trade/Query-Single-Order) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +Option trading pair, e.g BTC-200730-9000-C + +orderId + +LONG + +NO + +Order id + +clientOrderId + +STRING + +NO + +User-defined order ID cannot be repeated in pending orders + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +> - Either `orderId` or `clientOrderId` must be sent. + +## Response Example[​](https://developers.binance.com/docs/derivatives/options-trading/trade/Query-Single-Order) + +``` +{ "orderId": 4611875134427365377, // System order id "symbol": "BTC-200730-9000-C", // Option trading pair "price": "100", // Order Price "quantity": "1", // Order Quantity "executedQty": "0", // Number of executed quantity "side": "BUY", // Buy/sell direction "type": "LIMIT", // Order type "timeInForce": "GTC", // Time in force method "reduceOnly": false, // Order is reduce only Y/N "createTime": 1592465880683, // Order Time "updateTime": 1566818724722, // Update time "status": "NEW", // Order status "avgPrice": "0", // Average price of completed trade  "clientOrderId": "", // Client order ID "priceScale": 2, "quantityScale": 2, "optionSide": "CALL", "quoteAsset": "USDT", "mmp": false} +``` + +> **No Order Response:** + +``` +{ "code": -2013, "msg": "Order does not exist"} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/options-trading/trade/Query-Single-Order) +- [HTTP Request](https://developers.binance.com/docs/derivatives/options-trading/trade/Query-Single-Order) +- [Request Weight](https://developers.binance.com/docs/derivatives/options-trading/trade/Query-Single-Order) +- [Request Parameters](https://developers.binance.com/docs/derivatives/options-trading/trade/Query-Single-Order) +- [Response Example](https://developers.binance.com/docs/derivatives/options-trading/trade/Query-Single-Order) diff --git a/docs/binance/binance_derivatives/docs_derivatives_options-trading_trade_User-Commission.md b/docs/binance/binance_derivatives/docs_derivatives_options-trading_trade_User-Commission.md new file mode 100644 index 0000000..a1595d3 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_options-trading_trade_User-Commission.md @@ -0,0 +1,52 @@ +--- +title: "User Commission | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/options-trading/trade/User-Commission" +fetched_at: "2026-01-27T05:28:12.244Z" +--- +# User Commission (USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/options-trading/trade/User-Commission) + +Get account commission. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/options-trading/trade/User-Commission) + +GET `/eapi/v1/commission` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/options-trading/trade/User-Commission) + +**5** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/options-trading/trade/User-Commission) + +Name + +Type + +Mandatory + +Description + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/options-trading/trade/User-Commission) + +``` +{ "commissions": [ { "underlying": "BTCUSDT", "makerFee": "0.000240", "takerFee": "0.000240" }, { "underlying": "ETHUSDT", "makerFee": "0.000240", "takerFee": "0.000240" }, { "underlying": "BNBUSDT", "makerFee": "0.000240", "takerFee": "0.000240" }, { "underlying": "SOLUSDT", "makerFee": "0.000240", "takerFee": "0.000240" }, { "underlying": "XRPUSDT", "makerFee": "0.000240", "takerFee": "0.000240" }, { "underlying": "DOGEUSDT", "makerFee": "0.000240", "takerFee": "0.000240" } ]} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/options-trading/trade/User-Commission) +- [HTTP Request](https://developers.binance.com/docs/derivatives/options-trading/trade/User-Commission) +- [Request Weight](https://developers.binance.com/docs/derivatives/options-trading/trade/User-Commission) +- [Request Parameters](https://developers.binance.com/docs/derivatives/options-trading/trade/User-Commission) +- [Response Example](https://developers.binance.com/docs/derivatives/options-trading/trade/User-Commission) diff --git a/docs/binance/binance_derivatives/docs_derivatives_options-trading_trade_User-Exercise-Record.md b/docs/binance/binance_derivatives/docs_derivatives_options-trading_trade_User-Exercise-Record.md new file mode 100644 index 0000000..4def2d5 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_options-trading_trade_User-Exercise-Record.md @@ -0,0 +1,84 @@ +--- +title: "User Exercise Record | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/options-trading/trade/User-Exercise-Record" +fetched_at: "2026-01-27T05:28:12.480Z" +--- +# User Exercise Record (USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/options-trading/trade/User-Exercise-Record) + +Get account exercise records. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/options-trading/trade/User-Exercise-Record) + +GET `/eapi/v1/exerciseRecord` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/options-trading/trade/User-Exercise-Record) + +**5** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/options-trading/trade/User-Exercise-Record) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +NO + +Option trading pair, e.g BTC-200730-9000-C + +startTime + +LONG + +NO + +startTime + +endTime + +LONG + +NO + +endTime + +limit + +INT + +NO + +default 1000, max 1000 + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/options-trading/trade/User-Exercise-Record) + +``` +[ { "id": "1125899906842624042", "currency": "USDT", "symbol": "BTC-220721-25000-C", "exercisePrice": "25000.00000000", "quantity": "1.00000000", "amount": "0.00000000", "fee": "0.00000000", "createDate": 1658361600000, "priceScale": 2, "quantityScale": 2, "optionSide": "CALL", "positionSide": "LONG", "quoteAsset": "USDT" }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/options-trading/trade/User-Exercise-Record) +- [HTTP Request](https://developers.binance.com/docs/derivatives/options-trading/trade/User-Exercise-Record) +- [Request Weight](https://developers.binance.com/docs/derivatives/options-trading/trade/User-Exercise-Record) +- [Request Parameters](https://developers.binance.com/docs/derivatives/options-trading/trade/User-Exercise-Record) +- [Response Example](https://developers.binance.com/docs/derivatives/options-trading/trade/User-Exercise-Record) diff --git a/docs/binance/binance_derivatives/docs_derivatives_options-trading_user-data-streams.md b/docs/binance/binance_derivatives/docs_derivatives_options-trading_user-data-streams.md new file mode 100644 index 0000000..8c22ceb --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_options-trading_user-data-streams.md @@ -0,0 +1,17 @@ +--- +title: "Connect | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/options-trading/user-data-streams" +fetched_at: "2026-01-27T05:28:12.487Z" +--- +# Connect + +- The base API endpoint is: **[https://eapi.binance.com](https://eapi.binance.com/)** +- A User Data Stream `listenKey` is valid for 60 minutes after creation. +- Doing a `PUT` on a `listenKey` will extend its validity for 60 minutes. +- Doing a `DELETE` on a `listenKey` will close the stream and invalidate the `listenKey`. +- Doing a `POST` on an account with an active `listenKey` will return the currently active `listenKey` and extend its validity for 60 minutes. +- Connection method for Websocket: + - Base Url: **wss://fstream.binance.com/private/** + - User Data Streams are accessed at **/ws/** + - Example: `wss://fstream.binance.com/private/ws/XaEAKTsQSRLZAGH9tuIu37plSRsdjmlAVBoNYPUITlTAko1WI22PgmBMpI1rS8Yh` +- A single connection is only valid for 24 hours; expect to be disconnected at the 24 hour mark diff --git a/docs/binance/binance_derivatives/docs_derivatives_options-trading_user-data-streams_Close-User-Data-Stream.md b/docs/binance/binance_derivatives/docs_derivatives_options-trading_user-data-streams_Close-User-Data-Stream.md new file mode 100644 index 0000000..0f3c018 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_options-trading_user-data-streams_Close-User-Data-Stream.md @@ -0,0 +1,34 @@ +--- +title: "Close User Data Stream | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Close-User-Data-Stream" +fetched_at: "2026-01-27T05:28:12.376Z" +--- +# Close User Data Stream (USER\_STREAM) + +## API Description[​](https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Close-User-Data-Stream) + +Close out a user data stream. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Close-User-Data-Stream) + +DELETE `/eapi/v1/listenKey` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Close-User-Data-Stream) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Close-User-Data-Stream) + +None + +## Response Example[​](https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Close-User-Data-Stream) + +``` +{} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Close-User-Data-Stream) +- [HTTP Request](https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Close-User-Data-Stream) +- [Request Weight](https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Close-User-Data-Stream) +- [Request Parameters](https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Close-User-Data-Stream) +- [Response Example](https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Close-User-Data-Stream) diff --git a/docs/binance/binance_derivatives/docs_derivatives_options-trading_user-data-streams_Event-Account-data.md b/docs/binance/binance_derivatives/docs_derivatives_options-trading_user-data-streams_Event-Account-data.md new file mode 100644 index 0000000..222210b --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_options-trading_user-data-streams_Event-Account-data.md @@ -0,0 +1,37 @@ +--- +title: "Event Account Data | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Event-Account-data" +fetched_at: "2026-01-27T05:28:12.490Z" +--- +# Event: Account data + +## Event Description[​](https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Event-Account-data) + +- Update under the following conditions: + - Account deposit or withdrawal + - Position info change + - Periodic update every 10s when having position + +## URL PATH[​](https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Event-Account-data) + +`/private` + +## Event Name[​](https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Event-Account-data) + +`ACCOUNT_UPDATE` + +## Update Speed[​](https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Event-Account-data) + +**50ms** + +## Response Example[​](https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Event-Account-data) + +``` +{ "stream": "89ljxuL6jFTN3Ej85aYOqH2BYXQ7eeuNYcGm7ktV", "data": { "e": "ACCOUNT_UPDATE", // Event type "E": 1762914568643, // Event time "T": 1762914568619, // Transaction Time "eq": "10000371.61462086", // account equity in USDT "aeq": "10000475.51032086", // account adjusted equity in USDT "b": "10000475.51032086", // account wallet balance in USDT "m": "-103.89570000", // position value "u": "16.10430000", // unrealized pnl "i": "32354.38562539", // initial margin in USDT "M": "6089.28766956" // maintenance margin in USDT }} +``` + +- [Event Description](https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Event-Account-data) +- [URL PATH](https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Event-Account-data) +- [Event Name](https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Event-Account-data) +- [Update Speed](https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Event-Account-data) +- [Response Example](https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Event-Account-data) diff --git a/docs/binance/binance_derivatives/docs_derivatives_options-trading_user-data-streams_Event-Balance-and-Position-Update.md b/docs/binance/binance_derivatives/docs_derivatives_options-trading_user-data-streams_Event-Balance-and-Position-Update.md new file mode 100644 index 0000000..1415d5e --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_options-trading_user-data-streams_Event-Balance-and-Position-Update.md @@ -0,0 +1,37 @@ +--- +title: "Event Balance and Position Update | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Event-Balance-and-Position-Update" +fetched_at: "2026-01-27T05:28:12.627Z" +--- +# Event: Balance and Position Update + +## Event Description[​](https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Event-Balance-and-Position-Update) + +Event type is `ACCOUNT_UPDATE`. + +- When balance or position get updated, this event will be pushed. + + - `ACCOUNT_UPDATE` will be pushed only when update happens on user's account, including changes on balances, positions. + - Unfilled orders or cancelled orders will not make the event `ACCOUNT_UPDATE` pushed, since there's no change on positions. + - "position" in `ACCOUNT_UPDATE`: Only symbols of changed positions will be pushed. +- The field "m" represents the reason type for the event and may shows the following possible types: + + - DEPOSIT + - WITHDRAW + - ORDER +- The field "bc" represents the balance change except for PnL and commission. + + +## Event Name[​](https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Event-Balance-and-Position-Update) + +`BALANCE_POSITION_UPDATE` + +## Response Example[​](https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Event-Balance-and-Position-Update) + +``` +{ "e": "BALANCE_POSITION_UPDATE", "E": 1762917544216, "T": 1762917544206, "m": "ORDER", "B": [ { "a": "USDT", // Margin asset "b": "10000471.37940900", // Account balance "bc": "0" // Balance Change except PnL and Commission } ], "P": [ { "s": "BTC-251123-126000-C", // symbol "c": "-0.1000", // position quantity "p": "-120.00000000", // Position value "a": "1200.00000000" // Average entry price } ]} +``` + +- [Event Description](https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Event-Balance-and-Position-Update) +- [Event Name](https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Event-Balance-and-Position-Update) +- [Response Example](https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Event-Balance-and-Position-Update) diff --git a/docs/binance/binance_derivatives/docs_derivatives_options-trading_user-data-streams_Event-Greek-Update.md b/docs/binance/binance_derivatives/docs_derivatives_options-trading_user-data-streams_Event-Greek-Update.md new file mode 100644 index 0000000..b5e8f3f --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_options-trading_user-data-streams_Event-Greek-Update.md @@ -0,0 +1,29 @@ +--- +title: "Event Greek Update | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Event-Greek-Update" +fetched_at: "2026-01-27T05:28:12.735Z" +--- +# Event: Greek Update + +## Event Description[​](https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Event-Greek-Update) + +`GREEK_UPDATE` will be triggered when a position changes or periodically every 10 seconds when having position. + +## URL PATH[​](https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Event-Greek-Update) + +`/private` + +## Event Name[​](https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Event-Greek-Update) + +`GREEK_UPDATE` + +## Response Example[​](https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Event-Greek-Update) + +``` +{ "e": "GREEK_UPDATE", "E": 1762917544216, "T": 1762917544216, "G": [ { "u": "BTCUSDT", "d": "-0.01304097", //delta "g": "-0.00000124", //gamma "t": "16.11648100", //theta "v": "-3.83444011" //vega } ]} +``` + +- [Event Description](https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Event-Greek-Update) +- [URL PATH](https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Event-Greek-Update) +- [Event Name](https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Event-Greek-Update) +- [Response Example](https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Event-Greek-Update) diff --git a/docs/binance/binance_derivatives/docs_derivatives_options-trading_user-data-streams_Event-Order-update.md b/docs/binance/binance_derivatives/docs_derivatives_options-trading_user-data-streams_Event-Order-update.md new file mode 100644 index 0000000..1106404 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_options-trading_user-data-streams_Event-Order-update.md @@ -0,0 +1,65 @@ +--- +title: "Event Order Update | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Event-Order-update" +fetched_at: "2026-01-27T05:28:12.741Z" +--- +# Event: Order update + +## Event Description[​](https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Event-Order-update) + +When new order created, order status changed will push such event. event type is `ORDER_TRADE_UPDATE`. + +**Side** + +- BUY +- SELL + +**Order Type** + +- LIMIT + +**Execution Type** + +- NEW +- CANCELED +- EXPIRED +- TRADE + +**Order Status** + +- NEW +- PARTIALLY\_FILLED +- FILLED +- CANCELED +- EXPIRED + +**Time in force** + +- GTC +- IOC +- FOK +- GTX + +## URL PATH[​](https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Event-Order-update) + +`/private` + +## Event Name[​](https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Event-Order-update) + +`ORDER_TRADE_UPDATE` + +## Update Speed[​](https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Event-Order-update) + +**50ms** + +## Response Example[​](https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Event-Order-update) + +``` +{ "e":"ORDER_TRADE_UPDATE", // Event Type "E":1568879465651, // Event Time "T":1568879465650, // Transaction Time "o":{ "s":"BTCUSDT", // Symbol "c":"TEST", // Client Order Id // special client order id: // starts with "autoclose-": liquidation order // "adl_autoclose": ADL auto close order "S":"SELL", // Side "o":"TRAILING_STOP_MARKET", // Order Type "f":"GTC", // Time in Force "q":"0.001", // Original Quantity "p":"0", // Original Price "ap":"0", // Average Price "x":"NEW", // Execution Type "X":"NEW", // Order Status "i":8886774, // Order Id "l":"0", // Order Last Filled Quantity "z":"0", // Order Filled Accumulated Quantity "L":"0", // Last Filled Price "N":"USDT", // Commission Asset "n":"0", // Commission, negative means fee charge "T":1568879465650, // Order Trade Time "t":0, // Trade Id "b":"0", // Bids qty "a":"9.91", // Ask qty "m":false, // Is this trade the maker side? "R":false, // Is this reduce only "ot":"TRAILING_STOP_MARKET", // Original Order Type "rp":"0", // Realized Profit of the trade }} +``` + +- [Event Description](https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Event-Order-update) +- [URL PATH](https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Event-Order-update) +- [Event Name](https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Event-Order-update) +- [Update Speed](https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Event-Order-update) +- [Response Example](https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Event-Order-update) diff --git a/docs/binance/binance_derivatives/docs_derivatives_options-trading_user-data-streams_Event-Risk-level-change.md b/docs/binance/binance_derivatives/docs_derivatives_options-trading_user-data-streams_Event-Risk-level-change.md new file mode 100644 index 0000000..48bade3 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_options-trading_user-data-streams_Event-Risk-level-change.md @@ -0,0 +1,40 @@ +--- +title: "Event Risk Level Change | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Event-Risk-level-change" +fetched_at: "2026-01-27T05:28:12.744Z" +--- +# Event: Risk level change + +## Event Description[​](https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Event-Risk-level-change) + +- Updates whenever there is an account risk level change. The following are possibly values: + - NORMAL + - REDUCE\_ONLY +- Note: Risk level changes are only applicable to VIP and Market Makers user accounts. VIP and certain Market Maker accounts will be automatically placed into REDUCE\_ONLY mode if their margin balance is insufficient to meet their maintenance margin obligations. Once in REDUCE\_ONLY mode, the system will re-evaluate the risk level only upon the following events: + - Funds transfer + - Trade fill + - Option expiry + +## URL PATH[​](https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Event-Risk-level-change) + +`/private` + +## Event Name[​](https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Event-Risk-level-change) + +`RISK_LEVEL_CHANGE` + +## Update Speed[​](https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Event-Risk-level-change) + +**50ms** + +## Response Example[​](https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Event-Risk-level-change) + +``` +{ "e":"RISK_LEVEL_CHANGE", //Event Type "E":1587727187525, //Event Time "s":"REDUCE_ONLY", //risk level "mb":"1534.11708371", //margin balance "mm":"254789.11708371" //maintenance margin } +``` + +- [Event Description](https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Event-Risk-level-change) +- [URL PATH](https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Event-Risk-level-change) +- [Event Name](https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Event-Risk-level-change) +- [Update Speed](https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Event-Risk-level-change) +- [Response Example](https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Event-Risk-level-change) diff --git a/docs/binance/binance_derivatives/docs_derivatives_options-trading_user-data-streams_Event-User-Data-Stream-Expired.md b/docs/binance/binance_derivatives/docs_derivatives_options-trading_user-data-streams_Event-User-Data-Stream-Expired.md new file mode 100644 index 0000000..dad3054 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_options-trading_user-data-streams_Event-User-Data-Stream-Expired.md @@ -0,0 +1,30 @@ +--- +title: "Event User Data Stream Expired | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Event-User-Data-Stream-Expired" +fetched_at: "2026-01-27T05:28:12.959Z" +--- +# Event: User Data Stream Expired + +## Event Description[​](https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Event-User-Data-Stream-Expired) + +When the `listenKey` used for the user data stream turns expired, this event will be pushed. + +**Notice:** + +> - This event is not related to the websocket disconnection. +> - This event will be received only when a valid `listenKey` in connection got expired. +> - No more user data event will be updated after this event received until a new valid `listenKey` used. + +## Event Name[​](https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Event-User-Data-Stream-Expired) + +`listenKeyExpired` + +## Response Example[​](https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Event-User-Data-Stream-Expired) + +``` +{ "e": "listenKeyExpired", // event type "E": "1736996475556", // event time "listenKey":"WsCMN0a4KHUPTQuX6IUnqEZfB1inxmv1qR4kbf1LuEjur5VdbzqvyxqG9TSjVVxv"} +``` + +- [Event Description](https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Event-User-Data-Stream-Expired) +- [Event Name](https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Event-User-Data-Stream-Expired) +- [Response Example](https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Event-User-Data-Stream-Expired) diff --git a/docs/binance/binance_derivatives/docs_derivatives_options-trading_user-data-streams_Keepalive-User-Data-Stream.md b/docs/binance/binance_derivatives/docs_derivatives_options-trading_user-data-streams_Keepalive-User-Data-Stream.md new file mode 100644 index 0000000..85c6e81 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_options-trading_user-data-streams_Keepalive-User-Data-Stream.md @@ -0,0 +1,34 @@ +--- +title: "Keepalive User Data Stream | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Keepalive-User-Data-Stream" +fetched_at: "2026-01-27T05:28:12.993Z" +--- +# Keepalive User Data Stream (USER\_STREAM) + +## API Description[​](https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Keepalive-User-Data-Stream) + +Keepalive a user data stream to prevent a time out. User data streams will close after 60 minutes. It's recommended to send a ping about every 60 minutes. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Keepalive-User-Data-Stream) + +PUT `/eapi/v1/listenKey` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Keepalive-User-Data-Stream) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Keepalive-User-Data-Stream) + +None + +## Response Example[​](https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Keepalive-User-Data-Stream) + +``` +{} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Keepalive-User-Data-Stream) +- [HTTP Request](https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Keepalive-User-Data-Stream) +- [Request Weight](https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Keepalive-User-Data-Stream) +- [Request Parameters](https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Keepalive-User-Data-Stream) +- [Response Example](https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Keepalive-User-Data-Stream) diff --git a/docs/binance/binance_derivatives/docs_derivatives_options-trading_user-data-streams_Start-User-Data-Stream.md b/docs/binance/binance_derivatives/docs_derivatives_options-trading_user-data-streams_Start-User-Data-Stream.md new file mode 100644 index 0000000..d472314 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_options-trading_user-data-streams_Start-User-Data-Stream.md @@ -0,0 +1,34 @@ +--- +title: "Start User Data Stream | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Start-User-Data-Stream" +fetched_at: "2026-01-27T05:28:12.999Z" +--- +# Start User Data Stream (USER\_STREAM) + +## API Description[​](https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Start-User-Data-Stream) + +Start a new user data stream. The stream will close after 60 minutes unless a keepalive is sent. If the account has an active `listenKey`, that `listenKey` will be returned and its validity will be extended for 60 minutes. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Start-User-Data-Stream) + +POST `/eapi/v1/listenKey` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Start-User-Data-Stream) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Start-User-Data-Stream) + +None + +## Response Example[​](https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Start-User-Data-Stream) + +``` +{ "listenKey": "pqia91ma19a5s61cv6a81va65sdf19v8a65a1a5s61cv6a81va65sdf19v8a65a1", "expiration": 1762855900452} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Start-User-Data-Stream) +- [HTTP Request](https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Start-User-Data-Stream) +- [Request Weight](https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Start-User-Data-Stream) +- [Request Parameters](https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Start-User-Data-Stream) +- [Response Example](https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Start-User-Data-Stream) diff --git a/docs/binance/binance_derivatives/docs_derivatives_options-trading_websocket-market-streams.md b/docs/binance/binance_derivatives/docs_derivatives_options-trading_websocket-market-streams.md new file mode 100644 index 0000000..a1fb975 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_options-trading_websocket-market-streams.md @@ -0,0 +1,46 @@ +--- +title: "Connect | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams" +fetched_at: "2026-01-27T05:28:13.134Z" +--- +# Connect + +- The baseurl of the websocket interface is: \*\*wss://fstream.binance.com/public/ \*\* or \*\*/ **wss://fstream.binance.com/market/** + +- Streams can be access either in a single raw stream or a combined stream + +- Raw streams are accessed at **/ws/** + +- Combined streams are accessed at **/stream?streams=//** + +- Example: + + - `wss://fstream.binance.com/public/ws/btc-210630-9000-p@ticker` + - `wss://fstream.binance.com/market/stream?streams=btc-210630-9000-p@markPriceoptionMarkPrice` +- A single connection is only valid for 24 hours; expect to be disconnected at the 24 hour mark + +- The websocket server will send a `ping frame` every 5 minutes. If the websocket server does not receive a `pong frame` back from the connection within a 15 minute period, the connection will be disconnected. Unsolicited `pong frames` are allowed. + +- WebSocket connections have a limit of 10 incoming messages per second. + +- A connection that goes beyond the limit will be disconnected; IPs that are repeatedly disconnected may be banned. + +- A single connection can listen to a maximum of **200** streams. + +- Considering the possible data latency from RESTful endpoints during an extremely volatile market, it is highly recommended to get the order status, position, etc from the Websocket user data stream. + +- Combined stream events are wrapped as follows: **{"stream":"","data":}** + +- All symbols for streams are **lowercase** + +- A single connection is only valid for 24 hours; expect to be disconnected at the 24 hour mark + +- The websocket server will send a `ping frame` every 5 minutes. If the websocket server does not receive a `pong frame` back from the connection within a 15 minute period, the connection will be disconnected. Unsolicited `pong frames` are allowed. + +- WebSocket connections have a limit of 10 incoming messages per second. + +- A connection that goes beyond the limit will be disconnected; IPs that are repeatedly disconnected may be banned. + +- A single connection can listen to a maximum of **200** streams. + +- Considering the possible data latency from RESTful endpoints during an extremely volatile market, it is highly recommended to get the order status, position, etc from the Websocket user data stream. diff --git a/docs/binance/binance_derivatives/docs_derivatives_options-trading_websocket-market-streams_24-hour-TICKER.md b/docs/binance/binance_derivatives/docs_derivatives_options-trading_websocket-market-streams_24-hour-TICKER.md new file mode 100644 index 0000000..b99cde0 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_options-trading_websocket-market-streams_24-hour-TICKER.md @@ -0,0 +1,34 @@ +--- +title: "24 Hour Ticker | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/24-hour-TICKER" +fetched_at: "2026-01-27T05:28:13.213Z" +--- +# 24-hour TICKER + +## Stream Description[​](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/24-hour-TICKER) + +24hr ticker info for all symbols. Only symbols whose ticker info changed will be sent. + +## URL PATH[​](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/24-hour-TICKER) + +`/public` + +## Stream Name[​](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/24-hour-TICKER) + +`@optionTicker` or `@optionTicker@` e.g: btcusdt@optionTicker@251230 + +## Update Speed[​](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/24-hour-TICKER) + +**1000ms** + +## Response Example[​](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/24-hour-TICKER) + +``` +{ "e": "24hrTicker", // Event type "E": 1764080707933, // Event time "s": "ETH-251226-3000-C", // Symbol "p": "0.0000", // Price change "P": "0.00", // Price change percent "w": "200.0000", // Weighted average price "c": "200.0000", // Last price "Q": "1.0000", // Last quantity "o": "200.0000", // Open price "h": "200.0000", // High price "l": "200.0000", // Low price "v": "9.0000", // Trading volume(in contracts) "q": "1800.0000", // trade amount(in quote asset) "O": 1764051060000, // Statistics open time "C": 1764080707933, // Statistics close time "F": 1, // First trade ID "L": 22, // Last trade Id "n": 9 // Total number of trade} +``` + +- [Stream Description](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/24-hour-TICKER) +- [URL PATH](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/24-hour-TICKER) +- [Stream Name](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/24-hour-TICKER) +- [Update Speed](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/24-hour-TICKER) +- [Response Example](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/24-hour-TICKER) diff --git a/docs/binance/binance_derivatives/docs_derivatives_options-trading_websocket-market-streams_Bookticker.md b/docs/binance/binance_derivatives/docs_derivatives_options-trading_websocket-market-streams_Bookticker.md new file mode 100644 index 0000000..5fbe25a --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_options-trading_websocket-market-streams_Bookticker.md @@ -0,0 +1,34 @@ +--- +title: "BookTicker | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Bookticker" +fetched_at: "2026-01-27T05:28:13.247Z" +--- +# Individual Symbol Book Ticker Streams + +## Stream Description[​](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Bookticker) + +Pushes any update to the best bid or ask's price or quantity in real-time for a specified symbol. + +## URL PATH[​](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Bookticker) + +`/public` + +## Stream Name[​](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Bookticker) + +`@bookTicker` + +## Update Speed[​](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Bookticker) + +**Real-Time** + +## Response Example[​](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Bookticker) + +``` +{ "e": "bookTicker", // event type "u": 2472, // order book updateId "s": "BTC-251226-110000-C", // symbol "b": "5000.000", // best bid price "B": "0.2000", // bid bid quantity "a": "5100.000", // best ask price "A": "0.1000", // best ask quantity "T": 1763041762942, // transaction time "E": 1763041762942 // event time} +``` + +- [Stream Description](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Bookticker) +- [URL PATH](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Bookticker) +- [Stream Name](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Bookticker) +- [Update Speed](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Bookticker) +- [Response Example](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Bookticker) diff --git a/docs/binance/binance_derivatives/docs_derivatives_options-trading_websocket-market-streams_Diff-Book-Depth-Streams.md b/docs/binance/binance_derivatives/docs_derivatives_options-trading_websocket-market-streams_Diff-Book-Depth-Streams.md new file mode 100644 index 0000000..28aec0a --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_options-trading_websocket-market-streams_Diff-Book-Depth-Streams.md @@ -0,0 +1,34 @@ +--- +title: "Diff Book Depth Streams | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Diff-Book-Depth-Streams" +fetched_at: "2026-01-27T05:28:13.257Z" +--- +# Diff Book Depth Streams + +## Stream Description[​](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Diff-Book-Depth-Streams) + +Bids and asks, pushed every 500 milliseconds, 100 milliseconds (if existing) + +## URL PATH[​](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Diff-Book-Depth-Streams) + +`/public` + +## Stream Name[​](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Diff-Book-Depth-Streams) + +`@depth@100ms` or `@depth@500ms` + +## Update Speed[​](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Diff-Book-Depth-Streams) + +**100ms** or **500ms** + +## Response Example[​](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Diff-Book-Depth-Streams) + +``` +{ "e": "depthUpdate", // event type "E": 1762866729459, // event time "T": 1762866729358, // transaction time "s": "BTC-251123-126000-C", // Option symbol "U": 465, // First update ID in event "u": 465, // Final update ID in event "pu": 464, // Final update Id in last stream(ie `u` in last stream) "b": [ // Buy order [ "1100.000", // Price "0.6000" // quantity ] ], "a": [ // Sell order [ "1300.000", "0.6000" ] ]} +``` + +- [Stream Description](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Diff-Book-Depth-Streams) +- [URL PATH](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Diff-Book-Depth-Streams) +- [Stream Name](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Diff-Book-Depth-Streams) +- [Update Speed](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Diff-Book-Depth-Streams) +- [Response Example](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Diff-Book-Depth-Streams) diff --git a/docs/binance/binance_derivatives/docs_derivatives_options-trading_websocket-market-streams_How-to-manage-a-local-order-book-correctly.md b/docs/binance/binance_derivatives/docs_derivatives_options-trading_websocket-market-streams_How-to-manage-a-local-order-book-correctly.md new file mode 100644 index 0000000..ca71b26 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_options-trading_websocket-market-streams_How-to-manage-a-local-order-book-correctly.md @@ -0,0 +1,21 @@ +--- +title: "How To Manage A Local Order Book Correctly | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/How-to-manage-a-local-order-book-correctly" +fetched_at: "2026-01-27T05:28:13.392Z" +--- +# How to manage a local order book correctly + +1. Open a stream to **wss://fstream.binance.com/public/stream?streams=btc-200630-9000-p@depth@100ms**. +2. Buffer the events you receive from the stream. For same price, latest received update covers the previous one. +3. Get a depth snapshot from **[https://eapi.binance.com/eapi/v1/depth?symbol=btc-200630-9000-p&limit=1000](https://eapi.binance.com/eapi/v1/depth?symbol=btc-200630-9000-p&limit=1000)** . +4. Drop any event where `u` is < `lastUpdateId` in the snapshot. +5. The first processed event should have `U` `<= ``lastUpdateId` **AND** `u` >`= ``lastUpdateId` + +- U = firstUpdateId (the first update ID) from the WebSocket stream. +- u = finalUpdateId (the last update ID) from the WebSocket stream. +- lastUpdateId = the update ID you got from the REST depth snapshot. + +6. While listening to the stream, each new event's `pu` should be equal to the previous event's `u`, otherwise initialize the process from step 3.ß +7. The data in each event is the **absolute** quantity for a price level. +8. If the quantity is 0, **remove** the price level. +9. Receiving an event that removes a price level that is not in your local order book can happen and is normal. diff --git a/docs/binance/binance_derivatives/docs_derivatives_options-trading_websocket-market-streams_Index-Price-Streams.md b/docs/binance/binance_derivatives/docs_derivatives_options-trading_websocket-market-streams_Index-Price-Streams.md new file mode 100644 index 0000000..3dd1ee1 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_options-trading_websocket-market-streams_Index-Price-Streams.md @@ -0,0 +1,32 @@ +--- +title: "Index Price Streams | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Index-Price-Streams" +fetched_at: "2026-01-27T05:28:13.468Z" +--- +# Index Price Streams + +## Stream Description[​](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Index-Price-Streams) + +Underlying(e.g ETHUSDT) index stream. + +## URL PATH[​](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Index-Price-Streams) + +`/market` + +**Stream Name:** +`!index@arr` + +## Update Speed[​](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Index-Price-Streams) + +**1000ms** + +## Response Example[​](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Index-Price-Streams) + +``` +[ { "e":"indexPrice", "E":1763092572229, "s":"ETHUSDT", "p":"3224.51976744" }, { "e": "indexPrice", // event type "E": 1763092572229, // time "s": "BTCUSDT", // underlying symbol "p": "99102.32326087" // index price }] +``` + +- [Stream Description](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Index-Price-Streams) +- [URL PATH](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Index-Price-Streams) +- [Update Speed](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Index-Price-Streams) +- [Response Example](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Index-Price-Streams) diff --git a/docs/binance/binance_derivatives/docs_derivatives_options-trading_websocket-market-streams_Kline-Candlestick-Streams.md b/docs/binance/binance_derivatives/docs_derivatives_options-trading_websocket-market-streams_Kline-Candlestick-Streams.md new file mode 100644 index 0000000..d705a82 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_options-trading_websocket-market-streams_Kline-Candlestick-Streams.md @@ -0,0 +1,40 @@ +--- +title: "Kline Candlestick Streams | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Kline-Candlestick-Streams" +fetched_at: "2026-01-27T05:28:13.565Z" +--- +# Kline/Candlestick Streams + +## Stream Description[​](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Kline-Candlestick-Streams) + +The Kline/Candlestick Stream push updates to the current klines/candlestick every 1000 milliseconds (if existing). + +**Kline/Candlestick chart intervals:** + +m -> minutes; h -> hours; d -> days; w -> weeks; M -> months + +"1m", "3m", "5m", "15m" "30m" "1h", "2h", "4h", "6h", "12h", "1d", "3d", "1w", + +## URL PATH[​](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Kline-Candlestick-Streams) + +`/market` + +## Stream Name[​](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Kline-Candlestick-Streams) + +`@kline_` + +## Update Speed[​](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Kline-Candlestick-Streams) + +**1000ms** + +## Response Example[​](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Kline-Candlestick-Streams) + +``` +{ "e":"kline", // event type "E":1638747660000, // event time "s":"BTC-200630-9000-P", // Option trading symbol "k":{ "t":1638747660000, // kline start time "T":1638747719999, // kline end time "s":"BTC-200630-9000-P", // Option trading symbol "i":"1m", // candle period "f":0, // first trade ID "L":0, // last trade ID "o":"1000", // open "c":"1000", // close "h":"1000", // high "l":"1000", // low "v":"0", // volume(in contracts) "n":0, // number of trades "x":false, // current candle has been completed Y/N "q":"0", // completed trade amount   (in quote asset)         "V":"0", // taker completed trade volume (in contracts)         "Q":"0" // taker trade amount(in quote asset) }} +``` + +- [Stream Description](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Kline-Candlestick-Streams) +- [URL PATH](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Kline-Candlestick-Streams) +- [Stream Name](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Kline-Candlestick-Streams) +- [Update Speed](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Kline-Candlestick-Streams) +- [Response Example](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Kline-Candlestick-Streams) diff --git a/docs/binance/binance_derivatives/docs_derivatives_options-trading_websocket-market-streams_Live-Subscribing-Unsubscribing-to-streams.md b/docs/binance/binance_derivatives/docs_derivatives_options-trading_websocket-market-streams_Live-Subscribing-Unsubscribing-to-streams.md new file mode 100644 index 0000000..4f96179 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_options-trading_websocket-market-streams_Live-Subscribing-Unsubscribing-to-streams.md @@ -0,0 +1,130 @@ +--- +title: "Live Subscribing Unsubscribing To Streams | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Live-Subscribing-Unsubscribing-to-streams" +fetched_at: "2026-01-27T05:28:13.508Z" +--- +# Live Subscribing/Unsubscribing to streams + +- The following data can be sent through the websocket instance in order to subscribe/unsubscribe from streams. Examples can be seen below. +- The `id` used in the JSON payloads is an unsigned INT used as an identifier to uniquely identify the messages going back and forth. + +## Subscribe to a stream[​](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Live-Subscribing-Unsubscribing-to-streams) + +> **Request** + +``` +{ "method": "SUBSCRIBE", "params": [ "btc-210630-9000-p@ticker", "btc-210630-9000-p@depth" ], "id": 1 } +``` + +> **Response** + +``` +{ "result": null, "id": 1} +``` + +## Unsubscribe to a stream[​](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Live-Subscribing-Unsubscribing-to-streams) + +> **Request** + +``` +{ "method": "UNSUBSCRIBE", "params": [ "btc-210630-9000-p@ticker" ], "id": 312 } +``` + +> **Response** + +``` +{ "result": null, "id": 312} +``` + +## Listing Subscriptions[​](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Live-Subscribing-Unsubscribing-to-streams) + +> **Request** + +``` +{ "method": "LIST_SUBSCRIPTIONS", "id": 3 } +``` + +> **Response** + +``` +{ "result": [ "btc-210630-9000-p@ticker" ], "id": 3} +``` + +## Setting Properties[​](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Live-Subscribing-Unsubscribing-to-streams) + +Currently, the only property can be set is to set whether `combined` stream payloads are enabled are not. The combined property is set to `false` when connecting using `/ws/` ("raw streams") and `true` when connecting using `/stream/`. + +> **Request** + +``` +{ "method": "SET_PROPERTY", "params": [ "combined", true ], "id": 5 } +``` + +> **Response** + +``` +{ "result": null, "id": 5} +``` + +## Retrieving Properties[​](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Live-Subscribing-Unsubscribing-to-streams) + +> **Request** + +``` +{ "method": "GET_PROPERTY", "params": [ "combined" ], "id": 2 }       +``` + +> **Response** + +``` +{ "result": true, // Indicates that combined is set to true. "id": 2} +``` + +## Error Messages[​](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Live-Subscribing-Unsubscribing-to-streams) + +Error Message + +Description + +{"code": 0, "msg": "Unknown property"} + +Parameter used in the `SET_PROPERTY` or `GET_PROPERTY` was invalid + +{"code": 1, "msg": "Invalid value type: expected Boolean"} + +Value should only be `true` or `false` + +{"code": 2, "msg": "Invalid request: property name must be a string"} + +Property name provided was invalid + +{"code": 2, "msg": "Invalid request: request ID must be an unsigned integer"} + +Parameter `id` had to be provided or the value provided in the `id` parameter is an unsupported type + +{"code": 2, "msg": "Invalid request: unknown variant %s, expected one of `SUBSCRIBE`, `UNSUBSCRIBE`, `LIST_SUBSCRIPTIONS`, `SET_PROPERTY`, `GET_PROPERTY` at line 1 column 28"} + +Possible typo in the provided method or provided method was neither of the expected values + +{"code": 2, "msg": "Invalid request: too many parameters"} + +Unnecessary parameters provided in the data + +{"code": 2, "msg": "Invalid request: property name must be a string"} + +Property name was not provided + +{"code": 2, "msg": "Invalid request: missing field `method` at line 1 column 73"} + +`method` was not provided in the data + +{"code":3,"msg":"Invalid JSON: expected value at line %s column %s"} + +JSON data sent has incorrect syntax.    ## Trade Streams + +- [Subscribe to a stream](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Live-Subscribing-Unsubscribing-to-streams) +- [Unsubscribe to a stream](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Live-Subscribing-Unsubscribing-to-streams) +- [Listing Subscriptions](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Live-Subscribing-Unsubscribing-to-streams) +- [Setting Properties](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Live-Subscribing-Unsubscribing-to-streams) +- [Retrieving Properties](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Live-Subscribing-Unsubscribing-to-streams) +- [Error Messages](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Live-Subscribing-Unsubscribing-to-streams) diff --git a/docs/binance/binance_derivatives/docs_derivatives_options-trading_websocket-market-streams_Mark-Price.md b/docs/binance/binance_derivatives/docs_derivatives_options-trading_websocket-market-streams_Mark-Price.md new file mode 100644 index 0000000..f4d3aa9 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_options-trading_websocket-market-streams_Mark-Price.md @@ -0,0 +1,34 @@ +--- +title: "Mark Price | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Mark-Price" +fetched_at: "2026-01-27T05:28:13.665Z" +--- +# Mark Price + +## Stream Description[​](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Mark-Price) + +The mark price for all option symbols on specific underlying asset. E.g.[btcusdt@optionMarkPrice](wss://fstream.binance.com/market/stream?streams=btcusdt@optionMarkPrice) + +## URL PATH[​](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Mark-Price) + +`/market` + +## Stream Name[​](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Mark-Price) + +`@optionMarkPrice` + +## Update Speed[​](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Mark-Price) + +**1000ms** + +## Response Example[​](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Mark-Price) + +``` +[ { "s": "BTC-251120-126000-C", // Symbol "mp": "770.543", // Mark price "E": 1762867543321, // Event time "e": "markPrice", // Event type "i": "104334.60217391", // Index price "P": "0.000", // Estimated Settle Price, only useful in the 0.5 hour before the settlement starts "bo": "0.000", // The best buy price "ao": "900.000", // The best sell price "bq": "0.0000", // The best buy quantity "aq": "0.2000", // The best sell quantity "b": "-1.0", // BuyImplied volatility "a": "0.98161161", // SellImplied volatility "hl": "924.652", // Buy Maximum price "ll": "616.435", // Sell Minimum price "vo": "0.9408058", // volatility "rf": "0.0", // risk free rate "d": "0.11111964", // delta "t": "-164.26702615", // theta "g": "0.00001245", // gamma "v": "30.63855919" // vega }, { "s": "BTC-251123-126000-C", "mp": "1249.61", "E": 1762867543321, "e": "markPrice", "i": "104334.60217391", "P": "0.000", "bo": "1200.000", "ao": "1300.000", "bq": "0.3000", "aq": "0.6000", "b": "0.92159033", "a": "0.94461441", "hl": "1499.533", "ll": "999.688", "vo": "0.93310237", "rf": "0.0", "d": "0.14869196", "t": "-172.12148811", "g": "0.00001326", "v": "43.43627792" }] +``` + +- [Stream Description](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Mark-Price) +- [URL PATH](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Mark-Price) +- [Stream Name](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Mark-Price) +- [Update Speed](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Mark-Price) +- [Response Example](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Mark-Price) diff --git a/docs/binance/binance_derivatives/docs_derivatives_options-trading_websocket-market-streams_New-Symbol-Info.md b/docs/binance/binance_derivatives/docs_derivatives_options-trading_websocket-market-streams_New-Symbol-Info.md new file mode 100644 index 0000000..331e1cd --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_options-trading_websocket-market-streams_New-Symbol-Info.md @@ -0,0 +1,34 @@ +--- +title: "New Symbol Info | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/New-Symbol-Info" +fetched_at: "2026-01-27T05:28:13.928Z" +--- +# New Symbol Info + +## Stream Description[​](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/New-Symbol-Info) + +New symbol listing stream. + +## URL PATH[​](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/New-Symbol-Info) + +`/market` + +## Stream Name[​](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/New-Symbol-Info) + +`!optionSymbol` + +## Update Speed[​](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/New-Symbol-Info) + +**50ms**   + +## Response Example[​](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/New-Symbol-Info) + +``` +{ "e":"optionSymbol", // Event Type "E":1669356423908, // Event Time "s":"BTC-250926-140000-C", // Symbol "ps":"BTCUSDT", // Underlying index of the contract "qa":"USDT", // Quotation asset "d":"CALL", // Option type "sp":"21000", // Strike price "dt":4133404800000, // Delivery date time "u":1, // unit, the quantity of the underlying asset represented by a single contract. "ot":1569398400000, // onboard date time "cs":"TRADING" // Contract status } +``` + +- [Stream Description](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/New-Symbol-Info) +- [URL PATH](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/New-Symbol-Info) +- [Stream Name](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/New-Symbol-Info) +- [Update Speed](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/New-Symbol-Info) +- [Response Example](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/New-Symbol-Info) diff --git a/docs/binance/binance_derivatives/docs_derivatives_options-trading_websocket-market-streams_Open-Interest.md b/docs/binance/binance_derivatives/docs_derivatives_options-trading_websocket-market-streams_Open-Interest.md new file mode 100644 index 0000000..e89a142 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_options-trading_websocket-market-streams_Open-Interest.md @@ -0,0 +1,34 @@ +--- +title: "Open Interest | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Open-Interest" +fetched_at: "2026-01-27T05:28:13.789Z" +--- +# Open Interest + +## Stream Description[​](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Open-Interest) + +Option open interest for specific underlying asset on specific expiration date. E.g.[ethusdt@openInterest@221125](wss://fstream.binance.com/market/stream?streams=ethusdt@openInterest@221125) + +## URL PATH[​](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Open-Interest) + +`/market` + +## Stream Name[​](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Open-Interest) + +`underlying@optionOpenInterest@` + +## Update Speed[​](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Open-Interest) + +**60s** + +## Response Example[​](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Open-Interest) + +``` +[ { "e":"openInterest", // Event type "E":1668759300045, // Event time "s":"ETH-221125-2700-C", // option symbol "o":"1580.87", // Open interest in contracts "h":"1912992.178168204" // Open interest in USDT }] +``` + +- [Stream Description](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Open-Interest) +- [URL PATH](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Open-Interest) +- [Stream Name](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Open-Interest) +- [Update Speed](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Open-Interest) +- [Response Example](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Open-Interest) diff --git a/docs/binance/binance_derivatives/docs_derivatives_options-trading_websocket-market-streams_Partial-Book-Depth-Streams.md b/docs/binance/binance_derivatives/docs_derivatives_options-trading_websocket-market-streams_Partial-Book-Depth-Streams.md new file mode 100644 index 0000000..fe89ec1 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_options-trading_websocket-market-streams_Partial-Book-Depth-Streams.md @@ -0,0 +1,34 @@ +--- +title: "Partial Book Depth Streams | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Partial-Book-Depth-Streams" +fetched_at: "2026-01-27T05:28:13.947Z" +--- +# Partial Book Depth Streams + +## Stream Description[​](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Partial-Book-Depth-Streams) + +Top **** bids and asks, Valid levels are **** are 5, 10, 20. + +## URL PATH[​](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Partial-Book-Depth-Streams) + +`/public` + +## Stream Name[​](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Partial-Book-Depth-Streams) + +`@depth@100ms` or `@depth@500ms` + +## Update Speed[​](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Partial-Book-Depth-Streams) + +**100ms** or **500ms** + +## Response Example[​](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Partial-Book-Depth-Streams) + +``` +{ "e": "depthUpdate", // event type "E": 1762866729459, // event time "T": 1762866729358, // transaction time "s": "BTC-251123-126000-C", // Option symbol "U": 465, // First update ID in event "u": 465, // Final update ID in event "pu": 464, // Final update Id in last stream(ie `u` in last stream) "b": [ // Buy order [ "1100.000", // Price "0.6000" // quantity ] ], "a": [ // Sell order [ "1300.000", "0.6000" ] ]} +``` + +- [Stream Description](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Partial-Book-Depth-Streams) +- [URL PATH](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Partial-Book-Depth-Streams) +- [Stream Name](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Partial-Book-Depth-Streams) +- [Update Speed](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Partial-Book-Depth-Streams) +- [Response Example](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Partial-Book-Depth-Streams) diff --git a/docs/binance/binance_derivatives/docs_derivatives_options-trading_websocket-market-streams_Trade-Streams.md b/docs/binance/binance_derivatives/docs_derivatives_options-trading_websocket-market-streams_Trade-Streams.md new file mode 100644 index 0000000..554210e --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_options-trading_websocket-market-streams_Trade-Streams.md @@ -0,0 +1,34 @@ +--- +title: "Trade Streams | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Trade-Streams" +fetched_at: "2026-01-27T05:28:13.910Z" +--- +# Trade Streams + +## Stream Description[​](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Trade-Streams) + +The Trade Streams push raw trade information for specific symbol or underlying asset. E.g.[btcusdt@optionTrade](wss://fstream.binance.com/public/stream?streams=btcusdt@optionTrade) + +## URL PATH[​](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Trade-Streams) + +`/public` + +## Stream Name[​](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Trade-Streams) + +`@optionTrade` or `@optionTrade` + +## Update Speed[​](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Trade-Streams) + +**50ms** + +## Response Example[​](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Trade-Streams) + +``` +{ "e": "trade", // event type "E": 1762856064204, // event time "T": 1762856064203, // trade completed time "s": "BTC-251123-126000-C", // Option trading symbol "t": 4, // trade ID "p": "1300.000", // price "q": "0.1000", // quantity, always positive "X": "MARKET", // trade type enum, "MARKET" for Orderbook trading, "BLOCK" for Block trade "S": "BUY", // direction "m": false // Is the buyer the market maker?} +``` + +- [Stream Description](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Trade-Streams) +- [URL PATH](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Trade-Streams) +- [Stream Name](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Trade-Streams) +- [Update Speed](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Trade-Streams) +- [Response Example](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Trade-Streams) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_account.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_account.md new file mode 100644 index 0000000..6ead15c --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_account.md @@ -0,0 +1,52 @@ +--- +title: "Get Portfolio Margin Pro Account Info(USER_DATA) | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account" +fetched_at: "2026-01-27T05:28:14.043Z" +--- +# Get Portfolio Margin Pro Account Info(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account) + +Get Portfolio Margin Pro Account Info + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account) + +GET `/sapi/v1/portfolio/account` + +## Request Weight(UID)[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account) + +**5** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account) + +Name + +Type + +Mandatory + +Description + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account) + +``` +{ "uniMMR": "5167.92171923", // Classic Portfolio margin account maintenance margin rate "accountEquity": "122607.35137903", // Account equity, unit:USD "actualEquity": "142607.35137903", // Actual equity, unit:USD "accountMaintMargin": "23.72469206", // Classic Portfolio margin account maintenance margin, unit:USD "accountInitialMargin": "47.44938412", // Ignored for PM PRO and PM PRO SPAN "totalAvailableBalance" : "122,559.90199491",// Ignored for PM PRO and PM PRO SPAN "accountStatus": "NORMAL", // Classic Portfolio margin account status:"NORMAL", "MARGIN_CALL", "SUPPLY_MARGIN", "REDUCE_ONLY", "ACTIVE_LIQUIDATION", "FORCE_LIQUIDATION", "BANKRUPTED" "accountType": "PM_1" //PM_1 for PM PRO, PM_2 for PM, PM_3 for PM PRO SPAN } +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account) +- [Request Weight(UID)](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_account_BNB-transfer.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_account_BNB-transfer.md new file mode 100644 index 0000000..f37d395 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_account_BNB-transfer.md @@ -0,0 +1,68 @@ +--- +title: "BNB transfer(USER_DATA) | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/BNB-transfer" +fetched_at: "2026-01-27T05:28:14.170Z" +--- +# BNB transfer(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/BNB-transfer) + +BNB transfer can be between Margin Account and USDM Account + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/BNB-transfer) + +POST `/sapi/v1/portfolio/bnb-transfer` + +## Request Weight(IP)[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/BNB-transfer) + +**1500** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/BNB-transfer) + +Name + +Type + +Mandatory + +Description + +amount + +DECIMAL + +YES + +transferSide + +STRING + +YES + +"TO\_UM","FROM\_UM" + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +> - You can only use this function 2 times per 10 minutes in a rolling manner + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/BNB-transfer) + +``` +{ "tranId": 100000001} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/BNB-transfer) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/BNB-transfer) +- [Request Weight(IP)](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/BNB-transfer) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/BNB-transfer) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/BNB-transfer) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_account_Change-Auto-repay-futures-Status.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_account_Change-Auto-repay-futures-Status.md new file mode 100644 index 0000000..3b7c6ff --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_account_Change-Auto-repay-futures-Status.md @@ -0,0 +1,60 @@ +--- +title: "Change Auto repay futures Status(TRADE) | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Change-Auto-repay-futures-Status" +fetched_at: "2026-01-27T05:28:14.307Z" +--- +# Change Auto-repay-futures Status(TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Change-Auto-repay-futures-Status) + +Change Auto-repay-futures Status + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Change-Auto-repay-futures-Status) + +POST `/sapi/v1/portfolio/repay-futures-switch` + +## Request Weight(IP)[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Change-Auto-repay-futures-Status) + +**1500** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Change-Auto-repay-futures-Status) + +Name + +Type + +Mandatory + +Description + +autoRepay + +STRING + +YES + +Default: `true`; `false` for turn off the auto-repay futures negative balance function + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Change-Auto-repay-futures-Status) + +``` +{ "msg": "success"} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Change-Auto-repay-futures-Status) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Change-Auto-repay-futures-Status) +- [Request Weight(IP)](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Change-Auto-repay-futures-Status) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Change-Auto-repay-futures-Status) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Change-Auto-repay-futures-Status) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_account_Classic-Portfolio-Margin-Bankruptcy-Loan-Repay.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_account_Classic-Portfolio-Margin-Bankruptcy-Loan-Repay.md new file mode 100644 index 0000000..a46caa2 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_account_Classic-Portfolio-Margin-Bankruptcy-Loan-Repay.md @@ -0,0 +1,62 @@ +--- +title: "Classic Portfolio Margin Bankruptcy Loan Repay | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Classic-Portfolio-Margin-Bankruptcy-Loan-Repay" +fetched_at: "2026-01-27T05:28:14.203Z" +--- +# Portfolio Margin Pro Bankruptcy Loan Repay + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Classic-Portfolio-Margin-Bankruptcy-Loan-Repay) + +Repay Portfolio Margin Pro Bankruptcy Loan + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Classic-Portfolio-Margin-Bankruptcy-Loan-Repay) + +POST `/sapi/v1/portfolio/repay` + +## Request Weight(UID)[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Classic-Portfolio-Margin-Bankruptcy-Loan-Repay) + +**3000** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Classic-Portfolio-Margin-Bankruptcy-Loan-Repay) + +Name + +Type + +Mandatory + +Description + +from + +STRING + +NO + +SPOT or MARGIN,default SPOT + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +- Please note that the API Key has enabled Spot & Margin Trading permissions to access this endpoint. + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Classic-Portfolio-Margin-Bankruptcy-Loan-Repay) + +``` +{ "tranId": 58203331886213504} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Classic-Portfolio-Margin-Bankruptcy-Loan-Repay) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Classic-Portfolio-Margin-Bankruptcy-Loan-Repay) +- [Request Weight(UID)](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Classic-Portfolio-Margin-Bankruptcy-Loan-Repay) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Classic-Portfolio-Margin-Bankruptcy-Loan-Repay) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Classic-Portfolio-Margin-Bankruptcy-Loan-Repay) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_account_Fund-Auto-collection.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_account_Fund-Auto-collection.md new file mode 100644 index 0000000..0a64eaa --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_account_Fund-Auto-collection.md @@ -0,0 +1,55 @@ +--- +title: "Fund Auto collection(USER_DATA) | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Fund-Auto-collection" +fetched_at: "2026-01-27T05:28:14.299Z" +--- +# Fund Auto-collection(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Fund-Auto-collection) + +Transfers all assets from Futures Account to Margin account + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Fund-Auto-collection) + +POST `/sapi/v1/portfolio/auto-collection` + +## Request Weight(IP)[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Fund-Auto-collection) + +**1500** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Fund-Auto-collection) + +Name + +Type + +Mandatory + +Description + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +> - The BNB would not be collected from UM-PM account to the Portfolio Margin account. +> - You can only use this function 500 times per hour in a rolling manner. + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Fund-Auto-collection) + +``` +{ "msg": "success"} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Fund-Auto-collection) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Fund-Auto-collection) +- [Request Weight(IP)](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Fund-Auto-collection) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Fund-Auto-collection) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Fund-Auto-collection) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_account_Fund-Collection-by-Asset.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_account_Fund-Collection-by-Asset.md new file mode 100644 index 0000000..6426c06 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_account_Fund-Collection-by-Asset.md @@ -0,0 +1,60 @@ +--- +title: "Fund Collection by Asset(USER_DATA) | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Fund-Collection-by-Asset" +fetched_at: "2026-01-27T05:28:14.424Z" +--- +# Fund Collection by Asset(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Fund-Collection-by-Asset) + +Transfers specific asset from Futures Account to Margin account + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Fund-Collection-by-Asset) + +POST `/sapi/v1/portfolio/asset-collection` + +## Request Weight(IP)[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Fund-Collection-by-Asset) + +**60** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Fund-Collection-by-Asset) + +Name + +Type + +Mandatory + +Description + +asset + +STRING + +YES + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +> - The BNB transfer is not be supported + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Fund-Collection-by-Asset) + +``` +{ "msg": "success"} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Fund-Collection-by-Asset) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Fund-Collection-by-Asset) +- [Request Weight(IP)](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Fund-Collection-by-Asset) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Fund-Collection-by-Asset) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Fund-Collection-by-Asset) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_account_Get-Auto-repay-futures-Status.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_account_Get-Auto-repay-futures-Status.md new file mode 100644 index 0000000..8fffd8d --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_account_Get-Auto-repay-futures-Status.md @@ -0,0 +1,52 @@ +--- +title: "Get Auto repay futures Status(USER_DATA) | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Get-Auto-repay-futures-Status" +fetched_at: "2026-01-27T05:28:14.458Z" +--- +# Get Auto-repay-futures Status(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Get-Auto-repay-futures-Status) + +Query Auto-repay-futures Status + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Get-Auto-repay-futures-Status) + +GET `/sapi/v1/portfolio/repay-futures-switch` + +## Request Weight(IP)[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Get-Auto-repay-futures-Status) + +**30** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Get-Auto-repay-futures-Status) + +Name + +Type + +Mandatory + +Description + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Get-Auto-repay-futures-Status) + +``` +{ "autoRepay": true // "true" for turn on the auto-repay futures; "false" for turn off the auto-repay futures } +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Get-Auto-repay-futures-Status) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Get-Auto-repay-futures-Status) +- [Request Weight(IP)](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Get-Auto-repay-futures-Status) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Get-Auto-repay-futures-Status) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Get-Auto-repay-futures-Status) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_account_Get-Classic-Portfolio-Margin-Account-Info-V2.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_account_Get-Classic-Portfolio-Margin-Account-Info-V2.md new file mode 100644 index 0000000..00e20a9 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_account_Get-Classic-Portfolio-Margin-Account-Info-V2.md @@ -0,0 +1,52 @@ +--- +title: "Get Portfolio Margin Pro SPAN Account Info(USER_DATA) | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Get-Classic-Portfolio-Margin-Account-Info-V2" +fetched_at: "2026-01-27T05:28:14.689Z" +--- +# Get Portfolio Margin Pro SPAN Account Info(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Get-Classic-Portfolio-Margin-Account-Info-V2) + +Get Portfolio Margin Pro SPAN Account Info (For Portfolio Margin Pro SPAN users only) + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Get-Classic-Portfolio-Margin-Account-Info-V2) + +GET `/sapi/v2/portfolio/account` + +## Request Weight(IP)[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Get-Classic-Portfolio-Margin-Account-Info-V2) + +**5** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Get-Classic-Portfolio-Margin-Account-Info-V2) + +Name + +Type + +Mandatory + +Description + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Get-Classic-Portfolio-Margin-Account-Info-V2) + +``` +{ "uniMMR": "5167.92171923", "accountEquity": "122607.35137903", // Account equity, unit:USD "actualEquity": "142607.35137903", // Actual equity, unit:USD "accountMaintMargin": "23.72469206", //Account maintenance margin, unit:USD "riskUnitMMList":[ { "asset": "BTC", "uniMaintainUsd": "23.72469206" } ] "marginMM": "0.00000000", "otherMM": "0.00000000", "accountStatus": "NORMAL", // Classic Portfolio margin account status:"NORMAL", "MARGIN_CALL", "SUPPLY_MARGIN", "REDUCE_ONLY", "ACTIVE_LIQUIDATION", "FORCE_LIQUIDATION", "BANKRUPTED" "accountType": "PM_3" //PM_1 for classic PM, PM_2 for PM, PM_3 for PM Pro(SPAN) } +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Get-Classic-Portfolio-Margin-Account-Info-V2) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Get-Classic-Portfolio-Margin-Account-Info-V2) +- [Request Weight(IP)](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Get-Classic-Portfolio-Margin-Account-Info-V2) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Get-Classic-Portfolio-Margin-Account-Info-V2) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Get-Classic-Portfolio-Margin-Account-Info-V2) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_account_Get-Classic-Portfolio-Margin-Balance-Info.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_account_Get-Classic-Portfolio-Margin-Balance-Info.md new file mode 100644 index 0000000..360dc75 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_account_Get-Classic-Portfolio-Margin-Balance-Info.md @@ -0,0 +1,58 @@ +--- +title: "Get Portfolio Margin Pro Balance Info(USER_DATA) | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Get-Classic-Portfolio-Margin-Balance-Info" +fetched_at: "2026-01-27T05:28:14.567Z" +--- +# Get Portfolio Margin Pro Account Balance(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Get-Classic-Portfolio-Margin-Balance-Info) + +Query Portfolio Margin Pro account balance + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Get-Classic-Portfolio-Margin-Balance-Info) + +GET `/sapi/v1/portfolio/balance` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Get-Classic-Portfolio-Margin-Balance-Info) + +**20** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Get-Classic-Portfolio-Margin-Balance-Info) + +Name + +Type + +Mandatory + +Description + +asset + +STRING + +NO + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Get-Classic-Portfolio-Margin-Balance-Info) + +``` +[ { "asset": "BTC", // asset name "totalWalletBalance": "100", // wallet balance = cross margin free + cross margin locked + UM wallet balance + CM wallet balance "crossMarginAsset": "100", // crossMarginAsset = crossMarginFree + crossMarginLocked "crossMarginBorrowed": "0", // principal of cross margin "crossMarginFree": "100", // free asset of cross margin "crossMarginInterest": "0", // interest of cross margin "crossMarginLocked": "0", //lock asset of cross margin "umWalletBalance": "0", // wallet balance of um "umUnrealizedPNL": "0", // unrealized profit of um "cmWalletBalance": "0", // wallet balance of cm "cmUnrealizedPNL": "0", // unrealized profit of cm "updateTime": 0, "negativeBalance": "0", "optionWalletBalance": "0", //only for PM PRO SPAN "optionEquity": "0" //only for PM PRO SPAN }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Get-Classic-Portfolio-Margin-Balance-Info) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Get-Classic-Portfolio-Margin-Balance-Info) +- [Request Weight](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Get-Classic-Portfolio-Margin-Balance-Info) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Get-Classic-Portfolio-Margin-Balance-Info) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Get-Classic-Portfolio-Margin-Balance-Info) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_account_Get-Delta-Mode-Status.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_account_Get-Delta-Mode-Status.md new file mode 100644 index 0000000..0605c93 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_account_Get-Delta-Mode-Status.md @@ -0,0 +1,52 @@ +--- +title: "Get Delta Mode Status(USER_DATA) | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Get-Delta-Mode-Status" +fetched_at: "2026-01-27T05:28:14.681Z" +--- +# Get Delta Mode Status(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Get-Delta-Mode-Status) + +Query the Delta mode status of current account. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Get-Delta-Mode-Status) + +GET `/sapi/v1/portfolio/delta-mode` + +## Request Weight(IP)[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Get-Delta-Mode-Status) + +**1500** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Get-Delta-Mode-Status) + +Name + +Type + +Mandatory + +Description + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Get-Delta-Mode-Status) + +``` +{ "deltaEnabled": false} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Get-Delta-Mode-Status) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Get-Delta-Mode-Status) +- [Request Weight(IP)](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Get-Delta-Mode-Status) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Get-Delta-Mode-Status) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Get-Delta-Mode-Status) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_account_Get-Transferable-Earn-Asset-Balance-Portfolio-Margin.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_account_Get-Transferable-Earn-Asset-Balance-Portfolio-Margin.md new file mode 100644 index 0000000..f04446f --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_account_Get-Transferable-Earn-Asset-Balance-Portfolio-Margin.md @@ -0,0 +1,68 @@ +--- +title: "Get Transferable Earn Asset Balance for Portfolio Margin(USER_DATA) | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Get-Transferable-Earn-Asset-Balance-Portfolio-Margin" +fetched_at: "2026-01-27T05:28:14.716Z" +--- +# Get Transferable Earn Asset Balance for Portfolio Margin (USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Get-Transferable-Earn-Asset-Balance-Portfolio-Margin) + +Get transferable earn asset balance for all types of Portfolio Margin account + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Get-Transferable-Earn-Asset-Balance-Portfolio-Margin) + +GET `/sapi/v1/portfolio/earn-asset-balance` + +## Request Weight(IP)[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Get-Transferable-Earn-Asset-Balance-Portfolio-Margin) + +**1500** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Get-Transferable-Earn-Asset-Balance-Portfolio-Margin) + +Name + +Type + +Mandatory + +Description + +asset + +STRING + +YES + +`LDUSDT` only + +transferType + +STRING + +YES + +`EARN_TO_FUTURE` /`FUTURE_TO_EARN` + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Get-Transferable-Earn-Asset-Balance-Portfolio-Margin) + +``` +{ "asset": "LDUSDT", "amount": "0.55"} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Get-Transferable-Earn-Asset-Balance-Portfolio-Margin) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Get-Transferable-Earn-Asset-Balance-Portfolio-Margin) +- [Request Weight(IP)](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Get-Transferable-Earn-Asset-Balance-Portfolio-Margin) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Get-Transferable-Earn-Asset-Balance-Portfolio-Margin) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Get-Transferable-Earn-Asset-Balance-Portfolio-Margin) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_account_Query-Classic-Portfolio-Margin-Bankruptcy-Loan-Amount.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_account_Query-Classic-Portfolio-Margin-Bankruptcy-Loan-Amount.md new file mode 100644 index 0000000..c52f27f --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_account_Query-Classic-Portfolio-Margin-Bankruptcy-Loan-Amount.md @@ -0,0 +1,54 @@ +--- +title: "Query Portfolio Margin Pro Bankruptcy Loan Amount(USER_DATA) | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Query-Classic-Portfolio-Margin-Bankruptcy-Loan-Amount" +fetched_at: "2026-01-27T05:28:14.824Z" +--- +# Query Portfolio Margin Pro Bankruptcy Loan Amount(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Query-Classic-Portfolio-Margin-Bankruptcy-Loan-Amount) + +Query Portfolio Margin Pro Bankruptcy Loan Amount + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Query-Classic-Portfolio-Margin-Bankruptcy-Loan-Amount) + +GET `/sapi/v1/portfolio/pmLoan` + +## Request Weight(UID)[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Query-Classic-Portfolio-Margin-Bankruptcy-Loan-Amount) + +**500** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Query-Classic-Portfolio-Margin-Bankruptcy-Loan-Amount) + +Name + +Type + +Mandatory + +Description + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +> - If there’s no classic portfolio margin bankruptcy loan, the amount would be 0 + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Query-Classic-Portfolio-Margin-Bankruptcy-Loan-Amount) + +``` +{ "asset": "BUSD", "amount": "579.45", // portfolio margin bankruptcy loan amount in BUSD} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Query-Classic-Portfolio-Margin-Bankruptcy-Loan-Amount) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Query-Classic-Portfolio-Margin-Bankruptcy-Loan-Amount) +- [Request Weight(UID)](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Query-Classic-Portfolio-Margin-Bankruptcy-Loan-Amount) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Query-Classic-Portfolio-Margin-Bankruptcy-Loan-Amount) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Query-Classic-Portfolio-Margin-Bankruptcy-Loan-Amount) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_account_Query-Classic-Portfolio-Margin-Negative-Balance-Interest-History.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_account_Query-Classic-Portfolio-Margin-Negative-Balance-Interest-History.md new file mode 100644 index 0000000..d480f5b --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_account_Query-Classic-Portfolio-Margin-Negative-Balance-Interest-History.md @@ -0,0 +1,78 @@ +--- +title: "Query Portfolio Margin Pro Negative Balance Interest History(USER_DATA) | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Query-Classic-Portfolio-Margin-Negative-Balance-Interest-History" +fetched_at: "2026-01-27T05:28:15.076Z" +--- +# Query Portfolio Margin Pro Negative Balance Interest History(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Query-Classic-Portfolio-Margin-Negative-Balance-Interest-History) + +Query interest history of negative balance for portfolio margin. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Query-Classic-Portfolio-Margin-Negative-Balance-Interest-History) + +GET `/sapi/v1/portfolio/interest-history` + +## Request Weight(IP)[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Query-Classic-Portfolio-Margin-Negative-Balance-Interest-History) + +**50** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Query-Classic-Portfolio-Margin-Negative-Balance-Interest-History) + +Name + +Type + +Mandatory + +Description + +asset + +STRING + +NO + +startTime + +LONG + +NO + +endTime + +LONG + +NO + +size + +LONG + +NO + +Default:10 Max:100 + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Query-Classic-Portfolio-Margin-Negative-Balance-Interest-History) + +``` +[ { "asset": "USDT", "interest": "24.4440", //interest amount "interestAccruedTime": 1670227200000, "interestRate": "0.0001164", //daily interest rate "principal": "210000" } ] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Query-Classic-Portfolio-Margin-Negative-Balance-Interest-History) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Query-Classic-Portfolio-Margin-Negative-Balance-Interest-History) +- [Request Weight(IP)](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Query-Classic-Portfolio-Margin-Negative-Balance-Interest-History) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Query-Classic-Portfolio-Margin-Negative-Balance-Interest-History) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Query-Classic-Portfolio-Margin-Negative-Balance-Interest-History) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_account_Query-Portfolio-Margin-Pro-Bankruptcy-Loan-Repay-History.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_account_Query-Portfolio-Margin-Pro-Bankruptcy-Loan-Repay-History.md new file mode 100644 index 0000000..4567e6f --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_account_Query-Portfolio-Margin-Pro-Bankruptcy-Loan-Repay-History.md @@ -0,0 +1,85 @@ +--- +title: "Query Portfolio Margin Pro Bankruptcy Loan Repay History(USER_DATA) | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Query-Portfolio-Margin-Pro-Bankruptcy-Loan-Repay-History" +fetched_at: "2026-01-27T05:28:14.946Z" +--- +# Query Portfolio Margin Pro Bankruptcy Loan Repay History(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Query-Portfolio-Margin-Pro-Bankruptcy-Loan-Repay-History) + +Query repay history of pmloan for portfolio margin pro. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Query-Portfolio-Margin-Pro-Bankruptcy-Loan-Repay-History) + +GET `/sapi/v1/portfolio/pmloan-history` + +## Request Weight(IP)[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Query-Portfolio-Margin-Pro-Bankruptcy-Loan-Repay-History) + +**500** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Query-Portfolio-Margin-Pro-Bankruptcy-Loan-Repay-History) + +Name + +Type + +Mandatory + +Description + +startTime + +LONG + +NO + +endTime + +LONG + +NO + +current + +LONG + +NO + +Currently querying page. Start from 1. Default:1 + +size + +LONG + +NO + +Default:10 Max:100 + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +- `startTime` and `endTime` cannot be longer than 360 days +- If `startTime` and `endTime` not sent, return records of the last 30 days by default. +- If `startTime`is sent and `endTime` is not sent, return records of \[startTime, startTime+30d\]. +- If `startTime` is not sent and `endTime` is sent, return records of \[endTime-30d, endTime\]. + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Query-Portfolio-Margin-Pro-Bankruptcy-Loan-Repay-History) + +``` +{ "total": 3, "rows": [ { "asset": "USDT", "amount": "404.80294503", "repayTime": 1731336427804 }, { "asset": "USDT", "amount": "4620.41204574", "repayTime": 1726125090016 } ]} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Query-Portfolio-Margin-Pro-Bankruptcy-Loan-Repay-History) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Query-Portfolio-Margin-Pro-Bankruptcy-Loan-Repay-History) +- [Request Weight(IP)](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Query-Portfolio-Margin-Pro-Bankruptcy-Loan-Repay-History) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Query-Portfolio-Margin-Pro-Bankruptcy-Loan-Repay-History) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Query-Portfolio-Margin-Pro-Bankruptcy-Loan-Repay-History) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_account_Repay-futures-Negative-Balance.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_account_Repay-futures-Negative-Balance.md new file mode 100644 index 0000000..4bb268e --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_account_Repay-futures-Negative-Balance.md @@ -0,0 +1,60 @@ +--- +title: "Repay futures Negative Balance(USER_DATA) | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Repay-futures-Negative-Balance" +fetched_at: "2026-01-27T05:28:15.108Z" +--- +# Repay futures Negative Balance(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Repay-futures-Negative-Balance) + +Repay futures Negative Balance + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Repay-futures-Negative-Balance) + +POST `/sapi/v1/portfolio/repay-futures-negative-balance` + +## Request Weight(IP)[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Repay-futures-Negative-Balance) + +**1500** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Repay-futures-Negative-Balance) + +Name + +Type + +Mandatory + +Description + +from + +STRING + +NO + +SPOT or MARGIN,default SPOT| + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Repay-futures-Negative-Balance) + +``` +{ "msg": "success"} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Repay-futures-Negative-Balance) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Repay-futures-Negative-Balance) +- [Request Weight(IP)](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Repay-futures-Negative-Balance) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Repay-futures-Negative-Balance) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Repay-futures-Negative-Balance) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_account_Switch-Delta-Mode.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_account_Switch-Delta-Mode.md new file mode 100644 index 0000000..d247e1b --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_account_Switch-Delta-Mode.md @@ -0,0 +1,60 @@ +--- +title: "Switch Delta Mode(TRADE) | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Switch-Delta-Mode" +fetched_at: "2026-01-27T05:28:15.089Z" +--- +# Switch Delta Mode(TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Switch-Delta-Mode) + +Switch the Delta mode for existing PM PRO / PM RETAIL accounts. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Switch-Delta-Mode) + +POST `/sapi/v1/portfolio/delta-mode` + +## Request Weight(IP)[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Switch-Delta-Mode) + +**1500** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Switch-Delta-Mode) + +Name + +Type + +Mandatory + +Description + +deltaEnabled + +STRING + +YES + +`true` to enable Delta mode; `false` to disable Delta mode + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Switch-Delta-Mode) + +``` +{ "msg": "success"} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Switch-Delta-Mode) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Switch-Delta-Mode) +- [Request Weight(IP)](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Switch-Delta-Mode) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Switch-Delta-Mode) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Switch-Delta-Mode) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_account_Transfer-LDUSDT-Portfolio-Margin.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_account_Transfer-LDUSDT-Portfolio-Margin.md new file mode 100644 index 0000000..410e58d --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_account_Transfer-LDUSDT-Portfolio-Margin.md @@ -0,0 +1,74 @@ +--- +title: "Transfer LDUSDT for Portfolio Margin(TRADE) | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Transfer-LDUSDT-Portfolio-Margin" +fetched_at: "2026-01-27T05:28:15.197Z" +--- +# Transfer LDUSDT/RWUSD for Portfolio Margin(TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Transfer-LDUSDT-Portfolio-Margin) + +Transfer LDUSDT/RWUSD as collateral for all types of Portfolio Margin account + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Transfer-LDUSDT-Portfolio-Margin) + +POST `/sapi/v1/portfolio/earn-asset-transfer` + +## Request Weight(UID)[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Transfer-LDUSDT-Portfolio-Margin) + +**1500** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Transfer-LDUSDT-Portfolio-Margin) + +Name + +Type + +Mandatory + +Description + +asset + +STRING + +YES + +`LDUSDT` and `RWUSD` + +transferType + +STRING + +YES + +`EARN_TO_FUTURE` /`FUTURE_TO_EARN` + +amount + +DECIMAL + +YES + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Transfer-LDUSDT-Portfolio-Margin) + +``` +{ "msg":"success"} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Transfer-LDUSDT-Portfolio-Margin) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Transfer-LDUSDT-Portfolio-Margin) +- [Request Weight(UID)](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Transfer-LDUSDT-Portfolio-Margin) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Transfer-LDUSDT-Portfolio-Margin) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Transfer-LDUSDT-Portfolio-Margin) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_error-code.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_error-code.md new file mode 100644 index 0000000..20b2f9f --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_error-code.md @@ -0,0 +1,1444 @@ +--- +title: "Error Code | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code" +fetched_at: "2026-01-27T05:28:15.422Z" +--- +# Error Codes + +> The error JSON payload: + +``` +{ "code":-1121, "msg":"Invalid symbol."} +``` + +Errors consist of two parts: an error code and a message. Codes are universal, but messages can vary. + +## 10xx - General Server or Network issues[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +### \-1000 UNKNOWN[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- An unknown error occurred while processing the request. +- An unknown error occurred while processing the request.\[%s\] + +### \-1001 DISCONNECTED[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Internal error; unable to process your request. Please try again. + +### \-1002 UNAUTHORIZED[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- You are not authorized to execute this request. + +### \-1003 TOO\_MANY\_REQUESTS[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Too much request weight used; current limit is %s request weight per %s. Please use WebSocket Streams for live updates to avoid polling the API. +- Way too much request weight used; IP banned until %s. Please use WebSocket Streams for live updates to avoid bans. + +### \-1004 SERVER\_BUSY[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Server is busy, please wait and try again + +### \-1006 UNEXPECTED\_RESP[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- An unexpected response was received from the message bus. Execution status unknown. + +### \-1007 TIMEOUT[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Timeout waiting for response from backend server. Send status unknown; execution status unknown. + +### \-1008 SERVER\_BUSY[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Spot server is currently overloaded with other requests. Please try again in a few minutes. + +### \-1014 UNKNOWN\_ORDER\_COMPOSITION[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Unsupported order combination. + +### \-1015 TOO\_MANY\_ORDERS[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Too many new orders. +- Too many new orders; current limit is %s orders per %s. + +### \-1016 SERVICE\_SHUTTING\_DOWN[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- This service is no longer available. + +### \-1020 UNSUPPORTED\_OPERATION[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- This operation is not supported. + +### \-1021 INVALID\_TIMESTAMP[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Timestamp for this request is outside of the recvWindow. +- Timestamp for this request was 1000ms ahead of the server's time. + +### \-1022 INVALID\_SIGNATURE[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Signature for this request is not valid. + +### \-1099 Not found, authenticated, or authorized[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- This replaces error code -1999 + +## 11xx - 2xxx Request issues[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +### \-1100 ILLEGAL\_CHARS[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Illegal characters found in a parameter. +- Illegal characters found in a parameter. %s +- Illegal characters found in parameter `%s`; legal range is `%s`. + +### \-1101 TOO\_MANY\_PARAMETERS[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Too many parameters sent for this endpoint. +- Too many parameters; expected `%s` and received `%s`. +- Duplicate values for a parameter detected. + +### \-1102 MANDATORY\_PARAM\_EMPTY\_OR\_MALFORMED[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- A mandatory parameter was not sent, was empty/null, or malformed. +- Mandatory parameter `%s` was not sent, was empty/null, or malformed. +- Param `%s` or `%s` must be sent, but both were empty/null! + +### \-1103 UNKNOWN\_PARAM[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- An unknown parameter was sent. + +### \-1104 UNREAD\_PARAMETERS[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Not all sent parameters were read. +- Not all sent parameters were read; read `%s` parameter(s) but was sent `%s`. + +### \-1105 PARAM\_EMPTY[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- A parameter was empty. +- Parameter `%s` was empty. + +### \-1106 PARAM\_NOT\_REQUIRED[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- A parameter was sent when not required. +- Parameter `%s` sent when not required. + +### \-1111 BAD\_PRECISION[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Precision is over the maximum defined for this asset. + +### \-1112 NO\_DEPTH[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- No orders on book for symbol. + +### \-1114 TIF\_NOT\_REQUIRED[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- TimeInForce parameter sent when not required. + +### \-1115 INVALID\_TIF[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Invalid timeInForce. + +### \-1116 INVALID\_ORDER\_TYPE[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Invalid orderType. + +### \-1117 INVALID\_SIDE[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Invalid side. + +### \-1118 EMPTY\_NEW\_CL\_ORD\_ID[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- New client order ID was empty. + +### \-1119 EMPTY\_ORG\_CL\_ORD\_ID[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Original client order ID was empty. + +### \-1120 BAD\_INTERVAL[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Invalid interval. + +### \-1121 BAD\_SYMBOL[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Invalid symbol. + +### \-1125 INVALID\_LISTEN\_KEY[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- This listenKey does not exist. + +### \-1127 MORE\_THAN\_XX\_HOURS[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Lookup interval is too big. +- More than %s hours between startTime and endTime. + +### \-1128 OPTIONAL\_PARAMS\_BAD\_COMBO[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Combination of optional parameters invalid. + +### \-1130 INVALID\_PARAMETER[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Invalid data sent for a parameter. +- Data sent for parameter `%s` is not valid. + +### \-1131 BAD\_RECV\_WINDOW[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- recvWindow must be less than 60000 + +### \-1134 BAD\_STRATEGY\_TYPE[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- `strategyType` was less than 1000000. + +#### \-1145 INVALID\_CANCEL\_RESTRICTIONS[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- `cancelRestrictions` has to be either `ONLY_NEW` or `ONLY_PARTIALLY_FILLED`. + +#### \-1151 DUPLICATE\_SYMBOLS[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Symbol is present multiple times in the list. + +### \-2010 NEW\_ORDER\_REJECTED[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- NEW\_ORDER\_REJECTED + +### \-2011 CANCEL\_REJECTED[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- CANCEL\_REJECTED + +### \-2013 NO\_SUCH\_ORDER[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Order does not exist. + +### \-2014 BAD\_API\_KEY\_FMT[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- API-key format invalid. + +### \-2015 REJECTED\_MBX\_KEY[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Invalid API-key, IP, or permissions for action. + +### \-2016 NO\_TRADING\_WINDOW[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- No trading window could be found for the symbol. Try ticker/24hrs instead. + +#### \-2026 ORDER\_ARCHIVED[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Order was canceled or expired with no executed qty over 90 days ago and has been archived. + +## 3xxx-5xxx SAPI-specific issues[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +### \-3000 INNER\_FAILURE[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Internal server error. + +### \-3001 NEED\_ENABLE\_2FA[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Please enable 2FA first. + +### \-3002 ASSET\_DEFICIENCY[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- We don't have this asset. + +### \-3003 NO\_OPENED\_MARGIN\_ACCOUNT[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Margin account does not exist. + +### \-3004 TRADE\_NOT\_ALLOWED[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Trade not allowed. + +### \-3005 TRANSFER\_OUT\_NOT\_ALLOWED[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Transferring out not allowed. + +### \-3006 EXCEED\_MAX\_BORROWABLE[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Your borrow amount has exceed maximum borrow amount. + +### \-3007 HAS\_PENDING\_TRANSACTION[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- You have pending transaction, please try again later. + +### \-3008 BORROW\_NOT\_ALLOWED[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Borrow not allowed. + +### \-3009 ASSET\_NOT\_MORTGAGEABLE[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- This asset are not allowed to transfer into margin account currently. + +### \-3010 REPAY\_NOT\_ALLOWED[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Repay not allowed. + +### \-3011 BAD\_DATE\_RANGE[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Your input date is invalid. + +### \-3012 ASSET\_ADMIN\_BAN\_BORROW[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Borrow is banned for this asset. + +### \-3013 LT\_MIN\_BORROWABLE[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Borrow amount less than minimum borrow amount. + +### \-3014 ACCOUNT\_BAN\_BORROW[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Borrow is banned for this account. + +### \-3015 REPAY\_EXCEED\_LIABILITY[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Repay amount exceeds borrow amount. + +### \-3016 LT\_MIN\_REPAY[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Repay amount less than minimum repay amount. + +### \-3017 ASSET\_ADMIN\_BAN\_MORTGAGE[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- This asset are not allowed to transfer into margin account currently. + +### \-3018 ACCOUNT\_BAN\_MORTGAGE[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Transferring in has been banned for this account. + +### \-3019 ACCOUNT\_BAN\_ROLLOUT[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Transferring out has been banned for this account. + +### \-3020 EXCEED\_MAX\_ROLLOUT[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Transfer out amount exceeds max amount. + +### \-3021 PAIR\_ADMIN\_BAN\_TRADE[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Margin account are not allowed to trade this trading pair. + +### \-3022 ACCOUNT\_BAN\_TRADE[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- You account's trading is banned. + +### \-3023 WARNING\_MARGIN\_LEVEL[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- You can't transfer out/place order under current margin level. + +### \-3024 FEW\_LIABILITY\_LEFT[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- The unpaid debt is too small after this repayment. + +### \-3025 INVALID\_EFFECTIVE\_TIME[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Your input date is invalid. + +### \-3026 VALIDATION\_FAILED[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Your input param is invalid. + +### \-3027 NOT\_VALID\_MARGIN\_ASSET[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Not a valid margin asset. + +### \-3028 NOT\_VALID\_MARGIN\_PAIR[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Not a valid margin pair. + +### \-3029 TRANSFER\_FAILED[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Transfer failed. + +### \-3036 ACCOUNT\_BAN\_REPAY[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- This account is not allowed to repay. + +### \-3037 PNL\_CLEARING[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- PNL is clearing. Wait a second. + +### \-3038 LISTEN\_KEY\_NOT\_FOUND[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Listen key not found. + +### \-3041 BALANCE\_NOT\_CLEARED[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Balance is not enough + +### \-3042 PRICE\_INDEX\_NOT\_FOUND[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- PriceIndex not available for this margin pair. + +### \-3043 TRANSFER\_IN\_NOT\_ALLOWED[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Transferring in not allowed. + +### \-3044 SYSTEM\_BUSY[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- System busy. + +### \-3045 SYSTEM[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- The system doesn't have enough asset now. + +### \-3999 NOT\_WHITELIST\_USER[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- This function is only available for invited users. + +### \-4001 CAPITAL\_INVALID[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Invalid operation. + +### \-4002 CAPITAL\_IG[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Invalid get. + +### \-4003 CAPITAL\_IEV[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Your input email is invalid. + +### \-4004 CAPITAL\_UA[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- You don't login or auth. + +### \-4005 CAPAITAL\_TOO\_MANY\_REQUEST[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Too many new requests. + +### \-4006 CAPITAL\_ONLY\_SUPPORT\_PRIMARY\_ACCOUNT[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Support main account only. + +### \-4007 CAPITAL\_ADDRESS\_VERIFICATION\_NOT\_PASS[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Address validation is not passed. + +### \-4008 CAPITAL\_ADDRESS\_TAG\_VERIFICATION\_NOT\_PASS[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Address tag validation is not passed. + +### \-4010 CAPITAL\_WHITELIST\_EMAIL\_CONFIRM[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- White list mail has been confirmed. + +### \-4011 CAPITAL\_WHITELIST\_EMAIL\_EXPIRED[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- White list mail is invalid. + +### \-4012 CAPITAL\_WHITELIST\_CLOSE[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- White list is not opened. + +### \-4013 CAPITAL\_WITHDRAW\_2FA\_VERIFY[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- 2FA is not opened. + +### \-4014 CAPITAL\_WITHDRAW\_LOGIN\_DELAY[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Withdraw is not allowed within 2 min login. + +### \-4015 CAPITAL\_WITHDRAW\_RESTRICTED\_MINUTE[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Withdraw is limited. + +### \-4016 CAPITAL\_WITHDRAW\_RESTRICTED\_PASSWORD[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Within 24 hours after password modification, withdrawal is prohibited. + +### \-4017 CAPITAL\_WITHDRAW\_RESTRICTED\_UNBIND\_2FA[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Within 24 hours after the release of 2FA, withdrawal is prohibited. + +### \-4018 CAPITAL\_WITHDRAW\_ASSET\_NOT\_EXIST[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- We don't have this asset. + +### \-4019 CAPITAL\_WITHDRAW\_ASSET\_PROHIBIT[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Current asset is not open for withdrawal. + +### \-4021 CAPITAL\_WITHDRAW\_AMOUNT\_MULTIPLE[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Asset withdrawal must be an %s multiple of %s. + +### \-4022 CAPITAL\_WITHDRAW\_MIN\_AMOUNT[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Not less than the minimum pick-up quantity %s. + +### \-4023 CAPITAL\_WITHDRAW\_MAX\_AMOUNT[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Within 24 hours, the withdrawal exceeds the maximum amount. + +### \-4024 CAPITAL\_WITHDRAW\_USER\_NO\_ASSET[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- You don't have this asset. + +### \-4025 CAPITAL\_WITHDRAW\_USER\_ASSET\_LESS\_THAN\_ZERO[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- The number of hold asset is less than zero. + +### \-4026 CAPITAL\_WITHDRAW\_USER\_ASSET\_NOT\_ENOUGH[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- You have insufficient balance. + +### \-4027 CAPITAL\_WITHDRAW\_GET\_TRAN\_ID\_FAILURE[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Failed to obtain tranId. + +### \-4028 CAPITAL\_WITHDRAW\_MORE\_THAN\_FEE[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- The amount of withdrawal must be greater than the Commission. + +### \-4029 CAPITAL\_WITHDRAW\_NOT\_EXIST[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- The withdrawal record does not exist. + +### \-4030 CAPITAL\_WITHDRAW\_CONFIRM\_SUCCESS[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Confirmation of successful asset withdrawal. + +### \-4031 CAPITAL\_WITHDRAW\_CANCEL\_FAILURE[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Cancellation failed. + +### \-4032 CAPITAL\_WITHDRAW\_CHECKSUM\_VERIFY\_FAILURE[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Withdraw verification exception. + +### \-4033 CAPITAL\_WITHDRAW\_ILLEGAL\_ADDRESS[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Illegal address. + +### \-4034 CAPITAL\_WITHDRAW\_ADDRESS\_CHEAT[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- The address is suspected of fake. + +### \-4035 CAPITAL\_WITHDRAW\_NOT\_WHITE\_ADDRESS[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- This address is not on the whitelist. Please join and try again. + +### \-4036 CAPITAL\_WITHDRAW\_NEW\_ADDRESS[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- The new address needs to be withdrawn in {0} hours. + +### \-4037 CAPITAL\_WITHDRAW\_RESEND\_EMAIL\_FAIL[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Re-sending Mail failed. + +### \-4038 CAPITAL\_WITHDRAW\_RESEND\_EMAIL\_TIME\_OUT[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Please try again in 5 minutes. + +### \-4039 CAPITAL\_USER\_EMPTY[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- The user does not exist. + +### \-4040 CAPITAL\_NO\_CHARGE[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- This address not charged. + +### \-4041 CAPITAL\_MINUTE\_TOO\_SMALL[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Please try again in one minute. + +### \-4042 CAPITAL\_CHARGE\_NOT\_RESET[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- This asset cannot get deposit address again. + +### \-4043 CAPITAL\_ADDRESS\_TOO\_MUCH[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- More than 100 recharge addresses were used in 24 hours. + +### \-4044 CAPITAL\_BLACKLIST\_COUNTRY\_GET\_ADDRESS[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- This is a blacklist country. + +### \-4045 CAPITAL\_GET\_ASSET\_ERROR[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Failure to acquire assets. + +### \-4046 CAPITAL\_AGREEMENT\_NOT\_CONFIRMED[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Agreement not confirmed. + +### \-4047 CAPITAL\_DATE\_INTERVAL\_LIMIT[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Time interval must be within 0-90 days + +### \-4060 CAPITAL\_WITHDRAW\_USER\_ASSET\_LOCK\_DEPOSIT[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- As your deposit has not reached the required block confirmations, we have temporarily locked {0} asset + +### \-5001 ASSET\_DRIBBLET\_CONVERT\_SWITCH\_OFF[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Don't allow transfer to micro assets. + +### \-5002 ASSET\_ASSET\_NOT\_ENOUGH[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- You have insufficient balance. + +### \-5003 ASSET\_USER\_HAVE\_NO\_ASSET[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- You don't have this asset. + +### \-5004 USER\_OUT\_OF\_TRANSFER\_FLOAT[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- The residual balances have exceeded 0.001BTC, Please re-choose. +- The residual balances of %s have exceeded 0.001BTC, Please re-choose. + +### \-5005 USER\_ASSET\_AMOUNT\_IS\_TOO\_LOW[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- The residual balances of the BTC is too low +- The residual balances of %s is too low, Please re-choose. + +### \-5006 USER\_CAN\_NOT\_REQUEST\_IN\_24\_HOURS[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Only transfer once in 24 hours. + +### \-5007 AMOUNT\_OVER\_ZERO[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Quantity must be greater than zero. + +### \-5008 ASSET\_WITHDRAW\_WITHDRAWING\_NOT\_ENOUGH[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Insufficient amount of returnable assets. + +### \-5009 PRODUCT\_NOT\_EXIST[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Product does not exist. + +### \-5010 TRANSFER\_FAIL[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Asset transfer fail. + +### \-5011 FUTURE\_ACCT\_NOT\_EXIST[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- future account not exists. + +### \-5012 TRANSFER\_PENDING[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Asset transfer is in pending. + +### \-5021 PARENT\_SUB\_HAVE\_NO\_RELATION[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- This parent sub have no relation + +### \-5012 FUTURE\_ACCT\_OR\_SUBRELATION\_NOT\_EXIST[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- future account or sub relation not exists. + +## 6XXX - Savings Issues[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +### \-6001 DAILY\_PRODUCT\_NOT\_EXIST[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Daily product not exists. + +### \-6003 DAILY\_PRODUCT\_NOT\_ACCESSIBLE[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Product not exist or you don't have permission + +### \-6004 DAILY\_PRODUCT\_NOT\_PURCHASABLE[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Product not in purchase status + +### \-6005 DAILY\_LOWER\_THAN\_MIN\_PURCHASE\_LIMIT[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Smaller than min purchase limit + +### \-6006 DAILY\_REDEEM\_AMOUNT\_ERROR[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Redeem amount error + +### \-6007 DAILY\_REDEEM\_TIME\_ERROR[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Not in redeem time + +### \-6008 DAILY\_PRODUCT\_NOT\_REDEEMABLE[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Product not in redeem status + +### \-6009 REQUEST\_FREQUENCY\_TOO\_HIGH[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Request frequency too high + +### \-6011 EXCEEDED\_USER\_PURCHASE\_LIMIT[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Exceeding the maximum num allowed to purchase per user + +### \-6012 BALANCE\_NOT\_ENOUGH[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Balance not enough + +### \-6013 PURCHASING\_FAILED[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Purchasing failed + +### \-6014 UPDATE\_FAILED[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Exceed up-limit allowed to purchased + +### \-6015 EMPTY\_REQUEST\_BODY[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Empty request body + +### \-6016 PARAMS\_ERR[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Parameter err + +### \-6017 NOT\_IN\_WHITELIST[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Not in whitelist + +### \-6018 ASSET\_NOT\_ENOUGH[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Asset not enough + +### \-6019 PENDING[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Need confirm + +### \-6020 PROJECT\_NOT\_EXISTS[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Project not exists + +## 70xx - Futures[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +### \-7001 FUTURES\_BAD\_DATE\_RANGE[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Date range is not supported. + +### \-7002 FUTURES\_BAD\_TYPE[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Data request type is not supported. + +## 20xxx - Futures/Spot Algo[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +### \-20121[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Invalid symbol. + +### \-20124[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Invalid algo id or it has been completed. + +### \-20130[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Invalid data sent for a parameter. + +### \-20132[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- The client algo id is duplicated. + +### \-20194[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Duration is too short to execute all required quantity. + +### \-20195[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- The total size is too small. + +### \-20196[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- The total size is too large. + +### \-20198[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Reach the max open orders allowed. + +### \-20204[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- The notional of USD is less or more than the limit. + +## Filter failures[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +Error message + +Description + +"Filter failure: PRICE\_FILTER" + +`price` is too high, too low, and/or not following the tick size rule for the symbol. + +"Filter failure: PERCENT\_PRICE" + +`price` is X% too high or X% too low from the average weighted price over the last Y minutes. + +"Filter failure: PERCENT\_PRICE\_BY\_SIDE" + +`price` is X% too high or Y% too low from the `lastPrice` on that side (i.e. BUY/SELL) + +"Filter failure: LOT\_SIZE" + +`quantity` is too high, too low, and/or not following the step size rule for the symbol. + +"Filter failure: MIN\_NOTIONAL" + +`price` \* `quantity` is too low to be a valid order for the symbol. + +"Filter failure: ICEBERG\_PARTS" + +`ICEBERG` order would break into too many parts; icebergQty is too small. + +"Filter failure: MARKET\_LOT\_SIZE" + +`MARKET` order's `quantity` is too high, too low, and/or not following the step size rule for the symbol. + +"Filter failure: MAX\_POSITION" + +The account's position has reached the maximum defined limit. + +This is composed of the sum of the balance of the base asset, and the sum of the quantity of all open `BUY`orders. + +"Filter failure: MAX\_NUM\_ORDERS" + +Account has too many open orders on the symbol. + +"Filter failure: MAX\_NUM\_ALGO\_ORDERS" + +Account has too many open stop loss and/or take profit orders on the symbol. + +"Filter failure: MAX\_NUM\_ICEBERG\_ORDERS" + +Account has too many open iceberg orders on the symbol. + +"Filter failure: TRAILING\_DELTA" + +`trailingDelta` is not within the defined range of the filter for that order type. + +"Filter failure: EXCHANGE\_MAX\_NUM\_ORDERS" + +Account has too many open orders on the exchange. + +"Filter failure: EXCHANGE\_MAX\_NUM\_ALGO\_ORDERS" + +Account has too many open stop loss and/or take profit orders on the exchange. + +## 10xxx - Crypto Loans[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +### \-10001 SYSTEM\_MAINTENANCE[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- The system is under maintenance, please try again later. + +### \-10002 INVALID\_INPUT[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Invalid input parameters. + +### \-10005 NO\_RECORDS[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- No records found. + +### \-10007 COIN\_NOT\_LOANABLE[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- This coin is not loanable. + +### \-10008 COIN\_NOT\_LOANABLE[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- This coin is not loanable + +### \-10009 COIN\_NOT\_COLLATERAL[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- This coin can not be used as collateral. + +### \-10010 COIN\_NOT\_COLLATERAL[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- This coin can not be used as collateral. + +### \-10011 INSUFFICIENT\_ASSET[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Insufficient spot assets. + +### \-10012 INVALID\_AMOUNT[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Invalid repayment amount. + +### \-10013 INSUFFICIENT\_AMOUNT[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Insufficient collateral amount. + +### \-10015 DEDUCTION\_FAILED[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Collateral deduction failed. + +### \-10016 LOAN\_FAILED[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Failed to provide loan. + +### \-10017 REPAY\_EXCEED\_DEBT[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Repayment amount exceeds debt. + +### \-10018 INVALID\_AMOUNT[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Invalid repayment amount. + +### \-10019 CONFIG\_NOT\_EXIST[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Configuration does not exists. + +### \-10020 UID\_NOT\_EXIST[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- User ID does not exist. + +### \-10021 ORDER\_NOT\_EXIST[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Order does not exist. + +### \-10022 INVALID\_AMOUNT[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Invalid adjustment amount. + +### \-10023 ADJUST\_LTV\_FAILED[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Failed to adjust LTV. + +### \-10024 ADJUST\_LTV\_NOT\_SUPPORTED[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- LTV adjustment not supported. + +### \-10025 REPAY\_FAILED[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Repayment failed. + +### \-10026 INVALID\_PARAMETER[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Invalid parameter. + +### \-10028 INVALID\_PARAMETER[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Invalid parameter. + +### \-10029 AMOUNT\_TOO\_SMALL[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Loan amount is too small. + +### \-10030 AMOUNT\_TOO\_LARGE[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Loan amount is too much. + +### \-10031 QUOTA\_REACHED[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Individual loan quota reached. + +### \-10032 REPAY\_NOT\_AVAILABLE[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Repayment is temporarily unavailable. + +### \-10034 REPAY\_NOT\_AVAILABLE[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Repay with collateral is not available currently, please try to repay with borrowed coin. + +### \-10039 AMOUNT\_TOO\_SMALL[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Repayment amount is too small. + +### \-10040 AMOUNT\_TOO\_LARGE[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Repayment amount is too large. + +### \-10041 INSUFFICIENT\_AMOUNT[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Due to high demand, there are currently insufficient loanable assets for {0}. Please adjust your borrow amount or try again tomorrow. + +### \-10042 ASSET\_NOT\_SUPPORTED[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- asset %s is not supported + +### \-10043 ASSET\_NOT\_SUPPORTED[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- {0} borrowing is currently not supported. + +### \-10044 QUOTA\_REACHED[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Collateral amount has reached the limit. Please reduce your collateral amount or try with other collaterals. + +### \-10045 COLLTERAL\_REPAY\_NOT\_SUPPORTED[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- The loan coin does not support collateral repayment. Please try again later. + +### \-10046 EXCEED\_MAX\_ADJUSTMENT[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Collateral Adjustment exceeds the maximum limit. Please try again. + +### \-10047 REGION\_NOT\_SUPPORTED[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- This coin is currently not supported in your location due to local regulations. + +## 13xxx - BLVT[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +### \-13000 BLVT\_FORBID\_REDEEM[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Redeption of the token is forbiden now + +### \-13001 BLVT\_EXCEED\_DAILY\_LIMIT[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Exceeds individual 24h redemption limit of the token + +### \-13002 BLVT\_EXCEED\_TOKEN\_DAILY\_LIMIT[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Exceeds total 24h redemption limit of the token + +### \-13003 BLVT\_FORBID\_PURCHASE[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Subscription of the token is forbiden now + +### \-13004 BLVT\_EXCEED\_DAILY\_PURCHASE\_LIMIT[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Exceeds individual 24h subscription limit of the token + +### \-13005 BLVT\_EXCEED\_TOKEN\_DAILY\_PURCHASE\_LIMIT[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Exceeds total 24h subscription limit of the token + +### \-13006 BLVT\_PURCHASE\_LESS\_MIN\_AMOUNT[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Subscription amount is too small + +### \-13007 BLVT\_PURCHASE\_AGREEMENT\_NOT\_SIGN[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- The Agreement is not signed + +## 12xxx - Liquid Swap[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +### \-12014 TOO MANY REQUESTS[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- More than 1 request in 2 seconds + + +## 18xxx - Binance Code[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +### \-18002[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- The total amount of codes you created has exceeded the 24-hour limit, please try again after UTC 0 + +### \-18003[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Too many codes created in 24 hours, please try again after UTC 0 + +### \-18004[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Too many invalid redeem attempts in 24 hours, please try again after UTC 0 + +### \-18005[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Too many invalid verify attempts, please try later + +### \-18006[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- The amount is too small, please re-enter + +### \-18007[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- This token is not currently supported, please re-enter + +## 21xxx - Portfolio Margin Account[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +### \-21001 USER\_IS\_NOT\_UNIACCOUNT[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Request ID is not a Portfolio Margin Account. + +### \-21002 UNI\_ACCOUNT\_CANT\_TRANSFER\_FUTURE[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Portfolio Margin Account doesn't support transfer from margin to futures. + +### \-21003 NET\_ASSET\_MUST\_LTE\_RATIO[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- Fail to retrieve margin assets. + +### \-21004 USER\_NO\_LIABILITY[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- User doesn’t have portfolio margin bankruptcy loan + +### \-21005 NO\_ENOUGH\_ASSET[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- User’s spot wallet doesn’t have enough BUSD to repay portfolio margin bankruptcy loan + +### \-21006 HAD\_IN\_PROCESS\_REPAY[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- User had portfolio margin bankruptcy loan repayment in process + +### \-21007 IN\_FORCE\_LIQUIDATION[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- User failed to repay portfolio margin bankruptcy loan since liquidation was in process + +### \-21015 ENDPOINT\_GONE[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +- The endpoint has been deprecated and removed + + +## Order Rejection Issues[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +Error messages like these are indicated when the error is coming specifically from the matching engine: + +- `-1010 ERROR_MSG_RECEIVED` +- `-2010 NEW_ORDER_REJECTED` +- `-2011 CANCEL_REJECTED` + +The following messages which will indicate the specific error: + +Error message + +Description + +"Unknown order sent." + +The order (by either `orderId`, `clientOrderId`, `origClientOrderId`) could not be found. + +"Duplicate order sent." + +The `clientOrderId` is already in use. + +"Market is closed." + +The symbol is not trading. + +"Account has insufficient balance for requested action." + +Not enough funds to complete the action. + +"Market orders are not supported for this symbol." + +`MARKET` is not enabled on the symbol. + +"Iceberg orders are not supported for this symbol." + +`icebergQty` is not enabled on the symbol + +"Stop loss orders are not supported for this symbol." + +`STOP_LOSS` is not enabled on the symbol + +"Stop loss limit orders are not supported for this symbol." + +`STOP_LOSS_LIMIT` is not enabled on the symbol + +"Take profit orders are not supported for this symbol." + +`TAKE_PROFIT` is not enabled on the symbol + +"Take profit limit orders are not supported for this symbol." + +`TAKE_PROFIT_LIMIT` is not enabled on the symbol + +"Price \* QTY is zero or less." + +`price` \* `quantity` is too low + +"IcebergQty exceeds QTY." + +`icebergQty` must be less than the order quantity + +"This action is disabled on this account." + +Contact customer support; some actions have been disabled on the account. + +"This account may not place or cancel orders." + +Contact customer support; the account has trading ability disabled. + +"Unsupported order combination" + +The `orderType`, `timeInForce`, `stopPrice`, and/or `icebergQty` combination isn't allowed. + +"Order would trigger immediately." + +The order's stop price is not valid when compared to the last traded price. + +"Cancel order is invalid. Check origClientOrderId and orderId." + +No `origClientOrderId` or `orderId` was sent in. + +"Order would immediately match and take." + +`LIMIT_MAKER` order type would immediately match and trade, and not be a pure maker order. + +"The relationship of the prices for the orders is not correct." + +The prices set in the `OCO` is breaking the Price rules. + +The rules are: + +`SELL Orders`: Limit Price > Last Price > Stop Price + +`BUY Orders`: Limit Price < Last Price < Stop Price + +"OCO orders are not supported for this symbol" + +`OCO` is not enabled on the symbol. + +"Quote order qty market orders are not support for this symbol." + +`MARKET` orders using the parameter `quoteOrderQty` are not enabled on this symbol. + +"Trailing stop orders are not supported for this symbol." + +Orders using `trailingDelta` are not enabled on the symbol. + +"Order cancel-replace is not supported for this symbol." + +`POST /api/v3/order/cancelReplace` (REST API) or `order.cancelReplace` (WebSocket API) is on enabled the symbol. + +"This symbol is not permitted for this account." + +Account and symbol do not have the same permissions. (e.g. `SPOT`, `MARGIN`, etc) + +"This symbol is restricted for this account." + +Account is unable to trade on that symbol. (e.g. An `ISOLATED_MARGIN` account cannot place `SPOT` orders.) + +"Order was not canceled due to cancel restrictions." + +Either `cancelRestrictions` was set to `ONLY_NEW` but the order status was not `NEW` +or +`cancelRestrictions` was set to `ONLY_PARTIALLY_FILLED` but the order status was not `PARTIALLY_FILLED`. + +## Errors regarding POST /api/v3/order/cancelReplace[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +### \-2021 Order cancel-replace partially failed[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +This code is sent when either the cancellation of the order failed or the new order placement failed but not both. + +### \-2022 Order cancel-replace failed.[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + +This code is sent when both the cancellation of the order failed and the new order placement failed. + +- [10xx - General Server or Network issues](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-1000 UNKNOWN](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-1001 DISCONNECTED](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-1002 UNAUTHORIZED](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-1003 TOO\_MANY\_REQUESTS](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-1004 SERVER\_BUSY](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-1006 UNEXPECTED\_RESP](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-1007 TIMEOUT](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-1008 SERVER\_BUSY](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-1014 UNKNOWN\_ORDER\_COMPOSITION](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-1015 TOO\_MANY\_ORDERS](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-1016 SERVICE\_SHUTTING\_DOWN](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-1020 UNSUPPORTED\_OPERATION](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-1021 INVALID\_TIMESTAMP](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-1022 INVALID\_SIGNATURE](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-1099 Not found, authenticated, or authorized](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) +- [11xx - 2xxx Request issues](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-1100 ILLEGAL\_CHARS](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-1101 TOO\_MANY\_PARAMETERS](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-1102 MANDATORY\_PARAM\_EMPTY\_OR\_MALFORMED](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-1103 UNKNOWN\_PARAM](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-1104 UNREAD\_PARAMETERS](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-1105 PARAM\_EMPTY](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-1106 PARAM\_NOT\_REQUIRED](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-1111 BAD\_PRECISION](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-1112 NO\_DEPTH](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-1114 TIF\_NOT\_REQUIRED](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-1115 INVALID\_TIF](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-1116 INVALID\_ORDER\_TYPE](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-1117 INVALID\_SIDE](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-1118 EMPTY\_NEW\_CL\_ORD\_ID](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-1119 EMPTY\_ORG\_CL\_ORD\_ID](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-1120 BAD\_INTERVAL](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-1121 BAD\_SYMBOL](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-1125 INVALID\_LISTEN\_KEY](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-1127 MORE\_THAN\_XX\_HOURS](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-1128 OPTIONAL\_PARAMS\_BAD\_COMBO](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-1130 INVALID\_PARAMETER](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-1131 BAD\_RECV\_WINDOW](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-1134 BAD\_STRATEGY\_TYPE](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-2010 NEW\_ORDER\_REJECTED](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-2011 CANCEL\_REJECTED](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-2013 NO\_SUCH\_ORDER](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-2014 BAD\_API\_KEY\_FMT](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-2015 REJECTED\_MBX\_KEY](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-2016 NO\_TRADING\_WINDOW](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) +- [3xxx-5xxx SAPI-specific issues](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-3000 INNER\_FAILURE](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-3001 NEED\_ENABLE\_2FA](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-3002 ASSET\_DEFICIENCY](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-3003 NO\_OPENED\_MARGIN\_ACCOUNT](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-3004 TRADE\_NOT\_ALLOWED](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-3005 TRANSFER\_OUT\_NOT\_ALLOWED](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-3006 EXCEED\_MAX\_BORROWABLE](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-3007 HAS\_PENDING\_TRANSACTION](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-3008 BORROW\_NOT\_ALLOWED](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-3009 ASSET\_NOT\_MORTGAGEABLE](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-3010 REPAY\_NOT\_ALLOWED](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-3011 BAD\_DATE\_RANGE](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-3012 ASSET\_ADMIN\_BAN\_BORROW](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-3013 LT\_MIN\_BORROWABLE](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-3014 ACCOUNT\_BAN\_BORROW](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-3015 REPAY\_EXCEED\_LIABILITY](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-3016 LT\_MIN\_REPAY](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-3017 ASSET\_ADMIN\_BAN\_MORTGAGE](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-3018 ACCOUNT\_BAN\_MORTGAGE](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-3019 ACCOUNT\_BAN\_ROLLOUT](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-3020 EXCEED\_MAX\_ROLLOUT](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-3021 PAIR\_ADMIN\_BAN\_TRADE](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-3022 ACCOUNT\_BAN\_TRADE](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-3023 WARNING\_MARGIN\_LEVEL](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-3024 FEW\_LIABILITY\_LEFT](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-3025 INVALID\_EFFECTIVE\_TIME](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-3026 VALIDATION\_FAILED](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-3027 NOT\_VALID\_MARGIN\_ASSET](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-3028 NOT\_VALID\_MARGIN\_PAIR](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-3029 TRANSFER\_FAILED](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-3036 ACCOUNT\_BAN\_REPAY](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-3037 PNL\_CLEARING](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-3038 LISTEN\_KEY\_NOT\_FOUND](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-3041 BALANCE\_NOT\_CLEARED](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-3042 PRICE\_INDEX\_NOT\_FOUND](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-3043 TRANSFER\_IN\_NOT\_ALLOWED](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-3044 SYSTEM\_BUSY](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-3045 SYSTEM](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-3999 NOT\_WHITELIST\_USER](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-4001 CAPITAL\_INVALID](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-4002 CAPITAL\_IG](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-4003 CAPITAL\_IEV](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-4004 CAPITAL\_UA](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-4005 CAPAITAL\_TOO\_MANY\_REQUEST](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-4006 CAPITAL\_ONLY\_SUPPORT\_PRIMARY\_ACCOUNT](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-4007 CAPITAL\_ADDRESS\_VERIFICATION\_NOT\_PASS](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-4008 CAPITAL\_ADDRESS\_TAG\_VERIFICATION\_NOT\_PASS](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-4010 CAPITAL\_WHITELIST\_EMAIL\_CONFIRM](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-4011 CAPITAL\_WHITELIST\_EMAIL\_EXPIRED](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-4012 CAPITAL\_WHITELIST\_CLOSE](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-4013 CAPITAL\_WITHDRAW\_2FA\_VERIFY](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-4014 CAPITAL\_WITHDRAW\_LOGIN\_DELAY](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-4015 CAPITAL\_WITHDRAW\_RESTRICTED\_MINUTE](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-4016 CAPITAL\_WITHDRAW\_RESTRICTED\_PASSWORD](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-4017 CAPITAL\_WITHDRAW\_RESTRICTED\_UNBIND\_2FA](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-4018 CAPITAL\_WITHDRAW\_ASSET\_NOT\_EXIST](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-4019 CAPITAL\_WITHDRAW\_ASSET\_PROHIBIT](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-4021 CAPITAL\_WITHDRAW\_AMOUNT\_MULTIPLE](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-4022 CAPITAL\_WITHDRAW\_MIN\_AMOUNT](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-4023 CAPITAL\_WITHDRAW\_MAX\_AMOUNT](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-4024 CAPITAL\_WITHDRAW\_USER\_NO\_ASSET](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-4025 CAPITAL\_WITHDRAW\_USER\_ASSET\_LESS\_THAN\_ZERO](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-4026 CAPITAL\_WITHDRAW\_USER\_ASSET\_NOT\_ENOUGH](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-4027 CAPITAL\_WITHDRAW\_GET\_TRAN\_ID\_FAILURE](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-4028 CAPITAL\_WITHDRAW\_MORE\_THAN\_FEE](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-4029 CAPITAL\_WITHDRAW\_NOT\_EXIST](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-4030 CAPITAL\_WITHDRAW\_CONFIRM\_SUCCESS](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-4031 CAPITAL\_WITHDRAW\_CANCEL\_FAILURE](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-4032 CAPITAL\_WITHDRAW\_CHECKSUM\_VERIFY\_FAILURE](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-4033 CAPITAL\_WITHDRAW\_ILLEGAL\_ADDRESS](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-4034 CAPITAL\_WITHDRAW\_ADDRESS\_CHEAT](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-4035 CAPITAL\_WITHDRAW\_NOT\_WHITE\_ADDRESS](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-4036 CAPITAL\_WITHDRAW\_NEW\_ADDRESS](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-4037 CAPITAL\_WITHDRAW\_RESEND\_EMAIL\_FAIL](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-4038 CAPITAL\_WITHDRAW\_RESEND\_EMAIL\_TIME\_OUT](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-4039 CAPITAL\_USER\_EMPTY](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-4040 CAPITAL\_NO\_CHARGE](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-4041 CAPITAL\_MINUTE\_TOO\_SMALL](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-4042 CAPITAL\_CHARGE\_NOT\_RESET](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-4043 CAPITAL\_ADDRESS\_TOO\_MUCH](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-4044 CAPITAL\_BLACKLIST\_COUNTRY\_GET\_ADDRESS](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-4045 CAPITAL\_GET\_ASSET\_ERROR](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-4046 CAPITAL\_AGREEMENT\_NOT\_CONFIRMED](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-4047 CAPITAL\_DATE\_INTERVAL\_LIMIT](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-4060 CAPITAL\_WITHDRAW\_USER\_ASSET\_LOCK\_DEPOSIT](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-5001 ASSET\_DRIBBLET\_CONVERT\_SWITCH\_OFF](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-5002 ASSET\_ASSET\_NOT\_ENOUGH](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-5003 ASSET\_USER\_HAVE\_NO\_ASSET](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-5004 USER\_OUT\_OF\_TRANSFER\_FLOAT](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-5005 USER\_ASSET\_AMOUNT\_IS\_TOO\_LOW](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-5006 USER\_CAN\_NOT\_REQUEST\_IN\_24\_HOURS](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-5007 AMOUNT\_OVER\_ZERO](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-5008 ASSET\_WITHDRAW\_WITHDRAWING\_NOT\_ENOUGH](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-5009 PRODUCT\_NOT\_EXIST](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-5010 TRANSFER\_FAIL](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-5011 FUTURE\_ACCT\_NOT\_EXIST](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-5012 TRANSFER\_PENDING](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-5021 PARENT\_SUB\_HAVE\_NO\_RELATION](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-5012 FUTURE\_ACCT\_OR\_SUBRELATION\_NOT\_EXIST](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) +- [6XXX - Savings Issues](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-6001 DAILY\_PRODUCT\_NOT\_EXIST](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-6003 DAILY\_PRODUCT\_NOT\_ACCESSIBLE](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-6004 DAILY\_PRODUCT\_NOT\_PURCHASABLE](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-6005 DAILY\_LOWER\_THAN\_MIN\_PURCHASE\_LIMIT](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-6006 DAILY\_REDEEM\_AMOUNT\_ERROR](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-6007 DAILY\_REDEEM\_TIME\_ERROR](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-6008 DAILY\_PRODUCT\_NOT\_REDEEMABLE](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-6009 REQUEST\_FREQUENCY\_TOO\_HIGH](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-6011 EXCEEDED\_USER\_PURCHASE\_LIMIT](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-6012 BALANCE\_NOT\_ENOUGH](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-6013 PURCHASING\_FAILED](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-6014 UPDATE\_FAILED](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-6015 EMPTY\_REQUEST\_BODY](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-6016 PARAMS\_ERR](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-6017 NOT\_IN\_WHITELIST](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-6018 ASSET\_NOT\_ENOUGH](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-6019 PENDING](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-6020 PROJECT\_NOT\_EXISTS](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) +- [70xx - Futures](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-7001 FUTURES\_BAD\_DATE\_RANGE](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-7002 FUTURES\_BAD\_TYPE](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) +- [20xxx - Futures/Spot Algo](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-20121](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-20124](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-20130](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-20132](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-20194](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-20195](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-20196](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-20198](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-20204](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) +- [Filter failures](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) +- [10xxx - Crypto Loans](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-10001 SYSTEM\_MAINTENANCE](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-10002 INVALID\_INPUT](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-10005 NO\_RECORDS](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-10007 COIN\_NOT\_LOANABLE](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-10008 COIN\_NOT\_LOANABLE](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-10009 COIN\_NOT\_COLLATERAL](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-10010 COIN\_NOT\_COLLATERAL](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-10011 INSUFFICIENT\_ASSET](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-10012 INVALID\_AMOUNT](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-10013 INSUFFICIENT\_AMOUNT](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-10015 DEDUCTION\_FAILED](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-10016 LOAN\_FAILED](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-10017 REPAY\_EXCEED\_DEBT](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-10018 INVALID\_AMOUNT](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-10019 CONFIG\_NOT\_EXIST](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-10020 UID\_NOT\_EXIST](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-10021 ORDER\_NOT\_EXIST](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-10022 INVALID\_AMOUNT](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-10023 ADJUST\_LTV\_FAILED](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-10024 ADJUST\_LTV\_NOT\_SUPPORTED](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-10025 REPAY\_FAILED](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-10026 INVALID\_PARAMETER](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-10028 INVALID\_PARAMETER](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-10029 AMOUNT\_TOO\_SMALL](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-10030 AMOUNT\_TOO\_LARGE](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-10031 QUOTA\_REACHED](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-10032 REPAY\_NOT\_AVAILABLE](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-10034 REPAY\_NOT\_AVAILABLE](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-10039 AMOUNT\_TOO\_SMALL](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-10040 AMOUNT\_TOO\_LARGE](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-10041 INSUFFICIENT\_AMOUNT](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-10042 ASSET\_NOT\_SUPPORTED](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-10043 ASSET\_NOT\_SUPPORTED](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-10044 QUOTA\_REACHED](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-10045 COLLTERAL\_REPAY\_NOT\_SUPPORTED](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-10046 EXCEED\_MAX\_ADJUSTMENT](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-10047 REGION\_NOT\_SUPPORTED](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) +- [13xxx - BLVT](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-13000 BLVT\_FORBID\_REDEEM](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-13001 BLVT\_EXCEED\_DAILY\_LIMIT](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-13002 BLVT\_EXCEED\_TOKEN\_DAILY\_LIMIT](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-13003 BLVT\_FORBID\_PURCHASE](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-13004 BLVT\_EXCEED\_DAILY\_PURCHASE\_LIMIT](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-13005 BLVT\_EXCEED\_TOKEN\_DAILY\_PURCHASE\_LIMIT](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-13006 BLVT\_PURCHASE\_LESS\_MIN\_AMOUNT](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-13007 BLVT\_PURCHASE\_AGREEMENT\_NOT\_SIGN](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) +- [12xxx - Liquid Swap](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-12014 TOO MANY REQUESTS](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) +- [18xxx - Binance Code](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-18002](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-18003](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-18004](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-18005](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-18006](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-18007](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) +- [21xxx - Portfolio Margin Account](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-21001 USER\_IS\_NOT\_UNIACCOUNT](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-21002 UNI\_ACCOUNT\_CANT\_TRANSFER\_FUTURE](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-21003 NET\_ASSET\_MUST\_LTE\_RATIO](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-21004 USER\_NO\_LIABILITY](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-21005 NO\_ENOUGH\_ASSET](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-21006 HAD\_IN\_PROCESS\_REPAY](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-21007 IN\_FORCE\_LIQUIDATION](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-21015 ENDPOINT\_GONE](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) +- [Order Rejection Issues](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) +- [Errors regarding POST /api/v3/order/cancelReplace](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-2021 Order cancel-replace partially failed](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) + - [\-2022 Order cancel-replace failed.](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/error-code) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_general-info.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_general-info.md new file mode 100644 index 0000000..5036291 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_general-info.md @@ -0,0 +1,456 @@ +--- +title: "General Info | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin-pro/general-info" +fetched_at: "2026-01-27T05:28:15.359Z" +--- +# General Info + +## General API Information[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/general-info) + +- The following base endpoints are available: + - **[https://api.binance.com](https://api.binance.com/)** + - **[https://api1.binance.com](https://api1.binance.com/)** + - **[https://api2.binance.com](https://api2.binance.com/)** + - **[https://api3.binance.com](https://api3.binance.com/)** + - **[https://api4.binance.com](https://api4.binance.com/)** +- The last 4 endpoints in the point above (`api1`\-`api4`) might give better performance but have less stability. Please use whichever works best for your setup. +- All endpoints return either a JSON object or array. +- Data is returned in **ascending** order. Oldest first, newest last. +- All time and timestamp related fields are in **milliseconds**. +- The base endpoint **[https://data-api.binance.vision](https://data-api.binance.vision/)** can be used to access the following API endpoints that have `NONE` as security type: + - [GET /api/v3/aggTrades](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/general-info) + - [GET /api/v3/avgPrice](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/general-info) + - [GET /api/v3/depth](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/general-info) + - [GET /api/v3/exchangeInfo](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/general-info) + - [GET /api/v3/klines](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/general-info) + - [GET /api/v3/ping](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/general-info) + - [GET /api/v3/ticker](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/general-info) + - [GET /api/v3/ticker/24hr](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/general-info) + - [GET /api/v3/ticker/bookTicker](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/general-info) + - [GET /api/v3/ticker/price](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/general-info) + - [GET /api/v3/time](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/general-info) + - [GET /api/v3/trades](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/general-info) + - [GET /api/v3/uiKlines](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/general-info) + +### HTTP Return Codes[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/general-info) + +- HTTP `4XX` return codes are used for malformed requests; the issue is on the sender's side. +- HTTP `403` return code is used when the WAF Limit (Web Application Firewall) has been violated. +- HTTP `409` return code is used when a cancelReplace order partially succeeds. (e.g. if the cancellation of the order fails but the new order placement succeeds.) +- HTTP `429` return code is used when breaking a request rate limit. +- HTTP `418` return code is used when an IP has been auto-banned for continuing to send requests after receiving `429` codes. +- HTTP `5XX` return codes are used for internal errors; the issue is on Binance's side. It is important to **NOT** treat this as a failure operation; the execution status is **UNKNOWN** and could have been a success. + +### Error Codes and Messages[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/general-info) + +- If there is an error, the API will return an error with a message of the reason. + +> The error payload on API and SAPI is as follows: + +``` +{ "code": -1121, "msg": "Invalid symbol."} +``` + +- Specific error codes and messages defined in [Error Codes](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/general-info). + +### General Information on Endpoints[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/general-info) + +- For `GET` endpoints, parameters must be sent as a `query string`. +- For `POST`, `PUT`, and `DELETE` endpoints, the parameters may be sent as a `query string` or in the `request body` with content type `application/x-www-form-urlencoded`. You may mix parameters between both the `query string` and `request body` if you wish to do so. +- Parameters may be sent in any order. +- If a parameter sent in both the `query string` and `request body`, the `query string` parameter will be used. + +--- + +## LIMITS[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/general-info) + +### General Info on Limits[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/general-info) + +- The following `intervalLetter` values for headers: + - SECOND => S + - MINUTE => M + - HOUR => H + - DAY => D +- `intervalNum` describes the amount of the interval. For example, `intervalNum` 5 with `intervalLetter` M means "Every 5 minutes". +- The `/api/v3/exchangeInfo` `rateLimits` array contains objects related to the exchange's `RAW_REQUESTS`, `REQUEST_WEIGHT`, and `ORDERS` rate limits. These are further defined in the `ENUM definitions` section under `Rate limiters (rateLimitType)`. +- A 429 will be returned when either request rate limit or order rate limit is violated. + +### IP Limits[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/general-info) + +- Every request will contain `X-MBX-USED-WEIGHT-(intervalNum)(intervalLetter)` in the response headers which has the current used weight for the IP for all request rate limiters defined. +- Each route has a `weight` which determines for the number of requests each endpoint counts for. Heavier endpoints and endpoints that do operations on multiple symbols will have a heavier `weight`. +- When a 429 is received, it's your obligation as an API to back off and not spam the API. +- **Repeatedly violating rate limits and/or failing to back off after receiving 429s will result in an automated IP ban (HTTP status 418).** +- IP bans are tracked and **scale in duration** for repeat offenders, **from 2 minutes to 3 days**. +- A `Retry-After` header is sent with a 418 or 429 responses and will give the **number of seconds** required to wait, in the case of a 429, to prevent a ban, or, in the case of a 418, until the ban is over. +- **The limits on the API are based on the IPs, not the API keys.** + +### Order Rate Limits[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/general-info) + +- Every successful order response will contain a `X-MBX-ORDER-COUNT-(intervalNum)(intervalLetter)` header which has the current order count for the account for all order rate limiters defined. + +- When the order count exceeds the limit, you will receive a 429 error without the `Retry-After` header. Please check the Order Rate Limit rules using `GET api/v3/exchangeInfo` and wait for reactivation accordingly. + +- Rejected/unsuccessful orders are not guaranteed to have `X-MBX-ORDER-COUNT-**` headers in the response. + +- **The order rate limit is counted against each account**. + +- To monitor order count usage, refer to GET `api/v3/rateLimit/order` + + +### Websocket Limits[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/general-info) + +- WebSocket connections have a limit of 5 incoming messages per second. A message is considered: + - A PING frame + - A PONG frame + - A JSON controlled message (e.g. subscribe, unsubscribe) +- A connection that goes beyond the limit will be disconnected; IPs that are repeatedly disconnected may be banned. +- A single connection can listen to a maximum of 1024 streams. +- There is a limit of **300 connections per attempt every 5 minutes per IP**. + +### /api/ and /sapi/ Limit Introduction[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/general-info) + +The `/api/*` and `/sapi/*` endpoints adopt either of two access limiting rules, IP limits or UID (account) limits. + +- Endpoints related to `/api/*`: + + - According to the two modes of IP and UID (account) limit, each are independent. + - Endpoints share the 6000 per minute limit based on IP. + - Responses contain the header `X-MBX-USED-WEIGHT-(intervalNum)(intervalLetter)`, defining the weight used by the current IP. + - Successful order responses contain the header `X-MBX-ORDER-COUNT-(intervalNum)(intervalLetter)`, defining the order limit used by the UID. +- Endpoints related to `/sapi/*`: + + - Endpoints are marked according to IP or UID limit and their corresponding weight value. + - Each endpoint with IP limits has an independent 12000 per minute limit. + - Each endpoint with UID limits has an independent 180000 per minute limit. + - Responses from endpoints with IP limits contain the header `X-SAPI-USED-IP-WEIGHT-1M`, defining the weight used by the current IP. + - Responses from endpoints with UID limits contain the header `X-SAPI-USED-UID-WEIGHT-1M`, defining the weight used by the current UID. + +--- + +## Data Sources[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/general-info) + +- The API system is asynchronous, so some delay in the response is normal and expected. +- Each endpoint has a data source indicating where the data is being retrieved, and thus which endpoints have the most up-to-date response. + +These are the three sources, ordered by which is has the most up-to-date response to the one with potential delays in updates. + +- **Matching Engine** - the data is from the matching Engine +- **Memory** - the data is from a server's local or external memory +- **Database** - the data is taken directly from a database + +## Endpoint security type[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/general-info) + +- Each endpoint has a security type that determines how you will interact with it. This is stated next to the NAME of the endpoint. + - If no security type is stated, assume the security type is NONE. +- API-keys are passed into the Rest API via the `X-MBX-APIKEY` header. +- API-keys and secret-keys **are case sensitive**. +- API-keys can be configured to only access certain types of secure endpoints. For example, one API-key could be used for TRADE only, while another API-key can access everything except for TRADE routes. +- By default, API-keys can access all secure routes. + +Security Type + +Description + +NONE + +Endpoint can be accessed freely. + +TRADE + +Endpoint requires sending a valid API-Key and signature. + +MARGIN + +Endpoint requires sending a valid API-Key and signature. + +USER\_DATA + +Endpoint requires sending a valid API-Key and signature. + +USER\_STREAM + +Endpoint requires sending a valid API-Key. + +MARKET\_DATA + +Endpoint requires sending a valid API-Key. + +- `TRADE`, `MARGIN` and `USER_DATA` endpoints are `SIGNED` endpoints. + +--- + +## SIGNED (TRADE, USER\_DATA, AND MARGIN) Endpoint security[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/general-info) + +- `SIGNED` endpoints require an additional parameter, `signature`, to be sent in the `query string` or `request body`. +- Endpoints use `HMAC SHA256` signatures. The `HMAC SHA256 signature` is a keyed `HMAC SHA256` operation. Use your `secretKey` as the key and `totalParams` as the value for the HMAC operation. +- The `signature` is **not case sensitive**. +- `totalParams` is defined as the `query string` concatenated with the `request body`. + +### Timing security[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/general-info) + +- A `SIGNED` endpoint also requires a parameter, `timestamp`, to be sent which should be the millisecond timestamp of when the request was created and sent. +- An additional parameter, `recvWindow`, may be sent to specify the number of milliseconds after `timestamp` the request is valid for. If `recvWindow` is not sent, **it defaults to 5000**. + +> The logic is as follows: + +``` + if (timestamp < (serverTime + 1000) && (serverTime - timestamp) <= recvWindow) { // process request } else { // reject request } +``` + +**Serious trading is about timing.** Networks can be unstable and unreliable, which can lead to requests taking varying amounts of time to reach the servers. With `recvWindow`, you can specify that the request must be processed within a certain number of milliseconds or be rejected by the server. + +### SIGNED Endpoint Examples for POST /api/v3/order - HMAC Keys[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/general-info) + +Here is a step-by-step example of how to send a vaild signed payload from the Linux command line using `echo`, `openssl`, and `curl`. + +Key + +Value + +apiKey + +vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A + +secretKey + +NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j + +Parameter + +Value + +symbol + +LTCBTC + +side + +BUY + +type + +LIMIT + +timeInForce + +GTC + +quantity + +1 + +price + +0.1 + +recvWindow + +5000 + +timestamp + +1499827319559 + +**Example 1: As a request body** + +> **Example 1** + +> **HMAC SHA256 signature:** + +``` + $ echo -n "symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559" | openssl dgst -sha256 -hmac "NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j" (stdin)= c8db56825ae71d6d79447849e617115f4a920fa2acdcab2b053c4b2838bd6b71 +``` + +> **curl command:** + +``` + (HMAC SHA256) $ curl -H "X-MBX-APIKEY: vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A" -X POST 'https://api.binance.com/api/v3/order' -d 'symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559&signature=c8db56825ae71d6d79447849e617115f4a920fa2acdcab2b053c4b2838bd6b71' +``` + +- **requestBody:** + +symbol=LTCBTC +&side=BUY +&type=LIMIT +&timeInForce=GTC +&quantity=1 +&price=0.1 +&recvWindow=5000 +×tamp=1499827319559 + +**Example 2: As a query string** + +> **Example 2** + +> **HMAC SHA256 signature:** + +``` + $ echo -n "symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559" | openssl dgst -sha256 -hmac "NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j" (stdin)= c8db56825ae71d6d79447849e617115f4a920fa2acdcab2b053c4b2838bd6b71 +``` + +> **curl command:** + +``` + (HMAC SHA256) $ curl -H "X-MBX-APIKEY: vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A" -X POST 'https://api.binance.com/api/v3/order?symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559&signature=c8db56825ae71d6d79447849e617115f4a920fa2acdcab2b053c4b2838bd6b71' +``` + +- **queryString:** + +symbol=LTCBTC +&side=BUY +&type=LIMIT +&timeInForce=GTC +&quantity=1 +&price=0.1 +&recvWindow=5000 +×tamp=1499827319559 + +**Example 3: Mixed query string and request body** + +> **Example 3** + +> **HMAC SHA256 signature:** + +``` + $ echo -n "symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTCquantity=1&price=0.1&recvWindow=5000×tamp=1499827319559" | openssl dgst -sha256 -hmac "NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j" (stdin)= 0fd168b8ddb4876a0358a8d14d0c9f3da0e9b20c5d52b2a00fcf7d1c602f9a77 +``` + +> **curl command:** + +``` + (HMAC SHA256) $ curl -H "X-MBX-APIKEY: vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A" -X POST 'https://api.binance.com/api/v3/order?symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC' -d 'quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559&signature=0fd168b8ddb4876a0358a8d14d0c9f3da0e9b20c5d52b2a00fcf7d1c602f9a77' +``` + +- **queryString:** + +symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC + +- **requestBody:** + +quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559 + +Note that the signature is different in example 3. There is no & between "GTC" and "quantity=1". + +### SIGNED Endpoint Example for POST /api/v3/order - RSA Keys[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/general-info) + +- This will be a step by step process how to create the signature payload to send a valid signed payload. +- We support `PKCS#8` currently. +- To get your API key, you need to upload your RSA Public Key to your account and a corresponding API key will be provided for you. + +For this example, the private key will be referenced as `test-prv-key.pem` + +Key + +Value + +apiKey + +CAvIjXy3F44yW6Pou5k8Dy1swsYDWJZLeoK2r8G4cFDnE9nosRppc2eKc1T8TRTQ + +Parameter + +Value + +symbol + +BTCUSDT + +side + +SELL + +type + +LIMIT + +timeInForce + +GTC + +quantity + +1 + +price + +0.2 + +recvWindow + +5000 + +timestamp + +1668481559918 + +> **Signature payload (with the listed parameters):** + +``` +symbol=BTCUSDT&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000 +``` + +**Step 1: Construct the payload** + +Arrange the list of parameters into a string. Separate each parameter with a `&`. + +**Step 2: Compute the signature:** + +2.1 - Encode signature payload as ASCII data. + +> **Step 2.2** + +``` + $ echo -n 'symbol=BTCUSDT&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000' | openssl dgst -sha256 -sign ./test-prv-key.pem +``` + +2.2 - Sign payload using RSASSA-PKCS1-v1\_5 algorithm with SHA-256 hash function. + +> **Step 2.3** + +``` +$ echo -n 'symbol=BTCUSDT&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918&recvWindow=5000' | openssl dgst -sha256 -sign ./test-prv-key.pem | openssl enc -base64 -AHZ8HOjiJ1s/igS9JA+n7+7Ti/ihtkRF5BIWcPIEluJP6tlbFM/Bf44LfZka/iemtahZAZzcO9TnI5uaXh3++lrqtNonCwp6/245UFWkiW1elpgtVAmJPbogcAv6rSlokztAfWk296ZJXzRDYAtzGH0gq7CgSJKfH+XxaCmR0WcvlKjNQnp12/eKXJYO4tDap8UCBLuyxDnR7oJKLHQHJLP0r0EAVOOSIbrFang/1WOq+Jaq4Efc4XpnTgnwlBbWTmhWDR1pvS9iVEzcSYLHT/fNnMRxFc7u+j3qI//5yuGuu14KR0MuQKKCSpViieD+fIti46sxPTsjSemoUKp0oXA== +``` + +2.3 - Encode output as base64 string. + +> **Step 2.4** + +``` +HZ8HOjiJ1s%2FigS9JA%2Bn7%2B7Ti%2FihtkRF5BIWcPIEluJP6tlbFM%2FBf44LfZka%2FiemtahZAZzcO9TnI5uaXh3%2B%2BlrqtNonCwp6%2F245UFWkiW1elpgtVAmJPbogcAv6rSlokztAfWk296ZJXzRDYAtzGH0gq7CgSJKfH%2BXxaCmR0WcvlKjNQnp12%2FeKXJYO4tDap8UCBLuyxDnR7oJKLHQHJLP0r0EAVOOSIbrFang%2F1WOq%2BJaq4Efc4XpnTgnwlBbWTmhWDR1pvS9iVEzcSYLHT%2FfNnMRxFc7u%2Bj3qI%2F%2F5yuGuu14KR0MuQKKCSpViieD%2BfIti46sxPTsjSemoUKp0oXA%3D%3D +``` + +2.4 - Since the signature may contain `/` and `=`, this could cause issues with sending the request. So the signature has to be URL encoded. + +> **Step 2.5** + +``` + curl -H "X-MBX-APIKEY: CAvIjXy3F44yW6Pou5k8Dy1swsYDWJZLeoK2r8G4cFDnE9nosRppc2eKc1T8TRTQ" -X POST 'https://api.binance.com/api/v3/order?symbol=BTCUSDT&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2×tamp=1668481559918recvWindow=5000&signature=HZ8HOjiJ1s%2FigS9JA%2Bn7%2B7Ti%2FihtkRF5BIWcPIEluJP6tlbFM%2FBf44LfZka%2FiemtahZAZzcO9TnI5uaXh3%2B%2BlrqtNonCwp6%2F245UFWkiW1elpgtVAmJPbogcAv6rSlokztAfWk296ZJXzRDYAtzGH0gq7CgSJKfH%2BXxaCmR0WcvlKjNQnp12%2FeKXJYO4tDap8UCBLuyxDnR7oJKLHQHJLP0r0EAVOOSIbrFang%2F1WOq%2BJaq4Efc4XpnTgnwlBbWTmhWDR1pvS9iVEzcSYLHT%2FfNnMRxFc7u%2Bj3qI%2F%2F5yuGuu14KR0MuQKKCSpViieD%2BfIti46sxPTsjSemoUKp0oXA%3D%3D' +``` + +2.5 - curl command + +> **Bash script** + +``` +#!/usr/bin/env bash# Set up authentication:API_KEY="put your own API Key here"PRIVATE_KEY_PATH="test-prv-key.pem"# Set up the request:API_METHOD="POST"API_CALL="api/v3/order"API_PARAMS="symbol=BTCUSDT&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2"# Sign the request:timestamp=$(date +%s000)api_params_with_timestamp="$API_PARAMS×tamp=$timestamp"signature=$(echo -n "$api_params_with_timestamp" \ | openssl dgst -sha256 -sign "$PRIVATE_KEY_PATH" \ | openssl enc -base64 -A)# Send the request:curl -H "X-MBX-APIKEY: $API_KEY" -X "$API_METHOD" \ "https://api.binance.com/$API_CALL?$api_params_with_timestamp" \ --data-urlencode "signature=$signature" +``` + +A sample Bash script containing similar steps is available in the right side. + +- [General API Information](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/general-info) + - [HTTP Return Codes](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/general-info) + - [Error Codes and Messages](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/general-info) + - [General Information on Endpoints](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/general-info) +- [LIMITS](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/general-info) + - [General Info on Limits](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/general-info) + - [IP Limits](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/general-info) + - [Order Rate Limits](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/general-info) + - [Websocket Limits](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/general-info) + - [/api/ and /sapi/ Limit Introduction](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/general-info) +- [Data Sources](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/general-info) +- [Endpoint security type](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/general-info) +- [SIGNED (TRADE, USER\_DATA, AND MARGIN) Endpoint security](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/general-info) + - [Timing security](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/general-info) + - [SIGNED Endpoint Examples for POST /api/v3/order - HMAC Keys](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/general-info) + - [SIGNED Endpoint Example for POST /api/v3/order - RSA Keys](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/general-info) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_market-data.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_market-data.md new file mode 100644 index 0000000..24feeb2 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_market-data.md @@ -0,0 +1,46 @@ +--- +title: "Query Portfolio Margin Asset Index Price(MARKET_DATA) | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin-pro/market-data" +fetched_at: "2026-01-27T05:28:15.500Z" +--- +# Query Portfolio Margin Asset Index Price (MARKET\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/market-data) + +Query Portfolio Margin Asset Index Price + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/market-data) + +GET `/sapi/v1/portfolio/asset-index-price` + +## Request Weight(IP)[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/market-data) + +**1** if send asset or **50** if not send asset + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/market-data) + +Name + +Type + +Mandatory + +Description + +asset + +STRING + +NO + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/market-data) + +``` +[ { "asset": "BTC", "assetIndexPrice": "28251.9136906", // in USD "time": 1683518338121 }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/market-data) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/market-data) +- [Request Weight(IP)](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/market-data) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/market-data) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/market-data) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_market-data_Classic-Portfolio-Margin-Collateral-Rate.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_market-data_Classic-Portfolio-Margin-Collateral-Rate.md new file mode 100644 index 0000000..e67434c --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_market-data_Classic-Portfolio-Margin-Collateral-Rate.md @@ -0,0 +1,34 @@ +--- +title: "Portfolio Margin Pro Collateral Rate(MARKET_DATA) | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin-pro/market-data/Classic-Portfolio-Margin-Collateral-Rate" +fetched_at: "2026-01-27T05:28:15.636Z" +--- +# Portfolio Margin Collateral Rate(MARKET\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/market-data/Classic-Portfolio-Margin-Collateral-Rate) + +Portfolio Margin Collateral Rate + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/market-data/Classic-Portfolio-Margin-Collateral-Rate) + +GET `/sapi/v1/portfolio/collateralRate` + +## Request Weight(IP)[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/market-data/Classic-Portfolio-Margin-Collateral-Rate) + +**50** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/market-data/Classic-Portfolio-Margin-Collateral-Rate) + +None + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/market-data/Classic-Portfolio-Margin-Collateral-Rate) + +``` +[ { "asset": "USDC", "collateralRate": "1.0000" }, { "asset": "BUSD", "collateralRate": "1.0000" },] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/market-data/Classic-Portfolio-Margin-Collateral-Rate) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/market-data/Classic-Portfolio-Margin-Collateral-Rate) +- [Request Weight(IP)](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/market-data/Classic-Portfolio-Margin-Collateral-Rate) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/market-data/Classic-Portfolio-Margin-Collateral-Rate) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/market-data/Classic-Portfolio-Margin-Collateral-Rate) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_market-data_Get-Portfolio-Margin-Asset-Leverage.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_market-data_Get-Portfolio-Margin-Asset-Leverage.md new file mode 100644 index 0000000..e9ccf43 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_market-data_Get-Portfolio-Margin-Asset-Leverage.md @@ -0,0 +1,29 @@ +--- +title: "Get Portfolio Margin Asset Leverage(USER_DATA) | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin-pro/market-data/Get-Portfolio-Margin-Asset-Leverage" +fetched_at: "2026-01-27T05:28:15.637Z" +--- +# Get Portfolio Margin Asset Leverage(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/market-data/Get-Portfolio-Margin-Asset-Leverage) + +Get Portfolio Margin Asset Leverage + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/market-data/Get-Portfolio-Margin-Asset-Leverage) + +GET `/sapi/v1/portfolio/margin-asset-leverage` + +## Request Weight(IP)[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/market-data/Get-Portfolio-Margin-Asset-Leverage) + +**50** + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/market-data/Get-Portfolio-Margin-Asset-Leverage) + +``` +[ { "asset": "USDC", "leverage": 10 }, { "asset": "USDT", "leverage": 10 }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/market-data/Get-Portfolio-Margin-Asset-Leverage) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/market-data/Get-Portfolio-Margin-Asset-Leverage) +- [Request Weight(IP)](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/market-data/Get-Portfolio-Margin-Asset-Leverage) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/market-data/Get-Portfolio-Margin-Asset-Leverage) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_market-data_Portfolio-Margin-Pro-Tiered-Collateral-Rate.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_market-data_Portfolio-Margin-Pro-Tiered-Collateral-Rate.md new file mode 100644 index 0000000..5b2657e --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_market-data_Portfolio-Margin-Pro-Tiered-Collateral-Rate.md @@ -0,0 +1,52 @@ +--- +title: "Portfolio Margin Pro Tiered Collateral Rate(USER_DATA) | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin-pro/market-data/Portfolio-Margin-Pro-Tiered-Collateral-Rate" +fetched_at: "2026-01-27T05:28:15.673Z" +--- +# Portfolio Margin Pro Tiered Collateral Rate(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/market-data/Portfolio-Margin-Pro-Tiered-Collateral-Rate) + +Portfolio Margin PRO Tiered Collateral Rate + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/market-data/Portfolio-Margin-Pro-Tiered-Collateral-Rate) + +GET `/sapi/v2/portfolio/collateralRate` + +## Request Weight(IP)[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/market-data/Portfolio-Margin-Pro-Tiered-Collateral-Rate) + +**50** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/market-data/Portfolio-Margin-Pro-Tiered-Collateral-Rate) + +Name + +Type + +Mandatory + +Description + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/market-data/Portfolio-Margin-Pro-Tiered-Collateral-Rate) + +``` +[ { "asset": "BNB", "collateralInfo": [ { "tierFloor": "0.0000", "tierCap": "1000.0000", "collateralRate": "1.0000", "cum":"0.0000" //account equity quick addition number }, { "tierFloor": "1000.0000", "tierCap": "2000.0000", "collateralRate": "0.9000", "cum":"0.0000" } ] }, { "asset": "USDT", "collateralInfo": [ { "tierFloor": "0.0000", "tierCap": "1000.0000", "collateralRate": "1.0000", "cum":"0.0000" }, { "tierFloor": "1000.0000", "tierCap": "2000.0000", "collateralRate": "0.9999", "cum":"0.0000" } ] }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/market-data/Portfolio-Margin-Pro-Tiered-Collateral-Rate) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/market-data/Portfolio-Margin-Pro-Tiered-Collateral-Rate) +- [Request Weight(IP)](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/market-data/Portfolio-Margin-Pro-Tiered-Collateral-Rate) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/market-data/Portfolio-Margin-Pro-Tiered-Collateral-Rate) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/market-data/Portfolio-Margin-Pro-Tiered-Collateral-Rate) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_portfolio-margin-pro-user-data-stream.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_portfolio-margin-pro-user-data-stream.md new file mode 100644 index 0000000..732b3d0 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_portfolio-margin-pro-user-data-stream.md @@ -0,0 +1,10 @@ +--- +title: "Connect | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin-pro/portfolio-margin-pro-user-data-stream" +fetched_at: "2026-01-27T05:28:15.759Z" +--- +# Portfolio Margin Pro User Data Stream Connect + +- The websocket base url is: **wss://fstream.binance.com/pm-classic** +- User Data Streams are accessed at **/ws/** +- Example: `wss://fstream.binance.com/pm-classic/ws/XaEAKTsQSRLZAGH9tuIu37plSRsdjmlAVBoNYPUITlTAko1WI22PgmBMpI1rS8Yh` diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_portfolio-margin-pro-user-data-stream_Event-riskLevelChange.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_portfolio-margin-pro-user-data-stream_Event-riskLevelChange.md new file mode 100644 index 0000000..76beee5 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin-pro_portfolio-margin-pro-user-data-stream_Event-riskLevelChange.md @@ -0,0 +1,27 @@ +--- +title: "Event Risklevelchange | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin-pro/portfolio-margin-pro-user-data-stream/Event-riskLevelChange" +fetched_at: "2026-01-27T05:28:15.887Z" +--- +# Event: riskLevelChange + +## Event Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/portfolio-margin-pro-user-data-stream/Event-riskLevelChange) + +- When the user's position risk ratio is too high, this stream will be pushed. +- This message is only used as risk guidance information and is not recommended for investment strategies. +- `RISK_LEVEL_CHANGE`includes following types:`MARGIN_CALL`, `REDUCE_ONLY`, `FORCE_LIQUIDATION` +- In the case of a highly volatile market, there may be the possibility that the user's position has been liquidated at the same time when this stream is pushed out. + +## Event Name[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/portfolio-margin-pro-user-data-stream/Event-riskLevelChange) + +`RISK_LEVEL_CHANGE` + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/portfolio-margin-pro-user-data-stream/Event-riskLevelChange) + +``` +{ "e":"riskLevelChange", // Event Type "E":1587727187525, // Event Time "u":"1.99999999", // uniMMR level "s":"MARGIN_CALL", //MARGIN_CALL, REDUCE_ONLY, FORCE_LIQUIDATION "eq":"30.23416728", // account equity in USD value "ae":"30.23416728", // actual equity without collateral rate in USD value "m":"15.11708371" // total maintenance margin in USD value } +``` + +- [Event Description](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/portfolio-margin-pro-user-data-stream/Event-riskLevelChange) +- [Event Name](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/portfolio-margin-pro-user-data-stream/Event-riskLevelChange) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/portfolio-margin-pro-user-data-stream/Event-riskLevelChange) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account.md new file mode 100644 index 0000000..08db718 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account.md @@ -0,0 +1,64 @@ +--- +title: "Account Balance | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/account" +fetched_at: "2026-01-27T05:28:15.961Z" +--- +# Account Balance(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account) + +Query account balance + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account) + +GET `/papi/v1/balance` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account) + +**20** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account) + +Name + +Type + +Mandatory + +Description + +asset + +STRING + +NO + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account) + +``` +[ { "asset": "USDT", // asset name "totalWalletBalance": "122607.35137903", // wallet balance = cross margin free + cross margin locked + UM wallet balance + CM wallet balance "crossMarginAsset": "92.27530794", // crossMarginAsset = crossMarginFree + crossMarginLocked "crossMarginBorrowed": "10.00000000", // principal of cross margin "crossMarginFree": "100.00000000", // free asset of cross margin "crossMarginInterest": "0.72469206", // interest of cross margin "crossMarginLocked": "3.00000000", //lock asset of cross margin        "umWalletBalance": "0.00000000", // wallet balance of um "umUnrealizedPNL": "23.72469206", // unrealized profit of um "cmWalletBalance": "23.72469206", // wallet balance of cm "cmUnrealizedPNL": "", // unrealized profit of cm "updateTime": 1617939110373, "negativeBalance": "0" }] +``` + +**OR (when asset sent)** + +``` +{ "asset": "USDT", // asset name "totalWalletBalance": "122607.35137903", // wallet balance = cross margin free + cross margin locked + UM wallet balance + CM wallet balance "crossMarginBorrowed": "10.00000000", // principal of cross margin "crossMarginFree": "100.00000000", // free asset of cross margin "crossMarginInterest": "0.72469206", // interest of cross margin "crossMarginLocked": "3.00000000", //lock asset of cross margin    "umWalletBalance": "0.00000000", // wallet balance of um "umUnrealizedPNL": "23.72469206", // unrealized profit of um "cmWalletBalance": "23.72469206", // wallet balance of cm "cmUnrealizedPNL": "", // unrealized profit of cm "updateTime": 1617939110373, "negativeBalance": "0"}``` +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/account) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/account) +- [Request Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/account) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/account) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/account) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Account-Information.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Account-Information.md new file mode 100644 index 0000000..2346d82 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Account-Information.md @@ -0,0 +1,52 @@ +--- +title: "Account Information | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/account/Account-Information" +fetched_at: "2026-01-27T05:28:15.923Z" +--- +# Account Information(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Account-Information) + +Query account information + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Account-Information) + +GET `/papi/v1/account` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Account-Information) + +**20** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Account-Information) + +Name + +Type + +Mandatory + +Description + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Account-Information) + +``` +{ "uniMMR": "5167.92171923", // Portfolio margin account maintenance margin rate "accountEquity": "122607.35137903", // Account equity, in USD value "actualEquity": "73.47428058", //Account equity without collateral rate, in USD value "accountInitialMargin": "23.72469206", "accountMaintMargin": "23.72469206", // Portfolio margin account maintenance margin, unit:USD "accountStatus": "NORMAL" // Portfolio margin account status:"NORMAL", "MARGIN_CALL", "SUPPLY_MARGIN", "REDUCE_ONLY", "ACTIVE_LIQUIDATION", "FORCE_LIQUIDATION", "BANKRUPTED" "virtualMaxWithdrawAmount": "1627523.32459208" // Portfolio margin maximum amount for transfer out in USD "totalAvailableBalance":"", "totalMarginOpenLoss":"", // in USD margin open order "updateTime": 1657707212154 // last update time } +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Account-Information) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Account-Information) +- [Request Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Account-Information) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Account-Information) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Account-Information) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_BNB-transfer.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_BNB-transfer.md new file mode 100644 index 0000000..cf6c829 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_BNB-transfer.md @@ -0,0 +1,70 @@ +--- +title: "Bnb Transfer | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/account/BNB-transfer" +fetched_at: "2026-01-27T05:28:16.149Z" +--- +# BNB transfer (TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/BNB-transfer) + +Transfer BNB in and out of UM + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/BNB-transfer) + +POST `/papi/v1/bnb-transfer` + +## Request Weight(IP)[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/BNB-transfer) + +**750** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/BNB-transfer) + +Name + +Type + +Mandatory + +Description + +amount + +DECIMAL + +YES + +transferSide + +STRING + +YES + +"TO\_UM","FROM\_UM" + +recvWindow + +LONG + +NO + +The value cannot be greater than 60000 + +timestamp + +LONG + +YES + +> - The endpoint can only be called 10 times per 10 minutes in a rolling manner + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/BNB-transfer) + +``` +{ "tranId": 100000001 //transaction id}   +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/account/BNB-transfer) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/account/BNB-transfer) +- [Request Weight(IP)](https://developers.binance.com/docs/derivatives/portfolio-margin/account/BNB-transfer) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/account/BNB-transfer) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/account/BNB-transfer) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_CM-Notional-and-Leverage-Brackets.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_CM-Notional-and-Leverage-Brackets.md new file mode 100644 index 0000000..e2d2a16 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_CM-Notional-and-Leverage-Brackets.md @@ -0,0 +1,58 @@ +--- +title: "Cm Notional And Leverage Brackets | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/account/CM-Notional-and-Leverage-Brackets" +fetched_at: "2026-01-27T05:28:16.279Z" +--- +# CM Notional and Leverage Brackets(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/CM-Notional-and-Leverage-Brackets) + +Query CM notional and leverage brackets + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/CM-Notional-and-Leverage-Brackets) + +GET `/papi/v1/cm/leverageBracket` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/CM-Notional-and-Leverage-Brackets) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/CM-Notional-and-Leverage-Brackets) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +NO + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/CM-Notional-and-Leverage-Brackets) + +``` +[ { "symbol": "BTCUSD_PERP", "brackets": [ { "bracket": 1, // bracket level "initialLeverage": 125, // the maximum leverage "qtyCap": 50, // upper edge of base asset quantity "qtyFloor": 0, // lower edge of base asset quantity "maintMarginRatio": 0.004, // maintenance margin rate "cum": 0.0 // Auxiliary number for quick calculation }, ] }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/account/CM-Notional-and-Leverage-Brackets) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/account/CM-Notional-and-Leverage-Brackets) +- [Request Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/account/CM-Notional-and-Leverage-Brackets) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/account/CM-Notional-and-Leverage-Brackets) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/account/CM-Notional-and-Leverage-Brackets) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Change-Auto-repay-futures-Status.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Change-Auto-repay-futures-Status.md new file mode 100644 index 0000000..9138a4a --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Change-Auto-repay-futures-Status.md @@ -0,0 +1,60 @@ +--- +title: "Change Auto Repay Futures Status | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/account/Change-Auto-repay-futures-Status" +fetched_at: "2026-01-27T05:28:16.171Z" +--- +# Change Auto-repay-futures Status(TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Change-Auto-repay-futures-Status) + +Change Auto-repay-futures Status + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Change-Auto-repay-futures-Status) + +POST `/papi/v1/repay-futures-switch` + +## Request Weight(IP)[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Change-Auto-repay-futures-Status) + +**750** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Change-Auto-repay-futures-Status) + +Name + +Type + +Mandatory + +Description + +autoRepay + +STRING + +YES + +Default: `true`; `false` for turn off the auto-repay futures negative balance function + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Change-Auto-repay-futures-Status) + +``` +{ "msg": "success"} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Change-Auto-repay-futures-Status) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Change-Auto-repay-futures-Status) +- [Request Weight(IP)](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Change-Auto-repay-futures-Status) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Change-Auto-repay-futures-Status) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Change-Auto-repay-futures-Status) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Change-CM-Initial-Leverage.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Change-CM-Initial-Leverage.md new file mode 100644 index 0000000..537138e --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Change-CM-Initial-Leverage.md @@ -0,0 +1,66 @@ +--- +title: "Change Cm Initial Leverage | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/account/Change-CM-Initial-Leverage" +fetched_at: "2026-01-27T05:28:16.211Z" +--- +# Change CM Initial Leverage (TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Change-CM-Initial-Leverage) + +Change user's initial leverage of specific symbol in CM. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Change-CM-Initial-Leverage) + +POST `/papi/v1/cm/leverage` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Change-CM-Initial-Leverage) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Change-CM-Initial-Leverage) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +leverage + +INT + +YES + +target initial leverage: int from 1 to 125 + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Change-CM-Initial-Leverage) + +``` +{ "leverage": 21, "maxQty": "1000",    "symbol": "BTCUSD_200925"} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Change-CM-Initial-Leverage) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Change-CM-Initial-Leverage) +- [Request Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Change-CM-Initial-Leverage) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Change-CM-Initial-Leverage) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Change-CM-Initial-Leverage) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Change-CM-Position-Mode.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Change-CM-Position-Mode.md new file mode 100644 index 0000000..147637f --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Change-CM-Position-Mode.md @@ -0,0 +1,60 @@ +--- +title: "Change Cm Position Mode | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/account/Change-CM-Position-Mode" +fetched_at: "2026-01-27T05:28:16.544Z" +--- +# Change CM Position Mode(TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Change-CM-Position-Mode) + +Change user's position mode (Hedge Mode or One-way Mode ) on EVERY symbol in CM + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Change-CM-Position-Mode) + +POST `/papi/v1/cm/positionSide/dual` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Change-CM-Position-Mode) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Change-CM-Position-Mode) + +Name + +Type + +Mandatory + +Description + +dualSidePosition + +STRING + +YES + +"true": Hedge Mode; "false": One-way Mode + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Change-CM-Position-Mode) + +``` +{ "code": 200, "msg": "success"} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Change-CM-Position-Mode) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Change-CM-Position-Mode) +- [Request Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Change-CM-Position-Mode) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Change-CM-Position-Mode) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Change-CM-Position-Mode) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Change-UM-Initial-Leverage.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Change-UM-Initial-Leverage.md new file mode 100644 index 0000000..45690f0 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Change-UM-Initial-Leverage.md @@ -0,0 +1,66 @@ +--- +title: "Change Um Initial Leverage | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/account/Change-UM-Initial-Leverage" +fetched_at: "2026-01-27T05:28:16.430Z" +--- +# Change UM Initial Leverage(TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Change-UM-Initial-Leverage) + +Change user's initial leverage of specific symbol in UM. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Change-UM-Initial-Leverage) + +POST `/papi/v1/um/leverage` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Change-UM-Initial-Leverage) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Change-UM-Initial-Leverage) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +leverage + +INT + +YES + +target initial leverage: int from 1 to 125 + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Change-UM-Initial-Leverage) + +``` +{ "leverage": 21, "maxNotionalValue": "1000000", "symbol": "BTCUSDT"} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Change-UM-Initial-Leverage) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Change-UM-Initial-Leverage) +- [Request Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Change-UM-Initial-Leverage) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Change-UM-Initial-Leverage) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Change-UM-Initial-Leverage) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Change-UM-Position-Mode.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Change-UM-Position-Mode.md new file mode 100644 index 0000000..b6a62f0 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Change-UM-Position-Mode.md @@ -0,0 +1,60 @@ +--- +title: "Change Um Position Mode | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/account/Change-UM-Position-Mode" +fetched_at: "2026-01-27T05:28:16.461Z" +--- +# Change UM Position Mode(TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Change-UM-Position-Mode) + +Change user's position mode (Hedge Mode or One-way Mode ) on EVERY symbol in UM + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Change-UM-Position-Mode) + +POST `/papi/v1/um/positionSide/dual` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Change-UM-Position-Mode) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Change-UM-Position-Mode) + +Name + +Type + +Mandatory + +Description + +dualSidePosition + +STRING + +YES + +"true": Hedge Mode; "false": One-way Mode + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Change-UM-Position-Mode) + +``` +{ "code": 200, "msg": "success"} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Change-UM-Position-Mode) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Change-UM-Position-Mode) +- [Request Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Change-UM-Position-Mode) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Change-UM-Position-Mode) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Change-UM-Position-Mode) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Fund-Auto-collection.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Fund-Auto-collection.md new file mode 100644 index 0000000..3d8cdb1 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Fund-Auto-collection.md @@ -0,0 +1,57 @@ +--- +title: "Fund Auto Collection | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/account/Fund-Auto-collection" +fetched_at: "2026-01-27T05:28:16.667Z" +--- +# Fund Auto-collection(TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Fund-Auto-collection) + +Fund collection for Portfolio Margin + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Fund-Auto-collection) + +`POST /papi/v1/auto-collection` + +## Request Weight(IP)[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Fund-Auto-collection) + +**750** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Fund-Auto-collection) + +Name + +Type + +Mandatory + +Description + +recvWindow + +LONG + +NO + +The value cannot be greater than 60000 + +timestamp + +LONG + +YES + +> - The BNB would not be collected from UM-PM account to the Portfolio Margin account. +> - You can only use this function 500 times per hour in a rolling manner. + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Fund-Auto-collection) + +``` +{ "msg": "success"} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Fund-Auto-collection) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Fund-Auto-collection) +- [Request Weight(IP)](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Fund-Auto-collection) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Fund-Auto-collection) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Fund-Auto-collection) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Fund-Collection-by-Asset.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Fund-Collection-by-Asset.md new file mode 100644 index 0000000..5c1d62f --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Fund-Collection-by-Asset.md @@ -0,0 +1,60 @@ +--- +title: "Fund Collection By Asset | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/account/Fund-Collection-by-Asset" +fetched_at: "2026-01-27T05:28:16.685Z" +--- +# Fund Collection by Asset(TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Fund-Collection-by-Asset) + +Transfers specific asset from Futures Account to Margin account + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Fund-Collection-by-Asset) + +POST `/papi/v1/asset-collection` + +## Request Weight(IP)[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Fund-Collection-by-Asset) + +**30** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Fund-Collection-by-Asset) + +Name + +Type + +Mandatory + +Description + +asset + +STRING + +YES + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +> - The BNB transfer is not be supported + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Fund-Collection-by-Asset) + +``` +{ "msg": "success"} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Fund-Collection-by-Asset) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Fund-Collection-by-Asset) +- [Request Weight(IP)](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Fund-Collection-by-Asset) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Fund-Collection-by-Asset) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Fund-Collection-by-Asset) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Get-Auto-repay-futures-Status.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Get-Auto-repay-futures-Status.md new file mode 100644 index 0000000..67993af --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Get-Auto-repay-futures-Status.md @@ -0,0 +1,52 @@ +--- +title: "Get Auto Repay Futures Status | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-Auto-repay-futures-Status" +fetched_at: "2026-01-27T05:28:16.715Z" +--- +# Get Auto-repay-futures Status(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-Auto-repay-futures-Status) + +Query Auto-repay-futures Status + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-Auto-repay-futures-Status) + +GET `/papi/v1/repay-futures-switch` + +## Request Weight(IP)[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-Auto-repay-futures-Status) + +**30** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-Auto-repay-futures-Status) + +Name + +Type + +Mandatory + +Description + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-Auto-repay-futures-Status) + +``` +{ "autoRepay": true // "true" for turn on the auto-repay futures; "false" for turn off the auto-repay futures } +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-Auto-repay-futures-Status) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-Auto-repay-futures-Status) +- [Request Weight(IP)](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-Auto-repay-futures-Status) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-Auto-repay-futures-Status) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-Auto-repay-futures-Status) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Get-CM-Account-Detail.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Get-CM-Account-Detail.md new file mode 100644 index 0000000..a9db4c5 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Get-CM-Account-Detail.md @@ -0,0 +1,52 @@ +--- +title: "Get Cm Account Detail | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-CM-Account-Detail" +fetched_at: "2026-01-27T05:28:16.809Z" +--- +# Get CM Account Detail(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-CM-Account-Detail) + +Get current CM account asset and position information. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-CM-Account-Detail) + +GET `/papi/v1/cm/account` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-CM-Account-Detail) + +**5** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-CM-Account-Detail) + +Name + +Type + +Mandatory + +Description + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-CM-Account-Detail) + +``` +{ "assets": [ { "asset": "BTC", // asset name "crossWalletBalance": "0.00241969", // total wallet balance "crossUnPnl": "0.00000000", // unrealized profit or loss "maintMargin": "0.00000000", // maintenance margin "initialMargin": "0.00000000", // total intial margin required with the latest mark price "positionInitialMargin": "0.00000000", // positions" margin required with the latest mark price "openOrderInitialMargin": "0.00000000", // open orders" intial margin required with the latest mark price            "updateTime": 1625474304765 // last update time         } ], "positions": [ { "symbol": "BTCUSD_201225", "positionAmt":"0", // position amount "initialMargin": "0", "maintMargin": "0", "unrealizedProfit": "0.00000000", "positionInitialMargin": "0", "openOrderInitialMargin": "0", "leverage": "125", "positionSide": "BOTH", // BOTH means that it is the position of One-way Mode "entryPrice": "0.0", "maxQty": "50", // maximum quantity of base asset "updateTime": 0 } ]} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-CM-Account-Detail) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-CM-Account-Detail) +- [Request Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-CM-Account-Detail) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-CM-Account-Detail) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-CM-Account-Detail) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Get-CM-Current-Position-Mode.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Get-CM-Current-Position-Mode.md new file mode 100644 index 0000000..b5b29f9 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Get-CM-Current-Position-Mode.md @@ -0,0 +1,52 @@ +--- +title: "Get Cm Current Position Mode | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-CM-Current-Position-Mode" +fetched_at: "2026-01-27T05:28:16.918Z" +--- +# Get CM Current Position Mode(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-CM-Current-Position-Mode) + +Get user's position mode (Hedge Mode or One-way Mode ) on EVERY symbol in CM + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-CM-Current-Position-Mode) + +GET `/papi/v1/cm/positionSide/dual` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-CM-Current-Position-Mode) + +**30** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-CM-Current-Position-Mode) + +Name + +Type + +Mandatory + +Description + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-CM-Current-Position-Mode) + +``` +{ "dualSidePosition": true // "true": Hedge Mode; "false": One-way Mode} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-CM-Current-Position-Mode) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-CM-Current-Position-Mode) +- [Request Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-CM-Current-Position-Mode) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-CM-Current-Position-Mode) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-CM-Current-Position-Mode) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Get-CM-Income-History.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Get-CM-Income-History.md new file mode 100644 index 0000000..10fb526 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Get-CM-Income-History.md @@ -0,0 +1,101 @@ +--- +title: "Get Cm Income History | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-CM-Income-History" +fetched_at: "2026-01-27T05:28:17.090Z" +--- +# Get CM Income History(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-CM-Income-History) + +Get CM Income History + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-CM-Income-History) + +GET `/papi/v1/cm/income` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-CM-Income-History) + +**30** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-CM-Income-History) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +NO + +incomeType + +STRING + +NO + +"TRANSFER","WELCOME\_BONUS", "FUNDING\_FEE", "REALIZED\_PNL", "COMMISSION", "INSURANCE\_CLEAR", and "DELIVERED\_SETTELMENT" + +startTime + +LONG + +NO + +Timestamp in ms to get funding from INCLUSIVE. + +endTime + +LONG + +NO + +Timestamp in ms to get funding until INCLUSIVE. + +page + +INT + +NO + +limit + +INT + +NO + +Default 100; max 1000 + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +> - If `incomeType` is not sent, all kinds of flow will be returned +> - "trandId" is unique in the same "incomeType" for a user +> - The interval between `startTime` and `endTime` can not exceed 200 days: +> - If `startTime` and `endTime` are not sent, the last 200 days will be returned + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-CM-Income-History) + +``` +[ { "symbol": "", // trade symbol, if existing "incomeType": "TRANSFER", // income type "income": "-0.37500000", // income amount "asset": "BTC", // income asset "info":"WITHDRAW", // extra information "time": 1570608000000, "tranId":"9689322392", // transaction id "tradeId":"" // trade id, if existing }, { "symbol": "BTCUSD_200925", "incomeType": "COMMISSION", "income": "-0.01000000", "asset": "BTC", "info":"", "time": 1570636800000, "tranId":"9689322392", "tradeId":"2059192" }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-CM-Income-History) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-CM-Income-History) +- [Request Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-CM-Income-History) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-CM-Income-History) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-CM-Income-History) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Get-Download-Id-For-UM-Futures-Order-History.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Get-Download-Id-For-UM-Futures-Order-History.md new file mode 100644 index 0000000..82e3e66 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Get-Download-Id-For-UM-Futures-Order-History.md @@ -0,0 +1,71 @@ +--- +title: "Get Download Id For UM Futures Order History | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-Download-Id-For-UM-Futures-Order-History" +fetched_at: "2026-01-27T05:28:17.024Z" +--- +# Get Download Id For UM Futures Order History (USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-Download-Id-For-UM-Futures-Order-History) + +Get download id for UM futures order history + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-Download-Id-For-UM-Futures-Order-History) + +GET `/papi/v1/um/order/asyn` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-Download-Id-For-UM-Futures-Order-History) + +**1500** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-Download-Id-For-UM-Futures-Order-History) + +Name + +Type + +Mandatory + +Description + +startTime + +LONG + +YES + +Timestamp in ms + +endTime + +LONG + +YES + +Timestamp in ms + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +> - Request Limitation is 10 times per month, shared by front end download page and rest api +> - The time between `startTime` and `endTime` can not be longer than 1 year + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-Download-Id-For-UM-Futures-Order-History) + +``` +{ "avgCostTimestampOfLast30d":7241837, // Average time taken for data download in the past 30 days "downloadId":"546975389218332672",} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-Download-Id-For-UM-Futures-Order-History) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-Download-Id-For-UM-Futures-Order-History) +- [Request Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-Download-Id-For-UM-Futures-Order-History) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-Download-Id-For-UM-Futures-Order-History) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-Download-Id-For-UM-Futures-Order-History) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Get-Download-Id-For-UM-Futures-Trade-History.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Get-Download-Id-For-UM-Futures-Trade-History.md new file mode 100644 index 0000000..cd4954b --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Get-Download-Id-For-UM-Futures-Trade-History.md @@ -0,0 +1,71 @@ +--- +title: "Get Download Id For UM Futures Trade History | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-Download-Id-For-UM-Futures-Trade-History" +fetched_at: "2026-01-27T05:28:17.203Z" +--- +# Get Download Id For UM Futures Trade History (USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-Download-Id-For-UM-Futures-Trade-History) + +Get download id for UM futures trade history + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-Download-Id-For-UM-Futures-Trade-History) + +GET `/papi/v1/um/trade/asyn` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-Download-Id-For-UM-Futures-Trade-History) + +**1500** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-Download-Id-For-UM-Futures-Trade-History) + +Name + +Type + +Mandatory + +Description + +startTime + +LONG + +YES + +Timestamp in ms + +endTime + +LONG + +YES + +Timestamp in ms + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +> - Request Limitation is 5 times per month, shared by front end download page and rest api +> - The time between `startTime` and `endTime` can not be longer than 1 year + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-Download-Id-For-UM-Futures-Trade-History) + +``` +{ "avgCostTimestampOfLast30d":7241837, // Average time taken for data download in the past 30 days "downloadId":"546975389218332672",} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-Download-Id-For-UM-Futures-Trade-History) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-Download-Id-For-UM-Futures-Trade-History) +- [Request Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-Download-Id-For-UM-Futures-Trade-History) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-Download-Id-For-UM-Futures-Trade-History) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-Download-Id-For-UM-Futures-Trade-History) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Get-Download-Id-For-UM-Futures-Transaction-History.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Get-Download-Id-For-UM-Futures-Transaction-History.md new file mode 100644 index 0000000..a7ac306 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Get-Download-Id-For-UM-Futures-Transaction-History.md @@ -0,0 +1,71 @@ +--- +title: "Get Download Id For UM Futures Transaction History | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-Download-Id-For-UM-Futures-Transaction-History" +fetched_at: "2026-01-27T05:28:17.176Z" +--- +# Get Download Id For UM Futures Transaction History (USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-Download-Id-For-UM-Futures-Transaction-History) + +Get download id for UM futures transaction history + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-Download-Id-For-UM-Futures-Transaction-History) + +GET `/papi/v1/um/income/asyn` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-Download-Id-For-UM-Futures-Transaction-History) + +**1500** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-Download-Id-For-UM-Futures-Transaction-History) + +Name + +Type + +Mandatory + +Description + +startTime + +LONG + +YES + +Timestamp in ms + +endTime + +LONG + +YES + +Timestamp in ms + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +> - Request Limitation is 5 times per month, shared by front end download page and rest api +> - The time between `startTime` and `endTime` can not be longer than 1 year + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-Download-Id-For-UM-Futures-Transaction-History) + +``` +{ "avgCostTimestampOfLast30d":7241837, // Average time taken for data download in the past 30 days "downloadId":"546975389218332672",} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-Download-Id-For-UM-Futures-Transaction-History) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-Download-Id-For-UM-Futures-Transaction-History) +- [Request Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-Download-Id-For-UM-Futures-Transaction-History) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-Download-Id-For-UM-Futures-Transaction-History) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-Download-Id-For-UM-Futures-Transaction-History) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Get-Margin-BorrowLoan-Interest-History.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Get-Margin-BorrowLoan-Interest-History.md new file mode 100644 index 0000000..2fd7083 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Get-Margin-BorrowLoan-Interest-History.md @@ -0,0 +1,108 @@ +--- +title: "Get Margin Borrowloan Interest History | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-Margin-BorrowLoan-Interest-History" +fetched_at: "2026-01-27T05:28:17.282Z" +--- +# Get Margin Borrow/Loan Interest History(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-Margin-BorrowLoan-Interest-History) + +Get Margin Borrow/Loan Interest History + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-Margin-BorrowLoan-Interest-History) + +GET `/papi/v1/margin/marginInterestHistory` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-Margin-BorrowLoan-Interest-History) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-Margin-BorrowLoan-Interest-History) + +Name + +Type + +Mandatory + +Description + +asset + +STRING + +NO + +startTime + +LONG + +NO + +endTime + +LONG + +NO + +current + +LONG + +NO + +Currently querying page. Start from 1. Default:1 + +size + +LONG + +NO + +Default:10 Max:100 + +archived + +STRING + +NO + +Default: `false`. Set to `true` for archived data from 6 months ago + +recvWindow + +LONG + +NO + +The value cannot be greater than `60000` + +timestamp + +LONG + +YES + +> - Response in descending order +> - The max interval between startTime and endTime is 30 days. It is a MUST to ensure data correctness. +> - If `startTime` and `endTime` not sent, return records of the last 7 days by default +> - If `startTime` is sent and `endTime` is not sent, the records from `startTime` to the present will be returned; if `startTime` is more than 30 days ago, the records of the past 30 days will be returned. +> - If `startTime` is not sent and `endTime` is sent, the records of the 7 days before `endTime` is returned. +> - Type in response has 5 enums: +> - `PERIODIC` interest charged per hour +> - `ON_BORROW` first interest charged on borrow +> - `PERIODIC_CONVERTED` interest charged per hour converted into BNB +> - `ON_BORROW_CONVERTED` first interest charged on borrow converted into BNB +> - `PORTFOLIO` Portfolio Margin negative balance daily interest + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-Margin-BorrowLoan-Interest-History) + +``` +{ "rows": [ { "txId": 1352286576452864727, "interestAccuredTime": 1672160400000, "asset": "USDT", "rawAsset": “USDT”, "principal": "45.3313", "interest": "0.00024995", "interestRate": "0.00013233", "type": "ON_BORROW" } ], "total": 1} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-Margin-BorrowLoan-Interest-History) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-Margin-BorrowLoan-Interest-History) +- [Request Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-Margin-BorrowLoan-Interest-History) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-Margin-BorrowLoan-Interest-History) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-Margin-BorrowLoan-Interest-History) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Get-UM-Account-Detail-V2.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Get-UM-Account-Detail-V2.md new file mode 100644 index 0000000..444ff91 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Get-UM-Account-Detail-V2.md @@ -0,0 +1,52 @@ +--- +title: "Get Um Account Detail V2 | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Account-Detail-V2" +fetched_at: "2026-01-27T05:28:17.433Z" +--- +# Get UM Account Detail V2(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Account-Detail-V2) + +Get current UM account asset and position information. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Account-Detail-V2) + +GET `/papi/v2/um/account` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Account-Detail-V2) + +**5** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Account-Detail-V2) + +Name + +Type + +Mandatory + +Description + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Account-Detail-V2) + +``` +{ "assets": [ { "asset": "USDT", // asset name "crossWalletBalance": "23.72469206", // wallet balance "crossUnPnl": "0.00000000", // unrealized profit "maintMargin": "0.00000000", // maintenance margin required "initialMargin": "0.00000000", // total initial margin required with current mark price "positionInitialMargin": "0.00000000", //initial margin required for positions with current mark price "openOrderInitialMargin": "0.00000000", // initial margin required for open orders with current mark price "updateTime": 1625474304765 // last update time } ], "positions": [ // positions of all symbols in the market are returned // only "BOTH" positions will be returned with One-way mode // only "LONG" and "SHORT" positions will be returned with Hedge mode { "symbol": "BTCUSDT", // symbol name "initialMargin": "0", // initial margin required with current mark price "maintMargin": "0", // maintenance margin required "unrealizedProfit": "0.00000000", // unrealized profit "positionSide": "BOTH", // position side "positionAmt": "0", // position amount "updateTime": 0, // last update time "notional": "86.98650000" } ]} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Account-Detail-V2) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Account-Detail-V2) +- [Request Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Account-Detail-V2) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Account-Detail-V2) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Account-Detail-V2) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Get-UM-Account-Detail.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Get-UM-Account-Detail.md new file mode 100644 index 0000000..d241466 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Get-UM-Account-Detail.md @@ -0,0 +1,52 @@ +--- +title: "Get Um Account Detail | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Account-Detail" +fetched_at: "2026-01-27T05:28:17.350Z" +--- +# Get UM Account Detail(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Account-Detail) + +Get current UM account asset and position information. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Account-Detail) + +GET `/papi/v1/um/account` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Account-Detail) + +**5** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Account-Detail) + +Name + +Type + +Mandatory + +Description + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Account-Detail) + +``` +{ "assets": [ { "asset": "USDT", // asset name "crossWalletBalance": "23.72469206", // wallet balance "crossUnPnl": "0.00000000", // unrealized profit "maintMargin": "0.00000000", // maintenance margin required "initialMargin": "0.00000000", // total initial margin required with current mark price "positionInitialMargin": "0.00000000", //initial margin required for positions with current mark price "openOrderInitialMargin": "0.00000000", // initial margin required for open orders with current mark price "updateTime": 1625474304765 // last update time } ], "positions": [ // positions of all symbols in the market are returned // only "BOTH" positions will be returned with One-way mode // only "LONG" and "SHORT" positions will be returned with Hedge mode { "symbol": "BTCUSDT", // symbol name "initialMargin": "0", // initial margin required with current mark price "maintMargin": "0", // maintenance margin required "unrealizedProfit": "0.00000000", // unrealized profit "positionInitialMargin": "0", // initial margin required for positions with current mark price "openOrderInitialMargin": "0", // initial margin required for open orders with current mark price "leverage": "100", // current initial leverage "entryPrice": "0.00000", // average entry price "maxNotional": "250000", // maximum available notional with current leverage "bidNotional": "0", // bids notional, ignore "askNotional": "0", // ask notional, ignore "positionSide": "BOTH", // position side "positionAmt": "0", // position amount "updateTime": 0 // last update time } ]} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Account-Detail) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Account-Detail) +- [Request Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Account-Detail) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Account-Detail) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Account-Detail) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Get-UM-Current-Position-Mode.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Get-UM-Current-Position-Mode.md new file mode 100644 index 0000000..3ecd364 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Get-UM-Current-Position-Mode.md @@ -0,0 +1,52 @@ +--- +title: "Get Um Current Position Mode | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Current-Position-Mode" +fetched_at: "2026-01-27T05:28:17.454Z" +--- +# Get UM Current Position Mode(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Current-Position-Mode) + +Get user's position mode (Hedge Mode or One-way Mode ) on EVERY symbol in UM + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Current-Position-Mode) + +GET `/papi/v1/um/positionSide/dual` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Current-Position-Mode) + +**30** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Current-Position-Mode) + +Name + +Type + +Mandatory + +Description + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Current-Position-Mode) + +``` +{ "dualSidePosition": true // "true": Hedge Mode; "false": One-way Mode} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Current-Position-Mode) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Current-Position-Mode) +- [Request Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Current-Position-Mode) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Current-Position-Mode) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Current-Position-Mode) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Get-UM-Futures-Account-Config.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Get-UM-Futures-Account-Config.md new file mode 100644 index 0000000..4594715 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Get-UM-Futures-Account-Config.md @@ -0,0 +1,52 @@ +--- +title: "Get Um Futures Account Configuration | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Futures-Account-Config" +fetched_at: "2026-01-27T05:28:17.674Z" +--- +# UM Futures Account Configuration(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Futures-Account-Config) + +Query UM Futures account configuration + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Futures-Account-Config) + +GET `/papi/v1/um/accountConfig` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Futures-Account-Config) + +**5** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Futures-Account-Config) + +Name + +Type + +Mandatory + +Description + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Futures-Account-Config) + +``` +{ "feeTier": 0, // account commission tier "canTrade": true, // if can trade "canDeposit": true, // if can transfer in asset "canWithdraw": true, // if can transfer out asset "dualSidePosition": true, "updateTime": 1724416653850, // reserved property, please ignore "multiAssetsMargin": false, "tradeGroupId": -1} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Futures-Account-Config) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Futures-Account-Config) +- [Request Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Futures-Account-Config) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Futures-Account-Config) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Futures-Account-Config) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Get-UM-Futures-Order-Download-Link-by-Id.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Get-UM-Futures-Order-Download-Link-by-Id.md new file mode 100644 index 0000000..2d35e53 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Get-UM-Futures-Order-Download-Link-by-Id.md @@ -0,0 +1,70 @@ +--- +title: "Get UM Futures Order Download Link by Id | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Futures-Order-Download-Link-by-Id" +fetched_at: "2026-01-27T05:28:17.664Z" +--- +# Get UM Futures Order Download Link by Id(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Futures-Order-Download-Link-by-Id) + +Get UM futures order download link by Id + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Futures-Order-Download-Link-by-Id) + +GET `/papi/v1/um/order/asyn/id` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Futures-Order-Download-Link-by-Id) + +**10** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Futures-Order-Download-Link-by-Id) + +Name + +Type + +Mandatory + +Description + +downloadId + +STRING + +YES + +get by download id api + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +> - Download link expiration: 24h + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Futures-Order-Download-Link-by-Id) + +> **Response:** + +``` +{ "downloadId":"545923594199212032", "status":"completed", // Enum:completed,processing "url":"www.binance.com", // The link is mapped to download id "s3Link": null, "notified":true, // ignore "expirationTimestamp":1645009771000, // The link would expire after this timestamp "isExpired":null,} +``` + +> **OR** (Response when server is processing) + +``` +{ "downloadId":"545923594199212032", "status":"processing", "url":"", "s3Link": null, "notified":false, "expirationTimestamp":-1 "isExpired":null, } +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Futures-Order-Download-Link-by-Id) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Futures-Order-Download-Link-by-Id) +- [Request Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Futures-Order-Download-Link-by-Id) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Futures-Order-Download-Link-by-Id) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Futures-Order-Download-Link-by-Id) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Get-UM-Futures-Symbol-Config.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Get-UM-Futures-Symbol-Config.md new file mode 100644 index 0000000..f7665e2 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Get-UM-Futures-Symbol-Config.md @@ -0,0 +1,58 @@ +--- +title: "Get Um Futures Symbol Configuration | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Futures-Symbol-Config" +fetched_at: "2026-01-27T05:28:17.688Z" +--- +# UM Futures Symbol Configuration(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Futures-Symbol-Config) + +Get current UM account symbol configuration. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Futures-Symbol-Config) + +GET `/papi/v1/um/symbolConfig` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Futures-Symbol-Config) + +**5** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Futures-Symbol-Config) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +NO + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Futures-Symbol-Config) + +``` +[ { "symbol": "BTCUSDT", "marginType": "CROSSED", "isAutoAddMargin": "false", "leverage": 21, "maxNotionalValue": "1000000", }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Futures-Symbol-Config) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Futures-Symbol-Config) +- [Request Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Futures-Symbol-Config) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Futures-Symbol-Config) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Futures-Symbol-Config) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Get-UM-Futures-Trade-Download-Link-by-Id.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Get-UM-Futures-Trade-Download-Link-by-Id.md new file mode 100644 index 0000000..af1bca1 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Get-UM-Futures-Trade-Download-Link-by-Id.md @@ -0,0 +1,70 @@ +--- +title: "Get UM Futures Trade Download Link by Id | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Futures-Trade-Download-Link-by-Id" +fetched_at: "2026-01-27T05:28:17.893Z" +--- +# Get UM Futures Trade Download Link by Id(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Futures-Trade-Download-Link-by-Id) + +Get UM futures trade download link by Id + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Futures-Trade-Download-Link-by-Id) + +GET `/papi/v1/um/trade/asyn/id` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Futures-Trade-Download-Link-by-Id) + +**10** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Futures-Trade-Download-Link-by-Id) + +Name + +Type + +Mandatory + +Description + +downloadId + +STRING + +YES + +get by download id api + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +> - Download link expiration: 24h + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Futures-Trade-Download-Link-by-Id) + +> **Response:** + +``` +{ "downloadId":"545923594199212032", "status":"completed", // Enum:completed,processing "url":"www.binance.com", // The link is mapped to download id "s3Link": null, "notified":true, // ignore "expirationTimestamp":1645009771000, // The link would expire after this timestamp "isExpired":null,} +``` + +> **OR** (Response when server is processing) + +``` +{ "downloadId":"545923594199212032", "status":"processing", "url":"", "s3Link": null, "notified":false, "expirationTimestamp":-1 "isExpired":null, } +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Futures-Trade-Download-Link-by-Id) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Futures-Trade-Download-Link-by-Id) +- [Request Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Futures-Trade-Download-Link-by-Id) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Futures-Trade-Download-Link-by-Id) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Futures-Trade-Download-Link-by-Id) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Get-UM-Futures-Transaction-Download-Link-by-Id.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Get-UM-Futures-Transaction-Download-Link-by-Id.md new file mode 100644 index 0000000..1e2b0ee --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Get-UM-Futures-Transaction-Download-Link-by-Id.md @@ -0,0 +1,70 @@ +--- +title: "Get UM Futures Transaction Download Link by Id | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Futures-Transaction-Download-Link-by-Id" +fetched_at: "2026-01-27T05:28:17.919Z" +--- +# Get UM Futures Transaction Download Link by Id(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Futures-Transaction-Download-Link-by-Id) + +Get UM futures Transaction download link by Id + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Futures-Transaction-Download-Link-by-Id) + +GET `/papi/v1/um/income/asyn/id` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Futures-Transaction-Download-Link-by-Id) + +**10** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Futures-Transaction-Download-Link-by-Id) + +Name + +Type + +Mandatory + +Description + +downloadId + +STRING + +YES + +get by download id api + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +> - Download link expiration: 24h + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Futures-Transaction-Download-Link-by-Id) + +> **Response:** + +``` +{ "downloadId":"545923594199212032", "status":"completed", // Enum:completed,processing "url":"www.binance.com", // The link is mapped to download id "s3Link": null, "notified":true, // ignore "expirationTimestamp":1645009771000, // The link would expire after this timestamp "isExpired":null,} +``` + +> **OR** (Response when server is processing) + +``` +{ "downloadId":"545923594199212032", "status":"processing", "url":"", "s3Link": null, "notified":false, "expirationTimestamp":-1 "isExpired":null, } +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Futures-Transaction-Download-Link-by-Id) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Futures-Transaction-Download-Link-by-Id) +- [Request Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Futures-Transaction-Download-Link-by-Id) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Futures-Transaction-Download-Link-by-Id) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Futures-Transaction-Download-Link-by-Id) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Get-UM-Income-History.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Get-UM-Income-History.md new file mode 100644 index 0000000..9528b79 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Get-UM-Income-History.md @@ -0,0 +1,101 @@ +--- +title: "Get Um Income History | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Income-History" +fetched_at: "2026-01-27T05:28:18.066Z" +--- +# Get UM Income History(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Income-History) + +Get UM Income History + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Income-History) + +GET `/papi/v1/um/income` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Income-History) + +**30** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Income-History) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +NO + +incomeType + +STRING + +NO + +TRANSFER, WELCOME\_BONUS, REALIZED\_PNL, FUNDING\_FEE, COMMISSION, INSURANCE\_CLEAR, REFERRAL\_KICKBACK, COMMISSION\_REBATE, API\_REBATE, CONTEST\_REWARD, CROSS\_COLLATERAL\_TRANSFER, OPTIONS\_PREMIUM\_FEE, OPTIONS\_SETTLE\_PROFIT, INTERNAL\_TRANSFER, AUTO\_EXCHANGE, DELIVERED\_SETTELMENT, COIN\_SWAP\_DEPOSIT, COIN\_SWAP\_WITHDRAW, POSITION\_LIMIT\_INCREASE\_FEE + +startTime + +LONG + +NO + +Timestamp in ms to get funding from INCLUSIVE. + +endTime + +LONG + +NO + +Timestamp in ms to get funding until INCLUSIVE. + +page + +INT + +NO + +limit + +INT + +NO + +Default 100; max 1000 + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +> - If neither `startTime` nor `endTime` is sent, the recent 7-day data will be returned. +> - If `incomeType` is not sent, all kinds of flow will be returned +> - "trandId" is unique in the same incomeType for a user +> - Income history only contains data for the last three months + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Income-History) + +``` +[ { "symbol": "", // trade symbol, if existing "incomeType": "TRANSFER", // income type "income": "-0.37500000", // income amount "asset": "USDT", // income asset "info":"TRANSFER", // extra information "time": 1570608000000, "tranId":"9689322392", // transaction id "tradeId":"" // trade id, if existing }, { "symbol": "BTCUSDT", "incomeType": "COMMISSION", "income": "-0.01000000", "asset": "USDT", "info":"COMMISSION", "time": 1570636800000, "tranId":"9689322392", "tradeId":"2059192" }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Income-History) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Income-History) +- [Request Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Income-History) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Income-History) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Income-History) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Get-User-Commission-Rate-for-CM.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Get-User-Commission-Rate-for-CM.md new file mode 100644 index 0000000..597c073 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Get-User-Commission-Rate-for-CM.md @@ -0,0 +1,58 @@ +--- +title: "Get User Commission Rate For Cm | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-User-Commission-Rate-for-CM" +fetched_at: "2026-01-27T05:28:18.074Z" +--- +# Get User Commission Rate for CM(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-User-Commission-Rate-for-CM) + +Get User Commission Rate for CM + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-User-Commission-Rate-for-CM) + +GET `/papi/v1/cm/commissionRate` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-User-Commission-Rate-for-CM) + +**20** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-User-Commission-Rate-for-CM) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-User-Commission-Rate-for-CM) + +``` +{ "symbol": "BTCUSD_PERP", "makerCommissionRate": "0.00015", // 0.015% "takerCommissionRate": "0.00040" // 0.040%} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-User-Commission-Rate-for-CM) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-User-Commission-Rate-for-CM) +- [Request Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-User-Commission-Rate-for-CM) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-User-Commission-Rate-for-CM) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-User-Commission-Rate-for-CM) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Get-User-Commission-Rate-for-UM.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Get-User-Commission-Rate-for-UM.md new file mode 100644 index 0000000..e34829a --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Get-User-Commission-Rate-for-UM.md @@ -0,0 +1,58 @@ +--- +title: "Get User Commission Rate For Um | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-User-Commission-Rate-for-UM" +fetched_at: "2026-01-27T05:28:18.140Z" +--- +# Get User Commission Rate for UM(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-User-Commission-Rate-for-UM) + +Get User Commission Rate for UM + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-User-Commission-Rate-for-UM) + +GET `/papi/v1/um/commissionRate` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-User-Commission-Rate-for-UM) + +**20** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-User-Commission-Rate-for-UM) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-User-Commission-Rate-for-UM) + +``` +{ "symbol": "BTCUSDT", "makerCommissionRate": "0.0002", // 0.02% "takerCommissionRate": "0.0004" // 0.04%} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-User-Commission-Rate-for-UM) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-User-Commission-Rate-for-UM) +- [Request Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-User-Commission-Rate-for-UM) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-User-Commission-Rate-for-UM) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-User-Commission-Rate-for-UM) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Margin-Max-Borrow.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Margin-Max-Borrow.md new file mode 100644 index 0000000..039757c --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Margin-Max-Borrow.md @@ -0,0 +1,60 @@ +--- +title: "Margin Max Borrow | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/account/Margin-Max-Borrow" +fetched_at: "2026-01-27T05:28:18.168Z" +--- +# Margin Max Borrow(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Margin-Max-Borrow) + +Query margin max borrow + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Margin-Max-Borrow) + +GET `/papi/v1/margin/maxBorrowable` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Margin-Max-Borrow) + +**5** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Margin-Max-Borrow) + +Name + +Type + +Mandatory + +Description + +asset + +STRING + +YES + +recvWindow + +LONG + +NO + +The value cannot be greater than `60000` + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Margin-Max-Borrow) + +``` +{ "amount": "1.69248805", // account's currently max borrowable amount with sufficient system availability "borrowLimit": "60" // max borrowable amount limited by the account level} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Margin-Max-Borrow) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Margin-Max-Borrow) +- [Request Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Margin-Max-Borrow) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Margin-Max-Borrow) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Margin-Max-Borrow) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Portfolio-Margin-UM-Trading-Quantitative-Rules-Indicators.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Portfolio-Margin-UM-Trading-Quantitative-Rules-Indicators.md new file mode 100644 index 0000000..29131fb --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Portfolio-Margin-UM-Trading-Quantitative-Rules-Indicators.md @@ -0,0 +1,64 @@ +--- +title: "Portfolio Margin Um Trading Quantitative Rules Indicators | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/account/Portfolio-Margin-UM-Trading-Quantitative-Rules-Indicators" +fetched_at: "2026-01-27T05:28:18.322Z" +--- +# Portfolio Margin UM Trading Quantitative Rules Indicators(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Portfolio-Margin-UM-Trading-Quantitative-Rules-Indicators) + +Portfolio Margin UM Trading Quantitative Rules Indicators + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Portfolio-Margin-UM-Trading-Quantitative-Rules-Indicators) + +GET `/papi/v1/um/apiTradingStatus` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Portfolio-Margin-UM-Trading-Quantitative-Rules-Indicators) + +**1** for a single symbol **10** when the symbol parameter is omitted + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Portfolio-Margin-UM-Trading-Quantitative-Rules-Indicators) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +NO + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Portfolio-Margin-UM-Trading-Quantitative-Rules-Indicators) + +``` +{ "indicators": { // indicator: quantitative rules indicators, value: user's indicators value, triggerValue: trigger indicator value threshold of quantitative rules. "BTCUSDT": [ { "isLocked": true, "plannedRecoverTime": 1545741270000, "indicator": "UFR", // Unfilled Ratio (UFR) "value": 0.05, // Current value "triggerValue": 0.995 // Trigger value }, { "isLocked": true, "plannedRecoverTime": 1545741270000, "indicator": "IFER", // IOC/FOK Expiration Ratio (IFER) "value": 0.99, // Current value "triggerValue": 0.99 // Trigger value }, { "isLocked": true, "plannedRecoverTime": 1545741270000, "indicator": "GCR", // GTC Cancellation Ratio (GCR) "value": 0.99, // Current value "triggerValue": 0.99 // Trigger value }, { "isLocked": true, "plannedRecoverTime": 1545741270000, "indicator": "DR", // Dust Ratio (DR) "value": 0.99, // Current value "triggerValue": 0.99 // Trigger value } ] }, "updateTime": 1545741270000} +``` + +Or (account violation triggered) + +``` +{ "indicators":{ "ACCOUNT":[ { "indicator":"TMV", // Too many violations under multiple symbols trigger account violation "value":10, "triggerValue":1, "plannedRecoverTime":1644919865000, "isLocked":true } ] }, "updateTime":1644913304748} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Portfolio-Margin-UM-Trading-Quantitative-Rules-Indicators) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Portfolio-Margin-UM-Trading-Quantitative-Rules-Indicators) +- [Request Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Portfolio-Margin-UM-Trading-Quantitative-Rules-Indicators) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Portfolio-Margin-UM-Trading-Quantitative-Rules-Indicators) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Portfolio-Margin-UM-Trading-Quantitative-Rules-Indicators) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Query-CM-Position-Information.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Query-CM-Position-Information.md new file mode 100644 index 0000000..4315827 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Query-CM-Position-Information.md @@ -0,0 +1,80 @@ +--- +title: "Query Cm Position Information | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-CM-Position-Information" +fetched_at: "2026-01-27T05:28:18.392Z" +--- +# Query CM Position Information(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-CM-Position-Information) + +Get current CM position information. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-CM-Position-Information) + +GET `/papi/v1/cm/positionRisk` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-CM-Position-Information) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-CM-Position-Information) + +Name + +Type + +Mandatory + +Description + +marginAsset + +STRING + +NO + +pair + +STRING + +NO + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +> - If neither `marginAsset` nor `pair` is sent, positions of all symbols with `TRADING` status will be returned. +> - for One-way Mode user, the response will only show the "BOTH" positions +> - for Hedge Mode user, the response will show "LONG", and "SHORT" positions. + +**Note** + +> - Please use with user data stream `ACCOUNT_UPDATE` to meet your timeliness and accuracy needs. + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-CM-Position-Information) + +- For One-way position mode: + +``` +[ { "symbol": "BTCUSD_201225", "positionAmt": "1", "entryPrice": "11707.70000003", "markPrice": "11788.66626667", "unRealizedProfit": "0.00005866", "liquidationPrice": "6170.20509059", "leverage": "125", "positionSide": "LONG", "updateTime": 1627026881327, "maxQty": "50", "notionalValue": "0.00084827" }] +``` + +> - For Hedge position mode(only return with position): + +``` +[ { "symbol": "BTCUSD_201225", "positionAmt": "1", "entryPrice": "11707.70000003", "markPrice": "11788.66626667", "unRealizedProfit": "0.00005866", "liquidationPrice": "6170.20509059", "leverage": "125", "positionSide": "LONG", "updateTime": 1627026881327, "maxQty": "50", "notionalValue": "0.00084827" }, { "symbol": "BTCUSD_201225", "positionAmt": "1", "entryPrice": "11707.70000003", "markPrice": "11788.66626667", "unRealizedProfit": "0.00005866", "liquidationPrice": "6170.20509059", "leverage": "125", "positionSide": "LONG", "updateTime": 1627026881327, "maxQty": "50", "notionalValue": "0.00084827" }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-CM-Position-Information) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-CM-Position-Information) +- [Request Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-CM-Position-Information) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-CM-Position-Information) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-CM-Position-Information) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Query-Margin-Loan-Record.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Query-Margin-Loan-Record.md new file mode 100644 index 0000000..1b4740f --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Query-Margin-Loan-Record.md @@ -0,0 +1,110 @@ +--- +title: "Query Margin Loan Record | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-Margin-Loan-Record" +fetched_at: "2026-01-27T05:28:18.397Z" +--- +# Query Margin Loan Record(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-Margin-Loan-Record) + +Query margin loan record + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-Margin-Loan-Record) + +GET `/papi/v1/margin/marginLoan` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-Margin-Loan-Record) + +**10** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-Margin-Loan-Record) + +Name + +Type + +Mandatory + +Description + +asset + +STRING + +YES + +txId + +LONG + +NO + +the `tranId` in `POST/papi/v1/marginLoan` + +startTime + +LONG + +NO + +endTime + +LONG + +NO + +current + +LONG + +NO + +Currently querying page. Start from 1. Default:1 + +size + +LONG + +NO + +Default:10 Max:100 + +archived + +STRING + +NO + +Default: `false`. Set to `true` for archived data from 6 months ago + +recvWindow + +LONG + +NO + +The value cannot be greater than 60000 + +timestamp + +LONG + +YES + +> - txId or startTime must be sent. txId takes precedence. +> - Response in descending order +> - The max interval between `startTime` and `endTime` is 30 days. +> - If `startTime` and `endTime` not sent, return records of the last 7 days by default +> - Set `archived` to `true` to query data from 6 months ago + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-Margin-Loan-Record) + +``` +{ "rows": [ { "txId": 12807067523, "asset": "BNB", "principal": "0.84624403", "timestamp": 1555056425000, "status": "CONFIRMED" //one of PENDING (pending execution), CONFIRMED (successfully loaned), FAILED (execution failed, nothing happened to your account); } ], "total": 1} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-Margin-Loan-Record) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-Margin-Loan-Record) +- [Request Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-Margin-Loan-Record) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-Margin-Loan-Record) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-Margin-Loan-Record) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Query-Margin-Max-Withdraw.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Query-Margin-Max-Withdraw.md new file mode 100644 index 0000000..b140409 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Query-Margin-Max-Withdraw.md @@ -0,0 +1,60 @@ +--- +title: "Query Margin Max Withdraw | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-Margin-Max-Withdraw" +fetched_at: "2026-01-27T05:28:18.422Z" +--- +# Query Margin Max Withdraw(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-Margin-Max-Withdraw) + +Query Margin Max Withdraw + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-Margin-Max-Withdraw) + +GET `/papi/v1/margin/maxWithdraw` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-Margin-Max-Withdraw) + +**5** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-Margin-Max-Withdraw) + +Name + +Type + +Mandatory + +Description + +asset + +STRING + +YES + +recvWindow + +LONG + +NO + +The value cannot be greater than `60000` + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-Margin-Max-Withdraw) + +``` +{ "amount": "60"} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-Margin-Max-Withdraw) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-Margin-Max-Withdraw) +- [Request Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-Margin-Max-Withdraw) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-Margin-Max-Withdraw) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-Margin-Max-Withdraw) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Query-Margin-repay-Record.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Query-Margin-repay-Record.md new file mode 100644 index 0000000..a03e9c3 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Query-Margin-repay-Record.md @@ -0,0 +1,110 @@ +--- +title: "Query Margin Repay Record | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-Margin-repay-Record" +fetched_at: "2026-01-27T05:28:18.718Z" +--- +# Query Margin repay Record(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-Margin-repay-Record) + +Query margin repay record. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-Margin-repay-Record) + +GET `/papi/v1/margin/repayLoan` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-Margin-repay-Record) + +**10** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-Margin-repay-Record) + +Name + +Type + +Mandatory + +Description + +asset + +STRING + +YES + +txId + +LONG + +NO + +the tranId in `POST/papi/v1/repayLoan` + +startTime + +LONG + +NO + +endTime + +LONG + +NO + +current + +LONG + +NO + +Currently querying page. Start from 1. Default:1 + +size + +LONG + +NO + +Default:10 Max:100 + +archived + +STRING + +NO + +Default: `false`. Set to `true` for archived data from 6 months ago + +recvWindow + +LONG + +NO + +The value cannot be greater than 60000 + +timestamp + +LONG + +YES + +> - txId or startTime must be sent. txId takes precedence. +> - Response in descending order +> - The max interval between `startTime` and `endTime` is 30 days. +> - If `startTime` and `endTime` not sent, return records of the last 7 days by default +> - Set `archived` to `true` to query data from 6 months ago + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-Margin-repay-Record) + +``` +{ "rows": [ { "amount": "14.00000000", //Total amount repaid "asset": "BNB", "interest": "0.01866667", //Interest repaid "principal": "13.98133333", //Principal repaid "status": "CONFIRMED", //one of PENDING (pending execution), CONFIRMED (successfully execution), FAILED (execution failed, nothing happened to your account) "timestamp": 1563438204000, "txId": 2970933056 } ], "total": 1} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-Margin-repay-Record) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-Margin-repay-Record) +- [Request Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-Margin-repay-Record) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-Margin-repay-Record) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-Margin-repay-Record) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Query-Portfolio-Margin-Negative-Balance-Interest-History.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Query-Portfolio-Margin-Negative-Balance-Interest-History.md new file mode 100644 index 0000000..389336a --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Query-Portfolio-Margin-Negative-Balance-Interest-History.md @@ -0,0 +1,84 @@ +--- +title: "Query Portfolio Margin Negative Balance Interest History | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-Portfolio-Margin-Negative-Balance-Interest-History" +fetched_at: "2026-01-27T05:28:18.645Z" +--- +# Query Portfolio Margin Negative Balance Interest History(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-Portfolio-Margin-Negative-Balance-Interest-History) + +Query interest history of negative balance for portfolio margin. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-Portfolio-Margin-Negative-Balance-Interest-History) + +`GET /papi/v1/portfolio/interest-history` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-Portfolio-Margin-Negative-Balance-Interest-History) + +**50** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-Portfolio-Margin-Negative-Balance-Interest-History) + +Name + +Type + +Mandatory + +Description + +asset + +STRING + +NO + +startTime + +LONG + +NO + +endTime + +LONG + +NO + +size + +LONG + +NO + +Default:10 Max:100 + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +> - Response in descending order +> - The max interval between startTime and endTime is 30 days. It is a MUST to ensure data correctness. +> - If `startTime` and `endTime` not sent, return records of the last 7 days by default +> - If `startTime` is sent and `endTime` is not sent, the records from `startTime` to the present will be returned; if `startTime` is more than 30 days ago, the records of the past 30 days will be returned. +> - If `startTime` is not sent and `endTime` is sent, the records of the 7 days before `endTime` is returned. + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-Portfolio-Margin-Negative-Balance-Interest-History) + +``` +[ { "asset": "USDT", "interest": "24.4440", //interest amount "interestAccuredTime": 1670227200000, "interestRate": "0.0001164", //daily interest rate "principal": "210000" }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-Portfolio-Margin-Negative-Balance-Interest-History) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-Portfolio-Margin-Negative-Balance-Interest-History) +- [Request Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-Portfolio-Margin-Negative-Balance-Interest-History) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-Portfolio-Margin-Negative-Balance-Interest-History) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-Portfolio-Margin-Negative-Balance-Interest-History) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Query-UM-Position-Information.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Query-UM-Position-Information.md new file mode 100644 index 0000000..f84b56e --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Query-UM-Position-Information.md @@ -0,0 +1,71 @@ +--- +title: "Query Um Position Information | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-UM-Position-Information" +fetched_at: "2026-01-27T05:28:18.788Z" +--- +# Query UM Position Information(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-UM-Position-Information) + +Get current UM position information. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-UM-Position-Information) + +GET `/papi/v1/um/positionRisk` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-UM-Position-Information) + +**5** + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +NO + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +**Note** + +> - Please use with user data stream `ACCOUNT_UPDATE` to meet your timeliness and accuracy needs.   +> - for One-way Mode user, the response will only show the "BOTH" positions +> - for Hedge Mode user, the response will show "LONG", and "SHORT" positions. + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-UM-Position-Information) + +> - For One-way position mode: + +``` + [ { "entryPrice": "0.00000", "leverage": "10", "markPrice": "6679.50671178", "maxNotionalValue": "20000000", "positionAmt": "0.000", "notional": "0", "symbol": "BTCUSDT", "unRealizedProfit": "0.00000000", "liquidationPrice": "6170.20509059", "positionSide": "BOTH", "updateTime": 1625474304765 }] +``` + +> Or For Hedge position mode(only return with position): + +``` +[ { "symbol": "BTCUSDT", "positionAmt": "0.001", "entryPrice": "22185.2", "markPrice": "21123.05052574", "unRealizedProfit": "-1.06214947", "liquidationPrice": "6170.20509059", "leverage": "4", "maxNotionalValue": "100000000", "positionSide": "LONG", "notional": "21.12305052", "updateTime": 1655217461579 }, { "symbol": "BTCUSDT", "positionAmt": "0.000", "entryPrice": "0.0", "markPrice": "21123.05052574", "unRealizedProfit": "0.00000000", "liquidationPrice": "6170.20509059", "leverage": "4", "maxNotionalValue": "100000000", "positionSide": "SHORT", "notional": "0", "updateTime": 0 }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-UM-Position-Information) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-UM-Position-Information) +- [Request Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-UM-Position-Information) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-UM-Position-Information) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Query-User-Negative-Balance-Auto-Exchange-Record.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Query-User-Negative-Balance-Auto-Exchange-Record.md new file mode 100644 index 0000000..3719072 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Query-User-Negative-Balance-Auto-Exchange-Record.md @@ -0,0 +1,71 @@ +--- +title: "Query User Negative Balance Auto Exchange Record | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-User-Negative-Balance-Auto-Exchange-Record" +fetched_at: "2026-01-27T05:28:18.683Z" +--- +# Query User Negative Balance Auto Exchange Record (USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-User-Negative-Balance-Auto-Exchange-Record) + +Query user negative balance auto exchange record + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-User-Negative-Balance-Auto-Exchange-Record) + +GET `/papi/v1/portfolio/negative-balance-exchange-record` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-User-Negative-Balance-Auto-Exchange-Record) + +**100** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-User-Negative-Balance-Auto-Exchange-Record) + +Name + +Type + +Mandatory + +Description + +startTime + +LONG + +YES + +endTime + +LONG + +YES + +recvWindow + +LONG + +NO + +The value cannot be greater than 60000 + +timestamp + +LONG + +YES + +**Note** + +> - Response in descending order +> - The max interval between `startTime` and `endTime` is 3 months. + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-User-Negative-Balance-Auto-Exchange-Record) + +``` +{ "total": 2, "rows": [ { "startTime": 1736263046841, "endTime": 1736263248179, "details": [ { "asset": "ETH", "negativeBalance": 18, //negative balance amount "negativeMaxThreshold": 5 //the max negative balance threshold } ] }, { "startTime": 1736184913252, "endTime": 1736184965474, "details": [ { "asset": "BNB", "negativeBalance": 1.10264488, "negativeMaxThreshold": 0 } ] } ]} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-User-Negative-Balance-Auto-Exchange-Record) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-User-Negative-Balance-Auto-Exchange-Record) +- [Request Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-User-Negative-Balance-Auto-Exchange-Record) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-User-Negative-Balance-Auto-Exchange-Record) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-User-Negative-Balance-Auto-Exchange-Record) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Query-User-Rate-Limit.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Query-User-Rate-Limit.md new file mode 100644 index 0000000..692f4fa --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Query-User-Rate-Limit.md @@ -0,0 +1,52 @@ +--- +title: "Query User Rate Limit | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-User-Rate-Limit" +fetched_at: "2026-01-27T05:28:18.901Z" +--- +# Query User Rate Limit (USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-User-Rate-Limit) + +Query User Rate Limit + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-User-Rate-Limit) + +GET `/papi/v1/rateLimit/order` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-User-Rate-Limit) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-User-Rate-Limit) + +Name + +Type + +Mandatory + +Description + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-User-Rate-Limit) + +``` +[ { "rateLimitType": "ORDERS", "interval": "MINUTE", "intervalNum": 1, "limit": 1200 }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-User-Rate-Limit) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-User-Rate-Limit) +- [Request Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-User-Rate-Limit) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-User-Rate-Limit) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-User-Rate-Limit) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Repay-futures-Negative-Balance.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Repay-futures-Negative-Balance.md new file mode 100644 index 0000000..647b83a --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_Repay-futures-Negative-Balance.md @@ -0,0 +1,52 @@ +--- +title: "Repay Futures Negative Balance | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/account/Repay-futures-Negative-Balance" +fetched_at: "2026-01-27T05:28:18.992Z" +--- +# Repay futures Negative Balance(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Repay-futures-Negative-Balance) + +Repay futures Negative Balance + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Repay-futures-Negative-Balance) + +POST `/papi/v1/repay-futures-negative-balance` + +## Request Weight(IP)[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Repay-futures-Negative-Balance) + +**750** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Repay-futures-Negative-Balance) + +Name + +Type + +Mandatory + +Description + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Repay-futures-Negative-Balance) + +``` +{ "msg": "success"} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Repay-futures-Negative-Balance) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Repay-futures-Negative-Balance) +- [Request Weight(IP)](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Repay-futures-Negative-Balance) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Repay-futures-Negative-Balance) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/account/Repay-futures-Negative-Balance) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_UM-Notional-and-Leverage-Brackets.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_UM-Notional-and-Leverage-Brackets.md new file mode 100644 index 0000000..5f23021 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_account_UM-Notional-and-Leverage-Brackets.md @@ -0,0 +1,58 @@ +--- +title: "Um Notional And Leverage Brackets | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/account/UM-Notional-and-Leverage-Brackets" +fetched_at: "2026-01-27T05:28:18.978Z" +--- +# UM Notional and Leverage Brackets (USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/UM-Notional-and-Leverage-Brackets) + +Query UM notional and leverage brackets + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/UM-Notional-and-Leverage-Brackets) + +`GET /papi/v1/um/leverageBracket` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/UM-Notional-and-Leverage-Brackets) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/UM-Notional-and-Leverage-Brackets) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +NO + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/account/UM-Notional-and-Leverage-Brackets) + +``` +[ { "symbol": "ETHUSDT", "notionalCoef": "4.0", "brackets": [ { "bracket": 1, // Notional bracket "initialLeverage": 75, // Max initial leverage for this bracket "notionalCap": 10000, // Cap notional of this bracket "notionalFloor": 0, // Notional threshold of this bracket "maintMarginRatio": 0.0065, // Maintenance ratio for this bracket "cum":0 // Auxiliary number for quick calculation }, ] }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/account/UM-Notional-and-Leverage-Brackets) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/account/UM-Notional-and-Leverage-Brackets) +- [Request Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/account/UM-Notional-and-Leverage-Brackets) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/account/UM-Notional-and-Leverage-Brackets) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/account/UM-Notional-and-Leverage-Brackets) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_common-definition.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_common-definition.md new file mode 100644 index 0000000..7c82fad --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_common-definition.md @@ -0,0 +1,255 @@ +--- +title: "Common Definition | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/common-definition" +fetched_at: "2026-01-27T05:28:19.052Z" +--- +# Public API Definitions + +## Terminology[​](https://developers.binance.com/docs/derivatives/portfolio-margin/common-definition) + +- `baseasseet` refers to the asset that is the `quantity` of a symbol. +- `quoteAsset` refers to the asset that is the `price` of a symbol. +- `Margin` refers to `Cross Margin` +- `UM` refers to `USD-M Futures` +- `CM` refers to `Coin-M Futures` + +## ENUM definitions[​](https://developers.binance.com/docs/derivatives/portfolio-margin/common-definition) + +**Order side (side)** + +- BUY +- SELL + +**Position side for Futures (positionSide)** + +- BOTH +- LONG +- SHORT + +**Time in force (timeInForce)** + +- GTC - Good Till Cancel +- IOC - Immediate or Cancel +- FOK - Fill or Kill +- GTX - Good Till Crossing (Post Only) + +**Stop-Limit Time in force (stopLimitTimeInForce)** + +- GTC - Good Till Cancel +- IOC - Immediate or Cancel +- FOK - Fill or Kill + +**Side Effect Type (sideEffectType)** + +- NO\_SIDE\_EFFECT +- MARGIN\_BUY +- AUTO\_REPAY + +**Price Match (priceMatch)** + +- NONE: no price match +- OPPONENT: counterparty best price +- OPPONENT\_5: counterparty 5th best price +- OPPONENT\_10: counterparty 10th best price +- OPPONENT\_20: counterparty 20th best price +- QUEUE: the best price on the same side of the order book +- QUEUE\_5: the 5th best price on the same side of the order book +- QUEUE\_10: the 10th best price on the same side of the order book +- QUEUE\_20: the 20th best price on the same side of the order book + +**Self-Trade Prevention mode (selfTradePreventionMode)** + +- NONE: No Self-Trade Prevention +- EXPIRE\_TAKER: expire taker order when STP trigger +- EXPIRE\_BOTH: expire taker and maker order when STP trigger +- EXPIRE\_MAKER: expire maker order when STP trigger + +**Response Type (newOrderRespType)** + +- ACK +- RESULT + +**Order types (type)** + +- LIMIT +- MARKET + +**Conditional Order types (strategyType)** + +- STOP +- STOP\_MARKET +- TAKE\_PROFIT +- TAKE\_PROFIT\_MARKET +- TRAILING\_STOP\_MARKET + +**Working Type for Futures Conditional Orders (workingType)** + +- MARK\_PRICE + +**Order status (status)** + +- NEW +- CANCELED +- REJECTED +- PARTIALLY\_FILLED +- FILLED +- EXPIRED + +**Conditional Order status (strategyStatus)** + +- NEW +- CANCELED +- TRIGGERED - conditional order is triggered +- FINISHED - triggered order is filled +- EXPIRED + +**Futures Contract type (contractType):** + +- PERPETUAL +- CURRENT\_MONTH +- NEXT\_MONTH +- CURRENT\_QUARTER +- NEXT\_QUARTER +- PERPETUAL\_DELIVERING + +**Contract status (contractStatus, status):** + +- PENDING\_TRADING +- TRADING +- PRE\_DELIVERING +- DELIVERING +- DELIVERED +- PRE\_SETTLE +- SETTLING +- CLOSE + +**Rate limiters (rateLimitType)** + +- REQUEST\_WEIGHT +- ORDERS + +> **REQUEST\_WEIGHT** + +``` + { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 2400 } +``` + +> **ORDERS** + +``` + { "rateLimitType": "ORDERS", "interval": "MINUTE", "intervalNum": 1, "limit": 1200 } +``` + +**Rate limit intervals (interval)** + +- MINUTE + +# Filters + +Filters define trading rules on a symbol or an exchange. + +## Symbol filters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/common-definition) + +### PRICE\_FILTER[​](https://developers.binance.com/docs/derivatives/portfolio-margin/common-definition) + +The `PRICE_FILTER` defines the `price` rules for a symbol. There are 3 parts: + +- `minPrice` defines the minimum `price`/`stopPrice` allowed; disabled on `minPrice` == 0. +- `maxPrice` defines the maximum `price`/`stopPrice` allowed; disabled on `maxPrice` == 0. +- `tickSize` defines the intervals that a `price`/`stopPrice` can be increased/decreased by; disabled on `tickSize` == 0. + +Any of the above variables can be set to 0, which disables that rule in the `price filter`. In order to pass the `price filter`, the following must be true for `price`/`stopPrice` of the enabled rules: + +- sell order `price` >= `minPrice` +- buy order `price` <= `maxPrice` +- (`price`\-`minPrice`) % `tickSize` == 0 + +> **ExchangeInfo format:** + +``` +{ "filterType": "PRICE_FILTER", "minPrice": "0.00000100", "maxPrice": "100000.00000000", "tickSize": "0.00000100"} +``` + +### LOT\_SIZE[​](https://developers.binance.com/docs/derivatives/portfolio-margin/common-definition) + +The `LOT_SIZE` filter defines the `quantity` (aka "lots" in auction terms) rules for a symbol. There are 3 parts: + +- `minQty` defines the minimum `quantity` allowed. +- `maxQty` defines the maximum `quantity` allowed. +- `stepSize` defines the intervals that a `quantity` can be increased/decreased by. + +In order to pass the `lot size`, the following must be true for `quantity`: + +- `quantity` >= `minQty` +- `quantity` <= `maxQty` +- (`quantity`\-`minQty`) % `stepSize` == 0 + +> **/exchangeInfo format:** + +``` +{ "filterType": "LOT_SIZE", "minQty": "0.00100000", "maxQty": "100000.00000000", "stepSize": "0.00100000"} +``` + +### PERCENT\_PRICE[​](https://developers.binance.com/docs/derivatives/portfolio-margin/common-definition) + +The `PERCENT_PRICE` filter defines valid range for a price based on the mark price in Futures and on the average of the previous trades in Cross Margin. For Cross Margin `avgPriceMins` is the number of minutes the average price is calculated over. 0 means the last price is used. + +In order to pass the `percent price`, the following must be true for `price`: + +- Futures BUY: `price` <= `markPrice` \_ `multiplierUp` SELL: `price` >= `markPrice` \_ `multiplierDown` +- Cross Margin BUY: `price` <= `weightedAveragePrice` \_ `multiplierUp` SELL: `price` >= `weightedAveragePrice` \_ `multiplierDown` + +### MIN\_NOTIONAL[​](https://developers.binance.com/docs/derivatives/portfolio-margin/common-definition) + +The `MIN_NOTIONAL` filter defines the minimum notional value allowed for an order on a symbol. An order's notional value is the `price` \* `quantity`. Since `MARKET` orders have no price, the `mark price` is used in Futures and the average price is used over the last `avgPriceMins` for Cross Margin. `avgPriceMins` is the number of minutes the average price is calculated over. 0 means the last price is used. + +### MARKET\_LOT\_SIZE[​](https://developers.binance.com/docs/derivatives/portfolio-margin/common-definition) + +The `MARKET_LOT_SIZE` filter defines the `quantity` (aka "lots" in auction terms) rules for `MARKET` orders on a symbol. There are 3 parts: + +- `minQty` defines the minimum `quantity` allowed. +- `maxQty` defines the maximum `quantity` allowed. +- `stepSize` defines the intervals that a `quantity` can be increased/decreased by. + +In order to pass the `market lot size`, the following must be true for `quantity`: + +- `quantity` >= `minQty` +- `quantity` <= `maxQty` +- (`quantity`\-`minQty`) % `stepSize` == 0 + +> **/exchangeInfo format:** + +``` +{ "filterType": "MARKET_LOT_SIZE", "minQty": "0.00100000", "maxQty": "100000.00000000", "stepSize": "0.00100000"} +``` + +### MAX\_NUM\_ORDERS[​](https://developers.binance.com/docs/derivatives/portfolio-margin/common-definition) + +The `MAX_NUM_ORDERS` filter defines the maximum number of orders an account is allowed to have open on a symbol. Note that both "algo" orders and normal orders are counted for this filter. + +> **/exchangeInfo format:** + +``` +{ "filterType": "MAX_NUM_ORDERS", "limit": 200} +``` + +### MAX\_NUM\_ALGO\_ORDERS[​](https://developers.binance.com/docs/derivatives/portfolio-margin/common-definition) + +The `MAX_NUM_ALGO_ORDERS` filter defines the maximum number of all kinds of algo orders an account is allowed to have open on a symbol. The algo orders include `STOP`, `STOP_MARKET`, `TAKE_PROFIT`, `TAKE_PROFIT_MARKET`, and `TRAILING_STOP_MARKET` orders. + +> **/exchangeInfo format:** + +``` +{ "filterType": "MAX_NUM_ALGO_ORDERS", "limit": 100} +``` + +- [Terminology](https://developers.binance.com/docs/derivatives/portfolio-margin/common-definition) +- [ENUM definitions](https://developers.binance.com/docs/derivatives/portfolio-margin/common-definition) +- [Symbol filters](https://developers.binance.com/docs/derivatives/portfolio-margin/common-definition) + - [PRICE\_FILTER](https://developers.binance.com/docs/derivatives/portfolio-margin/common-definition) + - [LOT\_SIZE](https://developers.binance.com/docs/derivatives/portfolio-margin/common-definition) + - [PERCENT\_PRICE](https://developers.binance.com/docs/derivatives/portfolio-margin/common-definition) + - [MIN\_NOTIONAL](https://developers.binance.com/docs/derivatives/portfolio-margin/common-definition) + - [MARKET\_LOT\_SIZE](https://developers.binance.com/docs/derivatives/portfolio-margin/common-definition) + - [MAX\_NUM\_ORDERS](https://developers.binance.com/docs/derivatives/portfolio-margin/common-definition) + - [MAX\_NUM\_ALGO\_ORDERS](https://developers.binance.com/docs/derivatives/portfolio-margin/common-definition) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_error-code.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_error-code.md new file mode 100644 index 0000000..889bee6 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_error-code.md @@ -0,0 +1,891 @@ +--- +title: "Error Code | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/error-code" +fetched_at: "2026-01-27T05:28:19.180Z" +--- +# Error Codes + +> Here is the error JSON payload: + +``` +{ "code":-1121, "msg":"Invalid symbol."} +``` + +Errors consist of two parts: an error code and a message. +Codes are universal,but messages can vary. + +## 10xx - General Server or Network issues[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +### \-1000 UNKNOWN[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- An unknown error occured while processing the request. + +### \-1001 DISCONNECTED[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Internal error; unable to process your request. Please try again. + +### \-1002 UNAUTHORIZED[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- You are not authorized to execute this request. + +### \-1003 TOO\_MANY\_REQUESTS[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Too many requests; current limit is %s requests per minute. Please use the websocket for live updates to avoid polling the API. +- Way too many requests; IP banned until %s. Please use the websocket for live updates to avoid bans. + +### \-1004 DUPLICATE\_IP[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- This IP is already on the white list + +### \-1005 NO\_SUCH\_IP[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- No such IP has been white listed + +### \-1006 UNEXPECTED\_RESP[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- An unexpected response was received from the message bus. Execution status unknown. + +### \-1007 TIMEOUT[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Timeout waiting for response from backend server. Send status unknown; execution status unknown. + +### \-1008 Request Throttled[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Request throttled by system-level protection. Reduce-only/close-position orders are exempt. Please try again. + +### \-1010 ERROR\_MSG\_RECEIVED[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- ERROR\_MSG\_RECEIVED. + +### \-1011 NON\_WHITE\_LIST[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- This IP cannot access this route. + +### \-1013 INVALID\_MESSAGE[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- INVALID\_MESSAGE. + +### \-1014 UNKNOWN\_ORDER\_COMPOSITION[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Unsupported order combination. + +### \-1015 TOO\_MANY\_ORDERS[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Too many new orders. +- Too many new orders; current limit is %s orders per %s. + +### \-1016 SERVICE\_SHUTTING\_DOWN[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- This service is no longer available. + +### \-1020 UNSUPPORTED\_OPERATION[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- This operation is not supported. + +### \-1021 INVALID\_TIMESTAMP[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Timestamp for this request is outside of the recvWindow. +- Timestamp for this request was 1000ms ahead of the server's time. + +### \-1022 INVALID\_SIGNATURE[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Signature for this request is not valid. + +### \-1023 START\_TIME\_GREATER\_THAN\_END\_TIME[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Start time is greater than end time. + +## 11xx - Request issues[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +### \-1100 ILLEGAL\_CHARS[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Illegal characters found in a parameter. +- Illegal characters found in parameter '%s'; legal range is '%s'. + +### \-1101 TOO\_MANY\_PARAMETERS[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Too many parameters sent for this endpoint. +- Too many parameters; expected '%s' and received '%s'. +- Duplicate values for a parameter detected. + +### \-1102 MANDATORY\_PARAM\_EMPTY\_OR\_MALFORMED[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- A mandatory parameter was not sent, was empty/null, or malformed. +- Mandatory parameter '%s' was not sent, was empty/null, or malformed. +- Param '%s' or '%s' must be sent, but both were empty/null! + +### \-1103 UNKNOWN\_PARAM[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- An unknown parameter was sent. + +### \-1104 UNREAD\_PARAMETERS[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Not all sent parameters were read. +- Not all sent parameters were read; read '%s' parameter(s) but was sent '%s'. + +### \-1105 PARAM\_EMPTY[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- A parameter was empty. +- Parameter '%s' was empty. + +### \-1106 PARAM\_NOT\_REQUIRED[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- A parameter was sent when not required. +- Parameter '%s' sent when not required. + +### \-1108 BAD\_ASSET[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Invalid asset. + +### \-1109 BAD\_ACCOUNT[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Invalid account. + +### \-1110 BAD\_INSTRUMENT\_TYPE[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Invalid symbolType. + +### \-1111 BAD\_PRECISION[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Precision is over the maximum defined for this asset. + +### \-1112 NO\_DEPTH[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- No orders on book for symbol. + +### \-1113 WITHDRAW\_NOT\_NEGATIVE[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Withdrawal amount must be negative. + +### \-1114 TIF\_NOT\_REQUIRED[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- TimeInForce parameter sent when not required. + +### \-1115 INVALID\_TIF[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Invalid timeInForce. + +### \-1116 INVALID\_ORDER\_TYPE[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Invalid orderType. + +### \-1117 INVALID\_SIDE[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Invalid side. + +### \-1118 EMPTY\_NEW\_CL\_ORD\_ID[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- New client order ID was empty. + +### \-1119 EMPTY\_ORG\_CL\_ORD\_ID[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Original client order ID was empty. + +### \-1120 BAD\_INTERVAL[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Invalid interval. + +### \-1121 BAD\_SYMBOL[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Invalid symbol. + +### \-1125 INVALID\_LISTEN\_KEY[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- This listenKey does not exist. Please use `POST /papi/v1/listenKey` to recreate `listenKey` + +### \-1127 MORE\_THAN\_XX\_HOURS[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Lookup interval is too big. +- More than %s hours between startTime and endTime. + +### \-1128 OPTIONAL\_PARAMS\_BAD\_COMBO[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Combination of optional parameters invalid. + +### \-1130 INVALID\_PARAMETER[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Invalid data sent for a parameter. +- Data sent for parameter '%s' is not valid. + +### \-1136 INVALID\_NEW\_ORDER\_RESP\_TYPE[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Invalid newOrderRespType. + +## 20xx - Processing Issues[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +### \-2010 NEW\_ORDER\_REJECTED[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- NEW\_ORDER\_REJECTED + +### \-2011 CANCEL\_REJECTED[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- CANCEL\_REJECTED + +### \-2013 NO\_SUCH\_ORDER[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Order does not exist. + +### \-2014 BAD\_API\_KEY\_FMT[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- API-key format invalid. + +### \-2015 REJECTED\_MBX\_KEY[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Invalid API-key, IP, or permissions for action. + +### \-2016 NO\_TRADING\_WINDOW[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- No trading window could be found for the symbol. Try ticker/24hrs instead. + +### \-2018 BALANCE\_NOT\_SUFFICIENT[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Balance is insufficient. + +### \-2019 MARGIN\_NOT\_SUFFICIEN[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Margin is insufficient. + +### \-2020 UNABLE\_TO\_FILL[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Unable to fill. + +### \-2021 ORDER\_WOULD\_IMMEDIATELY\_TRIGGER[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Order would immediately trigger. + +### \-2022 REDUCE\_ONLY\_REJECT[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- ReduceOnly Order is rejected. +- This indicates the new reduce-only order conflicts with existing open orders; cancel the existing order and resubmit the reduce-only order. + +### \-2023 USER\_IN\_LIQUIDATION[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- User in liquidation mode now. + +### \-2024 POSITION\_NOT\_SUFFICIENT[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Position is not sufficient. + +### \-2025 MAX\_OPEN\_ORDER\_EXCEEDED[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Reach max open order limit. + +### \-2026 REDUCE\_ONLY\_ORDER\_TYPE\_NOT\_SUPPORTED[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- This OrderType is not supported when reduceOnly. + +### \-2027 MAX\_LEVERAGE\_RATIO[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Exceeded the maximum allowable position at current leverage. + +### \-2028 MIN\_LEVERAGE\_RATIO[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Leverage is smaller than permitted: insufficient margin balance. + +## 40xx - Filters and other Issues[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +### \-4000 INVALID\_ORDER\_STATUS[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Invalid order status. + +### \-4001 PRICE\_LESS\_THAN\_ZERO[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Price less than 0. + +### \-4002 PRICE\_GREATER\_THAN\_MAX\_PRICE[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Price greater than max price. + +### \-4003 QTY\_LESS\_THAN\_ZERO[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Quantity less than zero. + +### \-4004 QTY\_LESS\_THAN\_MIN\_QTY[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Quantity less than min quantity. + +### \-4005 QTY\_GREATER\_THAN\_MAX\_QTY[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Quantity greater than max quantity. + +### \-4006 STOP\_PRICE\_LESS\_THAN\_ZERO[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Stop price less than zero. + +### \-4007 STOP\_PRICE\_GREATER\_THAN\_MAX\_PRICE[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Stop price greater than max price. + +### \-4008 TICK\_SIZE\_LESS\_THAN\_ZERO[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Tick size less than zero. + +### \-4009 MAX\_PRICE\_LESS\_THAN\_MIN\_PRICE[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Max price less than min price. + +### \-4010 MAX\_QTY\_LESS\_THAN\_MIN\_QTY[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Max qty less than min qty. + +### \-4011 STEP\_SIZE\_LESS\_THAN\_ZERO[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Step size less than zero. + +### \-4012 MAX\_NUM\_ORDERS\_LESS\_THAN\_ZERO[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Max mum orders less than zero. + +### \-4013 PRICE\_LESS\_THAN\_MIN\_PRICE[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Price less than min price. + +### \-4014 PRICE\_NOT\_INCREASED\_BY\_TICK\_SIZE[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Price not increased by tick size. + +### \-4015 INVALID\_CL\_ORD\_ID\_LEN[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Client order id is not valid. +- Client order id length should not be more than 36 chars + +### \-4016 PRICE\_HIGHTER\_THAN\_MULTIPLIER\_UP[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Price is higher than mark price multiplier cap. + +### \-4017 MULTIPLIER\_UP\_LESS\_THAN\_ZERO[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Multiplier up less than zero. + +### \-4018 MULTIPLIER\_DOWN\_LESS\_THAN\_ZERO[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Multiplier down less than zero. + +### \-4019 COMPOSITE\_SCALE\_OVERFLOW[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Composite scale too large. + +### \-4020 TARGET\_STRATEGY\_INVALID[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Target strategy invalid for orderType '%s',reduceOnly '%b'. + +### \-4021 INVALID\_DEPTH\_LIMIT[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Invalid depth limit. +- '%s' is not valid depth limit. + +### \-4022 WRONG\_MARKET\_STATUS[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- market status sent is not valid. + +### \-4023 QTY\_NOT\_INCREASED\_BY\_STEP\_SIZE[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Qty not increased by step size. + +### \-4024 PRICE\_LOWER\_THAN\_MULTIPLIER\_DOWN[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Price is lower than mark price multiplier floor. + +### \-4025 MULTIPLIER\_DECIMAL\_LESS\_THAN\_ZERO[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Multiplier decimal less than zero. + +### \-4026 COMMISSION\_INVALID[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Commission invalid. +- `%s` less than zero. +- `%s` absolute value greater than `%s` + +### \-4027 INVALID\_ACCOUNT\_TYPE[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Invalid account type. + +### \-4028 INVALID\_LEVERAGE[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Invalid leverage +- Leverage `%s` is not valid +- Leverage `%s` already exist with `%s` + +### \-4029 INVALID\_TICK\_SIZE\_PRECISION[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Tick size precision is invalid. + +### \-4030 INVALID\_STEP\_SIZE\_PRECISION[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Step size precision is invalid. + +### \-4031 INVALID\_WORKING\_TYPE[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Invalid parameter working type +- Invalid parameter working type: `%s` + +### \-4032 EXCEED\_MAX\_CANCEL\_ORDER\_SIZE[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Exceed maximum cancel order size. +- Invalid parameter working type: `%s` + +### \-4033 INSURANCE\_ACCOUNT\_NOT\_FOUND[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Insurance account not found. + +### \-4044 INVALID\_BALANCE\_TYPE[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Balance Type is invalid. + +### \-4045 MAX\_STOP\_ORDER\_EXCEEDED[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Reach max stop order limit. + +### \-4046 NO\_NEED\_TO\_CHANGE\_MARGIN\_TYPE[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- No need to change margin type. + +### \-4047 THERE\_EXISTS\_OPEN\_ORDERS[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Margin type cannot be changed if there exists open orders. + +### \-4048 THERE\_EXISTS\_QUANTITY[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Margin type cannot be changed if there exists position. + +### \-4049 ADD\_ISOLATED\_MARGIN\_REJECT[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Add margin only support for isolated position. + +### \-4050 CROSS\_BALANCE\_INSUFFICIENT[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Cross balance insufficient. + +### \-4051 ISOLATED\_BALANCE\_INSUFFICIENT[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Isolated balance insufficient. + +### \-4052 NO\_NEED\_TO\_CHANGE\_AUTO\_ADD\_MARGIN[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- No need to change auto add margin. + +### \-4053 AUTO\_ADD\_CROSSED\_MARGIN\_REJECT[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Auto add margin only support for isolated position. + +### \-4054 ADD\_ISOLATED\_MARGIN\_NO\_POSITION\_REJECT[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Cannot add position margin: position is 0. + +### \-4055 AMOUNT\_MUST\_BE\_POSITIVE[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Amount must be positive. + +### \-4056 INVALID\_API\_KEY\_TYPE[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Invalid api key type. + +### \-4057 INVALID\_RSA\_PUBLIC\_KEY[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Invalid api public key + +### \-4058 MAX\_PRICE\_TOO\_LARGE[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- maxPrice and priceDecimal too large,please check. + +### \-4059 NO\_NEED\_TO\_CHANGE\_POSITION\_SIDE[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- No need to change position side. + +### \-4060 INVALID\_POSITION\_SIDE[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Invalid position side. + +### \-4061 POSITION\_SIDE\_NOT\_MATCH[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Order's position side does not match user's setting. + +### \-4062 REDUCE\_ONLY\_CONFLICT[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Invalid or improper reduceOnly value. + +### \-4063 INVALID\_OPTIONS\_REQUEST\_TYPE[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Invalid options request type + +### \-4064 INVALID\_OPTIONS\_TIME\_FRAME[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Invalid options time frame + +### \-4065 INVALID\_OPTIONS\_AMOUNT[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Invalid options amount + +### \-4066 INVALID\_OPTIONS\_EVENT\_TYPE[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Invalid options event type + +### \-4067 POSITION\_SIDE\_CHANGE\_EXISTS\_OPEN\_ORDERS[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Position side cannot be changed if there exists open orders. + +### \-4068 POSITION\_SIDE\_CHANGE\_EXISTS\_QUANTITY[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Position side cannot be changed if there exists position. + +### \-4069 INVALID\_OPTIONS\_PREMIUM\_FEE[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Invalid options premium fee + +### \-4070 INVALID\_CL\_OPTIONS\_ID\_LEN[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Client options id is not valid. +- Client options id length should be less than 32 chars + +### \-4071 INVALID\_OPTIONS\_DIRECTION[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Invalid options direction + +### \-4072 OPTIONS\_PREMIUM\_NOT\_UPDATE[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- premium fee is not updated, reject order + +### \-4073 OPTIONS\_PREMIUM\_INPUT\_LESS\_THAN\_ZERO[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- input premium fee is less than 0, reject order + +### \-4074 OPTIONS\_AMOUNT\_BIGGER\_THAN\_UPPER[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Order amount is bigger than upper boundary or less than 0, reject order + +### \-4075 OPTIONS\_PREMIUM\_OUTPUT\_ZERO[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- output premium fee is less than 0, reject order + +### \-4076 OPTIONS\_PREMIUM\_TOO\_DIFF[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- original fee is too much higher than last fee + +### \-4077 OPTIONS\_PREMIUM\_REACH\_LIMIT[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- place order amount has reached to limit, reject order + +### \-4078 OPTIONS\_COMMON\_ERROR[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- options internal error + +### \-4079 INVALID\_OPTIONS\_ID[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- invalid options id +- invalid options id: %s +- duplicate options id %d for user %d + +### \-4080 OPTIONS\_USER\_NOT\_FOUND[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- user not found +- user not found with id: %s + +### \-4081 OPTIONS\_NOT\_FOUND[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- options not found +- options not found with id: %s + +### \-4082 INVALID\_BATCH\_PLACE\_ORDER\_SIZE[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Invalid number of batch place orders. +- Invalid number of batch place orders: %s + +### \-4083 PLACE\_BATCH\_ORDERS\_FAIL[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Fail to place batch orders. + +### \-4084 UPCOMING\_METHOD[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Method is not allowed currently. Upcoming soon. + +### \-4085 INVALID\_NOTIONAL\_LIMIT\_COEF[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Invalid notional limit coefficient + +### \-4086 INVALID\_PRICE\_SPREAD\_THRESHOLD[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Invalid price spread threshold + +### \-4087 REDUCE\_ONLY\_ORDER\_PERMISSION[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- User can only place reduce only order + +### \-4088 NO\_PLACE\_ORDER\_PERMISSION[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- User can not place order currently + +### \-4104 INVALID\_CONTRACT\_TYPE[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Invalid contract type + +### \-4114 INVALID\_CLIENT\_TRAN\_ID\_LEN[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- clientTranId is not valid +- Client tran id length should be less than 64 chars + +### \-4115 DUPLICATED\_CLIENT\_TRAN\_ID[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- clientTranId is duplicated +- Client tran id should be unique within 7 days + +### \-4118 REDUCE\_ONLY\_MARGIN\_CHECK\_FAILED[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- ReduceOnly Order Failed. Please check your existing position and open orders +- This indicates the new reduce-only order conflicts with existing open orders; cancel the existing order and resubmit the reduce-only order. + +### \-4131 MARKET\_ORDER\_REJECT[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- The counterparty's best price does not meet the PERCENT\_PRICE filter limit + +### \-4135 INVALID\_ACTIVATION\_PRICE[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Invalid activation price + +### \-4137 QUANTITY\_EXISTS\_WITH\_CLOSE\_POSITION[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Quantity must be zero with closePosition equals true + +### \-4138 REDUCE\_ONLY\_MUST\_BE\_TRUE[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Reduce only must be true with closePosition equals true + +### \-4139 ORDER\_TYPE\_CANNOT\_BE\_MKT[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Order type can not be market if it's unable to cancel + +### \-4140 INVALID\_OPENING\_POSITION\_STATUS[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Invalid symbol status for opening position + +### \-4141 SYMBOL\_ALREADY\_CLOSED[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Symbol is closed + +### \-4142 STRATEGY\_INVALID\_TRIGGER\_PRICE[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- REJECT: take profit or stop order will be triggered immediately + +### \-4144 INVALID\_PAIR[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Invalid pair + +### \-4161 ISOLATED\_LEVERAGE\_REJECT\_WITH\_POSITION[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Leverage reduction is not supported in Isolated Margin Mode with open positions + +### \-4164 MIN\_NOTIONAL[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Order's notional must be no smaller than 5.0 (unless you choose reduce only) +- Order's notional must be no smaller than %s (unless you choose reduce only) + +### \-4165 INVALID\_TIME\_INTERVAL[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Invalid time interval +- Maximum time interval is %s days + +### \-4183 PRICE\_HIGHTER\_THAN\_STOP\_MULTIPLIER\_UP[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Price is higher than stop price multiplier cap. +- Limit price can't be higher than %s. + +### \-4184 PRICE\_LOWER\_THAN\_STOP\_MULTIPLIER\_DOWN[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Price is lower than stop price multiplier floor. +- Limit price can't be lower than %s. + +## 50xx/51xxx - Order Execution Issues[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +### \-5021 FOK\_ORDER\_REJECT[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Due to the order could not be filled immediately, the FOK order has been rejected. + +### \-5022 GTX\_ORDER\_REJECT[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Due to the order could not be executed as maker, the Post Only order will be rejected. + +### \-5028 ME\_RECVWINDOW\_REJECT[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- The requested timestamp is outside the recvWindow of the matching engine + +### \-5041 TOO\_MANY\_REQUESTS\_IN\_QUEUE[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Time out for too many requests from this account queueing at the same time. + +### \-51078 NET\_ASSET\_MUST\_LTE\_RATIO[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- Fail to retrieve margin assets. + +### \-51007 HAS\_PENDING\_TRANSACTION[​](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + +- You have pending borrow or repayment, please try again later + +- [10xx - General Server or Network issues](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-1000 UNKNOWN](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-1001 DISCONNECTED](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-1002 UNAUTHORIZED](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-1003 TOO\_MANY\_REQUESTS](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-1004 DUPLICATE\_IP](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-1005 NO\_SUCH\_IP](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-1006 UNEXPECTED\_RESP](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-1007 TIMEOUT](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-1008 Request Throttled](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-1010 ERROR\_MSG\_RECEIVED](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-1011 NON\_WHITE\_LIST](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-1013 INVALID\_MESSAGE](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-1014 UNKNOWN\_ORDER\_COMPOSITION](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-1015 TOO\_MANY\_ORDERS](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-1016 SERVICE\_SHUTTING\_DOWN](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-1020 UNSUPPORTED\_OPERATION](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-1021 INVALID\_TIMESTAMP](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-1022 INVALID\_SIGNATURE](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-1023 START\_TIME\_GREATER\_THAN\_END\_TIME](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) +- [11xx - Request issues](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-1100 ILLEGAL\_CHARS](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-1101 TOO\_MANY\_PARAMETERS](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-1102 MANDATORY\_PARAM\_EMPTY\_OR\_MALFORMED](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-1103 UNKNOWN\_PARAM](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-1104 UNREAD\_PARAMETERS](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-1105 PARAM\_EMPTY](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-1106 PARAM\_NOT\_REQUIRED](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-1108 BAD\_ASSET](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-1109 BAD\_ACCOUNT](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-1110 BAD\_INSTRUMENT\_TYPE](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-1111 BAD\_PRECISION](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-1112 NO\_DEPTH](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-1113 WITHDRAW\_NOT\_NEGATIVE](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-1114 TIF\_NOT\_REQUIRED](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-1115 INVALID\_TIF](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-1116 INVALID\_ORDER\_TYPE](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-1117 INVALID\_SIDE](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-1118 EMPTY\_NEW\_CL\_ORD\_ID](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-1119 EMPTY\_ORG\_CL\_ORD\_ID](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-1120 BAD\_INTERVAL](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-1121 BAD\_SYMBOL](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-1125 INVALID\_LISTEN\_KEY](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-1127 MORE\_THAN\_XX\_HOURS](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-1128 OPTIONAL\_PARAMS\_BAD\_COMBO](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-1130 INVALID\_PARAMETER](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-1136 INVALID\_NEW\_ORDER\_RESP\_TYPE](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) +- [20xx - Processing Issues](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-2010 NEW\_ORDER\_REJECTED](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-2011 CANCEL\_REJECTED](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-2013 NO\_SUCH\_ORDER](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-2014 BAD\_API\_KEY\_FMT](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-2015 REJECTED\_MBX\_KEY](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-2016 NO\_TRADING\_WINDOW](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-2018 BALANCE\_NOT\_SUFFICIENT](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-2019 MARGIN\_NOT\_SUFFICIEN](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-2020 UNABLE\_TO\_FILL](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-2021 ORDER\_WOULD\_IMMEDIATELY\_TRIGGER](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-2022 REDUCE\_ONLY\_REJECT](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-2023 USER\_IN\_LIQUIDATION](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-2024 POSITION\_NOT\_SUFFICIENT](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-2025 MAX\_OPEN\_ORDER\_EXCEEDED](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-2026 REDUCE\_ONLY\_ORDER\_TYPE\_NOT\_SUPPORTED](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-2027 MAX\_LEVERAGE\_RATIO](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-2028 MIN\_LEVERAGE\_RATIO](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) +- [40xx - Filters and other Issues](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4000 INVALID\_ORDER\_STATUS](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4001 PRICE\_LESS\_THAN\_ZERO](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4002 PRICE\_GREATER\_THAN\_MAX\_PRICE](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4003 QTY\_LESS\_THAN\_ZERO](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4004 QTY\_LESS\_THAN\_MIN\_QTY](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4005 QTY\_GREATER\_THAN\_MAX\_QTY](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4006 STOP\_PRICE\_LESS\_THAN\_ZERO](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4007 STOP\_PRICE\_GREATER\_THAN\_MAX\_PRICE](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4008 TICK\_SIZE\_LESS\_THAN\_ZERO](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4009 MAX\_PRICE\_LESS\_THAN\_MIN\_PRICE](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4010 MAX\_QTY\_LESS\_THAN\_MIN\_QTY](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4011 STEP\_SIZE\_LESS\_THAN\_ZERO](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4012 MAX\_NUM\_ORDERS\_LESS\_THAN\_ZERO](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4013 PRICE\_LESS\_THAN\_MIN\_PRICE](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4014 PRICE\_NOT\_INCREASED\_BY\_TICK\_SIZE](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4015 INVALID\_CL\_ORD\_ID\_LEN](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4016 PRICE\_HIGHTER\_THAN\_MULTIPLIER\_UP](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4017 MULTIPLIER\_UP\_LESS\_THAN\_ZERO](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4018 MULTIPLIER\_DOWN\_LESS\_THAN\_ZERO](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4019 COMPOSITE\_SCALE\_OVERFLOW](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4020 TARGET\_STRATEGY\_INVALID](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4021 INVALID\_DEPTH\_LIMIT](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4022 WRONG\_MARKET\_STATUS](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4023 QTY\_NOT\_INCREASED\_BY\_STEP\_SIZE](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4024 PRICE\_LOWER\_THAN\_MULTIPLIER\_DOWN](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4025 MULTIPLIER\_DECIMAL\_LESS\_THAN\_ZERO](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4026 COMMISSION\_INVALID](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4027 INVALID\_ACCOUNT\_TYPE](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4028 INVALID\_LEVERAGE](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4029 INVALID\_TICK\_SIZE\_PRECISION](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4030 INVALID\_STEP\_SIZE\_PRECISION](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4031 INVALID\_WORKING\_TYPE](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4032 EXCEED\_MAX\_CANCEL\_ORDER\_SIZE](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4033 INSURANCE\_ACCOUNT\_NOT\_FOUND](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4044 INVALID\_BALANCE\_TYPE](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4045 MAX\_STOP\_ORDER\_EXCEEDED](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4046 NO\_NEED\_TO\_CHANGE\_MARGIN\_TYPE](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4047 THERE\_EXISTS\_OPEN\_ORDERS](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4048 THERE\_EXISTS\_QUANTITY](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4049 ADD\_ISOLATED\_MARGIN\_REJECT](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4050 CROSS\_BALANCE\_INSUFFICIENT](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4051 ISOLATED\_BALANCE\_INSUFFICIENT](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4052 NO\_NEED\_TO\_CHANGE\_AUTO\_ADD\_MARGIN](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4053 AUTO\_ADD\_CROSSED\_MARGIN\_REJECT](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4054 ADD\_ISOLATED\_MARGIN\_NO\_POSITION\_REJECT](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4055 AMOUNT\_MUST\_BE\_POSITIVE](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4056 INVALID\_API\_KEY\_TYPE](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4057 INVALID\_RSA\_PUBLIC\_KEY](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4058 MAX\_PRICE\_TOO\_LARGE](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4059 NO\_NEED\_TO\_CHANGE\_POSITION\_SIDE](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4060 INVALID\_POSITION\_SIDE](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4061 POSITION\_SIDE\_NOT\_MATCH](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4062 REDUCE\_ONLY\_CONFLICT](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4063 INVALID\_OPTIONS\_REQUEST\_TYPE](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4064 INVALID\_OPTIONS\_TIME\_FRAME](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4065 INVALID\_OPTIONS\_AMOUNT](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4066 INVALID\_OPTIONS\_EVENT\_TYPE](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4067 POSITION\_SIDE\_CHANGE\_EXISTS\_OPEN\_ORDERS](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4068 POSITION\_SIDE\_CHANGE\_EXISTS\_QUANTITY](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4069 INVALID\_OPTIONS\_PREMIUM\_FEE](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4070 INVALID\_CL\_OPTIONS\_ID\_LEN](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4071 INVALID\_OPTIONS\_DIRECTION](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4072 OPTIONS\_PREMIUM\_NOT\_UPDATE](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4073 OPTIONS\_PREMIUM\_INPUT\_LESS\_THAN\_ZERO](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4074 OPTIONS\_AMOUNT\_BIGGER\_THAN\_UPPER](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4075 OPTIONS\_PREMIUM\_OUTPUT\_ZERO](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4076 OPTIONS\_PREMIUM\_TOO\_DIFF](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4077 OPTIONS\_PREMIUM\_REACH\_LIMIT](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4078 OPTIONS\_COMMON\_ERROR](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4079 INVALID\_OPTIONS\_ID](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4080 OPTIONS\_USER\_NOT\_FOUND](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4081 OPTIONS\_NOT\_FOUND](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4082 INVALID\_BATCH\_PLACE\_ORDER\_SIZE](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4083 PLACE\_BATCH\_ORDERS\_FAIL](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4084 UPCOMING\_METHOD](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4085 INVALID\_NOTIONAL\_LIMIT\_COEF](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4086 INVALID\_PRICE\_SPREAD\_THRESHOLD](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4087 REDUCE\_ONLY\_ORDER\_PERMISSION](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4088 NO\_PLACE\_ORDER\_PERMISSION](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4104 INVALID\_CONTRACT\_TYPE](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4114 INVALID\_CLIENT\_TRAN\_ID\_LEN](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4115 DUPLICATED\_CLIENT\_TRAN\_ID](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4118 REDUCE\_ONLY\_MARGIN\_CHECK\_FAILED](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4131 MARKET\_ORDER\_REJECT](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4135 INVALID\_ACTIVATION\_PRICE](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4137 QUANTITY\_EXISTS\_WITH\_CLOSE\_POSITION](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4138 REDUCE\_ONLY\_MUST\_BE\_TRUE](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4139 ORDER\_TYPE\_CANNOT\_BE\_MKT](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4140 INVALID\_OPENING\_POSITION\_STATUS](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4141 SYMBOL\_ALREADY\_CLOSED](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4142 STRATEGY\_INVALID\_TRIGGER\_PRICE](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4144 INVALID\_PAIR](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4161 ISOLATED\_LEVERAGE\_REJECT\_WITH\_POSITION](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4164 MIN\_NOTIONAL](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4165 INVALID\_TIME\_INTERVAL](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4183 PRICE\_HIGHTER\_THAN\_STOP\_MULTIPLIER\_UP](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-4184 PRICE\_LOWER\_THAN\_STOP\_MULTIPLIER\_DOWN](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) +- [50xx/51xxx - Order Execution Issues](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-5021 FOK\_ORDER\_REJECT](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-5022 GTX\_ORDER\_REJECT](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-5028 ME\_RECVWINDOW\_REJECT](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-5041 TOO\_MANY\_REQUESTS\_IN\_QUEUE](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-51078 NET\_ASSET\_MUST\_LTE\_RATIO](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) + - [\-51007 HAS\_PENDING\_TRANSACTION](https://developers.binance.com/docs/derivatives/portfolio-margin/error-code) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_general-info.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_general-info.md new file mode 100644 index 0000000..5577c87 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_general-info.md @@ -0,0 +1,392 @@ +--- +title: "General Info | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/general-info" +fetched_at: "2026-01-27T05:28:19.234Z" +--- +# General Info + +## General API Information[​](https://developers.binance.com/docs/derivatives/portfolio-margin/general-info) + +- The base endpoint is: **[https://papi.binance.com](https://papi.binance.com/)** +- All endpoints return either a JSON object or raw primitive. +- Data is returned in ascending order. Oldest first, newest last. +- All time and timestamp related fields are in UTC milliseconds. +- All data types adopt definition in JAVA. + +### HTTP Return Codes[​](https://developers.binance.com/docs/derivatives/portfolio-margin/general-info) + +- HTTP `4XX` return codes are used for for malformed requests; the issue is on the sender's side. +- HTTP `403` return code is used when the WAF Limit (Web Application Firewall) has been violated. +- HTTP `429` return code is used when breaking a request rate limit. +- HTTP `418` return code is used when an IP has been auto-banned for continuing to send requests after receiving `429` codes. +- HTTP `5XX` return codes are used for internal errors; the issue is on Binance's side. + 1. If there is an error message "Request occur unknown error.", please retry later. +- HTTP `503` return code is used when: + 1. If there is an error message "Unknown error, please check your request or try again later." returned in the response, the API successfully sent the request but not get a response within the timeout period.It is important to NOT treat this as a failure operation; the execution status is UNKNOWN and could have been a success; + 2. If there is an error message "Service Unavailable." returned in the response, it means this is a failure API operation and the service might be unavailable at the moment, you need to retry later. + 3. If there is an error message "Internal error; unable to process your request. Please try again." returned in the response, it means this is a failure API operation and you can resend your request if you need. + 4. If the response contains the error message **"Request throttled by system-level protection. Reduce-only/close-position orders are exempt. Please try again." (-1008)**, This indicates the node has exceeded its maximum concurrency and is temporarily throttled. Close-position, reduce-only, and cancel orders are exempt and will not receive this error. + +### HTTP 503 Status: Message Variants & Handling[​](https://developers.binance.com/docs/derivatives/portfolio-margin/general-info) + +--- + +#### A. “Unknown error, please check your request or try again later.” (Execution status **unknown**)[​](https://developers.binance.com/docs/derivatives/portfolio-margin/general-info) + +- **Meaning**: Request accepted but no response before timeout; **execution may have succeeded**. +- **Handling**: + - **Do not treat as immediate failure**; first verify via **WebSocket updates** or **orderId queries** to avoid duplicates. + - During peaks, prefer **single orders** over batch to reduce uncertainty. +- **Rate-limit counting**: **May or may not** count, check header to verify rate limit info + +--- + +#### B. “Service Unavailable.” (Failure)[​](https://developers.binance.com/docs/derivatives/portfolio-margin/general-info) + +- **Meaning**: Service temporarily unavailable; **100% failure**. +- **Handling**: **Retry with exponential backoff** (e.g., 200ms → 400ms → 800ms, max 3–5 attempts). +- **Rate-limit counting**: **not counted** + +--- + +##### C. “Request throttled by system-level protection. Reduce-only/close-position orders are exempt. Please try again.” (**\-1008**, Failure)[​](https://developers.binance.com/docs/derivatives/portfolio-margin/general-info) + +- **Meaning**: System overload; **100% failure**. +- **Handling**: **Retry with backoff** and **reduce concurrency**; +- **Applicable endpoints**: + - `POST /fapi/v1/order` / `POST /dapi/v1/order` / `POST /papi/v1/order` + - `POST /fapi/v1/batchOrders` / `POST /dapi/v1/batchOrders` / `POST papi/v1/batchOrders` +- **Rate-limit counting**: **Not counted** (overload protection). +- **Exception integrated here**: When a request **reduces exposure** (Reduce-only / Close-position: `closePosition = true`, or `positionSide = BOTH` with `reduceOnly = true`, or `LONG+SELL`, or `SHORT+BUY`), it is **not affected or prioritized under -1008** to ensure risk reduction. + - Covered endpoints: `POST /fapi/v1/order`、`POST /dapi/v1/order`、`POST /papi/v1/order`、`POST /fapi/v1/batchOrders`、`POST /dapi/v1/batchOrders`、`POST /papi/v1/batchOrders` (when parameters satisfy the condition) + +### Error Codes and Messages[​](https://developers.binance.com/docs/derivatives/portfolio-margin/general-info) + +- Any endpoint can return an ERROR +- Specific error codes and messages defined in Error Codes. + +### General Information on Endpoints[​](https://developers.binance.com/docs/derivatives/portfolio-margin/general-info) + +- For `GET` endpoints, parameters must be sent as a `query string`. +- For `POST`, `PUT`, and `DELETE` endpoints, the parameters may be sent as a `query string` or in the `request body` with content type `application/x-www-form-urlencoded`. You may mix parameters between both the `query string` and `request body` if you wish to do so. +- Parameters may be sent in any order. +- If a parameter sent in both the `query string` and `request body`, the `query string` parameter will be used. + +## LIMITS[​](https://developers.binance.com/docs/derivatives/portfolio-margin/general-info) + +- A `429` will be returned when either rate limit is violated. + +### IP Limits[​](https://developers.binance.com/docs/derivatives/portfolio-margin/general-info) + +- Every request will contain `X-MBX-USED-WEIGHT-(intervalNum)(intervalLetter)` in the response headers which has the current used weight for the IP for all request rate limiters defined. +- Each route has a `weight` which determines for the number of requests each endpoint counts for. Heavier endpoints and endpoints that do operations on multiple symbols will have a heavier `weight`. +- When a `429` is received, it's your obligation as an API to back off and not spam the API. +- **Repeatedly violating rate limits and/or failing to back off after receiving 429s will result in an automated IP ban (HTTP status 418).** +- IP bans are tracked and **scale in duration** for repeat offenders, **from 2 minutes to 3 days**. +- **The limits on the API are based on the IPs, not the API keys.** +- Portfolio Margin IP Limit is 6000/min. + +### Order Rate Limits[​](https://developers.binance.com/docs/derivatives/portfolio-margin/general-info) + +- Every order response will contain a `X-MBX-ORDER-COUNT-(intervalNum)(intervalLetter)` header which has the current order count for the account for all order rate limiters defined. +- Rejected/unsuccessful orders are not guaranteed to have `X-MBX-ORDER-COUNT-**` headers in the response. +- **The order rate limit is counted against each account**. +- Portfolio Margin Order Limits are 1200/min. + +## Endpoint Security Type[​](https://developers.binance.com/docs/derivatives/portfolio-margin/general-info) + +- Each endpoint has a security type that determines the how you will interact with it. +- API-keys are passed into the Rest API via the `X-MBX-APIKEY` header. +- API-keys and secret-keys are **case sensitive**. +- API-keys can be configured to only access certain types of secure endpoints. For example, one API-key could be used for TRADE only, while another API-key can access everything except for TRADE routes. +- By default, API-keys can access all secure routes. + +Security Type + +Description + +NONE + +Endpoint can be accessed freely. + +TRADE + +Endpoint requires sending a valid API-Key and signature. + +USER\_DATA + +Endpoint requires sending a valid API-Key and signature. + +USER\_STREAM + +Endpoint requires sending a valid API-Key and signature. + +## SIGNED (TRADE and USER\_DATA) Endpoint Security[​](https://developers.binance.com/docs/derivatives/portfolio-margin/general-info) + +- `SIGNED` endpoints require an additional parameter, signature, to be sent in the `query string` or `request body`. +- Endpoints use `HMAC SHA256` signatures. The `HMAC SHA256` signature is a keyed `HMAC SHA256` operation. Use your `secretKey` as the key and `totalParams` as the value for the HMAC operation. +- The `signature` is not case sensitive. +- Please make sure the `signature` is the end part of your `query string` or `request body`. +- `totalParam`s is defined as the `query string` concatenated with the `request body`. + +### Timing security[​](https://developers.binance.com/docs/derivatives/portfolio-margin/general-info) + +- A `SIGNED` endpoint also requires a parameter, `timestamp`, to be sent which should be the millisecond timestamp of when the request was created and sent. +- An additional parameter, `recvWindow`, may be sent to specify the number of milliseconds after `timestamp` the request is valid for. If `recvWindow` is not sent, **it defaults to 5000**. `recvWindow` cannot exceed 60000. +- If the server determines that the timestamp sent by the client is more than one second in the future of the server time, the request will also be rejected. + +**Serious trading is about timing.** Networks can be unstable and unreliable, which can lead to requests taking varying amounts of time to reach the servers. With `recvWindow`, you can specify that the request must be processed within a certain number of milliseconds or be rejected by the server. + +### SIGNED Endpoint Examples for POST /papi/v1/um/order[​](https://developers.binance.com/docs/derivatives/portfolio-margin/general-info) + +Here is a step-by-step example of how to send a valid signed payload from the Linux command line using `echo`, `openssl`, and `curl`. + +Key + +Value + +apiKey + +22BjeOROKiXJ3NxbR3zjh3uoGcaflPu3VMyBXAg8Jj2J1xVSnY0eB4dzacdE9IWn + +secretKey + +YtP1BudNOWZE1ag5uzCkh4hIC7qSmQOu797r5EJBFGhxBYivjj8HIX0iiiPof5yG + +Parameter + +Value + +symbol + +BTCUSDT + +side + +BUY + +type + +LIMIT + +timeInForce + +GTC + +quantity + +1 + +price + +2000 + +recvWindow + +5000 + +timestamp + +1611825601400 + +#### Example 1: As a request body[​](https://developers.binance.com/docs/derivatives/portfolio-margin/general-info) + +> **Example 1** + +> **HMAC SHA256 signature:** + +``` + $ echo -n "symbol=BTCUSDT&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=2000&recvWindow=5000×tamp=1611825601400" | openssl dgst -sha256 -hmac "YtP1BudNOWZE1ag5uzCkh4hIC7qSmQOu797r5EJBFGhxBYivjj8HIX0iiiPof5yG" (stdin)= 7c12045972f6140e765e0f2b67d28099718df805732676494238f50be830a7d7 +``` + +> **curl command:** + +``` + (HMAC SHA256) $ curl -H "X-MBX-APIKEY: 22BjeOROKiXJ3NxbR3zjh3uoGcaflPu3VMyBXAg8Jj2J1xVSnY0eB4dzacdE9IWn" -X POST 'https://papi.binance.com/papi/v1/order' -d 'symbol=BTCUSDT&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=2000&recvWindow=5000×tamp=1611825601400&signature=7c12045972f6140e765e0f2b67d28099718df805732676494238f50be830a7d7' +``` + +- **requestBody:** + +symbol=BTCUSDT &side=BUY +&type=LIMIT +&timeInForce=GTC +&quantity=1 +&price=2000 +&recvWindow=5000 +×tamp=1611825601400 + +#### Example 2: As a query string[​](https://developers.binance.com/docs/derivatives/portfolio-margin/general-info) + +> **Example 2** + +> **HMAC SHA256 signature:** + +``` + $ echo -n "symbol=BTCUSDT&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=2000&recvWindow=5000×tamp=1611825601400" | openssl dgst -sha256 -hmac "YtP1BudNOWZE1ag5uzCkh4hIC7qSmQOu797r5EJBFGhxBYivjj8HIX0iiiPof5yG" (stdin)= 7c12045972f6140e765e0f2b67d28099718df805732676494238f50be830a7d7 +``` + +> **curl command:** + +``` + (HMAC SHA256) $ curl -H "X-MBX-APIKEY: 22BjeOROKiXJ3NxbR3zjh3uoGcaflPu3VMyBXAg8Jj2J1xVSnY0eB4dzacdE9IWn" -X POST 'https://papi.binance.com/papi/v1/order?symbol=BTCUSDT&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=2000&recvWindow=5000×tamp=1611825601400&signature=7c12045972f6140e765e0f2b67d28099718df805732676494238f50be830a7d7' +``` + +- **queryString:** + + symbol=BTCUSDT + &side=BUY + &type=LIMIT + &timeInForce=GTC + &quantity=1 + &price=2000 + &recvWindow=5000 + ×tamp=1611825601400 + + +#### Example 3: Mixed query string and request body[​](https://developers.binance.com/docs/derivatives/portfolio-margin/general-info) + +> **Example 3** + +> **HMAC SHA256 signature:** + +``` + $ echo -n "symbol=BTCUSDT&side=BUY&type=LIMIT&timeInForce=GTCquantity=0.01&price=2000&recvWindow=5000×tamp=1611825601400" | openssl dgst -sha256 -hmac "YtP1BudNOWZE1ag5uzCkh4hIC7qSmQOu797r5EJBFGhxBYivjj8HIX0iiiPof5yG" (stdin)= fa6045c54fb02912b766442be1f66fab619217e551a4fb4f8a1ee000df914d8e +``` + +> **curl command:** + +``` + (HMAC SHA256) $ curl -H "X-MBX-APIKEY: 22BjeOROKiXJ3NxbR3zjh3uoGcaflPu3VMyBXAg8Jj2J1xVSnY0eB4dzacdE9IWn" -X POST 'https://papi.binance.com/papi/v1/order?symbol=BTCUSDT&side=BUY&type=LIMIT&timeInForce=GTC' -d 'quantity=0.01&price=2000&recvWindow=5000×tamp=1611825601400&signature=fa6045c54fb02912b766442be1f66fab619217e551a4fb4f8a1ee000df914d8e' +``` + +- **queryString:** + +symbol=BTCUSDT&side=BUY&type=LIMIT&timeInForce=GTC + +- **requestBody:** + +quantity=1&price=2000&recvWindow=5000×tamp=1611825601400 + +Note that the signature is different in example 3. There is no & between "GTC" and "quantity=1". + +### RSA Keys - SIGNED Endpoint Examples for POST /papi/v1/um/order[​](https://developers.binance.com/docs/derivatives/portfolio-margin/general-info) + +- This will be a step by step process how to create the signature payload to send a valid signed payload. +- We support `PKCS#8` currently. +- To get your API key, you need to upload your RSA Public Key to your account and a corresponding API key will be provided for you. + +For this example, the private key will be referenced as `test-prv-key.pem` + +Key + +Value + +apiKey + +vE3BDAL1gP1UaexugRLtteaAHg3UO8Nza20uexEuW1Kh3tVwQfFHdAiyjjY428o2 + +Parameter + +Value + +symbol + +BTCUSDT + +side + +BUY + +type + +LIMIT + +timeInForce + +GTC + +quantity + +1 + +price + +2000 + +recvWindow + +5000 + +timestamp + +1611825601400 + +**Step 1: Construct the payload** + +Arrange the list of parameters into a string. Separate each parameter with a `&`. + +**Step 2: Compute the signature:** + +2.1 - Encode signature payload as ASCII data. + +> **Step 2.2** + +``` + $ echo -n 'timestamp=1671090801999&recvWindow=9999999&symbol=BTCUSDT&side=SELL&type=MARKET&quantity=1.23' | openssl dgst -keyform PEM -sha256 -sign ./test-prv-key.pem +``` + +2.2 - Sign payload using RSASSA-PKCS1-v1\_5 algorithm with SHA-256 hash function. + +> **Step 2.3** + +``` +$ echo -n 'timestamp=1671090801999&recvWindow=9999999&symbol=BTCUSDT&side=SELL&type=MARKET&quantity=1.23' | openssl dgst -keyform PEM -sha256 -sign ./test-prv-key.pem | openssl enc -base64aap36wD5loVXizxvvPI3wz9Cjqwmb3KVbxoym0XeWG1jZq8umqrnSk8H8dkLQeySjgVY91Ufs%2BBGCW%2B4sZjQEpgAfjM76riNxjlD3coGGEsPsT2lG39R%2F1q72zpDs8pYcQ4A692NgHO1zXcgScTGgdkjp%2Brp2bcddKjyz5XBrBM%3D +``` + +2.3 - Encode output as base64 string. + +> **Step 2.4** + +``` +$ echo -n 'timestamp=1671090801999&recvWindow=9999999&symbol=BTCUSDT&side=SELL&type=MARKET&quantity=1.23' | openssl dgst -keyform PEM -sha256 -sign ./test-prv-key.pem | openssl enc -base64 | tr -d '\n'aap36wD5loVXizxvvPI3wz9Cjqwmb3KVbxoym0XeWG1jZq8umqrnSk8H8dkLQeySjgVY91Ufs%2BBGCW%2B4sZjQEpgAfjM76riNxjlD3coGGEsPsT2lG39R%2F1q72zpDs8pYcQ4A692NgHO1zXcgScTGgdkjp%2Brp2bcddKjyz5XBrBM%3D +``` + +2.4 - Delete any newlines in the signature. + +> **Step 2.5** + +``` +aap36wD5loVXizxvvPI3wz9Cjqwmb3KVbxoym0XeWG1jZq8umqrnSk8H8dkLQeySjgVY91Ufs%2BBGCW%2B4sZjQEpgAfjM76riNxjlD3coGGEsPsT2lG39R%2F1q72zpDs8pYcQ4A692NgHO1zXcgScTGgdkjp%2Brp2bcddKjyz5XBrBM%3D +``` + +2.5 - Since the signature may contain `/` and `=`, this could cause issues with sending the request. So the signature has to be URL encoded. + +> **Step 2.6** + +``` + curl -H "X-MBX-APIKEY: vE3BDAL1gP1UaexugRLtteaAHg3UO8Nza20uexEuW1Kh3tVwQfFHdAiyjjY428o2" -X POST 'https://papi.binance.com/papi/v1/um/order?timestamp=1671090801999&recvWindow=9999999&symbol=BTCUSDT&side=SELL&type=MARKET&quantity=1.23&signature=aap36wD5loVXizxvvPI3wz9Cjqwmb3KVbxoym0XeWG1jZq8umqrnSk8H8dkLQeySjgVY91Ufs%2BBGCW%2B4sZjQEpgAfjM76riNxjlD3coGGEsPsT2lG39R%2F1q72zpDs8pYcQ4A692NgHO1zXcgScTGgdkjp%2Brp2bcddKjyz5XBrBM%3D' +``` + +2.6 - curl command + +> **Bash script** + +``` +#!/usr/bin/env bash# Set up authentication:apiKey="vE3BDAL1gP1UaexugRLtteaAHg3UO8Nza20uexEuW1Kh3tVwQfFHdAiyjjY428o2" ### REPLACE THIS WITH YOUR API KEY# Set up the request:apiMethod="POST"apiCall="v1/order"apiParams="timestamp=1671090801999&recvWindow=9999999&symbol=BTCUSDT&side=SELL&type=MARKET&quantity=1.23"function rawurlencode { local value="$1" local len=${#value} local encoded="" local pos c o for (( pos=0 ; pos - If `newOrderRespType` is sent as `RESULT` : +> - `MARKET` order: the final FILLED result of the order will be return directly. +> - `LIMIT` order with special `timeInForce`: the final status result of the order(FILLED or EXPIRED) will be returned directly. +> - `selfTradePreventionMode` is only effective when `timeInForce` set to `IOC` or `GTC` or `GTD`. +> - In extreme market conditions, timeInForce `GTD` order auto cancel time might be delayed comparing to `goodTillDate` + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade) + +``` +{ "clientOrderId": "testOrder", "cumQty": "0", "cumQuote": "0", "executedQty": "0", "orderId": 22542179, "avgPrice": "0.00000", "origQty": "10", "price": "0", "reduceOnly": false, "side": "BUY", "positionSide": "SHORT", "status": "NEW", "symbol": "BTCUSDT", "timeInForce": "GTD", "type": "MARKET", "selfTradePreventionMode": "NONE", //self trading preventation mode "goodTillDate": 1693207680000, //order pre-set auot cancel time for TIF GTD order "updateTime": 1566818724722, "priceMatch": "NONE"} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/trade) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/trade) +- [Request Weight(Order)](https://developers.binance.com/docs/derivatives/portfolio-margin/trade) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/trade) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/trade) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_CM-Account-Trade-List.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_CM-Account-Trade-List.md new file mode 100644 index 0000000..f5cc501 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_CM-Account-Trade-List.md @@ -0,0 +1,101 @@ +--- +title: "Cm Account Trade List | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/trade/CM-Account-Trade-List" +fetched_at: "2026-01-27T05:28:19.439Z" +--- +# CM Account Trade List(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/CM-Account-Trade-List) + +Get trades for a specific account and CM symbol. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/CM-Account-Trade-List) + +GET `/papi/v1/cm/userTrades` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/CM-Account-Trade-List) + +**20** with symbol, **40** with pair + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/CM-Account-Trade-List) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +NO + +pair + +STRING + +NO + +startTime + +LONG + +NO + +endTime + +LONG + +NO + +fromId + +LONG + +NO + +Trade id to fetch from. Default gets most recent trades. + +limit + +INT + +NO + +Default 50; max 1000. + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +> - Either `symbol` or `pair` must be sent +> - `symbol` and `pair` cannot be sent together +> - `pair` and `fromId` cannot be sent together +> - `OrderId` can only be sent together with symbol +> - If a `pair` is sent, tickers for all symbols of the `pair` will be returned +> - The parameter `fromId` cannot be sent with `startTime` or `endTime` +> - If `startTime` and `endTime` are both not sent, then the last '24 hours' data will be returned. +> - The time between `startTime` and `endTime` cannot be longer than 24 hours. + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/CM-Account-Trade-List) + +``` +[ { 'symbol': 'BTCUSD_200626', 'id': 6, 'orderId': 28, 'pair': 'BTCUSD', 'side': 'SELL', 'price': '8800', 'qty': '1', 'realizedPnl': '0', 'marginAsset': 'BTC', 'baseQty': '0.01136364', 'commission': '0.00000454', 'commissionAsset': 'BTC', 'time': 1590743483586, 'positionSide': 'BOTH', 'buyer': false, 'maker': false }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/CM-Account-Trade-List) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/CM-Account-Trade-List) +- [Request Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/CM-Account-Trade-List) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/CM-Account-Trade-List) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/CM-Account-Trade-List) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_CM-Position-ADL-Quantile-Estimation.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_CM-Position-ADL-Quantile-Estimation.md new file mode 100644 index 0000000..fc400a8 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_CM-Position-ADL-Quantile-Estimation.md @@ -0,0 +1,64 @@ +--- +title: "Cm Position Adl Quantile Estimation | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/trade/CM-Position-ADL-Quantile-Estimation" +fetched_at: "2026-01-27T05:28:19.496Z" +--- +# CM Position ADL Quantile Estimation(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/CM-Position-ADL-Quantile-Estimation) + +Query CM 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. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/CM-Position-ADL-Quantile-Estimation) + +GET `/papi/v1/cm/adlQuantile` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/CM-Position-ADL-Quantile-Estimation) + +**5** + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +NO + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/CM-Position-ADL-Quantile-Estimation) + +``` +[ { "symbol": "BTCUSD_200925", "adlQuantile": { // if the positions of the symbol are crossed margined in Hedge Mode, "LONG" and "SHORT" will be returned a same quantile value, and "HEDGE" will be returned instead of "BOTH". "LONG": 3, "SHORT": 3, "HEDGE": 0 // only a sign, ignore the value } }, { "symbol": "BTCUSD_201225", "adlQuantile": { // for positions of the symbol are in One-way Mode "LONG": 1, // adl quantile for "LONG" position in hedge mode "SHORT": 2, // adl qauntile for "SHORT" position in hedge mode "BOTH": 0 // adl qunatile for position in one-way mode } }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/CM-Position-ADL-Quantile-Estimation) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/CM-Position-ADL-Quantile-Estimation) +- [Request Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/CM-Position-ADL-Quantile-Estimation) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/CM-Position-ADL-Quantile-Estimation) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Cancel-All-CM-Open-Conditional-Orders.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Cancel-All-CM-Open-Conditional-Orders.md new file mode 100644 index 0000000..319d871 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Cancel-All-CM-Open-Conditional-Orders.md @@ -0,0 +1,58 @@ +--- +title: "Cancel All Cm Open Conditional Orders | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-All-CM-Open-Conditional-Orders" +fetched_at: "2026-01-27T05:28:19.504Z" +--- +# Cancel All CM Open Conditional Orders(TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-All-CM-Open-Conditional-Orders) + +Cancel All CM Open Conditional Orders + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-All-CM-Open-Conditional-Orders) + +DELETE `/papi/v1/cm/conditional/allOpenOrders` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-All-CM-Open-Conditional-Orders) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-All-CM-Open-Conditional-Orders) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-All-CM-Open-Conditional-Orders) + +``` +{ "code": "200", "msg": "The operation of cancel all conditional open order is done."} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-All-CM-Open-Conditional-Orders) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-All-CM-Open-Conditional-Orders) +- [Request Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-All-CM-Open-Conditional-Orders) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-All-CM-Open-Conditional-Orders) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-All-CM-Open-Conditional-Orders) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Cancel-All-CM-Open-Orders.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Cancel-All-CM-Open-Orders.md new file mode 100644 index 0000000..0f894b9 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Cancel-All-CM-Open-Orders.md @@ -0,0 +1,58 @@ +--- +title: "Cancel All Cm Open Orders | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-All-CM-Open-Orders" +fetched_at: "2026-01-27T05:28:19.631Z" +--- +# Cancel All CM Open Orders(TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-All-CM-Open-Orders) + +Cancel all active LIMIT orders on specific symbol + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-All-CM-Open-Orders) + +DELETE `/papi/v1/cm/allOpenOrders` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-All-CM-Open-Orders) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-All-CM-Open-Orders) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-All-CM-Open-Orders) + +``` +{ "code": 200, "msg": "The operation of cancel all open order is done."} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-All-CM-Open-Orders) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-All-CM-Open-Orders) +- [Request Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-All-CM-Open-Orders) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-All-CM-Open-Orders) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-All-CM-Open-Orders) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Cancel-All-UM-Open-Conditional-Orders.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Cancel-All-UM-Open-Conditional-Orders.md new file mode 100644 index 0000000..82aa54e --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Cancel-All-UM-Open-Conditional-Orders.md @@ -0,0 +1,58 @@ +--- +title: "Cancel All Um Open Conditional Orders | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-All-UM-Open-Conditional-Orders" +fetched_at: "2026-01-27T05:28:19.740Z" +--- +# Cancel All UM Open Conditional Orders (TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-All-UM-Open-Conditional-Orders) + +Cancel All UM Open Conditional Orders + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-All-UM-Open-Conditional-Orders) + +`DELETE /papi/v1/um/conditional/allOpenOrders` + +## Request Weight(Order)[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-All-UM-Open-Conditional-Orders) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-All-UM-Open-Conditional-Orders) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-All-UM-Open-Conditional-Orders) + +``` +{ "code": "200", "msg": "The operation of cancel all conditional open order is done."} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-All-UM-Open-Conditional-Orders) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-All-UM-Open-Conditional-Orders) +- [Request Weight(Order)](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-All-UM-Open-Conditional-Orders) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-All-UM-Open-Conditional-Orders) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-All-UM-Open-Conditional-Orders) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Cancel-All-UM-Open-Orders.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Cancel-All-UM-Open-Orders.md new file mode 100644 index 0000000..617dcd5 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Cancel-All-UM-Open-Orders.md @@ -0,0 +1,58 @@ +--- +title: "Cancel All Um Open Orders | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-All-UM-Open-Orders" +fetched_at: "2026-01-27T05:28:19.799Z" +--- +# Cancel All UM Open Orders(TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-All-UM-Open-Orders) + +Cancel all active LIMIT orders on specific symbol + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-All-UM-Open-Orders) + +DELETE `/papi/v1/um/allOpenOrders` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-All-UM-Open-Orders) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-All-UM-Open-Orders) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-All-UM-Open-Orders) + +``` +{ "code": 200, "msg": "The operation of cancel all open order is done."} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-All-UM-Open-Orders) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-All-UM-Open-Orders) +- [Request Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-All-UM-Open-Orders) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-All-UM-Open-Orders) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-All-UM-Open-Orders) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Cancel-CM-Conditional-Order.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Cancel-CM-Conditional-Order.md new file mode 100644 index 0000000..93f3d0b --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Cancel-CM-Conditional-Order.md @@ -0,0 +1,72 @@ +--- +title: "Cancel Cm Conditional Order | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-CM-Conditional-Order" +fetched_at: "2026-01-27T05:28:19.884Z" +--- +# Cancel CM Conditional Order(TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-CM-Conditional-Order) + +Cancel CM Conditional Order + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-CM-Conditional-Order) + +DELETE `/papi/v1/cm/conditional/order` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-CM-Conditional-Order) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-CM-Conditional-Order) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +strategyId + +LONG + +NO + +newClientStrategyId + +STRING + +NO + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +> - Either `strategyId` or `newClientStrategyId` must be sent. + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-CM-Conditional-Order) + +``` +{ "newClientStrategyId": "myOrder1", "strategyId":123445, "strategyStatus":"CANCELED", "strategyType": "TRAILING_STOP_MARKET", "origQty": "11", "price": "0", "reduceOnly": false, "side": "BUY", "positionSide": "SHORT", "stopPrice": "9300", // please ignore when order type is TRAILING_STOP_MARKET "symbol": "BTCUSD", "timeInForce": "GTC", "activatePrice": "9020", // activation price, only return with TRAILING_STOP_MARKET order "priceRate": "0.3", // callback rate, only return with TRAILING_STOP_MARKET order "bookTime": 1566818724710, "updateTime": 1566818724722, "workingType":"CONTRACT_PRICE", "priceProtect": false } +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-CM-Conditional-Order) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-CM-Conditional-Order) +- [Request Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-CM-Conditional-Order) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-CM-Conditional-Order) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-CM-Conditional-Order) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Cancel-CM-Order.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Cancel-CM-Order.md new file mode 100644 index 0000000..ad42af5 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Cancel-CM-Order.md @@ -0,0 +1,72 @@ +--- +title: "Cancel Cm Order | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-CM-Order" +fetched_at: "2026-01-27T05:28:20.014Z" +--- +# Cancel CM Order(TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-CM-Order) + +Cancel an active LIMIT order + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-CM-Order) + +DELETE `/papi/v1/cm/order` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-CM-Order) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-CM-Order) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +orderId + +LONG + +NO + +origClientOrderId + +STRING + +NO + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +> - Either `orderId` or `origClientOrderId` must be sent. + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-CM-Order) + +``` +{ "avgPrice": "0.0", "clientOrderId": "myOrder1", "cumQty": "0", "cumBase": "0", "executedQty": "0", "orderId": 283194212, "origQty": "2", "price": "0", "reduceOnly": false, "side": "BUY", "positionSide": "SHORT", "status": "CANCELED", "symbol": "BTCUSD_200925", "pair": "BTCUSD", "timeInForce": "GTC", "type": "LIMIT", "updateTime": 1571110484038,} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-CM-Order) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-CM-Order) +- [Request Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-CM-Order) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-CM-Order) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-CM-Order) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Cancel-Margin-Account-All-Open-Orders-on-a-Symbol.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Cancel-Margin-Account-All-Open-Orders-on-a-Symbol.md new file mode 100644 index 0000000..2ad41f5 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Cancel-Margin-Account-All-Open-Orders-on-a-Symbol.md @@ -0,0 +1,60 @@ +--- +title: "Cancel Margin Account All Open Orders On A Symbol | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-Margin-Account-All-Open-Orders-on-a-Symbol" +fetched_at: "2026-01-27T05:28:20.011Z" +--- +# Cancel Margin Account All Open Orders on a Symbol(TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-Margin-Account-All-Open-Orders-on-a-Symbol) + +Cancel Margin Account All Open Orders on a Symbol + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-Margin-Account-All-Open-Orders-on-a-Symbol) + +DELETE `/papi/v1/margin/allOpenOrders` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-Margin-Account-All-Open-Orders-on-a-Symbol) + +**5** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-Margin-Account-All-Open-Orders-on-a-Symbol) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +recvWindow + +LONG + +NO + +The value cannot be greater than 60000 + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-Margin-Account-All-Open-Orders-on-a-Symbol) + +``` +[ { "symbol": "BTCUSDT", "origClientOrderId": "E6APeyTJvkMvLMYMqu1KQ4", "orderId": 11, "orderListId": -1, "clientOrderId": "pXLV6Hz6mprAcVYpVMTGgx", "price": "0.089853", "origQty": "0.178622", "executedQty": "0.000000", "cummulativeQuoteQty": "0.000000", "status": "CANCELED", "timeInForce": "GTC", "type": "LIMIT", "side": "BUY" }, { "orderListId": 1929, "contingencyType": "OCO", "listStatusType": "ALL_DONE", "listOrderStatus": "ALL_DONE", "listClientOrderId": "2inzWQdDvZLHbbAmAozX2N", "transactionTime": 1585230948299, "symbol": "BTCUSDT", "orders": [ { "symbol": "BTCUSDT", "orderId": 20, "clientOrderId": "CwOOIPHSmYywx6jZX77TdL" }, { "symbol": "BTCUSDT", "orderId": 21, "clientOrderId": "461cPg51vQjV3zIMOXNz39" } ], "orderReports": [ { "symbol": "BTCUSDT", "origClientOrderId": "CwOOIPHSmYywx6jZX77TdL", "orderId": 20, "orderListId": 1929, "clientOrderId": "pXLV6Hz6mprAcVYpVMTGgx", "price": "0.668611", "origQty": "0.690354", "executedQty": "0.000000", "cummulativeQuoteQty": "0.000000", "status": "CANCELED", "timeInForce": "GTC", "type": "STOP_LOSS_LIMIT", "side": "BUY", "stopPrice": "0.378131", "icebergQty": "0.017083" }, { "symbol": "BTCUSDT", "origClientOrderId": "461cPg51vQjV3zIMOXNz39", "orderId": 21, "orderListId": 1929, "clientOrderId": "pXLV6Hz6mprAcVYpVMTGgx", "price": "0.008791", "origQty": "0.690354", "executedQty": "0.000000", "cummulativeQuoteQty": "0.000000", "status": "CANCELED", "timeInForce": "GTC", "type": "LIMIT_MAKER", "side": "BUY", "icebergQty": "0.639962" } ] }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-Margin-Account-All-Open-Orders-on-a-Symbol) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-Margin-Account-All-Open-Orders-on-a-Symbol) +- [Request Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-Margin-Account-All-Open-Orders-on-a-Symbol) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-Margin-Account-All-Open-Orders-on-a-Symbol) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-Margin-Account-All-Open-Orders-on-a-Symbol) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Cancel-Margin-Account-OCO-Orders.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Cancel-Margin-Account-OCO-Orders.md new file mode 100644 index 0000000..19efc64 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Cancel-Margin-Account-OCO-Orders.md @@ -0,0 +1,86 @@ +--- +title: "Cancel Margin Account Oco Orders | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-Margin-Account-OCO-Orders" +fetched_at: "2026-01-27T05:28:20.055Z" +--- +# Cancel Margin Account OCO Orders(TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-Margin-Account-OCO-Orders) + +Cancel Margin Account OCO Orders + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-Margin-Account-OCO-Orders) + +DELETE `/papi/v1/margin/orderList` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-Margin-Account-OCO-Orders) + +**2** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-Margin-Account-OCO-Orders) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +orderListId + +LONG + +NO + +Either `orderListId` or `listClientOrderId` must be provided + +listClientOrderId + +STRING + +NO + +Either `orderListId` or `listClientOrderId` must be provided + +newClientOrderId + +STRING + +NO + +Used to uniquely identify this cancel. Automatically generated by default + +recvWindow + +LONG + +NO + +The value cannot be greater than 60000 + +timestamp + +LONG + +YES + +> - Additional notes: Canceling an individual leg will cancel the entire OCO + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-Margin-Account-OCO-Orders) + +``` +{ "orderListId": 0, "contingencyType": "OCO", "listStatusType": "ALL_DONE", "listOrderStatus": "ALL_DONE", "listClientOrderId": "C3wyj4WVEktd7u9aVBRXcN", "transactionTime": 1574040868128, "symbol": "LTCBTC", "orders": [ { "symbol": "LTCBTC", "orderId": 2, "clientOrderId": "pO9ufTiFGg3nw2fOdgeOXa" }, { "symbol": "LTCBTC", "orderId": 3, "clientOrderId": "TXOvglzXuaubXAaENpaRCB" } ], "orderReports": [ { "symbol": "LTCBTC", "origClientOrderId": "pO9ufTiFGg3nw2fOdgeOXa", "orderId": 2, "orderListId": 0, "clientOrderId": "unfWT8ig8i0uj6lPuYLez6", "price": "1.00000000", "origQty": "10.00000000", "executedQty": "0.00000000", "cummulativeQuoteQty": "0.00000000", "status": "CANCELED", "timeInForce": "GTC", "type": "STOP_LOSS_LIMIT", "side": "SELL", "stopPrice": "1.00000000" }, { "symbol": "LTCBTC", "origClientOrderId": "TXOvglzXuaubXAaENpaRCB", "orderId": 3, "orderListId": 0, "clientOrderId": "unfWT8ig8i0uj6lPuYLez6", "price": "3.00000000", "origQty": "10.00000000", "executedQty": "0.00000000", "cummulativeQuoteQty": "0.00000000", "status": "CANCELED", "timeInForce": "GTC", "type": "LIMIT_MAKER", "side": "SELL" } ]} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-Margin-Account-OCO-Orders) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-Margin-Account-OCO-Orders) +- [Request Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-Margin-Account-OCO-Orders) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-Margin-Account-OCO-Orders) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-Margin-Account-OCO-Orders) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Cancel-Margin-Account-Order.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Cancel-Margin-Account-Order.md new file mode 100644 index 0000000..77d0ee7 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Cancel-Margin-Account-Order.md @@ -0,0 +1,82 @@ +--- +title: "Cancel Margin Account Order | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-Margin-Account-Order" +fetched_at: "2026-01-27T05:28:20.204Z" +--- +# Cancel Margin Account Order(TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-Margin-Account-Order) + +Cancel Margin Account Order + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-Margin-Account-Order) + +DELETE `/papi/v1/margin/order` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-Margin-Account-Order) + +**2** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-Margin-Account-Order) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +orderId + +LONG + +NO + +origClientOrderId + +STRING + +NO + +newClientOrderId + +STRING + +NO + +Used to uniquely identify this cancel. Automatically generated by default. + +recvWindow + +LONG + +NO + +The value cannot be greater than `60000` + +timestamp + +LONG + +YES + +> - Either `orderId` or `origClientOrderId` must be sent. + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-Margin-Account-Order) + +``` +{ "symbol": "LTCBTC", "orderId": 28, "origClientOrderId": "myOrder1", "clientOrderId": "cancelMyOrder1", "price": "1.00000000", "origQty": "10.00000000", "executedQty": "8.00000000", "cummulativeQuoteQty": "8.00000000", "status": "CANCELED", "timeInForce": "GTC", "type": "LIMIT", "side": "SELL"} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-Margin-Account-Order) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-Margin-Account-Order) +- [Request Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-Margin-Account-Order) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-Margin-Account-Order) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-Margin-Account-Order) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Cancel-UM-Conditional-Order.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Cancel-UM-Conditional-Order.md new file mode 100644 index 0000000..484714d --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Cancel-UM-Conditional-Order.md @@ -0,0 +1,72 @@ +--- +title: "Cancel Um Conditional Order | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-UM-Conditional-Order" +fetched_at: "2026-01-27T05:28:20.262Z" +--- +# Cancel UM Conditional Order(TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-UM-Conditional-Order) + +Cancel UM Conditional Order + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-UM-Conditional-Order) + +DELETE `/papi/v1/um/conditional/order` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-UM-Conditional-Order) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-UM-Conditional-Order) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +strategyId + +LONG + +NO + +newClientStrategyId + +STRING + +NO + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +> - Either `strategyId` or `newClientStrategyId` must be sent. + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-UM-Conditional-Order) + +``` +{ "newClientStrategyId": "myOrder1", "strategyId":123445, "strategyStatus":"CANCELED", "strategyType": "TRAILING_STOP_MARKET", "origQty": "11", "price": "0", "reduceOnly": false, "side": "BUY", "positionSide": "SHORT", "stopPrice": "9300", // please ignore when order type is TRAILING_STOP_MARKET "symbol": "BTCUSDT", "timeInForce": "GTC", "activatePrice": "9020", // activation price, only return with TRAILING_STOP_MARKET order "priceRate": "0.3", // callback rate, only return with TRAILING_STOP_MARKET order "bookTime": 1566818724710, "updateTime": 1566818724722, "workingType":"CONTRACT_PRICE", "priceProtect": false, "selfTradePreventionMode": "NONE", //self trading preventation mode "goodTillDate": 0, "priceMatch": "NONE" } +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-UM-Conditional-Order) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-UM-Conditional-Order) +- [Request Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-UM-Conditional-Order) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-UM-Conditional-Order) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-UM-Conditional-Order) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Cancel-UM-Order.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Cancel-UM-Order.md new file mode 100644 index 0000000..8278130 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Cancel-UM-Order.md @@ -0,0 +1,72 @@ +--- +title: "Cancel Um Order | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-UM-Order" +fetched_at: "2026-01-27T05:28:20.267Z" +--- +# Cancel UM Order(TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-UM-Order) + +Cancel an active UM LIMIT order + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-UM-Order) + +DELETE `/papi/v1/um/order` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-UM-Order) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-UM-Order) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +orderId + +LONG + +NO + +origClientOrderId + +STRING + +NO + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +> - Either `orderId` or `origClientOrderId` must be sent. + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-UM-Order) + +``` +{ "avgPrice": "0.00000", "clientOrderId": "myOrder1", "cumQty": "0", "cumQuote": "0", "executedQty": "0", "orderId": 4611875134427365377, "origQty": "0.40", "price": "0", "reduceOnly": false, "side": "BUY", "positionSide": "SHORT", "status": "CANCELED", "symbol": "BTCUSDT", "timeInForce": "GTC", "type": "LIMIT", "updateTime": 1571110484038, "selfTradePreventionMode": "NONE", "goodTillDate": 0, "priceMatch": "NONE" } +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-UM-Order) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-UM-Order) +- [Request Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-UM-Order) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-UM-Order) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-UM-Order) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Get-UM-Futures-BNB-Burn-Status.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Get-UM-Futures-BNB-Burn-Status.md new file mode 100644 index 0000000..529dd23 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Get-UM-Futures-BNB-Burn-Status.md @@ -0,0 +1,52 @@ +--- +title: "Get Um Futures BNB Burn Status | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Get-UM-Futures-BNB-Burn-Status" +fetched_at: "2026-01-27T05:28:20.377Z" +--- +# Get UM Futures BNB Burn Status (USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Get-UM-Futures-BNB-Burn-Status) + +Get user's BNB Fee Discount for UM Futures (Fee Discount On or Fee Discount Off ) + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Get-UM-Futures-BNB-Burn-Status) + +GET `/papi/v1/um/feeBurn` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Get-UM-Futures-BNB-Burn-Status) + +**30** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Get-UM-Futures-BNB-Burn-Status) + +Name + +Type + +Mandatory + +Description + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Get-UM-Futures-BNB-Burn-Status) + +``` +{ "feeBurn": true // "true": Fee Discount On; "false": Fee Discount Off} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Get-UM-Futures-BNB-Burn-Status) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Get-UM-Futures-BNB-Burn-Status) +- [Request Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Get-UM-Futures-BNB-Burn-Status) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Get-UM-Futures-BNB-Burn-Status) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Get-UM-Futures-BNB-Burn-Status) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Margin-Account-Borrow.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Margin-Account-Borrow.md new file mode 100644 index 0000000..cdb20b6 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Margin-Account-Borrow.md @@ -0,0 +1,66 @@ +--- +title: "Margin Account Borrow | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Margin-Account-Borrow" +fetched_at: "2026-01-27T05:28:20.452Z" +--- +# Margin Account Borrow(MARGIN) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Margin-Account-Borrow) + +Apply for a margin loan. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Margin-Account-Borrow) + +POST `/papi/v1/marginLoan` + +## Request Weight(IP)[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Margin-Account-Borrow) + +**100** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Margin-Account-Borrow) + +Name + +Type + +Mandatory + +Description + +asset + +STRING + +YES + +amount + +DECIMAL + +YES + +recvWindow + +LONG + +NO + +The value cannot be greater than 60000 + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Margin-Account-Borrow) + +``` +{ //transaction id "tranId": 100000001} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Margin-Account-Borrow) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Margin-Account-Borrow) +- [Request Weight(IP)](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Margin-Account-Borrow) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Margin-Account-Borrow) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Margin-Account-Borrow) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Margin-Account-New-OCO.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Margin-Account-New-OCO.md new file mode 100644 index 0000000..c589b36 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Margin-Account-New-OCO.md @@ -0,0 +1,163 @@ +--- +title: "Margin Account New OCO | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Margin-Account-New-OCO" +fetched_at: "2026-01-27T05:28:20.589Z" +--- +# Margin Account New OCO(TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Margin-Account-New-OCO) + +Send in a new OCO for a margin account + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Margin-Account-New-OCO) + +POST `/papi/v1/margin/order/oco` + +## Request Weight(Order)[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Margin-Account-New-OCO) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Margin-Account-New-OCO) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +listClientOrderId + +STRING + +NO + +A unique Id for the entire orderList + +side + +ENUM + +YES + +quantity + +DECIMAL + +YES + +limitClientOrderId + +STRING + +NO + +A unique Id for the limit order + +price + +DECIMAL + +YES + +limitIcebergQty + +DECIMAL + +NO + +stopClientOrderId + +STRING + +NO + +A unique Id for the stop loss/stop loss limit leg + +stopPrice + +DECIMAL + +YES + +stopLimitPrice + +DECIMAL + +NO + +If provided, stopLimitTimeInForce is required. + +stopIcebergQty + +DECIMAL + +NO + +stopLimitTimeInForce + +ENUM + +NO + +Valid values are `GTC/FOK/IOC` + +newOrderRespType + +ENUM + +NO + +Set the response JSON. + +sideEffectType + +ENUM + +NO + +NO\_SIDE\_EFFECT, MARGIN\_BUY, AUTO\_REPAY; default NO\_SIDE\_EFFECT. + +recvWindow + +LONG + +NO + +The value cannot be greater than `60000` + +timestamp + +LONG + +YES + +Other Info: + +> - Price Restrictions: +> - `SELL`: Limit Price > Last Price > Stop Price +> - `BUY`: Limit Price < Last Price < Stop Price +> - Quantity Restrictions: +> - Both legs must have the same quantity +> - `ICEBERG` quantities however do not have to be the same. +> - Order Rate Limit +> - `OCO` counts as 2 orders against the order rate limit. + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Margin-Account-New-OCO) + +``` +{ "orderListId": 0, "contingencyType": "OCO", "listStatusType": "EXEC_STARTED", "listOrderStatus": "EXECUTING", "listClientOrderId": "JYVpp3F0f5CAG15DhtrqLp", "transactionTime": 1563417480525, "symbol": "LTCBTC", "marginBuyBorrowAmount": "5", // will not return if no margin trade happens "marginBuyBorrowAsset": "BTC", // will not return if no margin trade happens "orders": [ { "symbol": "LTCBTC", "orderId": 2, "clientOrderId": "Kk7sqHb9J6mJWTMDVW7Vos" }, { "symbol": "LTCBTC", "orderId": 3, "clientOrderId": "xTXKaGYd4bluPVp78IVRvl" } ], "orderReports": [ { "symbol": "LTCBTC", "orderId": 2, "orderListId": 0, "clientOrderId": "Kk7sqHb9J6mJWTMDVW7Vos", "transactTime": 1563417480525, "price": "0.000000", "origQty": "0.624363", "executedQty": "0.000000", "cummulativeQuoteQty": "0.000000", "status": "NEW", "timeInForce": "GTC", "type": "STOP_LOSS", "side": "BUY", "stopPrice": "0.960664" }, { "symbol": "LTCBTC", "orderId": 3, "orderListId": 0, "clientOrderId": "xTXKaGYd4bluPVp78IVRvl", "transactTime": 1563417480525, "price": "0.036435", "origQty": "0.624363", "executedQty": "0.000000", "cummulativeQuoteQty": "0.000000", "status": "NEW", "timeInForce": "GTC", "type": "LIMIT_MAKER", "side": "BUY" } ]} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Margin-Account-New-OCO) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Margin-Account-New-OCO) +- [Request Weight(Order)](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Margin-Account-New-OCO) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Margin-Account-New-OCO) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Margin-Account-New-OCO) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Margin-Account-Repay-Debt.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Margin-Account-Repay-Debt.md new file mode 100644 index 0000000..d42d82c --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Margin-Account-Repay-Debt.md @@ -0,0 +1,79 @@ +--- +title: "Margin Account Repay Debt | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Margin-Account-Repay-Debt" +fetched_at: "2026-01-27T05:28:20.629Z" +--- +# Margin Account Repay Debt(TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Margin-Account-Repay-Debt) + +Repay debt for a margin loan. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Margin-Account-Repay-Debt) + +POST `/papi/v1/margin/repay-debt` + +## Request Weight(Order)[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Margin-Account-Repay-Debt) + +**3000** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Margin-Account-Repay-Debt) + +Name + +Type + +Mandatory + +Description + +asset + +STRING + +YES + +amount + +STRING + +NO + +specifyRepayAssets + +STRING + +NO + +Specific asset list to repay debt; Can be added in batch, separated by commas + +recvWindow + +LONG + +NO + +The value cannot be greater than 60000 + +timestamp + +LONG + +YES + +> - The repay asset amount cannot exceed 50000 USD equivalent value for a single request. +> - If `amount` is not sent, all the asset loan will be repaid if having enough specific repay assets. +> - If `amount` is sent, only the certain amount of the asset loan will be repaid if having enough specific repay assets. +> - The system will use the same asset to repay the loan first (if have) no matter whether put the asset in `specifyRepayAssets` + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Margin-Account-Repay-Debt) + +``` +{ "amount": "0.10000000", "asset": "BNB", "specifyRepayAssets": [ "USDT", "BTC" ], "updateTime": 1636371437000 "success": true} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Margin-Account-Repay-Debt) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Margin-Account-Repay-Debt) +- [Request Weight(Order)](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Margin-Account-Repay-Debt) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Margin-Account-Repay-Debt) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Margin-Account-Repay-Debt) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Margin-Account-Repay.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Margin-Account-Repay.md new file mode 100644 index 0000000..2b6b743 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Margin-Account-Repay.md @@ -0,0 +1,66 @@ +--- +title: "Margin Account Repay | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Margin-Account-Repay" +fetched_at: "2026-01-27T05:28:20.562Z" +--- +# Margin Account Repay(MARGIN) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Margin-Account-Repay) + +Repay for a margin loan. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Margin-Account-Repay) + +POST `/papi/v1/repayLoan` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Margin-Account-Repay) + +**100** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Margin-Account-Repay) + +Name + +Type + +Mandatory + +Description + +asset + +STRING + +YES + +amount + +DECIMAL + +YES + +recvWindow + +LONG + +NO + +The value cannot be greater than 60000 + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Margin-Account-Repay) + +``` +{ //transaction id "tranId": 100000001} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Margin-Account-Repay) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Margin-Account-Repay) +- [Request Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Margin-Account-Repay) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Margin-Account-Repay) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Margin-Account-Repay) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Margin-Account-Trade-List.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Margin-Account-Trade-List.md new file mode 100644 index 0000000..0f26311 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Margin-Account-Trade-List.md @@ -0,0 +1,99 @@ +--- +title: "Margin Account Trade List | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Margin-Account-Trade-List" +fetched_at: "2026-01-27T05:28:20.852Z" +--- +# Margin Account Trade List (USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Margin-Account-Trade-List) + +Margin Account Trade List + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Margin-Account-Trade-List) + +GET `/papi/v1/margin/myTrades` + +## Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Margin-Account-Trade-List) + +**5** + +## Parameters:[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Margin-Account-Trade-List) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +orderId + +LONG + +NO + +startTime + +LONG + +NO + +endTime + +LONG + +NO + +fromId + +LONG + +NO + +TradeId to fetch from. Default gets most recent trades. + +limit + +INT + +NO + +Default 500; max 1000. + +recvWindow + +LONG + +NO + +The value cannot be greater than 60000 + +timestamp + +LONG + +YES + +**Notes:** + +- If `fromId` is set, it will get trades >= that `fromId`. Otherwise most recent trades are returned. +- Less than 24 hours between `startTime` and `endTime`. + +## Response:[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Margin-Account-Trade-List) + +``` +[ { "commission": "0.00006000", "commissionAsset": "BTC", "id": 34, "isBestMatch": true, "isBuyer": false, "isMaker": false, "orderId": 39324, "price": "0.02000000", "qty": "3.00000000", "symbol": "BNBBTC", "time": 1561973357171 }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Margin-Account-Trade-List) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Margin-Account-Trade-List) +- [Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Margin-Account-Trade-List) +- [Parameters:](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Margin-Account-Trade-List) +- [Response:](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Margin-Account-Trade-List) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Modify-CM-Order.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Modify-CM-Order.md new file mode 100644 index 0000000..48e583a --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Modify-CM-Order.md @@ -0,0 +1,107 @@ +--- +title: "Modify CM Order | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Modify-CM-Order" +fetched_at: "2026-01-27T05:28:20.820Z" +--- +# Modify CM Order(TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Modify-CM-Order) + +Order modify function, currently only LIMIT order modification is supported, modified orders will be reordered in the match queue + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Modify-CM-Order) + +PUT `/papi/v1/cm/order` + +## Request Weight(Order)[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Modify-CM-Order) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Modify-CM-Order) + +Name + +Type + +Mandatory + +Description + +orderId + +LONG + +NO + +origClientOrderId + +STRING + +NO + +symbol + +STRING + +YES + +side + +ENUM + +YES + +SELL, BUY + +quantity + +DECIMAL + +YES + +Order quantity + +price + +DECIMAL + +YES + +priceMatch + +ENUM + +NO + +only avaliable for `LIMIT`/`STOP`/`TAKE_PROFIT` order; can be set to `OPPONENT`/ `OPPONENT_5`/ `OPPONENT_10`/ `OPPONENT_20`: /`QUEUE`/ `QUEUE_5`/ `QUEUE_10`/ `QUEUE_20`; Can't be passed together with `price` + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +> - Either `orderId` or `origClientOrderId` must be sent, and the `orderId` will prevail if both are sent. +> - Both `quantity` and `price` must be sent +> - 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 + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Modify-CM-Order) + +``` +{ "orderId": 20072994037, "symbol": "BTCUSD_PERP", "pair": "BTCUSD", "status": "NEW", "clientOrderId": "LJ9R4QZDihCaS8UAOOLpgW", "price": "30005", "avgPrice": "0.0", "origQty": "1", "executedQty": "0", "cumQty": "0", "cumBase": "0", "timeInForce": "GTC", "type": "LIMIT", "reduceOnly": false, "side": "BUY", "positionSide": "LONG", "origType": "LIMIT", "updateTime": 1629182711600} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Modify-CM-Order) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Modify-CM-Order) +- [Request Weight(Order)](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Modify-CM-Order) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Modify-CM-Order) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Modify-CM-Order) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Modify-UM-Order.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Modify-UM-Order.md new file mode 100644 index 0000000..3b1d53c --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Modify-UM-Order.md @@ -0,0 +1,107 @@ +--- +title: "Modify UM Order | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Modify-UM-Order" +fetched_at: "2026-01-27T05:28:20.983Z" +--- +# Modify UM Order(TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Modify-UM-Order) + +Order modify function, currently only LIMIT order modification is supported, modified orders will be reordered in the match queue + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Modify-UM-Order) + +PUT `/papi/v1/um/order` + +## Request Weight(Order)[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Modify-UM-Order) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Modify-UM-Order) + +Name + +Type + +Mandatory + +Description + +orderId + +LONG + +NO + +origClientOrderId + +STRING + +NO + +symbol + +STRING + +YES + +side + +ENUM + +YES + +SELL, BUY + +quantity + +DECIMAL + +YES + +Order quantity + +price + +DECIMAL + +YES + +priceMatch + +ENUM + +NO + +only avaliable for `LIMIT`/`STOP`/`TAKE_PROFIT` order; can be set to `OPPONENT`/ `OPPONENT_5`/ `OPPONENT_10`/ `OPPONENT_20`: /`QUEUE`/ `QUEUE_5`/ `QUEUE_10`/ `QUEUE_20`; Can't be passed together with `price` + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +> - Either orderId or origClientOrderId must be sent, and the orderId will prevail if both are sent. +> - Both quantity and price must be sent +> - 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 + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Modify-UM-Order) + +``` +{ "orderId": 20072994037, "symbol": "BTCUSDT", "status": "NEW", "clientOrderId": "LJ9R4QZDihCaS8UAOOLpgW", "price": "30005", "avgPrice": "0.0", "origQty": "1", "executedQty": "0", "cumQty": "0", "cumQuote": "0", "timeInForce": "GTC", "type": "LIMIT", "reduceOnly": false, "side": "BUY", "positionSide": "LONG", "origType": "LIMIT", "selfTradePreventionMode": "NONE", //self trading preventation mode "goodTillDate": 0 //order pre-set auot cancel time for TIF GTD order "updateTime": 1629182711600, "priceMatch": "NONE"} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Modify-UM-Order) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Modify-UM-Order) +- [Request Weight(Order)](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Modify-UM-Order) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Modify-UM-Order) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Modify-UM-Order) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_New-CM-Conditional-Order.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_New-CM-Conditional-Order.md new file mode 100644 index 0000000..9ff9e20 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_New-CM-Conditional-Order.md @@ -0,0 +1,201 @@ +--- +title: "New Cm Conditional Order | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-CM-Conditional-Order" +fetched_at: "2026-01-27T05:28:20.942Z" +--- +# New CM Conditional Order(TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-CM-Conditional-Order) + +New CM Conditional Order + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-CM-Conditional-Order) + +POST `/papi/v1/cm/conditional/order` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-CM-Conditional-Order) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-CM-Conditional-Order) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +side + +ENUM + +YES + +positionSide + +ENUM + +NO + +Default `BOTH` for One-way Mode ; `LONG` or `SHORT` for Hedge Mode. It must be sent in Hedge Mode. + +strategyType + +ENUM + +YES + +"STOP", "STOP\_MARKET", "TAKE\_PROFIT", "TAKE\_PROFIT\_MARKET", and "TRAILING\_STOP\_MARKET" + +timeInForce + +ENUM + +NO + +quantity + +DECIMAL + +NO + +reduceOnly + +STRING + +NO + +"true" or "false". default "false". Cannot be sent in Hedge Mode + +price + +DECIMAL + +NO + +workingType + +ENUM + +NO + +stopPrice triggered by: "MARK\_PRICE", "CONTRACT\_PRICE". Default "CONTRACT\_PRICE" + +priceProtect + +STRING + +NO + +"TRUE" or "FALSE", default "FALSE". Used with `STOP`/`STOP_MARKET` or `TAKE_PROFIT`/`TAKE_PROFIT_MARKET` orders + +newClientStrategyId + +STRING + +NO + +A unique id among open orders. Automatically generated if not sent. Can only be string following the rule: `^[\.A-Z\:/a-z0-9_-]{1,36}$` + +stopPrice + +DECIMAL + +NO + +Used with `STOP/STOP_MARKET` or `TAKE_PROFIT/TAKE_PROFIT_MARKET` orders. + +activationPrice + +DECIMAL + +NO + +Used with `TRAILING_STOP_MARKET` orders, default as the mark price + +callbackRate + +DECIMAL + +NO + +Used with `TRAILING_STOP_MARKET` orders, min 0.1, max 5 where 1 for 1% + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +Additional mandatory parameters based on type: + +Type + +Additional mandatory parameters + +`STOP/TAKE_PROFIT` + +`quantity`, `price`, `stopPrice` + +`STOP_MARKET/TAKE_PROFIT_MARKET` + +`stopPrice` + +`TRAILING_STOP_MARKET` + +`callbackRate` + +- Order with type `STOP/TAKE_PROFIT`, parameter `timeInForce` can be sent ( default `GTC`). + +- Condition orders will be triggered when: + + - `STOP`, `STOP_MARKET`: + - BUY: "MARK\_PRICE" >= `stopPrice` + - SELL: "MARK\_PRICE" <= `stopPrice` + - `TAKE_PROFIT`, `TAKE_PROFIT_MARKET`: + - BUY: "MARK\_PRICE" <= `stopPrice` + - SELL: "MARK\_PRICE" >= `stopPrice` + - `TRAILING_STOP_MARKET`: + - BUY: the lowest mark price after order placed `<=` activationPrice`, and the latest mark price >`\= the lowest mark price \* (1 + `callbackRate`) + - SELL: the highest mark price after order placed >= `activationPrice`, and the latest mark price <= the highest mark 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 mark price. + - SELL: `activationPrice` should be larger than latest mark price. +- Condition orders will be triggered when: + + - If parameter`priceProtect`is 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` + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-CM-Conditional-Order) + +``` +{ "newClientStrategyId": "testOrder", "strategyId":123445, "strategyStatus":"NEW", "strategyType": "TRAILING_STOP_MARKET", "origQty": "10", "price": "0", "reduceOnly": false, "side": "BUY", "positionSide": "SHORT", "stopPrice": "9300", // please ignore when order type is TRAILING_STOP_MARKET "symbol": "BTCUSD_200925", "pair": "BTCUSD", "timeInForce": "GTC", "activatePrice": "9020", // activation price, only return with TRAILING_STOP_MARKET order "priceRate": "0.3", // callback rate, only return with TRAILING_STOP_MARKET order "bookTime": 1566818724710, // order place time "updateTime": 1566818724722 "workingType":"CONTRACT_PRICE", "priceProtect": false } +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-CM-Conditional-Order) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-CM-Conditional-Order) +- [Request Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-CM-Conditional-Order) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-CM-Conditional-Order) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-CM-Conditional-Order) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_New-CM-Order.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_New-CM-Order.md new file mode 100644 index 0000000..055dc72 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_New-CM-Order.md @@ -0,0 +1,148 @@ +--- +title: "New Cm Order | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-CM-Order" +fetched_at: "2026-01-27T05:28:21.080Z" +--- +# New CM Order(TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-CM-Order) + +Place new CM order + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-CM-Order) + +POST `/papi/v1/cm/order` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-CM-Order) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-CM-Order) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +side + +ENUM + +YES + +positionSide + +ENUM + +NO + +Default `BOTH` for One-way Mode ; `LONG` or `SHORT` for Hedge Mode. It must be sent in Hedge Mode. + +type + +ENUM + +YES + +"LIMIT", "MARKET" + +timeInForce + +ENUM + +NO + +quantity + +DECIMAL + +NO + +reduceOnly + +STRING + +NO + +"true" or "false". default "false". Cannot be sent in Hedge Mode. + +price + +DECIMAL + +NO + +priceMatch + +ENUM + +NO + +only avaliable for `LIMIT`/`STOP`/`TAKE_PROFIT` order; can be set to `OPPONENT`/ `OPPONENT_5`/ `OPPONENT_10`/ `OPPONENT_20`: /`QUEUE`/ `QUEUE_5`/ `QUEUE_10`/ `QUEUE_20`; Can't be passed together with `price` + +newClientOrderId + +STRING + +NO + +A unique id among open orders. Automatically generated if not sent. Can only be string following the rule: `^[\.A-Z\:/a-z0-9_-]{1,32}$` + +newOrderRespType + +ENUM + +NO + +"ACK", "RESULT", default "ACK" + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +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 return directly. + - `LIMIT` order with special `timeInForce`: the final status result of the order(FILLED or EXPIRED) will be returned directly. + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-CM-Order) + +``` +{ "clientOrderId": "testOrder", "cumQty": "0", "cumBase": "0", "executedQty": "0", "orderId": 22542179, "avgPrice": "0.0", "origQty": "10", "price": "0", "reduceOnly": false, "side": "BUY", "positionSide": "SHORT", "status": "NEW", "symbol": "BTCUSD_200925", "pair": "BTCUSD", "timeInForce": "GTC", "type": "MARKET", "updateTime": 1566818724722} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-CM-Order) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-CM-Order) +- [Request Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-CM-Order) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-CM-Order) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-CM-Order) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_New-Margin-Order.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_New-Margin-Order.md new file mode 100644 index 0000000..280a2b0 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_New-Margin-Order.md @@ -0,0 +1,156 @@ +--- +title: "New Margin Order | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-Margin-Order" +fetched_at: "2026-01-27T05:28:21.110Z" +--- +# New Margin Order(TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-Margin-Order) + +New Margin Order + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-Margin-Order) + +POST `/papi/v1/margin/order` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-Margin-Order) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-Margin-Order) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +side + +ENUM + +YES + +BUY ; SELL + +type + +ENUM + +YES + +quantity + +DECIMAL + +NO + +quoteOrderQty + +DECIMAL + +NO + +price + +DECIMAL + +NO + +stopPrice + +DECIMAL + +NO + +Used with `STOP_LOSS`, `STOP_LOSS_LIMIT`, `TAKE_PROFIT`, and `TAKE_PROFIT_LIMIT` orders. + +newClientOrderId + +STRING + +NO + +A unique id among open orders. Automatically generated if not sent. + +newOrderRespType + +ENUM + +NO + +Set the response JSON. ACK, RESULT, or FULL; MARKET and LIMIT order types default to FULL, all other orders default to ACK. + +icebergQty + +DECIMAL + +NO + +Used with `LIMIT`, `STOP_LOSS_LIMIT`, and `TAKE_PROFIT_LIMIT` to create an iceberg order + +sideEffectType + +ENUM + +NO + +`NO_SIDE_EFFECT`, `MARGIN_BUY`, `AUTO_REPAY`,`AUTO_BORROW_REPAY`; default `NO_SIDE_EFFECT`. + +timeInForce + +ENUM + +NO + +GTC,IOC,FOK + +selfTradePreventionMode + +ENUM + +NO + +`NONE`:No STP / `EXPIRE_TAKER`:expire taker order when STP triggers/ `EXPIRE_MAKER`:expire taker order when STP triggers/ `EXPIRE_BOTH`:expire both orders when STP triggers + +autoRepayAtCancel + +BOOLEAN + +NO + +Only when MARGIN\_BUY or AUTO\_BORROW\_REPAY order takes effect, true means that the debt generated by the order needs to be repay after the order is cancelled. The default is true + +recvWindow + +LONG + +NO + +The value cannot be greater than `60000` + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-Margin-Order) + +``` +{ "symbol": "BTCUSDT", "orderId": 28, "clientOrderId": "6gCrw2kRUAF9CvJDGP16IP", "transactTime": 1507725176595, "price": "1.00000000", "origQty": "10.00000000", "executedQty": "10.00000000", "cummulativeQuoteQty": "10.00000000", "status": "FILLED", "timeInForce": "GTC", "type": "MARKET", "side": "SELL", "marginBuyBorrowAmount": "5", // will not return if no margin trade happens "marginBuyBorrowAsset": "BTC", // will not return if no margin trade happens "fills": [ { "price": "4000.00000000", "qty": "1.00000000", "commission": "4.00000000", "commissionAsset": "USDT" }, { "price": "3999.00000000", "qty": "5.00000000", "commission": "19.99500000", "commissionAsset": "USDT" } ]} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-Margin-Order) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-Margin-Order) +- [Request Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-Margin-Order) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-Margin-Order) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-Margin-Order) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_New-UM-Conditional-Order.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_New-UM-Conditional-Order.md new file mode 100644 index 0000000..7adbdbe --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_New-UM-Conditional-Order.md @@ -0,0 +1,229 @@ +--- +title: "New Um Conditional Order | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-UM-Conditional-Order" +fetched_at: "2026-01-27T05:28:21.207Z" +--- +# New UM Conditional Order (TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-UM-Conditional-Order) + +Place new UM conditional order + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-UM-Conditional-Order) + +POST `/papi/v1/um/conditional/order` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-UM-Conditional-Order) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-UM-Conditional-Order) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +side + +ENUM + +YES + +positionSide + +ENUM + +NO + +Default `BOTH` for One-way Mode ; `LONG` or `SHORT` for Hedge Mode. It must be sent in Hedge Mode. + +strategyType + +ENUM + +YES + +"STOP", "STOP\_MARKET", "TAKE\_PROFIT", "TAKE\_PROFIT\_MARKET", and "TRAILING\_STOP\_MARKET" + +timeInForce + +ENUM + +NO + +quantity + +DECIMAL + +NO + +reduceOnly + +STRING + +NO + +"true" or "false". default "false". Cannot be sent in Hedge Mode ; cannot be sent with `closePosition`\=`true` + +price + +DECIMAL + +NO + +workingType + +ENUM + +NO + +stopPrice triggered by: "MARK\_PRICE", "CONTRACT\_PRICE". Default "CONTRACT\_PRICE" + +priceProtect + +STRING + +NO + +"TRUE" or "FALSE", default "FALSE". Used with `STOP/STOP_MARKET` or `TAKE_PROFIT/TAKE_PROFIT_MARKET` orders + +newClientStrategyId + +STRING + +NO + +A unique id among open orders. Automatically generated if not sent. Can only be string following the rule: `^[\.A-Z\:/a-z0-9_-]{1,32}$` + +stopPrice + +DECIMAL + +NO + +Used with `STOP/STOP_MARKET` or `TAKE_PROFIT/TAKE_PROFIT_MARKET` orders. + +activationPrice + +DECIMAL + +NO + +Used with `TRAILING_STOP_MARKET` orders, default as the mark price + +callbackRate + +DECIMAL + +NO + +Used with `TRAILING_STOP_MARKET` orders, min 0.1, max 5 where 1 for 1% + +priceMatch + +ENUM + +NO + +only avaliable for `LIMIT`/`STOP`/`TAKE_PROFIT` order; can be set to `OPPONENT`/ `OPPONENT_5`/ `OPPONENT_10`/ `OPPONENT_20`: /`QUEUE`/ `QUEUE_5`/ `QUEUE_10`/ `QUEUE_20`; Can't be passed together with `price` + +selfTradePreventionMode + +ENUM + +NO + +`NONE`:No STP / `EXPIRE_TAKER`:expire taker order when STP triggers/ `EXPIRE_MAKER`:expire taker order when STP triggers/ `EXPIRE_BOTH`:expire both orders when STP triggers + +goodTillDate + +LONG + +NO + +order cancel time for timeInForce `GTD`, mandatory when `timeInforce` set to `GTD`; order the timestamp only retains second-level precision, ms part will be ignored; The goodTillDate timestamp must be greater than the current time plus 600 seconds and smaller than 253402300799000Mode. It must be sent in Hedge Mode. + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +Additional mandatory parameters based on type: + +Type + +Additional mandatory parameters + +`STOP/TAKE_PROFIT` + +`quantity`, `price`, `stopPrice` + +`STOP_MARKET/TAKE_PROFIT_MARKET` + +`stopPrice` + +`TRAILING_STOP_MARKET` + +`callbackRate` + +- Order with type `STOP/TAKE_PROFIT`, parameter `timeInForce` can be sent ( default `GTC`). + +- Condition orders will be triggered when: + + - `STOP`, `STOP_MARKET`: + - BUY: "MARK\_PRICE" >= `stopPrice` + - SELL: "MARK\_PRICE" <= `stopPrice` + - `TAKE_PROFIT`, `TAKE_PROFIT_MARKET`: + - BUY: "MARK\_PRICE" <= `stopPrice` + - SELL: "MARK\_PRICE" >= `stopPrice` + - `TRAILING_STOP_MARKET`: + - BUY: the lowest mark price after order placed `<=` activationPrice`, and the latest mark price >`\= the lowest mark price \* (1 + `callbackRate`) + - SELL: the highest mark price after order placed >= `activationPrice`, and the latest mark price <= the highest mark 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 mark price. + - SELL: `activationPrice` should be larger than latest mark price. +- Condition orders will be triggered when: + + - If parameter`priceProtect`is 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` +- `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` + + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-UM-Conditional-Order) + +``` +{ "newClientStrategyId": "testOrder", "strategyId":123445, "strategyStatus":"NEW", "strategyType": "TRAILING_STOP_MARKET", "origQty": "10", "price": "0", "reduceOnly": false, "side": "BUY", "positionSide": "SHORT", "stopPrice": "9300", // please ignore when order type is TRAILING_STOP_MARKET "symbol": "BTCUSDT", "timeInForce": "GTD", "activatePrice": "9020", // activation price, only return with TRAILING_STOP_MARKET order "priceRate": "0.3", // callback rate, only return with TRAILING_STOP_MARKET order "bookTime": 1566818724710, // order place time "updateTime": 1566818724722 "workingType":"CONTRACT_PRICE", "priceProtect": false, "selfTradePreventionMode": "NONE", //self trading preventation mode "goodTillDate": 1693207680000, //order pre-set auot cancel time for TIF GTD order "priceMatch": "NONE" } +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-UM-Conditional-Order) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-UM-Conditional-Order) +- [Request Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-UM-Conditional-Order) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-UM-Conditional-Order) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-UM-Conditional-Order) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-All-CM-Conditional-Orders.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-All-CM-Conditional-Orders.md new file mode 100644 index 0000000..7cbc3a7 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-All-CM-Conditional-Orders.md @@ -0,0 +1,94 @@ +--- +title: "Query All Cm Conditional Orders | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Conditional-Orders" +fetched_at: "2026-01-27T05:28:21.251Z" +--- +# Query All CM Conditional Orders(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Conditional-Orders) + +Query All CM Conditional Orders + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Conditional-Orders) + +GET `/papi/v1/cm/conditional/allOrders` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Conditional-Orders) + +**1** for a single symbol; **40** when the symbol parameter is omitted + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Conditional-Orders) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +NO + +strategyId + +LONG + +NO + +startTime + +LONG + +NO + +endTime + +LONG + +NO + +limit + +INT + +NO + +Default 500; max 1000. + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +  + +**Notes:** + +> - These orders will not be found: +> - order strategyStatus is `CANCELED` or `EXPIRED`, **AND** +> - order has NO filled trade, **AND** +> - created time + 7 days < current time +> - The query time period must be less than 7 days( default as the recent 7 days). + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Conditional-Orders) + +``` +[ { "newClientStrategyId": "abc", "strategyId":123445, "strategyStatus":"TRIGGERED", "strategyType": "TRAILING_STOP_MARKET", "origQty": "0.40", "price": "0", "reduceOnly": false, "side": "BUY", "positionSide": "SHORT", "stopPrice": "9300", // please ignore when order type is TRAILING_STOP_MARKET "symbol": "BTCUSD", "orderId": 12123343534, //Normal orderID after trigger if appliable, only have when the strategy is triggered "status": "NEW", //Normal order status after trigger if appliable, only have when the strategy is triggered   "bookTime": 1566818724710, // order time "updateTime": 1566818724722, "triggerTime": 1566818724750, "timeInForce": "GTC", "type": "MARKET", //Normal order type after trigger if appliable "activatePrice": "9020", // activation price, only return with TRAILING_STOP_MARKET order "priceRate": "0.3" // callback rate, only return with TRAILING_STOP_MARKET order }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Conditional-Orders) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Conditional-Orders) +- [Request Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Conditional-Orders) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Conditional-Orders) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Conditional-Orders) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-All-CM-Orders.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-All-CM-Orders.md new file mode 100644 index 0000000..e6a5dc7 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-All-CM-Orders.md @@ -0,0 +1,97 @@ +--- +title: "Query All Cm Orders | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Orders" +fetched_at: "2026-01-27T05:28:21.352Z" +--- +# Query All CM Orders (USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Orders) + +Get all account CM orders; active, canceled, or filled. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Orders) + +GET `/papi/v1/cm/allOrders` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Orders) + +**20** with symbol, **40** with pair + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Orders) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +pair + +STRING + +NO + +orderId + +LONG + +NO + +startTime + +LONG + +NO + +endTime + +LONG + +NO + +limit + +INT + +NO + +Default 50; max 100. + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +> - Either `symbol` or `pair` must be sent. +> - If `orderId` is set, it will get orders >= that orderId. Otherwise most recent orders are returned. +> - 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 + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Orders) + +``` +[ { "avgPrice": "0.0", "clientOrderId": "abc", "cumBase": "0", "executedQty": "0", "orderId": 1917641, "origQty": "0.40", "origType": "LIMIT", "price": "0", "reduceOnly": false, "side": "BUY", "positionSide": "SHORT", "status": "NEW", "symbol": "BTCUSD_200925", "pair": "BTCUSD", "time": 1579276756075, // order time "timeInForce": "GTC", "type": "LIMIT", "updateTime": 1579276756075 // update time }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Orders) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Orders) +- [Request Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Orders) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Orders) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Orders) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-All-Current-CM-Open-Conditional-Orders.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-All-Current-CM-Open-Conditional-Orders.md new file mode 100644 index 0000000..81997d8 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-All-Current-CM-Open-Conditional-Orders.md @@ -0,0 +1,60 @@ +--- +title: "Query All Current Cm Open Conditional Orders | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Current-CM-Open-Conditional-Orders" +fetched_at: "2026-01-27T05:28:21.374Z" +--- +# Query All Current CM Open Conditional Orders (USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Current-CM-Open-Conditional-Orders) + +Get all open conditional orders on a symbol. **Careful** when accessing this with no symbol. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Current-CM-Open-Conditional-Orders) + +GET `/papi/v1/cm/conditional/openOrders` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Current-CM-Open-Conditional-Orders) + +**1** for a single symbol; **40** when the symbol parameter is omitted + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Current-CM-Open-Conditional-Orders) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +NO + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +> - If the symbol is not sent, orders for all symbols will be returned in an array. + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Current-CM-Open-Conditional-Orders) + +``` +[ { "newClientStrategyId": "abc", "strategyId":123445, "strategyStatus":"NEW", "strategyType": "TRAILING_STOP_MARKET", "origQty": "0.40", "price": "0", "reduceOnly": false, "side": "BUY", "positionSide": "SHORT", "stopPrice": "9300", // please ignore when order type is TRAILING_STOP_MARKET "symbol": "BTCUSD", "bookTime": 1566818724710, // order time "updateTime": 1566818724722, "timeInForce": "GTC", "activatePrice": "9020", // activation price, only return with TRAILING_STOP_MARKET order "priceRate": "0.3" // callback rate, only return with TRAILING_STOP_MARKET order }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Current-CM-Open-Conditional-Orders) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Current-CM-Open-Conditional-Orders) +- [Request Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Current-CM-Open-Conditional-Orders) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Current-CM-Open-Conditional-Orders) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Current-CM-Open-Conditional-Orders) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-All-Current-CM-Open-Orders.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-All-Current-CM-Open-Orders.md new file mode 100644 index 0000000..32336a2 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-All-Current-CM-Open-Orders.md @@ -0,0 +1,66 @@ +--- +title: "Query All Current Cm Open Orders | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Current-CM-Open-Orders" +fetched_at: "2026-01-27T05:28:21.469Z" +--- +# Query All Current CM Open Orders(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Current-CM-Open-Orders) + +Get all open orders on a symbol. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Current-CM-Open-Orders) + +`GET /papi/v1/cm/openOrders` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Current-CM-Open-Orders) + +**1** for a single symbol; **40** when the symbol parameter is omitted **Careful** when accessing this with no symbol. + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Current-CM-Open-Orders) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +NO + +pair + +STRING + +NO + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +> - If the symbol is not sent, orders for all symbols will be returned in an array. + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Current-CM-Open-Orders) + +``` +[ { "avgPrice": "0.0", "clientOrderId": "abc", "cumBase": "0", "executedQty": "0", "orderId": 1917641, "origQty": "0.40", "origType": "LIMIT", "price": "0", "reduceOnly": false, "side": "BUY", "positionSide": "SHORT", "status": "NEW", "symbol": "BTCUSD_200925", "pair":"BTCUSD", "time": 1579276756075, // order time "timeInForce": "GTC", "type": "LIMIT", "updateTime": 1579276756075 // update time }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Current-CM-Open-Orders) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Current-CM-Open-Orders) +- [Request Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Current-CM-Open-Orders) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Current-CM-Open-Orders) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Current-CM-Open-Orders) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-All-Current-UM-Open-Conditional-Orders.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-All-Current-UM-Open-Conditional-Orders.md new file mode 100644 index 0000000..55811e9 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-All-Current-UM-Open-Conditional-Orders.md @@ -0,0 +1,59 @@ +--- +title: "Query All Current Um Open Conditional Orders | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Current-UM-Open-Conditional-Orders" +fetched_at: "2026-01-27T05:28:21.506Z" +--- +# Query All Current UM Open Conditional Orders(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Current-UM-Open-Conditional-Orders) + +Get all open conditional orders on a symbol. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Current-UM-Open-Conditional-Orders) + +`GET /papi/v1/um/conditional/openOrders` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Current-UM-Open-Conditional-Orders) + +**1** for a single symbol; **40** when the symbol parameter is omitted **Careful** when accessing this with no symbol. + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +NO + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +> - If the symbol is not sent, orders for all symbols will be returned in an array. + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Current-UM-Open-Conditional-Orders) + +``` +[ { "newClientStrategyId": "abc", "strategyId":123445, "strategyStatus":"NEW", "strategyType": "TRAILING_STOP_MARKET", "origQty": "0.40", "price": "0", "reduceOnly": false, "side": "BUY", "positionSide": "SHORT", "stopPrice": "9300", // please ignore when order type is TRAILING_STOP_MARKET "symbol": "BTCUSDT", "bookTime": 1566818724710, // order time "updateTime": 1566818724722, "timeInForce": "GTC", "activatePrice": "9020", // activation price, only return with TRAILING_STOP_MARKET order "priceRate": "0.3", // callback rate, only return with TRAILING_STOP_MARKET order "selfTradePreventionMode": "NONE", //self trading preventation mode "goodTillDate": 0, "priceMatch": "NONE" }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Current-UM-Open-Conditional-Orders) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Current-UM-Open-Conditional-Orders) +- [Request Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Current-UM-Open-Conditional-Orders) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Current-UM-Open-Conditional-Orders) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-All-Current-UM-Open-Orders.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-All-Current-UM-Open-Orders.md new file mode 100644 index 0000000..81ff59d --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-All-Current-UM-Open-Orders.md @@ -0,0 +1,60 @@ +--- +title: "Query All Current Um Open Orders | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Current-UM-Open-Orders" +fetched_at: "2026-01-27T05:28:21.615Z" +--- +# Query All Current UM Open Orders(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Current-UM-Open-Orders) + +Get all open orders on a symbol. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Current-UM-Open-Orders) + +GET `/papi/v1/um/openOrders` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Current-UM-Open-Orders) + +**1** for a single symbol; **40** when the symbol parameter is omitted + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Current-UM-Open-Orders) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +NO + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +> - If the symbol is not sent, orders for all symbols will be returned in an array. + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Current-UM-Open-Orders) + +``` +[ { "avgPrice": "0.00000", "clientOrderId": "abc", "cumQuote": "0", "executedQty": "0", "orderId": 1917641, "origQty": "0.40", "origType": "LIMIT", "price": "0", "reduceOnly": false, "side": "BUY", "positionSide": "SHORT", "status": "NEW", "symbol": "BTCUSDT", "time": 1579276756075, // order time "timeInForce": "GTC", "type": "LIMIT", "updateTime": 1579276756075, // update time "selfTradePreventionMode": "NONE", //self trading preventation mode "goodTillDate": 0, "priceMatch": "NONE" }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Current-UM-Open-Orders) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Current-UM-Open-Orders) +- [Request Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Current-UM-Open-Orders) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Current-UM-Open-Orders) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Current-UM-Open-Orders) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-All-Margin-Account-Orders.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-All-Margin-Account-Orders.md new file mode 100644 index 0000000..37430dc --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-All-Margin-Account-Orders.md @@ -0,0 +1,91 @@ +--- +title: "Query All Margin Account Orders | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Margin-Account-Orders" +fetched_at: "2026-01-27T05:28:21.635Z" +--- +# Query All Margin Account Orders (USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Margin-Account-Orders) + +Query All Margin Account Orders + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Margin-Account-Orders) + +GET `/papi/v1/margin/allOrders` + +## Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Margin-Account-Orders) + +**100** + +## Parameters:[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Margin-Account-Orders) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +orderId + +LONG + +NO + +startTime + +LONG + +NO + +endTime + +LONG + +NO + +limit + +INT + +NO + +Default 500; max 500. + +recvWindow + +LONG + +NO + +The value cannot be greater than 60000 + +timestamp + +LONG + +YES + +**Notes:** + +- If `orderId` is set, it will get orders >= that `orderId`. Otherwise most recent orders are returned. +- For some historical orders cummulativeQuoteQty will be < 0, meaning the data is not available at this time. + +## Response:[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Margin-Account-Orders) + +``` +[ { "clientOrderId": "D2KDy4DIeS56PvkM13f8cP", "cummulativeQuoteQty": "0.00000000", "executedQty": "0.00000000", "icebergQty": "0.00000000", "isWorking": false, "orderId": 41295, "origQty": "5.31000000", "price": "0.22500000", "side": "SELL", "status": "CANCELED", "stopPrice": "0.18000000", "symbol": "BNBBTC", "time": 1565769338806, "timeInForce": "GTC", "type": "TAKE_PROFIT_LIMIT", "updateTime": 1565769342148, "accountId": 152950866, "selfTradePreventionMode": "EXPIRE_TAKER", "preventedMatchId": null, "preventedQuantity": null }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Margin-Account-Orders) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Margin-Account-Orders) +- [Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Margin-Account-Orders) +- [Parameters:](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Margin-Account-Orders) +- [Response:](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Margin-Account-Orders) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-All-UM-Conditional-Orders.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-All-UM-Conditional-Orders.md new file mode 100644 index 0000000..6a05824 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-All-UM-Conditional-Orders.md @@ -0,0 +1,90 @@ +--- +title: "Query All Um Conditional Orders | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Conditional-Orders" +fetched_at: "2026-01-27T05:28:21.780Z" +--- +# Query All UM Conditional Orders(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Conditional-Orders) + +Query All UM Conditional Orders + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Conditional-Orders) + +GET `/papi/v1/um/conditional/allOrders` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Conditional-Orders) + +**1** for a single symbol; **40** when the symbol parameter is omitted + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Conditional-Orders) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +NO + +strategyId + +LONG + +NO + +startTime + +LONG + +NO + +endTime + +LONG + +NO + +limit + +INT + +NO + +Default 500; max 1000. + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +> - These orders will not be found: +> - order strategyStatus is `CANCELED` or `EXPIRED`, **AND** +> - order has NO filled trade, **AND** +> - created time + 7 days < current time +> - The query time period must be less than 7 days( default as the recent 7 days). + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Conditional-Orders) + +``` +[ { "newClientStrategyId": "abc", "strategyId":123445, "strategyStatus":"TRIGGERED", "strategyType": "TRAILING_STOP_MARKET", "origQty": "0.40", "price": "0", "reduceOnly": false, "side": "BUY", "positionSide": "SHORT", "stopPrice": "9300", // please ignore when order type is TRAILING_STOP_MARKET "symbol": "BTCUSDT", "orderId":12132343435, //Normal orderID after trigger if appliable, only have when the strategy is triggered "status": "NEW", //Normal order status after trigger if appliable, only have when the strategy is triggered   "bookTime": 1566818724710, // order time "updateTime": 1566818724722, "triggerTime": 1566818724750, "timeInForce": "GTC", "type": "MARKET", //Normal order type after trigger if appliable "activatePrice": "9020", // activation price, only return with TRAILING_STOP_MARKET order "priceRate": "0.3", // callback rate, only return with TRAILING_STOP_MARKET order "selfTradePreventionMode": "NONE", //self trading preventation mode "goodTillDate": 0, "priceMatch": "NONE" }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Conditional-Orders) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Conditional-Orders) +- [Request Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Conditional-Orders) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Conditional-Orders) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Conditional-Orders) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-All-UM-Orders.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-All-UM-Orders.md new file mode 100644 index 0000000..dad9b42 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-All-UM-Orders.md @@ -0,0 +1,92 @@ +--- +title: "Query All Um Orders | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Orders" +fetched_at: "2026-01-27T05:28:21.755Z" +--- +# Query All UM Orders(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Orders) + +Get all account UM 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 + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Orders) + +GET `/papi/v1/um/allOrders` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Orders) + +**5** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Orders) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +orderId + +LONG + +NO + +startTime + +LONG + +NO + +endTime + +LONG + +NO + +limit + +INT + +NO + +Default 500; max 1000. + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +> - 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). + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Orders) + +``` +[ { "avgPrice": "0.00000", "clientOrderId": "abc", "cumQuote": "0", "executedQty": "0", "orderId": 1917641, "origQty": "0.40", "origType": "LIMIT", "price": "0", "reduceOnly": false, "side": "BUY", "positionSide": "SHORT", "status": "NEW", "symbol": "BTCUSDT", "time": 1579276756075, // order time "timeInForce": "GTC", "type": "LIMIT", "updateTime": 1579276756075, // update time "selfTradePreventionMode": "NONE", //self trading preventation mode "goodTillDate": 0, "priceMatch": "NONE" }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Orders) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Orders) +- [Request Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Orders) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Orders) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Orders) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-CM-Conditional-Order-History.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-CM-Conditional-Order-History.md new file mode 100644 index 0000000..23db587 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-CM-Conditional-Order-History.md @@ -0,0 +1,81 @@ +--- +title: "Query Cm Conditional Order History | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-CM-Conditional-Order-History" +fetched_at: "2026-01-27T05:28:21.996Z" +--- +# Query CM Conditional Order History(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-CM-Conditional-Order-History) + +Query CM Conditional Order History + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-CM-Conditional-Order-History) + +GET `/papi/v1/cm/conditional/orderHistory` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-CM-Conditional-Order-History) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-CM-Conditional-Order-History) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +strategyId + +LONG + +NO + +newClientStrategyId + +STRING + +NO + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +  + +**Notes:** + +> - Either `strategyId` or `newClientStrategyId` must be sent. +> - `NEW` orders will not be found. +> - These orders will not be found: +> - order status is `CANCELED` or `EXPIRED`, **AND** +> - order has NO filled trade, **AND** +> - created time + 7 days < current time + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-CM-Conditional-Order-History) + +``` +{ "newClientStrategyId": "abc", "strategyId":123445, "strategyStatus":"TRIGGERED", "strategyType": "TRAILING_STOP_MARKET", "origQty": "0.40", "price": "0", "reduceOnly": false, "side": "BUY", "positionSide": "SHORT", "stopPrice": "9300", // please ignore when order type is TRAILING_STOP_MARKET "symbol": "BTCUSD", "orderId": 12123343534, //Normal orderID after trigger if appliable,only have when the strategy is triggered "status": "NEW", //Normal order status after trigger if appliable, only have when the strategy is triggered    "bookTime": 1566818724710, // order time "updateTime": 1566818724722, "triggerTime": 1566818724750, "timeInForce": "GTC", "type": "MARKET", //Normal order type after trigger if appliable "activatePrice": "9020", // activation price, only return with TRAILING_STOP_MARKET order "priceRate": "0.3" // callback rate, only return with TRAILING_STOP_MARKET order "workingType":"CONTRACT_PRICE", "priceProtect": false, "priceMatch": "NONE" } +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-CM-Conditional-Order-History) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-CM-Conditional-Order-History) +- [Request Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-CM-Conditional-Order-History) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-CM-Conditional-Order-History) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-CM-Conditional-Order-History) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-CM-Modify-Order-History.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-CM-Modify-Order-History.md new file mode 100644 index 0000000..8de74c2 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-CM-Modify-Order-History.md @@ -0,0 +1,96 @@ +--- +title: "Query Cm Modify Order History | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-CM-Modify-Order-History" +fetched_at: "2026-01-27T05:28:21.946Z" +--- +# Query CM Modify Order History(TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-CM-Modify-Order-History) + +Get order modification history + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-CM-Modify-Order-History) + +GET `/papi/v1/cm/orderAmendment` + +## Request Weight(Order)[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-CM-Modify-Order-History) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-CM-Modify-Order-History) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +orderId + +LONG + +NO + +origClientOrderId + +STRING + +NO + +startTime + +LONG + +NO + +Timestamp in ms to get modification history from INCLUSIVE + +endTime + +LONG + +NO + +Timestamp in ms to get modification history until INCLUSIVE + +limit + +INT + +NO + +Default 50, max 100 + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +> - Either `orderId` or `origClientOrderId` must be sent, and the `orderId` will prevail if both are sent. + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-CM-Modify-Order-History) + +``` +[ { "amendmentId": 5363, // Order modification ID "symbol": "BTCUSD_PERP", "pair": "BTCUSD", "orderId": 20072994037, "clientOrderId": "LJ9R4QZDihCaS8UAOOLpgW", "time": 1629184560899, // Order modification time "amendment": { "price": { "before": "30004", "after": "30003.2" }, "origQty": { "before": "1", "after": "1" }, "count": 3 // Order modification count, representing the number of times the order has been modified } }, { "amendmentId": 5361, "symbol": "BTCUSD_PERP", "pair": "BTCUSD", "orderId": 20072994037, "clientOrderId": "LJ9R4QZDihCaS8UAOOLpgW", "time": 1629184533946, "amendment": { "price": { "before": "30005", "after": "30004" }, "origQty": { "before": "1", "after": "1" }, "count": 2 } }, { "amendmentId": 5325, "symbol": "BTCUSD_PERP", "pair": "BTCUSD", "orderId": 20072994037, "clientOrderId": "LJ9R4QZDihCaS8UAOOLpgW", "time": 1629182711787, "amendment": { "price": { "before": "30002", "after": "30005" }, "origQty": { "before": "1", "after": "1" }, "count": 1 } }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-CM-Modify-Order-History) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-CM-Modify-Order-History) +- [Request Weight(Order)](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-CM-Modify-Order-History) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-CM-Modify-Order-History) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-CM-Modify-Order-History) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-CM-Order.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-CM-Order.md new file mode 100644 index 0000000..d7c719f --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-CM-Order.md @@ -0,0 +1,78 @@ +--- +title: "Query Cm Order | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-CM-Order" +fetched_at: "2026-01-27T05:28:22.121Z" +--- +# Query CM Order(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-CM-Order) + +Check an CM order's status. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-CM-Order) + +GET `/papi/v1/cm/order` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-CM-Order) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-CM-Order) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +orderId + +LONG + +NO + +origClientOrderId + +STRING + +NO + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +Notes: + +> - Either `orderId` or `origClientOrderId` must be sent. +> - 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 + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-CM-Order) + +``` +{ "avgPrice": "0.0", "clientOrderId": "abc",    "cumBase": "0", "executedQty": "0", "orderId": 1917641, "origQty": "0.40", "origType": "LIMIT", "price": "0", "reduceOnly": false, "side": "BUY", "status": "NEW", "symbol": "BTCUSD_200925", "pair": "BTCUSD", "positionSide": "SHORT",    "time": 1579276756075, // order time "timeInForce": "GTC", "type": "LIMIT", "updateTime": 1579276756075 // update time} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-CM-Order) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-CM-Order) +- [Request Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-CM-Order) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-CM-Order) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-CM-Order) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-Current-CM-Open-Conditional-Order.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-Current-CM-Open-Conditional-Order.md new file mode 100644 index 0000000..e2aea9e --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-Current-CM-Open-Conditional-Order.md @@ -0,0 +1,75 @@ +--- +title: "Query Current Cm Open Conditional Order | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-CM-Open-Conditional-Order" +fetched_at: "2026-01-27T05:28:22.206Z" +--- +# Query Current CM Open Conditional Order(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-CM-Open-Conditional-Order) + +Query Current CM Open Conditional Order + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-CM-Open-Conditional-Order) + +GET `/papi/v1/cm/conditional/openOrder` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-CM-Open-Conditional-Order) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-CM-Open-Conditional-Order) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +strategyId + +LONG + +NO + +newClientStrategyId + +STRING + +NO + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +Notes: + +> - Either `strategyId` or `newClientStrategyId` must be sent. +> - If the queried order has been triggered, cancelled or expired, the error message "Order does not exist" will be returned. + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-CM-Open-Conditional-Order) + +``` +{ "newClientStrategyId": "abc", "strategyId":123445, "strategyStatus":"NEW", "strategyType": "TRAILING_STOP_MARKET", "origQty": "0.40", "price": "0", "reduceOnly": false, "side": "BUY", "positionSide": "SHORT", "stopPrice": "9300", // please ignore when order type is TRAILING_STOP_MARKET "symbol": "BTCUSD", "bookTime": 1566818724710, // order time "updateTime": 1566818724722, "timeInForce": "GTC", "activatePrice": "9020", // activation price, only return with TRAILING_STOP_MARKET order "priceRate": "0.3" // callback rate, only return with TRAILING_STOP_MARKET order } +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-CM-Open-Conditional-Order) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-CM-Open-Conditional-Order) +- [Request Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-CM-Open-Conditional-Order) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-CM-Open-Conditional-Order) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-CM-Open-Conditional-Order) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-Current-CM-Open-Order.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-Current-CM-Open-Order.md new file mode 100644 index 0000000..1b4ace5 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-Current-CM-Open-Order.md @@ -0,0 +1,75 @@ +--- +title: "Query Current Cm Open Order | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-CM-Open-Order" +fetched_at: "2026-01-27T05:28:22.270Z" +--- +# Query Current CM Open Order (USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-CM-Open-Order) + +Query current CM open order + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-CM-Open-Order) + +GET `/papi/v1/cm/openOrder` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-CM-Open-Order) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-CM-Open-Order) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +orderId + +LONG + +NO + +origClientOrderId + +STRING + +NO + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +Notes: + +> - Either `orderId` or `origClientOrderId` must be sent. +> - If the queried order has been filled or cancelled, the error message "Order does not exist" will be returned. + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-CM-Open-Order) + +``` +[ { "avgPrice": "0.0", "clientOrderId": "abc", "cumBase": "0", "executedQty": "0", "orderId": 1917641, "origQty": "0.40", "origType": "LIMIT", "price": "0", "reduceOnly": false, "side": "BUY", "positionSide": "SHORT", "status": "NEW", "symbol": "BTCUSD_200925", "pair": "BTCUSD" "time": 1579276756075, // order time "timeInForce": "GTC", "type": "LIMIT", "updateTime": 1579276756075 // update time }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-CM-Open-Order) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-CM-Open-Order) +- [Request Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-CM-Open-Order) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-CM-Open-Order) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-CM-Open-Order) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-Current-Margin-Open-Order.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-Current-Margin-Open-Order.md new file mode 100644 index 0000000..28d20cd --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-Current-Margin-Open-Order.md @@ -0,0 +1,65 @@ +--- +title: "Query Current Margin Open Order | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-Margin-Open-Order" +fetched_at: "2026-01-27T05:28:22.268Z" +--- +# Query Current Margin Open Order (USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-Margin-Open-Order) + +Query Current Margin Open Order + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-Margin-Open-Order) + +GET `/papi/v1/margin/openOrders` + +## Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-Margin-Open-Order) + +**5** + +## Parameters:[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-Margin-Open-Order) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +recvWindow + +LONG + +NO + +The value cannot be greater than 60000 + +timestamp + +LONG + +YES + +**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. + +## Response:[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-Margin-Open-Order) + +``` +[ { "clientOrderId": "qhcZw71gAkCCTv0t0k8LUK", "cummulativeQuoteQty": "0.00000000", "executedQty": "0.00000000", "icebergQty": "0.00000000", "isWorking": true, "orderId": 211842552, "origQty": "0.30000000", "price": "0.00475010", "side": "SELL", "status": "NEW", "stopPrice": "0.00000000", "symbol": "BNBBTC", "time": 1562040170089, "timeInForce": "GTC", "type": "LIMIT", "updateTime": 1562040170089, "accountId": 152950866, "selfTradePreventionMode": "EXPIRE_TAKER", "preventedMatchId": null, "preventedQuantity": null }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-Margin-Open-Order) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-Margin-Open-Order) +- [Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-Margin-Open-Order) +- [Parameters:](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-Margin-Open-Order) +- [Response:](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-Margin-Open-Order) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-Current-UM-Open-Conditional-Order.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-Current-UM-Open-Conditional-Order.md new file mode 100644 index 0000000..c218a36 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-Current-UM-Open-Conditional-Order.md @@ -0,0 +1,75 @@ +--- +title: "Query Current Um Open Conditional Order | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-UM-Open-Conditional-Order" +fetched_at: "2026-01-27T05:28:22.406Z" +--- +# Query Current UM Open Conditional Order(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-UM-Open-Conditional-Order) + +Query Current UM Open Conditional Order + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-UM-Open-Conditional-Order) + +GET `/papi/v1/um/conditional/openOrder` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-UM-Open-Conditional-Order) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-UM-Open-Conditional-Order) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +strategyId + +LONG + +NO + +newClientStrategyId + +STRING + +NO + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +Notes: + +> - Either `strategyId` or `newClientStrategyId` must be sent. +> - If the queried order has been `CANCELED`, `TRIGGERED` or `EXPIRED`, the error message "Order does not exist" will be returned. + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-UM-Open-Conditional-Order) + +``` +{ "newClientStrategyId": "abc", "strategyId":123445, "strategyStatus":"NEW", "strategyType": "TRAILING_STOP_MARKET", "origQty": "0.40", "price": "0", "reduceOnly": false, "side": "BUY", "positionSide": "SHORT", "stopPrice": "9300", // please ignore when order type is TRAILING_STOP_MARKET "symbol": "BTCUSDT", "bookTime": 1566818724710, // order time "updateTime": 1566818724722, "timeInForce": "GTC", "activatePrice": "9020", // activation price, only return with TRAILING_STOP_MARKET order "priceRate": "0.3", // callback rate, only return with TRAILING_STOP_MARKET order "selfTradePreventionMode": "NONE", //self trading preventation mode "goodTillDate": 0, "priceMatch": "NONE" } +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-UM-Open-Conditional-Order) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-UM-Open-Conditional-Order) +- [Request Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-UM-Open-Conditional-Order) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-UM-Open-Conditional-Order) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-UM-Open-Conditional-Order) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-Current-UM-Open-Order.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-Current-UM-Open-Order.md new file mode 100644 index 0000000..5d4c435 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-Current-UM-Open-Order.md @@ -0,0 +1,75 @@ +--- +title: "Query Current Um Open Order | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-UM-Open-Order" +fetched_at: "2026-01-27T05:28:22.461Z" +--- +# Query Current UM Open Order(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-UM-Open-Order) + +Query current UM open order + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-UM-Open-Order) + +GET `/papi/v1/um/openOrder` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-UM-Open-Order) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-UM-Open-Order) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +orderId + +LONG + +NO + +origClientOrderId + +STRING + +NO + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +Notes: + +> - Either `orderId` or `origClientOrderId` must be sent. +> - If the queried order has been filled or cancelled, the error message "Order does not exist" will be returned. + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-UM-Open-Order) + +``` +{ "avgPrice": "0.00000", "clientOrderId": "abc", "cumQuote": "0", "executedQty": "0", "orderId": 1917641, "origQty": "0.40", "origType": "LIMIT", "price": "0", "reduceOnly": false, "side": "BUY", "positionSide": "SHORT", "status": "NEW", "symbol": "BTCUSDT", "time": 1579276756075, // order time "timeInForce": "GTC", "type": "LIMIT", "updateTime": 1579276756075, "selfTradePreventionMode": "NONE", "goodTillDate": 0, "priceMatch": "NONE" } +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-UM-Open-Order) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-UM-Open-Order) +- [Request Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-UM-Open-Order) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-UM-Open-Order) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-UM-Open-Order) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-Margin-Account-OCO.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-Margin-Account-OCO.md new file mode 100644 index 0000000..7554913 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-Margin-Account-OCO.md @@ -0,0 +1,70 @@ +--- +title: "Query Margin Account OCO | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Margin-Account-OCO" +fetched_at: "2026-01-27T05:28:22.536Z" +--- +# Query Margin Account's OCO (USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Margin-Account-OCO) + +Retrieves a specific OCO based on provided optional parameters + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Margin-Account-OCO) + +GET `/papi/v1/margin/orderList` + +## Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Margin-Account-OCO) + +**5** + +## Parameters:[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Margin-Account-OCO) + +Name + +Type + +Mandatory + +Description + +orderListId + +LONG + +NO + +Either orderListId or origClientOrderId must be provided + +origClientOrderId + +STRING + +NO + +Either orderListId or origClientOrderId must be provided + +recvWindow + +LONG + +NO + +The value cannot be greater than 60000 + +timestamp + +LONG + +YES + +## Response:[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Margin-Account-OCO) + +``` +{ "orderListId": 27, "contingencyType": "OCO", "listStatusType": "EXEC_STARTED", "listOrderStatus": "EXECUTING", "listClientOrderId": "h2USkA5YQpaXHPIrkd96xE", "transactionTime": 1565245656253, "symbol": "LTCBTC", "orders": [ { "symbol": "LTCBTC", "orderId": 4, "clientOrderId": "qD1gy3kc3Gx0rihm9Y3xwS" }, { "symbol": "LTCBTC", "orderId": 5, "clientOrderId": "ARzZ9I00CPM8i3NhmU9Ega" } ]} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Margin-Account-OCO) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Margin-Account-OCO) +- [Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Margin-Account-OCO) +- [Parameters:](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Margin-Account-OCO) +- [Response:](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Margin-Account-OCO) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-Margin-Account-Open-OCO.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-Margin-Account-Open-OCO.md new file mode 100644 index 0000000..61e0ff6 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-Margin-Account-Open-OCO.md @@ -0,0 +1,54 @@ +--- +title: "Query Margin Account Open OCO | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Margin-Account-Open-OCO" +fetched_at: "2026-01-27T05:28:22.674Z" +--- +# Query Margin Account's Open OCO (USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Margin-Account-Open-OCO) + +Query Margin Account's Open OCO + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Margin-Account-Open-OCO) + +GET `/papi/v1/margin/openOrderList` + +## Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Margin-Account-Open-OCO) + +**5** + +## Parameters:[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Margin-Account-Open-OCO) + +Name + +Type + +Mandatory + +Description + +recvWindow + +LONG + +NO + +The value cannot be greater than 60000 + +timestamp + +LONG + +YES + +## Response:[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Margin-Account-Open-OCO) + +``` +[ { "orderListId": 31, "contingencyType": "OCO", "listStatusType": "EXEC_STARTED", "listOrderStatus": "EXECUTING", "listClientOrderId": "wuB13fmulKj3YjdqWEcsnp", "transactionTime": 1565246080644, "symbol": "LTCBTC", "orders": [ { "symbol": "LTCBTC", "orderId": 4, "clientOrderId": "r3EH2N76dHfLoSZWIUw1bT" }, { "symbol": "LTCBTC", "orderId": 5, "clientOrderId": "Cv1SnyPD3qhqpbjpYEHbd2" } ] }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Margin-Account-Open-OCO) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Margin-Account-Open-OCO) +- [Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Margin-Account-Open-OCO) +- [Parameters:](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Margin-Account-Open-OCO) +- [Response:](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Margin-Account-Open-OCO) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-Margin-Account-Order.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-Margin-Account-Order.md new file mode 100644 index 0000000..f9247de --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-Margin-Account-Order.md @@ -0,0 +1,77 @@ +--- +title: "Query Margin Account Order | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Margin-Account-Order" +fetched_at: "2026-01-27T05:28:22.667Z" +--- +# Query Margin Account Order (USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Margin-Account-Order) + +Query Margin Account Order + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Margin-Account-Order) + +GET `/papi/v1/margin/order` + +## Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Margin-Account-Order) + +**10** + +## Parameters:[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Margin-Account-Order) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +orderId + +LONG + +NO + +origClientOrderId + +STRING + +NO + +recvWindow + +LONG + +NO + +The value cannot be greater than 60000 + +timestamp + +LONG + +YES + +**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. + +## Response:[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Margin-Account-Order) + +``` +{ "clientOrderId": "ZwfQzuDIGpceVhKW5DvCmO", "cummulativeQuoteQty": "0.00000000", "executedQty": "0.00000000", "icebergQty": "0.00000000", "isWorking": true, "orderId": 213205622, "origQty": "0.30000000", "price": "0.00493630", "side": "SELL", "status": "NEW", "stopPrice": "0.00000000", "symbol": "BNBBTC", "time": 1562133008725, "timeInForce": "GTC", "type": "LIMIT", "updateTime": 1562133008725, "accountId": 152950866, "selfTradePreventionMode": "EXPIRE_TAKER", "preventedMatchId": null, "preventedQuantity": null} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Margin-Account-Order) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Margin-Account-Order) +- [Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Margin-Account-Order) +- [Parameters:](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Margin-Account-Order) +- [Response:](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Margin-Account-Order) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-Margin-Account-all-OCO.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-Margin-Account-all-OCO.md new file mode 100644 index 0000000..3810275 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-Margin-Account-all-OCO.md @@ -0,0 +1,82 @@ +--- +title: "Query Margin Account all OCO | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Margin-Account-all-OCO" +fetched_at: "2026-01-27T05:28:22.722Z" +--- +# Query Margin Account's all OCO (USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Margin-Account-all-OCO) + +Query all OCO for a specific margin account based on provided optional parameters + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Margin-Account-all-OCO) + +GET `/papi/v1/margin/allOrderList` + +## Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Margin-Account-all-OCO) + +**100** + +## Parameters:[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Margin-Account-all-OCO) + +Name + +Type + +Mandatory + +Description + +fromId + +LONG + +NO + +If supplied, neither startTime or endTime can be provided + +startTime + +LONG + +NO + +endTime + +LONG + +NO + +limit + +INT + +NO + +Default 500; max 500. + +recvWindow + +LONG + +NO + +The value cannot be greater than 60000 + +timestamp + +LONG + +YES + +## Response:[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Margin-Account-all-OCO) + +``` +[ { "orderListId": 29, "contingencyType": "OCO", "listStatusType": "EXEC_STARTED", "listOrderStatus": "EXECUTING", "listClientOrderId": "amEEAXryFzFwYF1FeRpUoZ", "transactionTime": 1565245913483, "symbol": "LTCBTC", "orders": [ { "symbol": "LTCBTC", "orderId": 4, "clientOrderId": "oD7aesZqjEGlZrbtRpy5zB" }, { "symbol": "LTCBTC", "orderId": 5, "clientOrderId": "Jr1h6xirOxgeJOUuYQS7V3" } ] }, { "orderListId": 28, "contingencyType": "OCO", "listStatusType": "EXEC_STARTED", "listOrderStatus": "EXECUTING", "listClientOrderId": "hG7hFNxJV6cZy3Ze4AUT4d", "transactionTime": 1565245913407, "symbol": "LTCBTC", "orders": [ { "symbol": "LTCBTC", "orderId": 2, "clientOrderId": "j6lFOfbmFMRjTYA7rRJ0LP" }, { "symbol": "LTCBTC", "orderId": 3, "clientOrderId": "z0KCjOdditiLS5ekAFtK81" } ] }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Margin-Account-all-OCO) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Margin-Account-all-OCO) +- [Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Margin-Account-all-OCO) +- [Parameters:](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Margin-Account-all-OCO) +- [Response:](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Margin-Account-all-OCO) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-UM-Conditional-Order-History.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-UM-Conditional-Order-History.md new file mode 100644 index 0000000..929b4e3 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-UM-Conditional-Order-History.md @@ -0,0 +1,79 @@ +--- +title: "Query Um Conditional Order History | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-UM-Conditional-Order-History" +fetched_at: "2026-01-27T05:28:22.790Z" +--- +# Query UM Conditional Order History(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-UM-Conditional-Order-History) + +Query UM Conditional Order History + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-UM-Conditional-Order-History) + +GET `/papi/v1/um/conditional/orderHistory` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-UM-Conditional-Order-History) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-UM-Conditional-Order-History) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +strategyId + +LONG + +NO + +newClientStrategyId + +STRING + +NO + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +**Notes:** + +> - Either `strategyId` or `newClientStrategyId` must be sent. +> - `NEW` orders will not be found. +> - These orders will not be found: +> - order status is `CANCELED` or `EXPIRED`, **AND** +> - order has NO filled trade, **AND** +> - created time + 7 days < current time + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-UM-Conditional-Order-History) + +``` +{ "newClientStrategyId": "abc", "strategyId":123445, "strategyStatus":"TRIGGERED", "strategyType": "TRAILING_STOP_MARKET", "origQty": "0.40", "price": "0", "reduceOnly": false, "side": "BUY", "positionSide": "SHORT", "stopPrice": "9300", // please ignore when order type is TRAILING_STOP_MARKET "symbol": "BTCUSDT", "orderId":12132343435, //Normal orderID after trigger if appliable,only have when the strategy is triggered "status": "NEW", //Normal order status after trigger if appliable, only have when the strategy is triggered   "bookTime": 1566818724710, // order time "updateTime": 1566818724722, "triggerTime": 1566818724750, "timeInForce": "GTC", "type": "MARKET",   //Normal order type after trigger if appliable   "activatePrice": "9020", // activation price, only return with TRAILING_STOP_MARKET order "priceRate": "0.3", // callback rate, only return with TRAILING_STOP_MARKET order "workingType":"CONTRACT_PRICE", "priceProtect": false, "selfTradePreventionMode": "NONE", //self trading preventation mode "goodTillDate": 0 } +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-UM-Conditional-Order-History) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-UM-Conditional-Order-History) +- [Request Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-UM-Conditional-Order-History) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-UM-Conditional-Order-History) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-UM-Conditional-Order-History) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-UM-Modify-Order-History.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-UM-Modify-Order-History.md new file mode 100644 index 0000000..c55f95e --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-UM-Modify-Order-History.md @@ -0,0 +1,96 @@ +--- +title: "Query Um Modify Order History | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-UM-Modify-Order-History" +fetched_at: "2026-01-27T05:28:22.935Z" +--- +# Query UM Modify Order History(TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-UM-Modify-Order-History) + +Get order modification history + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-UM-Modify-Order-History) + +GET `/papi/v1/um/orderAmendment` + +## Request Weight(Order)[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-UM-Modify-Order-History) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-UM-Modify-Order-History) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +orderId + +LONG + +NO + +origClientOrderId + +STRING + +NO + +startTime + +LONG + +NO + +Timestamp in ms to get modification history from INCLUSIVE + +endTime + +LONG + +NO + +Timestamp in ms to get modification history until INCLUSIVE + +limit + +INT + +NO + +Default 500, max 1000 + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +> - Either `orderId` or `origClientOrderId` must be sent, and the `orderId` will prevail if both are sent. + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-UM-Modify-Order-History) + +``` +[ { "amendmentId": 5363, // Order modification ID "symbol": "BTCUSDT", "pair": "BTCUSDT", "orderId": 20072994037, "clientOrderId": "LJ9R4QZDihCaS8UAOOLpgW", "time": 1629184560899, // Order modification time "amendment": { "price": { "before": "30004", "after": "30003.2" }, "origQty": { "before": "1", "after": "1" }, "count": 3 // Order modification count, representing the number of times the order has been modified }, "priceMatch": "NONE" }, { "amendmentId": 5361, "symbol": "BTCUSDT", "pair": "BTCUSDT", "orderId": 20072994037, "clientOrderId": "LJ9R4QZDihCaS8UAOOLpgW", "time": 1629184533946, "amendment": { "price": { "before": "30005", "after": "30004" }, "origQty": { "before": "1", "after": "1" }, "count": 2 }, "priceMatch": "NONE" }, { "amendmentId": 5325, "symbol": "BTCUSDT", "pair": "BTCUSDT", "orderId": 20072994037, "clientOrderId": "LJ9R4QZDihCaS8UAOOLpgW", "time": 1629182711787, "amendment": { "price": { "before": "30002", "after": "30005" }, "origQty": { "before": "1", "after": "1" }, "count": 1 }, "priceMatch": "NONE" }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-UM-Modify-Order-History) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-UM-Modify-Order-History) +- [Request Weight(Order)](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-UM-Modify-Order-History) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-UM-Modify-Order-History) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-UM-Modify-Order-History) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-UM-Order.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-UM-Order.md new file mode 100644 index 0000000..e7d2266 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-UM-Order.md @@ -0,0 +1,78 @@ +--- +title: "Query Um Order | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-UM-Order" +fetched_at: "2026-01-27T05:28:22.941Z" +--- +# Query UM Order (USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-UM-Order) + +Check an UM order's status. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-UM-Order) + +GET `/papi/v1/um/order` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-UM-Order) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-UM-Order) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +orderId + +LONG + +NO + +origClientOrderId + +STRING + +NO + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +Notes: + +> - These orders will not be found: +> - Either `orderId` or `origClientOrderId` must be sent. +> - order status is `CANCELED` or `EXPIRED`, **AND** +> - order has NO filled trade, **AND** +> - created time + 3 days < current time + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-UM-Order) + +``` +{ "avgPrice": "0.00000", "clientOrderId": "abc", "cumQuote": "0", "executedQty": "0", "orderId": 1917641, "origQty": "0.40", "origType": "LIMIT",    "price": "0", "reduceOnly": false, "side": "BUY", "positionSide": "SHORT", "status": "NEW", "symbol": "BTCUSDT", "time": 1579276756075, // order time "timeInForce": "GTC", "type": "LIMIT", "updateTime": 1579276756075, // update time "selfTradePreventionMode": "NONE", "goodTillDate": 0, "priceMatch": "NONE" } +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-UM-Order) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-UM-Order) +- [Request Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-UM-Order) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-UM-Order) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-UM-Order) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-Users-CM-Force-Orders.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-Users-CM-Force-Orders.md new file mode 100644 index 0000000..988216b --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-Users-CM-Force-Orders.md @@ -0,0 +1,91 @@ +--- +title: "Query Users Cm Force Orders | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Users-CM-Force-Orders" +fetched_at: "2026-01-27T05:28:23.121Z" +--- +# Query User's CM Force Orders(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Users-CM-Force-Orders) + +Query User's CM Force Orders + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Users-CM-Force-Orders) + +GET `/papi/v1/cm/forceOrders` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Users-CM-Force-Orders) + +**20** with symbol, **50** without symbol + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Users-CM-Force-Orders) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +NO + +autoCloseType + +ENUM + +NO + +"LIQUIDATION" for liquidation orders, "ADL" for ADL orders. + +startTime + +LONG + +NO + +endTime + +LONG + +NO + +limit + +INT + +NO + +Default 50; max 100. + +recvWindow + +LONG + +NO + +The value cannot be greater than 60000 + +timestamp + +LONG + +YES + +> - 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 + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Users-CM-Force-Orders) + +``` +[ { "orderId": 165123080, "symbol": "BTCUSD_200925", "pair": "BTCUSD", "status": "FILLED", "clientOrderId": "autoclose-1596542005017000006", "price": "11326.9", "avgPrice": "11326.9", "origQty": "1", "executedQty": "1", "cumBase": "0.00882854", "timeInForce": "IOC", "type": "LIMIT", "reduceOnly": false, "side": "SELL", "positionSide": "BOTH", "origType": "LIMIT", "time": 1596542005019, "updateTime": 1596542005050 }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Users-CM-Force-Orders) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Users-CM-Force-Orders) +- [Request Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Users-CM-Force-Orders) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Users-CM-Force-Orders) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Users-CM-Force-Orders) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-Users-Margin-Force-Orders.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-Users-Margin-Force-Orders.md new file mode 100644 index 0000000..13433a9 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-Users-Margin-Force-Orders.md @@ -0,0 +1,82 @@ +--- +title: "Query Users Margin Force Orders | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Users-Margin-Force-Orders" +fetched_at: "2026-01-27T05:28:23.043Z" +--- +# Query User's Margin Force Orders(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Users-Margin-Force-Orders) + +Query user's margin force orders + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Users-Margin-Force-Orders) + +GET `/papi/v1/margin/forceOrders` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Users-Margin-Force-Orders) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Users-Margin-Force-Orders) + +Name + +Type + +Mandatory + +Description + +startTime + +LONG + +NO + +endTime + +LONG + +NO + +current + +LONG + +NO + +Currently querying page. Start from 1. Default:1 + +size + +LONG + +NO + +Default:10 Max:100 + +recvWindow + +LONG + +NO + +The value cannot be greater than 60000 + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Users-Margin-Force-Orders) + +``` +{ "rows": [ { "avgPrice": "0.00388359", "executedQty": "31.39000000", "orderId": 180015097, "price": "0.00388110", "qty": "31.39000000", "side": "SELL", "symbol": "BNBBTC", "timeInForce": "GTC", "updatedTime": 1558941374745 } ], "total": 1} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Users-Margin-Force-Orders) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Users-Margin-Force-Orders) +- [Request Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Users-Margin-Force-Orders) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Users-Margin-Force-Orders) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Users-Margin-Force-Orders) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-Users-UM-Force-Orders.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-Users-UM-Force-Orders.md new file mode 100644 index 0000000..3548574 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Query-Users-UM-Force-Orders.md @@ -0,0 +1,91 @@ +--- +title: "Query Users Um Force Orders | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Users-UM-Force-Orders" +fetched_at: "2026-01-27T05:28:23.185Z" +--- +# Query User's UM Force Orders (USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Users-UM-Force-Orders) + +Query User's UM Force Orders + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Users-UM-Force-Orders) + +GET `/papi/v1/um/forceOrders` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Users-UM-Force-Orders) + +**20** with symbol, **50** without symbol + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Users-UM-Force-Orders) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +NO + +autoCloseType + +ENUM + +NO + +`LIQUIDATION` for liquidation orders, `ADL` for ADL orders. + +startTime + +LONG + +NO + +endTime + +LONG + +NO + +limit + +INT + +NO + +Default 50; max 100. + +recvWindow + +LONG + +NO + +The value cannot be greater than 60000 + +timestamp + +LONG + +YES + +> - 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 + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Users-UM-Force-Orders) + +``` +[ { "orderId": 6071832819, "symbol": "BTCUSDT", "status": "FILLED", "clientOrderId": "autoclose-1596107620040000020", "price": "10871.09", "avgPrice": "10913.21000", "origQty": "0.001", "executedQty": "0.001", "cumQuote": "10.91321", "timeInForce": "IOC", "type": "LIMIT", "reduceOnly": false, "side": "SELL", "positionSide": "BOTH", "origType": "LIMIT", "time": 1596107620044, "updateTime": 1596107620087 }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Users-UM-Force-Orders) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Users-UM-Force-Orders) +- [Request Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Users-UM-Force-Orders) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Users-UM-Force-Orders) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Users-UM-Force-Orders) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Toggle-BNB-Burn-On-UM-Futures-Trade.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Toggle-BNB-Burn-On-UM-Futures-Trade.md new file mode 100644 index 0000000..aaa63c8 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_Toggle-BNB-Burn-On-UM-Futures-Trade.md @@ -0,0 +1,62 @@ +--- +title: "Toggle BNB Burn On Um Futures Trade | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Toggle-BNB-Burn-On-UM-Futures-Trade" +fetched_at: "2026-01-27T05:28:23.194Z" +--- +# Toggle BNB Burn On UM Futures Trade (TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Toggle-BNB-Burn-On-UM-Futures-Trade) + +Change user's BNB Fee Discount for UM Futures (Fee Discount On or Fee Discount Off ) on _**EVERY symbol**_ + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Toggle-BNB-Burn-On-UM-Futures-Trade) + +POST `/papi/v1/um/feeBurn` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Toggle-BNB-Burn-On-UM-Futures-Trade) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Toggle-BNB-Burn-On-UM-Futures-Trade) + +Name + +Type + +Mandatory + +Description + +feeBurn + +STRING + +YES + +"true": Fee Discount On; "false": Fee Discount Off + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +- The BNB would not be collected from UM-PM account to the Portfolio Margin account. + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Toggle-BNB-Burn-On-UM-Futures-Trade) + +``` +{ "code": 200, "msg": "success"} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Toggle-BNB-Burn-On-UM-Futures-Trade) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Toggle-BNB-Burn-On-UM-Futures-Trade) +- [Request Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Toggle-BNB-Burn-On-UM-Futures-Trade) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Toggle-BNB-Burn-On-UM-Futures-Trade) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Toggle-BNB-Burn-On-UM-Futures-Trade) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_UM-Account-Trade-List.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_UM-Account-Trade-List.md new file mode 100644 index 0000000..ca5b8fd --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_UM-Account-Trade-List.md @@ -0,0 +1,90 @@ +--- +title: "Um Account Trade List | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/trade/UM-Account-Trade-List" +fetched_at: "2026-01-27T05:28:23.295Z" +--- +# UM Account Trade List(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/UM-Account-Trade-List) + +Get trades for a specific account and UM symbol. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/UM-Account-Trade-List) + +GET `/papi/v1/um/userTrades` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/UM-Account-Trade-List) + +**5** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/UM-Account-Trade-List) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +startTime + +LONG + +NO + +endTime + +LONG + +NO + +fromId + +LONG + +NO + +Trade id to fetch from. Default gets most recent trades. + +limit + +INT + +NO + +Default 500; max 1000. + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +> - 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`. + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/UM-Account-Trade-List) + +``` +[ { "symbol": "BTCUSDT", "id": 67880589, "orderId": 270093109, "side": "SELL", "price": "28511.00", "qty": "0.010", "realizedPnl": "2.58500000", "quoteQty": "285.11000", "commission": "-0.11404400", "commissionAsset": "USDT", "time": 1680688557875, "buyer": false, "maker": false, "positionSide": "BOTH" }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/UM-Account-Trade-List) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/UM-Account-Trade-List) +- [Request Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/UM-Account-Trade-List) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/UM-Account-Trade-List) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/UM-Account-Trade-List) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_UM-Position-ADL-Quantile-Estimation.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_UM-Position-ADL-Quantile-Estimation.md new file mode 100644 index 0000000..615fbe7 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_trade_UM-Position-ADL-Quantile-Estimation.md @@ -0,0 +1,65 @@ +--- +title: "Um Position Adl Quantile Estimation | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/trade/UM-Position-ADL-Quantile-Estimation" +fetched_at: "2026-01-27T05:28:23.382Z" +--- +# UM Position ADL Quantile Estimation(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/UM-Position-ADL-Quantile-Estimation) + +Query UM 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. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/UM-Position-ADL-Quantile-Estimation) + +GET `/papi/v1/um/adlQuantile` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/UM-Position-ADL-Quantile-Estimation) + +**5** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/UM-Position-ADL-Quantile-Estimation) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +NO + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/UM-Position-ADL-Quantile-Estimation) + +``` +[ { "symbol": "ETHUSDT", "adlQuantile": { // if the positions of the symbol are crossed margined in Hedge Mode, "LONG" and "SHORT" will be returned a same quantile value. "LONG": 3, "SHORT": 3, "BOTH": 0 } }, { "symbol": "BTCUSDT", "adlQuantile": { "LONG": 0, // adl quantile for "LONG" position in hedge mode "SHORT": 0, // adl quantile for "SHORT" position in hedge mode "BOTH": 2 // adl quantile for position in one-way mode } }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/UM-Position-ADL-Quantile-Estimation) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/UM-Position-ADL-Quantile-Estimation) +- [Request Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/UM-Position-ADL-Quantile-Estimation) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/UM-Position-ADL-Quantile-Estimation) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/trade/UM-Position-ADL-Quantile-Estimation) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_user-data-streams.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_user-data-streams.md new file mode 100644 index 0000000..ac0fd08 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_user-data-streams.md @@ -0,0 +1,23 @@ +--- +title: "Connect | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams" +fetched_at: "2026-01-27T05:28:23.574Z" +--- +# User Data Streams Connect + +- The base API endpoint is: **[https://papi.binance.com](https://papi.binance.com/)** + +- A User Data Stream `listenKey` is valid for 60 minutes after creation. + +- Doing a `PUT` on a `listenKey` will extend its validity for 60 minutes, if response `-1125` error "This listenKey does not exist." Please use `POST /papi/v1/listenKey` to recreate `listenKey`. + +- Doing a `DELETE` on a `listenKey` will close the stream and invalidate the `listenKey`. + +- Doing a `POST` on an account with an active `listenKey` will return the currently active `listenKey` and extend its validity for 60 minutes. \*Connection method for Websocket: + + - Base Url: **wss://fstream.binance.com/pm** + - User Data Streams are accessed at **/ws/** + - Example: `wss://fstream.binance.com/pm/ws/pqia91ma19a5s61cv6a81va65sdf19v8a65a1a5s61cv6a81va65sdf19v8a65a1` +- For one connection(one user data), the user data stream payloads can guaranteed to be in order during heavy periods; **Strongly recommend you order your updates using E** + +- A single connection is only valid for 24 hours; expect to be disconnected at the 24 hour mark diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_user-data-streams_Close-User-Data-Stream.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_user-data-streams_Close-User-Data-Stream.md new file mode 100644 index 0000000..35245b6 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_user-data-streams_Close-User-Data-Stream.md @@ -0,0 +1,34 @@ +--- +title: "Close User Data Stream | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Close-User-Data-Stream" +fetched_at: "2026-01-27T05:28:23.590Z" +--- +# Close User Data Stream(USER\_STREAM) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Close-User-Data-Stream) + +Close out a user data stream. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Close-User-Data-Stream) + +DELETE `/papi/v1/listenKey` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Close-User-Data-Stream) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Close-User-Data-Stream) + +**None** + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Close-User-Data-Stream) + +``` +{} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Close-User-Data-Stream) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Close-User-Data-Stream) +- [Request Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Close-User-Data-Stream) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Close-User-Data-Stream) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Close-User-Data-Stream) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_user-data-streams_Event-Conditional-Order-Trade-Update.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_user-data-streams_Event-Conditional-Order-Trade-Update.md new file mode 100644 index 0000000..ea28f26 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_user-data-streams_Event-Conditional-Order-Trade-Update.md @@ -0,0 +1,60 @@ +--- +title: "Event Conditional Order Trade Update | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Event-Conditional-Order-Trade-Update" +fetched_at: "2026-01-27T05:28:23.557Z" +--- +# Event: Conditional Order Trade Update + +## Event Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Event-Conditional-Order-Trade-Update) + +When new order created, order status changed will push such event. event type is `CONDITIONAL_ORDER_TRADE_UPDATE`. + +**Side** + +- BUY +- SELL + +**Conditional Order Type** + +- STOP +- TAKE\_PROFIT +- STOP\_MARKET +- TAKE\_PROFIT\_MARKET +- TRAILING\_STOP\_MARKET + +**Execution Type** + +- NEW +- CANCELED +- CALCULATED - Liquidation Execution +- EXPIRED +- TRADE + +**Order Status** + +- NEW +- CANCELED +- EXPIRED +- TRIGGERED +- FINISHED + +**Time in force** + +- GTC +- IOC +- FOK +- GTX + +## Event Name[​](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Event-Conditional-Order-Trade-Update) + +`CONDITIONAL_ORDER_TRADE_UPDATE` + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Event-Conditional-Order-Trade-Update) + +``` +{ "e": "CONDITIONAL_ORDER_TRADE_UPDATE", // Event Type "T": 1669262908216, // Transaction Time "E": 1669262908218, // Event Time "fs": "UM", // Event business unit "so": { "s": "BTCUSDT", // Symbol "c":"TEST", // Strategy Client Order Id "si": 176057039, // Strategy ID "S":"SELL", // Side "st": "TRAILING_STOP_MARKET", // Strategy Type "f":"GTC", // Time in Force "q":"0.001", //Quantity "p":"0", //Price "sp":"7103.04", // Stop Price. Please ignore with TRAILING_STOP_MARKET order "os":"NEW", // Strategy Order Status "T":1568879465650, // Order book Time "ut": 1669262908216, // Order update Time "R":false, // Is this reduce only "wt":"MARK_PRICE", // Stop Price Working Type "ps":"LONG", // Position Side "cp":false, // If Close-All, pushed with conditional order "AP":"7476.89", // Activation Price, only pushed with TRAILING_STOP_MARKET order "cr":"5.0", // Callback Rate, only puhed with TRAILING_STOP_MARKET order "i":8886774, // Order Id "V":"EXPIRE_TAKER", // STP mode "gtd":0 }} +``` + +- [Event Description](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Event-Conditional-Order-Trade-Update) +- [Event Name](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Event-Conditional-Order-Trade-Update) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Event-Conditional-Order-Trade-Update) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_user-data-streams_Event-Futures-Account-Configuration-Update.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_user-data-streams_Event-Futures-Account-Configuration-Update.md new file mode 100644 index 0000000..d95eae3 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_user-data-streams_Event-Futures-Account-Configuration-Update.md @@ -0,0 +1,24 @@ +--- +title: "Event Futures Account Configuration Update | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Event-Futures-Account-Configuration-Update" +fetched_at: "2026-01-27T05:28:23.635Z" +--- +# Event: Futures Account Configuration Update(Leverage Update) + +## Event Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Event-Futures-Account-Configuration-Update) + +When the account configuration is changed, the event type will be pushed as `ACCOUNT_CONFIG_UPDATE` When the leverage of a trade pair changes, the payload will contain the object `ac` to represent the account configuration of the trade pair, where `s` represents the specific trade pair and `l` represents the leverage. + +## Event Name[​](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Event-Futures-Account-Configuration-Update) + +`ACCOUNT_CONFIG_UPDATE` + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Event-Futures-Account-Configuration-Update) + +``` +{ "e":"ACCOUNT_CONFIG_UPDATE", // Event Type "fs": "UM", // Event business unit "E":1611646737479, // Event Time "T":1611646737476, // Transaction Time "ac":{ "s":"BTCUSD_PERP", // symbol "l":25 // leverage }} +``` + +- [Event Description](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Event-Futures-Account-Configuration-Update) +- [Event Name](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Event-Futures-Account-Configuration-Update) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Event-Futures-Account-Configuration-Update) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_user-data-streams_Event-Futures-Balance-and-Position-Update.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_user-data-streams_Event-Futures-Balance-and-Position-Update.md new file mode 100644 index 0000000..9ede46b --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_user-data-streams_Event-Futures-Balance-and-Position-Update.md @@ -0,0 +1,60 @@ +--- +title: "Event Futures Balance And Position Update | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Event-Futures-Balance-and-Position-Update" +fetched_at: "2026-01-27T05:28:23.859Z" +--- +# Event: Futures Balance and Position Update + +## Event Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Event-Futures-Balance-and-Position-Update) + +Event type is `ACCOUNT_UPDATE`. + +- When balance or position get updated, this event will be pushed. + + - `ACCOUNT_UPDATE` will be pushed only when update happens on user's account, including changes on balances, positions, or margin type. + - Unfilled orders or cancelled orders will not make the event `ACCOUNT_UPDATE` pushed, since there's no change on positions. + - "position" in `ACCOUNT_UPDATE`: Only symbols of changed positions will be pushed. +- When "FUNDING FEE" changes to the user's balance, the event will be pushed with the brief message: + + - When "FUNDING FEE" occurs in a **crossed position**, `ACCOUNT_UPDATE` will be pushed with only the balance `B`(including the "FUNDING FEE" asset only), without any position `P` message. + - When "FUNDING FEE" occurs in an **isolated position**, `ACCOUNT_UPDATE` will be pushed with only the balance `B`(including the "FUNDING FEE" asset only) and the relative position message `P`( including the isolated position on which the "FUNDING FEE" occurs only, without any other position message). +- The field "m" represents the reason type for the event and may shows the following possible types: + + - DEPOSIT + - WITHDRAW + - ORDER + - FUNDING\_FEE + - WITHDRAW\_REJECT + - ADJUSTMENT + - INSURANCE\_CLEAR + - ADMIN\_DEPOSIT + - ADMIN\_WITHDRAW + - MARGIN\_TRANSFER + - MARGIN\_TYPE\_CHANGE + - ASSET\_TRANSFER + - OPTIONS\_PREMIUM\_FEE + - OPTIONS\_SETTLE\_PROFIT + - AUTO\_EXCHANGE + - COIN\_SWAP\_DEPOSIT + - COIN\_SWAP\_WITHDRAW +- The field "bc" represents the balance change except for PnL and commission. + + +## Event Name[​](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Event-Futures-Balance-and-Position-Update) + +`ACCOUNT_UPDATE` + +## Update Speed[​](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Event-Futures-Balance-and-Position-Update) + +50ms + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Event-Futures-Balance-and-Position-Update) + +``` +{ "e": "ACCOUNT_UPDATE", // Event Type "fs": "UM", // Event business unit. 'UM' for USDS-M futures and 'CM' for COIN-M futures "E": 1564745798939, // Event Time "T": 1564745798938 , // Transaction "i":"", // Account Alias, ignore for UM "a": // Update Data { "m":"ORDER", // Event reason type "B":[ // Balances { "a":"USDT", // Asset "wb":"122624.12345678", // Wallet Balance "cw":"100.12345678", // Cross Wallet Balance "bc":"50.12345678" // Balance Change except PnL and Commission }, { "a":"BUSD", "wb":"1.00000000", "cw":"0.00000000", "bc":"-49.12345678" } ], "P":[ { "s":"BTCUSDT", // Symbol "pa":"0", // Position Amount "ep":"0.00000", // Entry Price "cr":"200", // (Pre-fee) Accumulated Realized "up":"0", // Unrealized PnL "ps":"BOTH", // Position Side "bep":"0.00000" // breakeven price }, { "s":"BTCUSDT", "pa":"20", "ep":"6563.66500", "cr":"0", "up":"2850.21200", "ps":"LONG", "bep":"0.00000" // breakeven price } ] }} +``` + +- [Event Description](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Event-Futures-Balance-and-Position-Update) +- [Event Name](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Event-Futures-Balance-and-Position-Update) +- [Update Speed](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Event-Futures-Balance-and-Position-Update) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Event-Futures-Balance-and-Position-Update) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_user-data-streams_Event-Futures-Order-update.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_user-data-streams_Event-Futures-Order-update.md new file mode 100644 index 0000000..5f7f67b --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_user-data-streams_Event-Futures-Order-update.md @@ -0,0 +1,66 @@ +--- +title: "Event Futures Order Update | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Event-Futures-Order-update" +fetched_at: "2026-01-27T05:28:23.846Z" +--- +# Event: Futures Order update + +## Event Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Event-Futures-Order-update) + +When new order created, order status changed will push such event. event type is `ORDER_TRADE_UPDATE`. + +**Side** + +- BUY +- SELL + +**Order Type** + +- MARKET +- LIMIT +- LIQUIDATION + +**Execution Type** + +- NEW +- CANCELED +- CALCULATED - Liquidation Execution +- EXPIRED +- TRADE + +**Order Status** + +- NEW +- PARTIALLY\_FILLED +- FILLED +- CANCELED +- EXPIRED +- EXPIRED\_IN\_MATCH + +**Time in force** + +- GTC +- IOC +- FOK +- GTX + +**Liquidation and ADL:** + +- If user gets liquidated due to insufficient margin balance: + - c shows as "autoclose-XXX",X shows as "NEW" +- If user has enough margin balance but gets ADL: + - c shows as “adl\_autoclose”,X shows as “NEW” + +## Event Name[​](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Event-Futures-Order-update) + +`ORDER_TRADE_UPDATE` + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Event-Futures-Order-update) + +``` +{ "e":"ORDER_TRADE_UPDATE", // Event Type "fs": "UM", // Event business unit. 'UM' for USDS-M futures and 'CM' for COIN-M futures "E":1568879465651, // Event Time "T":1568879465650, // Transaction Time "i":"", // Account Alias,ignore for UM "o":{ "s":"BTCUSDT", // Symbol "c":"TEST", // Client Order Id // special client order id: // starts with "autoclose-": liquidation order // "adl_autoclose": ADL auto close order // "settlement_autoclose-": settlement order for delisting or delivery "S":"SELL", // Side "o":"MARKET", // Order Type "f":"GTC", // Time in Force "q":"0.001", // Original Quantity "p":"0", // Original Price "ap":"0", // Average Price "sp":"7103.04", // Ignore "x":"NEW", // Execution Type "X":"NEW", // Order Status "i":8886774, // Order Id "l":"0", // Order Last Filled Quantity "z":"0", // Order Filled Accumulated Quantity "L":"0", // Last Filled Price "N":"USDT", // Commission Asset, will not push if no commission "n":"0", // Commission, will not push if no commission "T":1568879465650, // Order Trade Time "t":0, // Trade Id "b":"0", // Bids Notional "a":"9.91", // Ask Notional "m":false, // Is this trade the maker side? "R":false, // Is this reduce only "ps":"LONG", // Position Side "rp":"0", // Realized Profit of the trade "st":"C_TAKE_PROFIT", // Strategy type, only pushed with conditional order triggered "si":12893, // StrategyId,only pushed with conditional order triggered "V":"EXPIRE_TAKER", // STP mode "gtd":0 }} +``` + +- [Event Description](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Event-Futures-Order-update) +- [Event Name](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Event-Futures-Order-update) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Event-Futures-Order-update) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_user-data-streams_Event-Liability-Update.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_user-data-streams_Event-Liability-Update.md new file mode 100644 index 0000000..4ae4b48 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_user-data-streams_Event-Liability-Update.md @@ -0,0 +1,24 @@ +--- +title: "Event Liability Update | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Event-Liability-Update" +fetched_at: "2026-01-27T05:28:23.854Z" +--- +# Event: Liability Update + +## Event Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Event-Liability-Update) + +Margin Liability update + +## Event Name[​](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Event-Liability-Update) + +`liabilityChange` + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Event-Liability-Update) + +``` +{ "e": "liabilityChange", //Event Type "E": 1573200697110, //Event Time "a": "BTC", //Asset "t": “BORROW” //Type "T": 1352286576452864727, //Transaction ID "p": "1.03453430", //Principal "i": "0", //Interest "l": "1.03476851" //Total Liability} +``` + +- [Event Description](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Event-Liability-Update) +- [Event Name](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Event-Liability-Update) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Event-Liability-Update) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_user-data-streams_Event-Margin-Account-Update.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_user-data-streams_Event-Margin-Account-Update.md new file mode 100644 index 0000000..cbd1780 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_user-data-streams_Event-Margin-Account-Update.md @@ -0,0 +1,24 @@ +--- +title: "Event Margin Account Update | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Event-Margin-Account-Update" +fetched_at: "2026-01-27T05:28:23.887Z" +--- +# Event: Margin Account Update + +## Event Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Event-Margin-Account-Update) + +`outboundAccountPosition` is sent any time an account balance has changed and contains the assets that were possibly changed by the event that generated the balance change. + +## Event Name[​](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Event-Margin-Account-Update) + +`outboundAccountPosition` + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Event-Margin-Account-Update) + +``` +{ "e": "outboundAccountPosition", //Event type "E": 1564034571105, //Event Time "u": 1564034571073, //Time of last account update "U": 1027053479517, // time updateID "B": [ //Balances Array { "a": "ETH", //Asset "f": "10000.000000", //Free "l": "0.000000" //Locked } ]} +``` + +- [Event Description](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Event-Margin-Account-Update) +- [Event Name](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Event-Margin-Account-Update) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Event-Margin-Account-Update) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_user-data-streams_Event-Margin-Balance-Update.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_user-data-streams_Event-Margin-Balance-Update.md new file mode 100644 index 0000000..2d080b3 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_user-data-streams_Event-Margin-Balance-Update.md @@ -0,0 +1,24 @@ +--- +title: "Event Margin Balance Update | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Event-Margin-Balance-Update" +fetched_at: "2026-01-27T05:28:24.101Z" +--- +# Event: Margin Balance Update + +## Event Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Event-Margin-Balance-Update) + +Margin Balance Update + +## Event Name[​](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Event-Margin-Balance-Update) + +`balanceUpdate` + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Event-Margin-Balance-Update) + +``` +{ "e": "balanceUpdate", //Event Type "E": 1573200697110, //Event Time "a": "BTC", //Asset "d": "100.00000000", //Balance Delta "U": 1027053479517 //event updateId "T": 1573200697068 //Clear Time} +``` + +- [Event Description](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Event-Margin-Balance-Update) +- [Event Name](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Event-Margin-Balance-Update) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Event-Margin-Balance-Update) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_user-data-streams_Event-Margin-Order-Update.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_user-data-streams_Event-Margin-Order-Update.md new file mode 100644 index 0000000..cf4510b --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_user-data-streams_Event-Margin-Order-Update.md @@ -0,0 +1,33 @@ +--- +title: "Event Margin Order Update | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Event-Margin-Order-Update" +fetched_at: "2026-01-27T05:28:24.113Z" +--- +# Event: Margin Order Update + +## Event Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Event-Margin-Order-Update) + +Margin orders are updated with the `executionReport` event. + +**Execution types:** + +- NEW - The order has been accepted into the engine. +- CANCELED - The order has been canceled by the user. +- REJECTED - The order has been rejected and was not processed (This message appears only with Cancel Replace Orders wherein the new order placement is rejected but the request to cancel request succeeds.) +- TRADE - Part of the order or all of the order's quantity has filled. +- EXPIRED - The order was canceled according to the order type's rules (e.g. LIMIT FOK orders with no fill, LIMIT IOC or MARKET orders that partially fill) or by the exchange, (e.g. orders canceled during liquidation, orders canceled during maintenance). +- TRADE\_PREVENTION - The order has expired due to STP trigger. Check the Public API Definitions for more relevant enum definitions. + +## Event Name[​](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Event-Margin-Order-Update) + +`executionReport` + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Event-Margin-Order-Update) + +``` +{ "e": "executionReport", // Event type "E": 1499405658658, // Event time "s": "ETHBTC", // Symbol "c": "mUvoqJxFIILMdfAW5iGSOW", // Client order ID "S": "BUY", // Side "o": "LIMIT", // Order type "f": "GTC", // Time in force "q": "1.00000000", // Order quantity "p": "0.10264410", // Order price "P": "0.00000000", // Stop price "d": 4, // Trailing Delta; This is only visible if the order was a trailing stop order. "F": "0.00000000", // Iceberg quantity; Will not be visible if not iceberg order "g": -1, // OrderListId "C": "", // Original client order ID; Only visible on cancellation of order, the ID of the order being canceled. "x": "NEW", // Current execution type "X": "NEW", // Current order status "r": "NONE", // Order reject reason; Only visible if there is a rejection, will be an error code. "i": 4293153, // Order ID "l": "0.00000000", // Last executed quantity "z": "0.00000000", // Cumulative filled quantity "L": "0.00000000", // Last executed price "n": "0", // Commission amount "N": null, // Commission asset; Only visible when there is a commission amount. "T": 1499405658657, // Transaction time "t": -1, // Trade ID "v": 3, // Prevented Match Id; This is only visible if the order expire due to STP trigger. "I": 8641984, // updateId "w": true, // Is the order on the book? "m": false, // Is this trade the maker side? "O": 1499405658657, // Order creation time "Z": "0.00000000", // Cumulative quote asset transacted quantity "Y": "0.00000000", // Last quote asset transacted quantity (i.e. lastPrice * lastQty) "Q": "0.00000000", // Quote Order Quantity; This is only visible if indicated in the order "D": 1668680518494, // Trailing Time; This is only visible if the trailing stop order has been activated. "j": 1, // Strategy ID; This is only visible if the strategyId parameter was provided upon order placement "J": 1000000, // Strategy Type; This is only visible if the strategyType parameter was provided upon order placement "W": 1499405658657, // Working Time; This is only visible if the order has been placed on the book. "V": "NONE", // selfTradePreventionMode "u":1, // TradeGroupId; This is only visible if the account is part of a trade group and the order expired due to STP trigger. "U":37, // CounterOrderId; This is only visible if the order expired due to STP trigger. "A":"3.000000", // Prevented Quantity; This is only visible if the order expired due to STP trigger. "B":"3.000000" // Last Prevented Quantity; This is only visible if the order expired due to STP trigger.} +``` + +- [Event Description](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Event-Margin-Order-Update) +- [Event Name](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Event-Margin-Order-Update) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Event-Margin-Order-Update) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_user-data-streams_Event-OpenOrderLoss-Update.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_user-data-streams_Event-OpenOrderLoss-Update.md new file mode 100644 index 0000000..665fe0b --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_user-data-streams_Event-OpenOrderLoss-Update.md @@ -0,0 +1,24 @@ +--- +title: "Event Openorderloss Update | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Event-OpenOrderLoss-Update" +fetched_at: "2026-01-27T05:28:24.115Z" +--- +# Event: OpenOrderLoss Update + +## Event Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Event-OpenOrderLoss-Update) + +Cross margin order margin stream + +## Event Name[​](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Event-OpenOrderLoss-Update) + +`openOrderLoss` + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Event-OpenOrderLoss-Update) + +``` +{ "e": "openOrderLoss", //Event Type "E": 1678710578788, // Event Time "O": [ { // Update Data "a": "BUSD", "o": "-0.1232313" // Amount }, { "a": "BNB", "o": "-12.1232313" } ]} +``` + +- [Event Description](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Event-OpenOrderLoss-Update) +- [Event Name](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Event-OpenOrderLoss-Update) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Event-OpenOrderLoss-Update) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_user-data-streams_Event-User-Data-Stream-Expired.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_user-data-streams_Event-User-Data-Stream-Expired.md new file mode 100644 index 0000000..329cdee --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_user-data-streams_Event-User-Data-Stream-Expired.md @@ -0,0 +1,30 @@ +--- +title: "Event User Data Stream Expired | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Event-User-Data-Stream-Expired" +fetched_at: "2026-01-27T05:28:24.141Z" +--- +# Event: User Data Stream Expired + +## Event Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Event-User-Data-Stream-Expired) + +When the `listenKey` used for the user data stream turns expired, this event will be pushed. + +**Notice:** + +- This event is not related to the websocket disconnection. +- This event will be received only when a valid `listenKey` in connection got expired. +- No more user data event will be updated after this event received until a new valid `listenKey` used. + +## Event Name[​](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Event-User-Data-Stream-Expired) + +`listenKeyExpired` + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Event-User-Data-Stream-Expired) + +``` +{ 'e': 'listenKeyExpired', // event type 'E': 1576653824250 // event time} +``` + +- [Event Description](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Event-User-Data-Stream-Expired) +- [Event Name](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Event-User-Data-Stream-Expired) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Event-User-Data-Stream-Expired) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_user-data-streams_Event-riskLevelChange.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_user-data-streams_Event-riskLevelChange.md new file mode 100644 index 0000000..17709e4 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_user-data-streams_Event-riskLevelChange.md @@ -0,0 +1,27 @@ +--- +title: "Event Risklevelchange | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Event-riskLevelChange" +fetched_at: "2026-01-27T05:28:24.355Z" +--- +# Event: riskLevelChange + +## Event Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Event-riskLevelChange) + +- When the user's position risk ratio is too high, this stream will be pushed. +- This message is only used as risk guidance information and is not recommended for investment strategies. +- `RISK_LEVEL_CHANGE`includes following types:`MARGIN_CALL`, `REDUCE_ONLY`, `FORCE_LIQUIDATION` +- In the case of a highly volatile market, there may be the possibility that the user's position has been liquidated at the same time when this stream is pushed out. + +## Event Name[​](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Event-riskLevelChange) + +`RISK_LEVEL_CHANGE` + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Event-riskLevelChange) + +``` +{ "e":"riskLevelChange", // Event Type "E":1587727187525, // Event Time "u":"1.99999999", // uniMMR level "s":"MARGIN_CALL", //MARGIN_CALL, REDUCE_ONLY, FORCE_LIQUIDATION "eq":"30.23416728", // account equity in USD value "ae":"30.23416728", // actual equity without collateral rate in USD value "m":"15.11708371" // total maintenance margin in USD value } +``` + +- [Event Description](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Event-riskLevelChange) +- [Event Name](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Event-riskLevelChange) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Event-riskLevelChange) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_user-data-streams_Keepalive-User-Data-Stream.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_user-data-streams_Keepalive-User-Data-Stream.md new file mode 100644 index 0000000..cb8d20a --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_user-data-streams_Keepalive-User-Data-Stream.md @@ -0,0 +1,34 @@ +--- +title: "Keepalive User Data Stream | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Keepalive-User-Data-Stream" +fetched_at: "2026-01-27T05:28:24.370Z" +--- +# Keepalive User Data Stream (USER\_STREAM) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Keepalive-User-Data-Stream) + +Keepalive a user data stream to prevent a time out. User data streams will close after 60 minutes. It's recommended to send a ping about every 60 minutes. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Keepalive-User-Data-Stream) + +PUT `/papi/v1/listenKey` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Keepalive-User-Data-Stream) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Keepalive-User-Data-Stream) + +**None** + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Keepalive-User-Data-Stream) + +``` +{} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Keepalive-User-Data-Stream) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Keepalive-User-Data-Stream) +- [Request Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Keepalive-User-Data-Stream) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Keepalive-User-Data-Stream) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Keepalive-User-Data-Stream) diff --git a/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_user-data-streams_Start-User-Data-Stream.md b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_user-data-streams_Start-User-Data-Stream.md new file mode 100644 index 0000000..3082dcf --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_portfolio-margin_user-data-streams_Start-User-Data-Stream.md @@ -0,0 +1,34 @@ +--- +title: "Start User Data Stream | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Start-User-Data-Stream" +fetched_at: "2026-01-27T05:28:24.415Z" +--- +# Start User Data Stream(USER\_STREAM) + +## API Description[​](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Start-User-Data-Stream) + +Start a new user data stream. The stream will close after 60 minutes unless a keepalive is sent. If the account has an active `listenKey`, that `listenKey` will be returned and its validity will be extended for 60 minutes. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Start-User-Data-Stream) + +POST `/papi/v1/listenKey` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Start-User-Data-Stream) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Start-User-Data-Stream) + +**None** + +## Response Example[​](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Start-User-Data-Stream) + +``` +{ "listenKey": "pqia91ma19a5s61cv6a81va65sdf19v8a65a1a5s61cv6a81va65sdf19v8a65a1"} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Start-User-Data-Stream) +- [HTTP Request](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Start-User-Data-Stream) +- [Request Weight](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Start-User-Data-Stream) +- [Request Parameters](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Start-User-Data-Stream) +- [Response Example](https://developers.binance.com/docs/derivatives/portfolio-margin/user-data-streams/Start-User-Data-Stream) diff --git a/docs/binance/binance_derivatives/docs_derivatives_quick-start.md b/docs/binance/binance_derivatives/docs_derivatives_quick-start.md new file mode 100644 index 0000000..1283a28 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_quick-start.md @@ -0,0 +1,64 @@ +--- +title: "Quick Start | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/quick-start" +fetched_at: "2026-01-27T05:28:24.271Z" +--- +# Quick Start + +## API Key Setup[​](https://developers.binance.com/docs/derivatives/quick-start) + +- Some endpoints will require an API Key. Please refer to [this page](https://www.binance.com/en/support/faq/how-to-create-api-keys-on-binance-360002502072) regarding API key creation. +- Once API key is created, it is recommended to set IP restrictions on the key for security reasons. +- **Never share your API key/secret key to ANYONE.** + +## API Key Restrictions[​](https://developers.binance.com/docs/derivatives/quick-start) + +- After creating the API key, the default restrictions is `Enable Reading`. +- To **enable withdrawals via the API**, the API key restriction needs to be modified through the Binance UI. + +## Enabling Accounts[​](https://developers.binance.com/docs/derivatives/quick-start) + +### Account[​](https://developers.binance.com/docs/derivatives/quick-start) + +A `SPOT` account is provided by default upon creation of a Binance Account. + +### Futures Account[​](https://developers.binance.com/docs/derivatives/quick-start) + +To enable a `FUTURES` account for Futures Trading, please refer to the [Futures Trading Guide](https://www.binance.com/en/support/faq/a-beginner-s-guide-to-futures-trading-website-360039304272) + +### Futures Testnet[​](https://developers.binance.com/docs/derivatives/quick-start) + +Users can use the Futures Testnet to practice `FUTURES` trading. + +Currently, this is only available via the API. + +Please refer to the [Futures Testnet page](https://testnet.binancefuture.com/en/futures/BTCUSDT) for more information and how to set up the Testnet API key. + +### Option Account[​](https://developers.binance.com/docs/derivatives/quick-start) + +To enable a `OPTION` account for Option Trading, please refer to the [Option Trading Guide](https://www.binance.com/en/support/faq/introduction-to-binance-options-374321c9317c473480243365298b8706) + +## API Library[​](https://developers.binance.com/docs/derivatives/quick-start) + +### Python connector[​](https://developers.binance.com/docs/derivatives/quick-start) + +This is a lightweight library that works as a connector to Binance public API, written in Python. + +[https://github.com/binance/binance-connector-python](https://github.com/binance/binance-connector-python) + +### Java connector[​](https://developers.binance.com/docs/derivatives/quick-start) + +This is a lightweight library that works as a connector to Binance public API, written for Java users. + +[https://github.com/binance/binance-connector-java](https://github.com/binance/binance-connector-java) + +- [API Key Setup](https://developers.binance.com/docs/derivatives/quick-start) +- [API Key Restrictions](https://developers.binance.com/docs/derivatives/quick-start) +- [Enabling Accounts](https://developers.binance.com/docs/derivatives/quick-start) + - [Account](https://developers.binance.com/docs/derivatives/quick-start) + - [Futures Account](https://developers.binance.com/docs/derivatives/quick-start) + - [Futures Testnet](https://developers.binance.com/docs/derivatives/quick-start) + - [Option Account](https://developers.binance.com/docs/derivatives/quick-start) +- [API Library](https://developers.binance.com/docs/derivatives/quick-start) + - [Python connector](https://developers.binance.com/docs/derivatives/quick-start) + - [Java connector](https://developers.binance.com/docs/derivatives/quick-start) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api.md new file mode 100644 index 0000000..04032fd --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api.md @@ -0,0 +1,12 @@ +--- +title: "New Future Account Transfer | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api" +fetched_at: "2026-01-27T05:28:24.653Z" +--- +!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){try{return new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}}()||function(){try{return window.localStorage.getItem("theme")}catch(t){}}();t(null!==e?e:"light")}(),function(){try{const n=new URLSearchParams(window.location.search).entries();for(var\[t,e\]of n)if(t.startsWith("docusaurus-data-")){var a=t.replace("docusaurus-data-","data-");document.documentElement.setAttribute(a,e)}}catch(t){}}() + +[Skip to main content](https://developers.binance.com/docs/derivatives/usds-margined-futures/general-info) + +# New Future Account Transfer + +Please find details from [here](https://developers.binance.com/docs/wallet/asset/user-universal-transfer). diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_Account-Config.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_Account-Config.md new file mode 100644 index 0000000..81f132a --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_Account-Config.md @@ -0,0 +1,52 @@ +--- +title: "Query Account Configuration | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Config" +fetched_at: "2026-01-27T05:28:24.610Z" +--- +# Futures Account Configuration(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Config) + +Query account configuration + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Config) + +GET `/fapi/v1/accountConfig` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Config) + +**5** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Config) + +Name + +Type + +Mandatory + +Description + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Config) + +``` +{ "feeTier": 0, // account commission tier "canTrade": true, // if can trade "canDeposit": true, // if can transfer in asset "canWithdraw": true, // if can transfer out asset "dualSidePosition": true, "updateTime": 0, // reserved property, please ignore "multiAssetsMargin": false, "tradeGroupId": -1} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Config) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Config) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Config) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Config) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Config) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_Account-Information-V2.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_Account-Information-V2.md new file mode 100644 index 0000000..cf9de1d --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_Account-Information-V2.md @@ -0,0 +1,60 @@ +--- +title: "Account Information | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Information-V2" +fetched_at: "2026-01-27T05:28:24.650Z" +--- +# Account Information V2(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Information-V2) + +Get current account information. User in single-asset/ multi-assets mode will see different value, see comments in response section for detail. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Information-V2) + +GET `/fapi/v2/account` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Information-V2) + +**5** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Information-V2) + +Name + +Type + +Mandatory + +Description + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Information-V2) + +> single-asset mode + +``` +{ "feeTier": 0, // account commission tier "feeBurn": true, // "true": Fee Discount On; "false": Fee Discount Off "canTrade": true, // if can trade "canDeposit": true, // if can transfer in asset "canWithdraw": true, // if can transfer out asset "updateTime": 0, // reserved property, please ignore "multiAssetsMargin": false, "tradeGroupId": -1, "totalInitialMargin": "0.00000000", // total initial margin required with current mark price (useless with isolated positions), only for USDT asset "totalMaintMargin": "0.00000000", // total maintenance margin required, only for USDT asset "totalWalletBalance": "23.72469206", // total wallet balance, only for USDT asset "totalUnrealizedProfit": "0.00000000", // total unrealized profit, only for USDT asset "totalMarginBalance": "23.72469206", // total margin balance, only for USDT asset "totalPositionInitialMargin": "0.00000000", // initial margin required for positions with current mark price, only for USDT asset "totalOpenOrderInitialMargin": "0.00000000", // initial margin required for open orders with current mark price, only for USDT asset "totalCrossWalletBalance": "23.72469206", // crossed wallet balance, only for USDT asset "totalCrossUnPnl": "0.00000000", // unrealized profit of crossed positions, only for USDT asset "availableBalance": "23.72469206", // available balance, only for USDT asset "maxWithdrawAmount": "23.72469206" // maximum amount for transfer out, only for USDT asset "assets": [ { "asset": "USDT", // asset name "walletBalance": "23.72469206", // wallet balance "unrealizedProfit": "0.00000000", // unrealized profit "marginBalance": "23.72469206", // margin balance "maintMargin": "0.00000000", // maintenance margin required "initialMargin": "0.00000000", // total initial margin required with current mark price "positionInitialMargin": "0.00000000", //initial margin required for positions with current mark price "openOrderInitialMargin": "0.00000000", // initial margin required for open orders with current mark price "crossWalletBalance": "23.72469206", // crossed wallet balance "crossUnPnl": "0.00000000" // unrealized profit of crossed positions "availableBalance": "23.72469206", // available balance "maxWithdrawAmount": "23.72469206", // maximum amount for transfer out "marginAvailable": true, // whether the asset can be used as margin in Multi-Assets mode "updateTime": 1625474304765 // last update time }, { "asset": "BUSD", // asset name "walletBalance": "103.12345678", // wallet balance "unrealizedProfit": "0.00000000", // unrealized profit "marginBalance": "103.12345678", // margin balance "maintMargin": "0.00000000", // maintenance margin required "initialMargin": "0.00000000", // total initial margin required with current mark price "positionInitialMargin": "0.00000000", //initial margin required for positions with current mark price "openOrderInitialMargin": "0.00000000", // initial margin required for open orders with current mark price "crossWalletBalance": "103.12345678", // crossed wallet balance "crossUnPnl": "0.00000000" // unrealized profit of crossed positions "availableBalance": "103.12345678", // available balance "maxWithdrawAmount": "103.12345678", // maximum amount for transfer out "marginAvailable": true, // whether the asset can be used as margin in Multi-Assets mode "updateTime": 1625474304765 // last update time } ], "positions": [ // positions of all symbols in the market are returned // only "BOTH" positions will be returned with One-way mode // only "LONG" and "SHORT" positions will be returned with Hedge mode { "symbol": "BTCUSDT", // symbol name "initialMargin": "0", // initial margin required with current mark price "maintMargin": "0", // maintenance margin required "unrealizedProfit": "0.00000000", // unrealized profit "positionInitialMargin": "0", // initial margin required for positions with current mark price "openOrderInitialMargin": "0", // initial margin required for open orders with current mark price "leverage": "100", // current initial leverage "isolated": true, // if the position is isolated "entryPrice": "0.00000", // average entry price "maxNotional": "250000", // maximum available notional with current leverage "bidNotional": "0", // bids notional, ignore "askNotional": "0", // ask notional, ignore "positionSide": "BOTH", // position side "positionAmt": "0", // position amount "updateTime": 0 // last update time } ]} +``` + +> OR multi-assets mode + +``` +{ "feeTier": 0, // account commission tier "feeBurn": true, // "true": Fee Discount On; "false": Fee Discount Off "canTrade": true, // if can trade "canTrade": true, // if can trade "canDeposit": true, // if can transfer in asset "canWithdraw": true, // if can transfer out asset "updateTime": 0, // reserved property, please ignore "multiAssetsMargin": true, "tradeGroupId": -1, "totalInitialMargin": "0.00000000", // the sum of USD value of all cross positions/open order initial margin "totalMaintMargin": "0.00000000", // the sum of USD value of all cross positions maintenance margin "totalWalletBalance": "126.72469206", // total wallet balance in USD "totalUnrealizedProfit": "0.00000000", // total unrealized profit in USD "totalMarginBalance": "126.72469206", // total margin balance in USD "totalPositionInitialMargin": "0.00000000", // the sum of USD value of all cross positions initial margin "totalOpenOrderInitialMargin": "0.00000000", // initial margin required for open orders with current mark price in USD "totalCrossWalletBalance": "126.72469206", // crossed wallet balance in USD "totalCrossUnPnl": "0.00000000", // unrealized profit of crossed positions in USD "availableBalance": "126.72469206", // available balance in USD "maxWithdrawAmount": "126.72469206" // maximum virtual amount for transfer out in USD "assets": [ { "asset": "USDT", // asset name "walletBalance": "23.72469206", // wallet balance "unrealizedProfit": "0.00000000", // unrealized profit "marginBalance": "23.72469206", // margin balance "maintMargin": "0.00000000", // maintenance margin required "initialMargin": "0.00000000", // total initial margin required with current mark price "positionInitialMargin": "0.00000000", //initial margin required for positions with current mark price "openOrderInitialMargin": "0.00000000", // initial margin required for open orders with current mark price "crossWalletBalance": "23.72469206", // crossed wallet balance "crossUnPnl": "0.00000000" // unrealized profit of crossed positions "availableBalance": "126.72469206", // available balance "maxWithdrawAmount": "23.72469206", // maximum amount for transfer out "marginAvailable": true, // whether the asset can be used as margin in Multi-Assets mode "updateTime": 1625474304765 // last update time }, { "asset": "BUSD", // asset name "walletBalance": "103.12345678", // wallet balance "unrealizedProfit": "0.00000000", // unrealized profit "marginBalance": "103.12345678", // margin balance "maintMargin": "0.00000000", // maintenance margin required "initialMargin": "0.00000000", // total initial margin required with current mark price "positionInitialMargin": "0.00000000", //initial margin required for positions with current mark price "openOrderInitialMargin": "0.00000000", // initial margin required for open orders with current mark price "crossWalletBalance": "103.12345678", // crossed wallet balance "crossUnPnl": "0.00000000" // unrealized profit of crossed positions "availableBalance": "126.72469206", // available balance "maxWithdrawAmount": "103.12345678", // maximum amount for transfer out "marginAvailable": true, // whether the asset can be used as margin in Multi-Assets mode "updateTime": 1625474304765 // last update time } ], "positions": [ // positions of all symbols in the market are returned // only "BOTH" positions will be returned with One-way mode // only "LONG" and "SHORT" positions will be returned with Hedge mode { "symbol": "BTCUSDT", // symbol name "initialMargin": "0", // initial margin required with current mark price "maintMargin": "0", // maintenance margin required "unrealizedProfit": "0.00000000", // unrealized profit "positionInitialMargin": "0", // initial margin required for positions with current mark price "openOrderInitialMargin": "0", // initial margin required for open orders with current mark price "leverage": "100", // current initial leverage "isolated": true, // if the position is isolated "entryPrice": "0.00000", // average entry price "maxNotional": "250000", // maximum available notional with current leverage "bidNotional": "0", // bids notional, ignore "askNotional": "0", // ask notional, ignore "positionSide": "BOTH", // position side "positionAmt": "0", // position amount "updateTime": 0 // last update time } ]} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Information-V2) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Information-V2) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Information-V2) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Information-V2) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Information-V2) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_Account-Information-V3.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_Account-Information-V3.md new file mode 100644 index 0000000..55bd37a --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_Account-Information-V3.md @@ -0,0 +1,60 @@ +--- +title: "Account Information V3 | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Information-V3" +fetched_at: "2026-01-27T05:28:24.690Z" +--- +# Account Information V3(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Information-V3) + +Get current account information. User in single-asset/ multi-assets mode will see different value, see comments in response section for detail. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Information-V3) + +GET `/fapi/v3/account` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Information-V3) + +**5** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Information-V3) + +Name + +Type + +Mandatory + +Description + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Information-V3) + +> single-asset mode + +``` +{ "totalInitialMargin": "0.00000000", // total initial margin required with current mark price (useless with isolated positions), only for USDT asset "totalMaintMargin": "0.00000000", // total maintenance margin required, only for USDT asset "totalWalletBalance": "103.12345678", // total wallet balance, only for USDT asset "totalUnrealizedProfit": "0.00000000", // total unrealized profit, only for USDT asset "totalMarginBalance": "103.12345678", // total margin balance, only for USDT asset "totalPositionInitialMargin": "0.00000000", // initial margin required for positions with current mark price, only for USDT asset "totalOpenOrderInitialMargin": "0.00000000", // initial margin required for open orders with current mark price, only for USDT asset "totalCrossWalletBalance": "103.12345678", // crossed wallet balance, only for USDT asset "totalCrossUnPnl": "0.00000000", // unrealized profit of crossed positions, only for USDT asset "availableBalance": "103.12345678", // available balance, only for USDT asset "maxWithdrawAmount": "103.12345678" // maximum amount for transfer out, only for USDT asset "assets": [ // For assets that are quote assets, USDT/USDC/BTC { "asset": "USDT", // asset name "walletBalance": "23.72469206", // wallet balance "unrealizedProfit": "0.00000000", // unrealized profit "marginBalance": "23.72469206", // margin balance "maintMargin": "0.00000000", // maintenance margin required "initialMargin": "0.00000000", // total initial margin required with current mark price "positionInitialMargin": "0.00000000", // initial margin required for positions with current mark price "openOrderInitialMargin": "0.00000000", // initial margin required for open orders with current mark price "crossWalletBalance": "23.72469206", // crossed wallet balance "crossUnPnl": "0.00000000" // unrealized profit of crossed positions "availableBalance": "23.72469206", // available balance "maxWithdrawAmount": "23.72469206", // maximum amount for transfer out "updateTime": 1625474304765 // last update time },    { "asset": "USDC", // asset name "walletBalance": "103.12345678", // wallet balance "unrealizedProfit": "0.00000000", // unrealized profit "marginBalance": "103.12345678", // margin balance "maintMargin": "0.00000000", // maintenance margin required "initialMargin": "0.00000000", // total initial margin required with current mark price "positionInitialMargin": "0.00000000", // initial margin required for positions with current mark price "openOrderInitialMargin": "0.00000000", // initial margin required for open orders with current mark price "crossWalletBalance": "103.12345678", // crossed wallet balance "crossUnPnl": "0.00000000" // unrealized profit of crossed positions "availableBalance": "126.72469206", // available balance "maxWithdrawAmount": "103.12345678", // maximum amount for transfer out "updateTime": 1625474304765 // last update time },       ], "positions": [ // positions of all symbols user had position/ open orders are returned // only "BOTH" positions will be returned with One-way mode // only "LONG" and "SHORT" positions will be returned with Hedge mode { "symbol": "BTCUSDT", "positionSide": "BOTH", // position side "positionAmt": "1.000", "unrealizedProfit": "0.00000000", // unrealized profit     "isolatedMargin": "0.00000000", "notional": "0", "isolatedWallet": "0", "initialMargin": "0", // initial margin required with current mark price "maintMargin": "0", // maintenance margin required "updateTime": 0 } ]} +``` + +> OR multi-assets mode + +``` +{ "totalInitialMargin": "0.00000000", // the sum of USD value of all cross positions/open order initial margin "totalMaintMargin": "0.00000000", // the sum of USD value of all cross positions maintenance margin "totalWalletBalance": "126.72469206", // total wallet balance in USD "totalUnrealizedProfit": "0.00000000", // total unrealized profit in USD "totalMarginBalance": "126.72469206", // total margin balance in USD "totalPositionInitialMargin": "0.00000000", // the sum of USD value of all cross positions initial margin "totalOpenOrderInitialMargin": "0.00000000", // initial margin required for open orders with current mark price in USD "totalCrossWalletBalance": "126.72469206", // crossed wallet balance in USD "totalCrossUnPnl": "0.00000000", // unrealized profit of crossed positions in USD "availableBalance": "126.72469206", // available balance in USD "maxWithdrawAmount": "126.72469206" // maximum virtual amount for transfer out in USD "assets": [ { "asset": "USDT", // asset name "walletBalance": "23.72469206", // wallet balance "unrealizedProfit": "0.00000000", // unrealized profit "marginBalance": "23.72469206", // margin balance "maintMargin": "0.00000000", // maintenance margin required "initialMargin": "0.00000000", // total initial margin required with current mark price "positionInitialMargin": "0.00000000", //initial margin required for positions with current mark price "openOrderInitialMargin": "0.00000000", // initial margin required for open orders with current mark price "crossWalletBalance": "23.72469206", // crossed wallet balance "crossUnPnl": "0.00000000" // unrealized profit of crossed positions "availableBalance": "126.72469206", // available balance "maxWithdrawAmount": "23.72469206", // maximum amount for transfer out "updateTime": 1625474304765 // last update time }, { "asset": "BUSD", // asset name "walletBalance": "103.12345678", // wallet balance "unrealizedProfit": "0.00000000", // unrealized profit "marginBalance": "103.12345678", // margin balance "maintMargin": "0.00000000", // maintenance margin required "initialMargin": "0.00000000", // total initial margin required with current mark price "positionInitialMargin": "0.00000000", //initial margin required for positions with current mark price "openOrderInitialMargin": "0.00000000", // initial margin required for open orders with current mark price "crossWalletBalance": "103.12345678", // crossed wallet balance "crossUnPnl": "0.00000000" // unrealized profit of crossed positions "availableBalance": "126.72469206", // available balance "maxWithdrawAmount": "103.12345678", // maximum amount for transfer out "updateTime": 1625474304765 // last update time } ], "positions": [ // positions of all symbols user had position are returned                    // only "BOTH" positions will be returned with One-way mode // only "LONG" and "SHORT" positions will be returned with Hedge mode { "symbol": "BTCUSDT", "positionSide": "BOTH", // position side "positionAmt": "1.000", "unrealizedProfit": "0.00000000", // unrealized profit     "isolatedMargin": "0.00000000", "notional": "0", "isolatedWallet": "0", "initialMargin": "0", // initial margin required with current mark price "maintMargin": "0", // maintenance margin required "updateTime": 0 } ] } +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Information-V3) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Information-V3) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Information-V3) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Information-V3) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Information-V3) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_Futures-Account-Balance-V2.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_Futures-Account-Balance-V2.md new file mode 100644 index 0000000..828159d --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_Futures-Account-Balance-V2.md @@ -0,0 +1,52 @@ +--- +title: "Futures Account Balance | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Futures-Account-Balance-V2" +fetched_at: "2026-01-27T05:28:24.994Z" +--- +# Futures Account Balance V2 (USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Futures-Account-Balance-V2) + +Query account balance info + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Futures-Account-Balance-V2) + +GET `/fapi/v2/balance` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Futures-Account-Balance-V2) + +**5** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Futures-Account-Balance-V2) + +Name + +Type + +Mandatory + +Description + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Futures-Account-Balance-V2) + +``` +[ { "accountAlias": "SgsR", // unique account code "asset": "USDT", // asset name "balance": "122607.35137903", // wallet balance "crossWalletBalance": "23.72469206", // crossed wallet balance "crossUnPnl": "0.00000000", // unrealized profit of crossed positions "availableBalance": "23.72469206", // available balance "maxWithdrawAmount": "23.72469206", // maximum amount for transfer out "marginAvailable": true, // whether the asset can be used as margin in Multi-Assets mode "updateTime": 1617939110373 }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Futures-Account-Balance-V2) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Futures-Account-Balance-V2) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Futures-Account-Balance-V2) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Futures-Account-Balance-V2) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Futures-Account-Balance-V2) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_Futures-Account-Balance-V3.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_Futures-Account-Balance-V3.md new file mode 100644 index 0000000..d1bb0ed --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_Futures-Account-Balance-V3.md @@ -0,0 +1,52 @@ +--- +title: "Futures Account Balance V3 | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Futures-Account-Balance-V3" +fetched_at: "2026-01-27T05:28:24.939Z" +--- +# Futures Account Balance V3 (USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Futures-Account-Balance-V3) + +Query account balance info + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Futures-Account-Balance-V3) + +GET `/fapi/v3/balance` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Futures-Account-Balance-V3) + +**5** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Futures-Account-Balance-V3) + +Name + +Type + +Mandatory + +Description + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Futures-Account-Balance-V3) + +``` +[ { "accountAlias": "SgsR", // unique account code "asset": "USDT", // asset name "balance": "122607.35137903", // wallet balance "crossWalletBalance": "23.72469206", // crossed wallet balance "crossUnPnl": "0.00000000", // unrealized profit of crossed positions "availableBalance": "23.72469206", // available balance "maxWithdrawAmount": "23.72469206", // maximum amount for transfer out "marginAvailable": true, // whether the asset can be used as margin in Multi-Assets mode "updateTime": 1617939110373 }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Futures-Account-Balance-V3) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Futures-Account-Balance-V3) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Futures-Account-Balance-V3) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Futures-Account-Balance-V3) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Futures-Account-Balance-V3) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_Futures-Trading-Quantitative-Rules-Indicators.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_Futures-Trading-Quantitative-Rules-Indicators.md new file mode 100644 index 0000000..25c5368 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_Futures-Trading-Quantitative-Rules-Indicators.md @@ -0,0 +1,67 @@ +--- +title: "Futures Trading Quantitative Rules Indicators | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Futures-Trading-Quantitative-Rules-Indicators" +fetched_at: "2026-01-27T05:28:24.910Z" +--- +# Futures Trading Quantitative Rules Indicators (USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Futures-Trading-Quantitative-Rules-Indicators) + +Futures trading quantitative rules indicators, for more information on this, please refer to the [Futures Trading Quantitative Rules](https://www.binance.com/en/support/faq/4f462ebe6ff445d4a170be7d9e897272) + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Futures-Trading-Quantitative-Rules-Indicators) + +GET `/fapi/v1/apiTradingStatus` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Futures-Trading-Quantitative-Rules-Indicators) + +- **1** for a single symbol +- **10** when the symbol parameter is omitted + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Futures-Trading-Quantitative-Rules-Indicators) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +NO + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Futures-Trading-Quantitative-Rules-Indicators) + +> **Response:** + +``` +{ "indicators": { // indicator: quantitative rules indicators, value: user's indicators value, triggerValue: trigger indicator value threshold of quantitative rules. "BTCUSDT": [ { "isLocked": true, "plannedRecoverTime": 1545741270000, "indicator": "UFR", // Unfilled Ratio (UFR) "value": 0.05, // Current value "triggerValue": 0.995 // Trigger value }, { "isLocked": true, "plannedRecoverTime": 1545741270000, "indicator": "IFER", // IOC/FOK Expiration Ratio (IFER) "value": 0.99, // Current value "triggerValue": 0.99 // Trigger value }, { "isLocked": true, "plannedRecoverTime": 1545741270000, "indicator": "GCR", // GTC Cancellation Ratio (GCR) "value": 0.99, // Current value "triggerValue": 0.99 // Trigger value }, { "isLocked": true, "plannedRecoverTime": 1545741270000, "indicator": "DR", // Dust Ratio (DR) "value": 0.99, // Current value "triggerValue": 0.99 // Trigger value } ], "ETHUSDT": [ { "isLocked": true, "plannedRecoverTime": 1545741270000, "indicator": "UFR", "value": 0.05, "triggerValue": 0.995 }, { "isLocked": true, "plannedRecoverTime": 1545741270000, "indicator": "IFER", "value": 0.99, "triggerValue": 0.99 }, { "isLocked": true, "plannedRecoverTime": 1545741270000, "indicator": "GCR", "value": 0.99, "triggerValue": 0.99 } { "isLocked": true, "plannedRecoverTime": 1545741270000, "indicator": "DR", "value": 0.99, "triggerValue": 0.99 } ] }, "updateTime": 1545741270000} +``` + +> Or (account violation triggered) + +``` +{ "indicators":{ "ACCOUNT":[ { "indicator":"TMV", // Too many violations under multiple symbols trigger account violation "value":10, "triggerValue":1, "plannedRecoverTime":1644919865000, "isLocked":true } ] }, "updateTime":1644913304748} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Futures-Trading-Quantitative-Rules-Indicators) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Futures-Trading-Quantitative-Rules-Indicators) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Futures-Trading-Quantitative-Rules-Indicators) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Futures-Trading-Quantitative-Rules-Indicators) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Futures-Trading-Quantitative-Rules-Indicators) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_Get-BNB-Burn-Status.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_Get-BNB-Burn-Status.md new file mode 100644 index 0000000..703674e --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_Get-BNB-Burn-Status.md @@ -0,0 +1,52 @@ +--- +title: "Get BNB Burn Status | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-BNB-Burn-Status" +fetched_at: "2026-01-27T05:28:25.144Z" +--- +# Get BNB Burn Status (USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-BNB-Burn-Status) + +Get user's BNB Fee Discount (Fee Discount On or Fee Discount Off ) + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-BNB-Burn-Status) + +GET `/fapi/v1/feeBurn` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-BNB-Burn-Status) + +**30** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-BNB-Burn-Status) + +Name + +Type + +Mandatory + +Description + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-BNB-Burn-Status) + +``` +{ "feeBurn": true // "true": Fee Discount On; "false": Fee Discount Off} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-BNB-Burn-Status) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-BNB-Burn-Status) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-BNB-Burn-Status) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-BNB-Burn-Status) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-BNB-Burn-Status) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_Get-Current-Multi-Assets-Mode.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_Get-Current-Multi-Assets-Mode.md new file mode 100644 index 0000000..066269b --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_Get-Current-Multi-Assets-Mode.md @@ -0,0 +1,52 @@ +--- +title: "Get Current Multi Assets Mode | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Current-Multi-Assets-Mode" +fetched_at: "2026-01-27T05:28:25.156Z" +--- +# Get Current Multi-Assets Mode (USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Current-Multi-Assets-Mode) + +Get user's Multi-Assets mode (Multi-Assets Mode or Single-Asset Mode) on _**Every symbol**_ + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Current-Multi-Assets-Mode) + +GET `/fapi/v1/multiAssetsMargin` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Current-Multi-Assets-Mode) + +**30** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Current-Multi-Assets-Mode) + +Name + +Type + +Mandatory + +Description + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Current-Multi-Assets-Mode) + +``` +{ "multiAssetsMargin": true // "true": Multi-Assets Mode; "false": Single-Asset Mode} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Current-Multi-Assets-Mode) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Current-Multi-Assets-Mode) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Current-Multi-Assets-Mode) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Current-Multi-Assets-Mode) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Current-Multi-Assets-Mode) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_Get-Current-Position-Mode.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_Get-Current-Position-Mode.md new file mode 100644 index 0000000..47f0138 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_Get-Current-Position-Mode.md @@ -0,0 +1,52 @@ +--- +title: "Get Current Position Mode | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Current-Position-Mode" +fetched_at: "2026-01-27T05:28:25.190Z" +--- +# Get Current Position Mode(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Current-Position-Mode) + +Get user's position mode (Hedge Mode or One-way Mode ) on _**EVERY symbol**_ + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Current-Position-Mode) + +GET `/fapi/v1/positionSide/dual` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Current-Position-Mode) + +30 + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Current-Position-Mode) + +Name + +Type + +Mandatory + +Description + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Current-Position-Mode) + +``` +{ "dualSidePosition": true // "true": Hedge Mode; "false": One-way Mode} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Current-Position-Mode) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Current-Position-Mode) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Current-Position-Mode) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Current-Position-Mode) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Current-Position-Mode) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_Get-Download-Id-For-Futures-Order-History.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_Get-Download-Id-For-Futures-Order-History.md new file mode 100644 index 0000000..92e2f62 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_Get-Download-Id-For-Futures-Order-History.md @@ -0,0 +1,71 @@ +--- +title: "Get Download Id For Futures Order History | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Download-Id-For-Futures-Order-History" +fetched_at: "2026-01-27T05:28:25.271Z" +--- +# Get Download Id For Futures Order History (USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Download-Id-For-Futures-Order-History) + +Get Download Id For Futures Order History + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Download-Id-For-Futures-Order-History) + +GET `/fapi/v1/order/asyn` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Download-Id-For-Futures-Order-History) + +**1000** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Download-Id-For-Futures-Order-History) + +Name + +Type + +Mandatory + +Description + +startTime + +LONG + +YES + +Timestamp in ms + +endTime + +LONG + +YES + +Timestamp in ms + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +> - Request Limitation is 10 times per month, shared by front end download page and rest api +> - The time between `startTime` and `endTime` can not be longer than 1 year + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Download-Id-For-Futures-Order-History) + +``` +{ "avgCostTimestampOfLast30d":7241837, // Average time taken for data download in the past 30 days "downloadId":"546975389218332672",} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Download-Id-For-Futures-Order-History) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Download-Id-For-Futures-Order-History) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Download-Id-For-Futures-Order-History) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Download-Id-For-Futures-Order-History) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Download-Id-For-Futures-Order-History) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_Get-Download-Id-For-Futures-Trade-History.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_Get-Download-Id-For-Futures-Trade-History.md new file mode 100644 index 0000000..5a84b1a --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_Get-Download-Id-For-Futures-Trade-History.md @@ -0,0 +1,71 @@ +--- +title: "Get Download Id For Futures Trade History | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Download-Id-For-Futures-Trade-History" +fetched_at: "2026-01-27T05:28:25.460Z" +--- +# Get Download Id For Futures Trade History (USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Download-Id-For-Futures-Trade-History) + +Get download id for futures trade history + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Download-Id-For-Futures-Trade-History) + +GET `/fapi/v1/trade/asyn` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Download-Id-For-Futures-Trade-History) + +**1000** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Download-Id-For-Futures-Trade-History) + +Name + +Type + +Mandatory + +Description + +startTime + +LONG + +YES + +Timestamp in ms + +endTime + +LONG + +YES + +Timestamp in ms + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +> - Request Limitation is 5 times per month, shared by front end download page and rest api +> - The time between `startTime` and `endTime` can not be longer than 1 year + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Download-Id-For-Futures-Trade-History) + +``` +{ "avgCostTimestampOfLast30d":7241837, // Average time taken for data download in the past 30 days "downloadId":"546975389218332672",} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Download-Id-For-Futures-Trade-History) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Download-Id-For-Futures-Trade-History) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Download-Id-For-Futures-Trade-History) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Download-Id-For-Futures-Trade-History) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Download-Id-For-Futures-Trade-History) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_Get-Download-Id-For-Futures-Transaction-History.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_Get-Download-Id-For-Futures-Transaction-History.md new file mode 100644 index 0000000..1d3158b --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_Get-Download-Id-For-Futures-Transaction-History.md @@ -0,0 +1,71 @@ +--- +title: "Get Download Id For Futures Transaction History | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Download-Id-For-Futures-Transaction-History" +fetched_at: "2026-01-27T05:28:25.408Z" +--- +# Get Download Id For Futures Transaction History(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Download-Id-For-Futures-Transaction-History) + +Get download id for futures transaction history + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Download-Id-For-Futures-Transaction-History) + +GET `/fapi/v1/income/asyn` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Download-Id-For-Futures-Transaction-History) + +**1000** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Download-Id-For-Futures-Transaction-History) + +Name + +Type + +Mandatory + +Description + +startTime + +LONG + +YES + +Timestamp in ms + +endTime + +LONG + +YES + +Timestamp in ms + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +> - Request Limitation is 5 times per month, shared by front end download page and rest api +> - The time between `startTime` and `endTime` can not be longer than 1 year + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Download-Id-For-Futures-Transaction-History) + +``` +{ "avgCostTimestampOfLast30d":7241837, // Average time taken for data download in the past 30 days "downloadId":"546975389218332672",} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Download-Id-For-Futures-Transaction-History) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Download-Id-For-Futures-Transaction-History) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Download-Id-For-Futures-Transaction-History) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Download-Id-For-Futures-Transaction-History) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Download-Id-For-Futures-Transaction-History) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_Get-Future-Account-Transaction-History-List.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_Get-Future-Account-Transaction-History-List.md new file mode 100644 index 0000000..7470299 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_Get-Future-Account-Transaction-History-List.md @@ -0,0 +1,8 @@ +--- +title: "Get Future Account Transaction History List | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Future-Account-Transaction-History-List" +fetched_at: "2026-01-27T05:28:25.571Z" +--- +# Get Future Account Transaction History List(USER\_DATA) + +Please find details from [here](https://developers.binance.com/docs/wallet/asset/query-user-universal-transfer). diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_Get-Futures-Order-History-Download-Link-by-Id.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_Get-Futures-Order-History-Download-Link-by-Id.md new file mode 100644 index 0000000..95be59a --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_Get-Futures-Order-History-Download-Link-by-Id.md @@ -0,0 +1,70 @@ +--- +title: "Get Futures Order History Download Link By Id | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Futures-Order-History-Download-Link-by-Id" +fetched_at: "2026-01-27T05:28:25.518Z" +--- +# Get Futures Order History Download Link by Id (USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Futures-Order-History-Download-Link-by-Id) + +Get futures order history download link by Id + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Futures-Order-History-Download-Link-by-Id) + +GET `/fapi/v1/order/asyn/id` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Futures-Order-History-Download-Link-by-Id) + +**10** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Futures-Order-History-Download-Link-by-Id) + +Name + +Type + +Mandatory + +Description + +downloadId + +STRING + +YES + +get by download id api + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +> - Download link expiration: 24h + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Futures-Order-History-Download-Link-by-Id) + +> **Response:** + +``` +{ "downloadId":"545923594199212032", "status":"completed", // Enum:completed,processing "url":"www.binance.com", // The link is mapped to download id "notified":true, // ignore "expirationTimestamp":1645009771000, // The link would expire after this timestamp "isExpired":null,} +``` + +> **OR** (Response when server is processing) + +``` +{ "downloadId":"545923594199212032", "status":"processing", "url":"", "notified":false, "expirationTimestamp":-1 "isExpired":null, } +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Futures-Order-History-Download-Link-by-Id) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Futures-Order-History-Download-Link-by-Id) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Futures-Order-History-Download-Link-by-Id) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Futures-Order-History-Download-Link-by-Id) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Futures-Order-History-Download-Link-by-Id) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_Get-Futures-Trade-Download-Link-by-Id.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_Get-Futures-Trade-Download-Link-by-Id.md new file mode 100644 index 0000000..4389d6a --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_Get-Futures-Trade-Download-Link-by-Id.md @@ -0,0 +1,70 @@ +--- +title: "Get Futures Trade Download Link By Id | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Futures-Trade-Download-Link-by-Id" +fetched_at: "2026-01-27T05:28:25.660Z" +--- +# Get Futures Trade Download Link by Id(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Futures-Trade-Download-Link-by-Id) + +Get futures trade download link by Id + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Futures-Trade-Download-Link-by-Id) + +GET `/fapi/v1/trade/asyn/id` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Futures-Trade-Download-Link-by-Id) + +**10** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Futures-Trade-Download-Link-by-Id) + +Name + +Type + +Mandatory + +Description + +downloadId + +STRING + +YES + +get by download id api + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +> - Download link expiration: 24h + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Futures-Trade-Download-Link-by-Id) + +> **Response:** + +``` +{ "downloadId":"545923594199212032", "status":"completed", // Enum:completed,processing "url":"www.binance.com", // The link is mapped to download id "notified":true, // ignore "expirationTimestamp":1645009771000, // The link would expire after this timestamp "isExpired":null,} +``` + +> **OR** (Response when server is processing) + +``` +{ "downloadId":"545923594199212032", "status":"processing", "url":"", "notified":false, "expirationTimestamp":-1 "isExpired":null, } +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Futures-Trade-Download-Link-by-Id) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Futures-Trade-Download-Link-by-Id) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Futures-Trade-Download-Link-by-Id) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Futures-Trade-Download-Link-by-Id) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Futures-Trade-Download-Link-by-Id) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_Get-Futures-Transaction-History-Download-Link-by-Id.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_Get-Futures-Transaction-History-Download-Link-by-Id.md new file mode 100644 index 0000000..2e21aaa --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_Get-Futures-Transaction-History-Download-Link-by-Id.md @@ -0,0 +1,70 @@ +--- +title: "Get Futures Transaction History Download Link By Id | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Futures-Transaction-History-Download-Link-by-Id" +fetched_at: "2026-01-27T05:28:25.714Z" +--- +# Get Futures Transaction History Download Link by Id (USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Futures-Transaction-History-Download-Link-by-Id) + +Get futures transaction history download link by Id + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Futures-Transaction-History-Download-Link-by-Id) + +GET `/fapi/v1/income/asyn/id` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Futures-Transaction-History-Download-Link-by-Id) + +**10** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Futures-Transaction-History-Download-Link-by-Id) + +Name + +Type + +Mandatory + +Description + +downloadId + +STRING + +YES + +get by download id api + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +> - Download link expiration: 24h + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Futures-Transaction-History-Download-Link-by-Id) + +> **Response:** + +``` +{ "downloadId":"545923594199212032", "status":"completed", // Enum:completed,processing "url":"www.binance.com", // The link is mapped to download id "notified":true, // ignore "expirationTimestamp":1645009771000, // The link would expire after this timestamp "isExpired":null,} +``` + +> **OR** (Response when server is processing) + +``` +{ "downloadId":"545923594199212032", "status":"processing", "url":"", "notified":false, "expirationTimestamp":-1 "isExpired":null, } +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Futures-Transaction-History-Download-Link-by-Id) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Futures-Transaction-History-Download-Link-by-Id) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Futures-Transaction-History-Download-Link-by-Id) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Futures-Transaction-History-Download-Link-by-Id) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Futures-Transaction-History-Download-Link-by-Id) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_Get-Income-History.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_Get-Income-History.md new file mode 100644 index 0000000..bbbe182 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_Get-Income-History.md @@ -0,0 +1,101 @@ +--- +title: "Get Income History | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Income-History" +fetched_at: "2026-01-27T05:28:25.778Z" +--- +# Get Income History (USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Income-History) + +Query income history + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Income-History) + +GET `/fapi/v1/income` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Income-History) + +**30** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Income-History) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +NO + +incomeType + +STRING + +NO + +TRANSFER, WELCOME\_BONUS, REALIZED\_PNL, FUNDING\_FEE, COMMISSION, INSURANCE\_CLEAR, REFERRAL\_KICKBACK, COMMISSION\_REBATE, API\_REBATE, CONTEST\_REWARD, CROSS\_COLLATERAL\_TRANSFER, OPTIONS\_PREMIUM\_FEE, OPTIONS\_SETTLE\_PROFIT, INTERNAL\_TRANSFER, AUTO\_EXCHANGE, DELIVERED\_SETTELMENT, COIN\_SWAP\_DEPOSIT, COIN\_SWAP\_WITHDRAW, POSITION\_LIMIT\_INCREASE\_FEE, STRATEGY\_UMFUTURES\_TRANSFER,FEE\_RETURN,BFUSD\_REWARD + +startTime + +LONG + +NO + +Timestamp in ms to get funding from INCLUSIVE. + +endTime + +LONG + +NO + +Timestamp in ms to get funding until INCLUSIVE. + +page + +INT + +NO + +limit + +INT + +NO + +Default 100; max 1000 + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +> - If neither `startTime` nor `endTime` is sent, the recent 7-day data will be returned. +> - If `incomeType` is not sent, all kinds of flow will be returned +> - "trandId" is unique in the same incomeType for a user +> - Income history only contains data for the last three months + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Income-History) + +``` +[ { "symbol": "", // trade symbol, if existing "incomeType": "TRANSFER", // income type "income": "-0.37500000", // income amount "asset": "USDT", // income asset "info":"TRANSFER", // extra information "time": 1570608000000, "tranId":9689322392, // transaction id "tradeId":"" // trade id, if existing }, { "symbol": "BTCUSDT", "incomeType": "COMMISSION", "income": "-0.01000000", "asset": "USDT", "info":"COMMISSION", "time": 1570636800000, "tranId":9689322392, "tradeId":"2059192" }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Income-History) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Income-History) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Income-History) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Income-History) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Income-History) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_Notional-and-Leverage-Brackets.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_Notional-and-Leverage-Brackets.md new file mode 100644 index 0000000..47f468f --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_Notional-and-Leverage-Brackets.md @@ -0,0 +1,66 @@ +--- +title: "Notional And Leverage Brackets | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Notional-and-Leverage-Brackets" +fetched_at: "2026-01-27T05:28:25.830Z" +--- +# Notional and Leverage Brackets (USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Notional-and-Leverage-Brackets) + +Query user notional and leverage bracket on speicfic symbol + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Notional-and-Leverage-Brackets) + +GET `/fapi/v1/leverageBracket` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Notional-and-Leverage-Brackets) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Notional-and-Leverage-Brackets) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +NO + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Notional-and-Leverage-Brackets) + +> **Response:** + +``` +[ { "symbol": "ETHUSDT", "notionalCoef": 1.50, //user symbol bracket multiplier, only appears when user's symbol bracket is adjusted "brackets": [ { "bracket": 1, // Notional bracket "initialLeverage": 75, // Max initial leverage for this bracket "notionalCap": 10000, // Cap notional of this bracket "notionalFloor": 0, // Notional threshold of this bracket "maintMarginRatio": 0.0065, // Maintenance ratio for this bracket "cum": 0.0 // Auxiliary number for quick calculation }, ] }] +``` + +> **OR** (if symbol sent) + +``` +{ "symbol": "ETHUSDT", "notionalCoef": 1.50, "brackets": [ { "bracket": 1, "initialLeverage": 75, "notionalCap": 10000, "notionalFloor": 0, "maintMarginRatio": 0.0065, "cum":0 }, ]} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Notional-and-Leverage-Brackets) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Notional-and-Leverage-Brackets) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Notional-and-Leverage-Brackets) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Notional-and-Leverage-Brackets) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Notional-and-Leverage-Brackets) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_Query-Rate-Limit.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_Query-Rate-Limit.md new file mode 100644 index 0000000..733aad4 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_Query-Rate-Limit.md @@ -0,0 +1,52 @@ +--- +title: "Query Order Rate Limit | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Query-Rate-Limit" +fetched_at: "2026-01-27T05:28:25.914Z" +--- +# Query User Rate Limit (USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Query-Rate-Limit) + +Query User Rate Limit + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Query-Rate-Limit) + +GET `/fapi/v1/rateLimit/order` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Query-Rate-Limit) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Query-Rate-Limit) + +Name + +Type + +Mandatory + +Description + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Query-Rate-Limit) + +``` +[ { "rateLimitType": "ORDERS", "interval": "SECOND", "intervalNum": 10, "limit": 10000, }, { "rateLimitType": "ORDERS", "interval": "MINUTE", "intervalNum": 1, "limit": 20000, }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Query-Rate-Limit) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Query-Rate-Limit) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Query-Rate-Limit) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Query-Rate-Limit) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Query-Rate-Limit) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_Symbol-Config.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_Symbol-Config.md new file mode 100644 index 0000000..2ec1442 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_Symbol-Config.md @@ -0,0 +1,58 @@ +--- +title: "Query Symbol Configuration | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Symbol-Config" +fetched_at: "2026-01-27T05:28:25.967Z" +--- +# Symbol Configuration(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Symbol-Config) + +Get current account symbol configuration. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Symbol-Config) + +GET `/fapi/v1/symbolConfig` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Symbol-Config) + +**5** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Symbol-Config) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +NO + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Symbol-Config) + +``` +[ { "symbol": "BTCUSDT", "marginType": "CROSSED", "isAutoAddMargin": false, "leverage": 21, "maxNotionalValue": "1000000", }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Symbol-Config) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Symbol-Config) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Symbol-Config) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Symbol-Config) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Symbol-Config) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_Toggle-BNB-Burn-On-Futures-Trade.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_Toggle-BNB-Burn-On-Futures-Trade.md new file mode 100644 index 0000000..472e7b2 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_Toggle-BNB-Burn-On-Futures-Trade.md @@ -0,0 +1,60 @@ +--- +title: "Toggle BNB Burn On Futures Trade | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Toggle-BNB-Burn-On-Futures-Trade" +fetched_at: "2026-01-27T05:28:26.026Z" +--- +# Toggle BNB Burn On Futures Trade (TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Toggle-BNB-Burn-On-Futures-Trade) + +Change user's BNB Fee Discount (Fee Discount On or Fee Discount Off ) on _**EVERY symbol**_ + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Toggle-BNB-Burn-On-Futures-Trade) + +POST `/fapi/v1/feeBurn` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Toggle-BNB-Burn-On-Futures-Trade) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Toggle-BNB-Burn-On-Futures-Trade) + +Name + +Type + +Mandatory + +Description + +feeBurn + +STRING + +YES + +"true": Fee Discount On; "false": Fee Discount Off + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Toggle-BNB-Burn-On-Futures-Trade) + +``` +{ "code": 200, "msg": "success"} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Toggle-BNB-Burn-On-Futures-Trade) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Toggle-BNB-Burn-On-Futures-Trade) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Toggle-BNB-Burn-On-Futures-Trade) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Toggle-BNB-Burn-On-Futures-Trade) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Toggle-BNB-Burn-On-Futures-Trade) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_User-Commission-Rate.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_User-Commission-Rate.md new file mode 100644 index 0000000..a9a7701 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_rest-api_User-Commission-Rate.md @@ -0,0 +1,58 @@ +--- +title: "User Commission Rate | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/User-Commission-Rate" +fetched_at: "2026-01-27T05:28:26.083Z" +--- +# User Commission Rate (USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/User-Commission-Rate) + +Get User Commission Rate + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/User-Commission-Rate) + +GET `/fapi/v1/commissionRate` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/User-Commission-Rate) + +**20** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/User-Commission-Rate) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/User-Commission-Rate) + +``` +{ "symbol": "BTCUSDT", "makerCommissionRate": "0.0002", // 0.02% "takerCommissionRate": "0.0004", // 0.04% "rpiCommissionRate": "0.00005" // 0.005%} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/User-Commission-Rate) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/User-Commission-Rate) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/User-Commission-Rate) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/User-Commission-Rate) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/User-Commission-Rate) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_websocket-api.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_websocket-api.md new file mode 100644 index 0000000..2c896e8 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_websocket-api.md @@ -0,0 +1,59 @@ +--- +title: "Futures Account Balance V2 | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/account/websocket-api" +fetched_at: "2026-01-27T05:28:26.166Z" +--- +# Futures Account Balance V2(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/websocket-api) + +Query account balance info + +## Method[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/websocket-api) + +`v2/account.balance` + +## Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/websocket-api) + +``` +{ "id": "605a6d20-6588-4cb9-afa0-b0ab087507ba", "method": "v2/account.balance", "params": { "apiKey": "xTaDyrmvA9XT2oBHHjy39zyPzKCvMdtH3b9q4xadkAg2dNSJXQGCxzui26L823W2", "timestamp": 1702561978458, "signature": "208bb94a26f99aa122b1319490ca9cb2798fccc81d9b6449521a26268d53217a" }} +``` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/websocket-api) + +**5** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/websocket-api) + +Name + +Type + +Mandatory + +Description + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/websocket-api) + +``` +{ "id": "605a6d20-6588-4cb9-afa0-b0ab087507ba", "status": 200, "result": [ { "accountAlias": "SgsR", // unique account code "asset": "USDT", // asset name "balance": "122607.35137903", // wallet balance "crossWalletBalance": "23.72469206", // crossed wallet balance "crossUnPnl": "0.00000000" // unrealized profit of crossed positions "availableBalance": "23.72469206", // available balance "maxWithdrawAmount": "23.72469206", // maximum amount for transfer out "marginAvailable": true, // whether the asset can be used as margin in Multi-Assets mode "updateTime": 1617939110373 } ], "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 2400, "count": 20 } ]} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/websocket-api) +- [Method](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/websocket-api) +- [Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/websocket-api) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/websocket-api) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/websocket-api) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/websocket-api) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_websocket-api_Account-Information-V2.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_websocket-api_Account-Information-V2.md new file mode 100644 index 0000000..9056c71 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_websocket-api_Account-Information-V2.md @@ -0,0 +1,67 @@ +--- +title: "Account Information V2 | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/account/websocket-api/Account-Information-V2" +fetched_at: "2026-01-27T05:28:26.420Z" +--- +# Account Information V2(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/websocket-api/Account-Information-V2) + +Get current account information. User in single-asset/ multi-assets mode will see different value, see comments in response section for detail. + +## Method[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/websocket-api/Account-Information-V2) + +`v2/account.status` + +## Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/websocket-api/Account-Information-V2) + +``` +{ "id": "605a6d20-6588-4cb9-afa0-b0ab087507ba", "method": "v2/account.status", "params": { "apiKey": "xTaDyrmvA9XT2oBHHjy39zyPzKCvMdtH3b9q4xadkAg2dNSJXQGCxzui26L823W2", "timestamp": 1702620814781, "signature": "6bb98ef84170c70ba3d01f44261bfdf50fef374e551e590de22b5c3b729b1d8c" }} +``` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/websocket-api/Account-Information-V2) + +**5** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/websocket-api/Account-Information-V2) + +Name + +Type + +Mandatory + +Description + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/websocket-api/Account-Information-V2) + +> Single Asset Mode + +``` +{ "id": "605a6d20-6588-4cb9-afa0-b0ab087507ba", "status": 200, "result": { "totalInitialMargin": "0.00000000", // total initial margin required with current mark price (useless with isolated positions), only for USDT asset "totalMaintMargin": "0.00000000", // total maintenance margin required, only for USDT asset "totalWalletBalance": "103.12345678", // total wallet balance, only for USDT asset "totalUnrealizedProfit": "0.00000000", // total unrealized profit, only for USDT asset "totalMarginBalance": "103.12345678", // total margin balance, only for USDT asset "totalPositionInitialMargin": "0.00000000", // initial margin required for positions with current mark price, only for USDT asset "totalOpenOrderInitialMargin": "0.00000000", // initial margin required for open orders with current mark price, only for USDT asset "totalCrossWalletBalance": "103.12345678", // crossed wallet balance, only for USDT asset "totalCrossUnPnl": "0.00000000", // unrealized profit of crossed positions, only for USDT asset "availableBalance": "103.12345678", // available balance, only for USDT asset "maxWithdrawAmount": "103.12345678" // maximum amount for transfer out, only for USDT asset "assets": [ // For assets that are quote assets, USDT/USDC/BTC { "asset": "USDT", // asset name "walletBalance": "23.72469206", // wallet balance "unrealizedProfit": "0.00000000", // unrealized profit "marginBalance": "23.72469206", // margin balance "maintMargin": "0.00000000", // maintenance margin required "initialMargin": "0.00000000", // total initial margin required with current mark price "positionInitialMargin": "0.00000000", // initial margin required for positions with current mark price "openOrderInitialMargin": "0.00000000", // initial margin required for open orders with current mark price "crossWalletBalance": "23.72469206", // crossed wallet balance "crossUnPnl": "0.00000000" // unrealized profit of crossed positions "availableBalance": "23.72469206", // available balance "maxWithdrawAmount": "23.72469206", // maximum amount for transfer out "updateTime": 1625474304765 // last update time },    { "asset": "USDC", // asset name "walletBalance": "103.12345678", // wallet balance "unrealizedProfit": "0.00000000", // unrealized profit "marginBalance": "103.12345678", // margin balance "maintMargin": "0.00000000", // maintenance margin required "initialMargin": "0.00000000", // total initial margin required with current mark price "positionInitialMargin": "0.00000000", // initial margin required for positions with current mark price "openOrderInitialMargin": "0.00000000", // initial margin required for open orders with current mark price "crossWalletBalance": "103.12345678", // crossed wallet balance "crossUnPnl": "0.00000000" // unrealized profit of crossed positions "availableBalance": "126.72469206", // available balance "maxWithdrawAmount": "103.12345678", // maximum amount for transfer out "updateTime": 1625474304765 // last update time },       ], "positions": [ // positions of all symbols user had position/ open orders are returned // only "BOTH" positions will be returned with One-way mode // only "LONG" and "SHORT" positions will be returned with Hedge mode { "symbol": "BTCUSDT", "positionSide": "BOTH", // position side "positionAmt": "1.000", "unrealizedProfit": "0.00000000", // unrealized profit     "isolatedMargin": "0.00000000", "notional": "0", "isolatedWallet": "0", "initialMargin": "0", // initial margin required with current mark price "maintMargin": "0", // maintenance margin required "updateTime": 0 } ] }, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 2400, "count": 20 } ]} +``` + +> Multi-Asset Mode + +``` +{ "id": "605a6d20-6588-4cb9-afa0-b0ab087507ba", "status": 200, "result": { "totalInitialMargin": "0.00000000", // the sum of USD value of all cross positions/open order initial margin "totalMaintMargin": "0.00000000", // the sum of USD value of all cross positions maintenance margin "totalWalletBalance": "126.72469206", // total wallet balance in USD "totalUnrealizedProfit": "0.00000000", // total unrealized profit in USD "totalMarginBalance": "126.72469206", // total margin balance in USD "totalPositionInitialMargin": "0.00000000", // the sum of USD value of all cross positions initial margin "totalOpenOrderInitialMargin": "0.00000000", // initial margin required for open orders with current mark price in USD "totalCrossWalletBalance": "126.72469206", // crossed wallet balance in USD "totalCrossUnPnl": "0.00000000", // unrealized profit of crossed positions in USD "availableBalance": "126.72469206", // available balance in USD "maxWithdrawAmount": "126.72469206" // maximum virtual amount for transfer out in USD "assets": [ { "asset": "USDT", // asset name "walletBalance": "23.72469206", // wallet balance "unrealizedProfit": "0.00000000", // unrealized profit "marginBalance": "23.72469206", // margin balance "maintMargin": "0.00000000", // maintenance margin required "initialMargin": "0.00000000", // total initial margin required with current mark price "positionInitialMargin": "0.00000000", //initial margin required for positions with current mark price "openOrderInitialMargin": "0.00000000", // initial margin required for open orders with current mark price "crossWalletBalance": "23.72469206", // crossed wallet balance "crossUnPnl": "0.00000000" // unrealized profit of crossed positions "availableBalance": "126.72469206", // available balance "maxWithdrawAmount": "23.72469206", // maximum amount for transfer out "marginAvailable": true, // whether the asset can be used as margin in Multi-Assets mode "updateTime": 1625474304765 // last update time }, { "asset": "BUSD", // asset name "walletBalance": "103.12345678", // wallet balance "unrealizedProfit": "0.00000000", // unrealized profit "marginBalance": "103.12345678", // margin balance "maintMargin": "0.00000000", // maintenance margin required "initialMargin": "0.00000000", // total initial margin required with current mark price "positionInitialMargin": "0.00000000", //initial margin required for positions with current mark price "openOrderInitialMargin": "0.00000000", // initial margin required for open orders with current mark price "crossWalletBalance": "103.12345678", // crossed wallet balance "crossUnPnl": "0.00000000" // unrealized profit of crossed positions "availableBalance": "126.72469206", // available balance "maxWithdrawAmount": "103.12345678", // maximum amount for transfer out "marginAvailable": true, // whether the asset can be used as margin in Multi-Assets mode "updateTime": 1625474304765 // last update time } ], "positions": [ // positions of all symbols user had position are returned                     // only "BOTH" positions will be returned with One-way mode // only "LONG" and "SHORT" positions will be returned with Hedge mode { "symbol": "BTCUSDT", "positionSide": "BOTH", // position side "positionAmt": "1.000", "unrealizedProfit": "0.00000000", // unrealized profit     "isolatedMargin": "0.00000000", "notional": "0", "isolatedWallet": "0", "initialMargin": "0", // initial margin required with current mark price "maintMargin": "0", // maintenance margin required "updateTime": 0 } ] }, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 2400, "count": 20 } ]} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/websocket-api/Account-Information-V2) +- [Method](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/websocket-api/Account-Information-V2) +- [Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/websocket-api/Account-Information-V2) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/websocket-api/Account-Information-V2) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/websocket-api/Account-Information-V2) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/websocket-api/Account-Information-V2) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_websocket-api_Account-Information.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_websocket-api_Account-Information.md new file mode 100644 index 0000000..3cf2766 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_websocket-api_Account-Information.md @@ -0,0 +1,67 @@ +--- +title: "Account Information | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/account/websocket-api/Account-Information" +fetched_at: "2026-01-27T05:28:26.229Z" +--- +# Account Information(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/websocket-api/Account-Information) + +Get current account information. User in single-asset/ multi-assets mode will see different value, see comments in response section for detail. + +## Method[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/websocket-api/Account-Information) + +`account.status` + +## Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/websocket-api/Account-Information) + +``` +{ "id": "605a6d20-6588-4cb9-afa0-b0ab087507ba", "method": "account.status", "params": { "apiKey": "xTaDyrmvA9XT2oBHHjy39zyPzKCvMdtH3b9q4xadkAg2dNSJXQGCxzui26L823W2", "timestamp": 1702620814781, "signature": "6bb98ef84170c70ba3d01f44261bfdf50fef374e551e590de22b5c3b729b1d8c" }} +``` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/websocket-api/Account-Information) + +**5** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/websocket-api/Account-Information) + +Name + +Type + +Mandatory + +Description + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/websocket-api/Account-Information) + +> Single Asset Mode + +``` +{ "id": "605a6d20-6588-4cb9-afa0-b0ab087507ba", "status": 200, "result": { "feeTier": 0, // account commission tier "canTrade": true, // if can trade "canDeposit": true, // if can transfer in asset "canWithdraw": true, // if can transfer out asset "updateTime": 0, // reserved property, please ignore "multiAssetsMargin": false, "tradeGroupId": -1, "totalInitialMargin": "0.00000000", // total initial margin required with current mark price (useless with isolated positions), only for USDT asset "totalMaintMargin": "0.00000000", // total maintenance margin required, only for USDT asset "totalWalletBalance": "23.72469206", // total wallet balance, only for USDT asset "totalUnrealizedProfit": "0.00000000", // total unrealized profit, only for USDT asset "totalMarginBalance": "23.72469206", // total margin balance, only for USDT asset "totalPositionInitialMargin": "0.00000000", // initial margin required for positions with current mark price, only for USDT asset "totalOpenOrderInitialMargin": "0.00000000", // initial margin required for open orders with current mark price, only for USDT asset "totalCrossWalletBalance": "23.72469206", // crossed wallet balance, only for USDT asset "totalCrossUnPnl": "0.00000000", // unrealized profit of crossed positions, only for USDT asset "availableBalance": "23.72469206", // available balance, only for USDT asset "maxWithdrawAmount": "23.72469206" // maximum amount for transfer out, only for USDT asset "assets": [ { "asset": "USDT", // asset name "walletBalance": "23.72469206", // wallet balance "unrealizedProfit": "0.00000000", // unrealized profit "marginBalance": "23.72469206", // margin balance "maintMargin": "0.00000000", // maintenance margin required "initialMargin": "0.00000000", // total initial margin required with current mark price "positionInitialMargin": "0.00000000", //initial margin required for positions with current mark price "openOrderInitialMargin": "0.00000000", // initial margin required for open orders with current mark price "crossWalletBalance": "23.72469206", // crossed wallet balance "crossUnPnl": "0.00000000" // unrealized profit of crossed positions "availableBalance": "23.72469206", // available balance "maxWithdrawAmount": "23.72469206", // maximum amount for transfer out "marginAvailable": true, // whether the asset can be used as margin in Multi-Assets mode "updateTime": 1625474304765 // last update time }, { "asset": "BUSD", // asset name "walletBalance": "103.12345678", // wallet balance "unrealizedProfit": "0.00000000", // unrealized profit "marginBalance": "103.12345678", // margin balance "maintMargin": "0.00000000", // maintenance margin required "initialMargin": "0.00000000", // total initial margin required with current mark price "positionInitialMargin": "0.00000000", //initial margin required for positions with current mark price "openOrderInitialMargin": "0.00000000", // initial margin required for open orders with current mark price "crossWalletBalance": "103.12345678", // crossed wallet balance "crossUnPnl": "0.00000000" // unrealized profit of crossed positions "availableBalance": "103.12345678", // available balance "maxWithdrawAmount": "103.12345678", // maximum amount for transfer out "marginAvailable": true, // whether the asset can be used as margin in Multi-Assets mode "updateTime": 1625474304765 // last update time } ], "positions": [ // positions of all symbols in the market are returned // only "BOTH" positions will be returned with One-way mode // only "LONG" and "SHORT" positions will be returned with Hedge mode { "symbol": "BTCUSDT", // symbol name "initialMargin": "0", // initial margin required with current mark price "maintMargin": "0", // maintenance margin required "unrealizedProfit": "0.00000000", // unrealized profit "positionInitialMargin": "0", // initial margin required for positions with current mark price "openOrderInitialMargin": "0", // initial margin required for open orders with current mark price "leverage": "100", // current initial leverage "isolated": true, // if the position is isolated "entryPrice": "0.00000", // average entry price "maxNotional": "250000", // maximum available notional with current leverage "bidNotional": "0", // bids notional, ignore "askNotional": "0", // ask notional, ignore "positionSide": "BOTH", // position side "positionAmt": "0", // position amount "updateTime": 0 // last update time } ] }, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 2400, "count": 20 } ]} +``` + +> Multi-Asset Mode + +``` +{ "id": "605a6d20-6588-4cb9-afa0-b0ab087507ba", "status": 200, "result": { "feeTier": 0, // account commission tier "canTrade": true, // if can trade "canDeposit": true, // if can transfer in asset "canWithdraw": true, // if can transfer out asset "updateTime": 0, // reserved property, please ignore "multiAssetsMargin": true, "tradeGroupId": -1, "totalInitialMargin": "0.00000000", // the sum of USD value of all cross positions/open order initial margin "totalMaintMargin": "0.00000000", // the sum of USD value of all cross positions maintenance margin "totalWalletBalance": "126.72469206", // total wallet balance in USD "totalUnrealizedProfit": "0.00000000", // total unrealized profit in USD "totalMarginBalance": "126.72469206", // total margin balance in USD "totalPositionInitialMargin": "0.00000000", // the sum of USD value of all cross positions initial margin "totalOpenOrderInitialMargin": "0.00000000", // initial margin required for open orders with current mark price in USD "totalCrossWalletBalance": "126.72469206", // crossed wallet balance in USD "totalCrossUnPnl": "0.00000000", // unrealized profit of crossed positions in USD "availableBalance": "126.72469206", // available balance in USD "maxWithdrawAmount": "126.72469206" // maximum virtual amount for transfer out in USD "assets": [ { "asset": "USDT", // asset name "walletBalance": "23.72469206", // wallet balance "unrealizedProfit": "0.00000000", // unrealized profit "marginBalance": "23.72469206", // margin balance "maintMargin": "0.00000000", // maintenance margin required "initialMargin": "0.00000000", // total initial margin required with current mark price "positionInitialMargin": "0.00000000", //initial margin required for positions with current mark price "openOrderInitialMargin": "0.00000000", // initial margin required for open orders with current mark price "crossWalletBalance": "23.72469206", // crossed wallet balance "crossUnPnl": "0.00000000" // unrealized profit of crossed positions "availableBalance": "126.72469206", // available balance "maxWithdrawAmount": "23.72469206", // maximum amount for transfer out "marginAvailable": true, // whether the asset can be used as margin in Multi-Assets mode "updateTime": 1625474304765 // last update time }, { "asset": "BUSD", // asset name "walletBalance": "103.12345678", // wallet balance "unrealizedProfit": "0.00000000", // unrealized profit "marginBalance": "103.12345678", // margin balance "maintMargin": "0.00000000", // maintenance margin required "initialMargin": "0.00000000", // total initial margin required with current mark price "positionInitialMargin": "0.00000000", //initial margin required for positions with current mark price "openOrderInitialMargin": "0.00000000", // initial margin required for open orders with current mark price "crossWalletBalance": "103.12345678", // crossed wallet balance "crossUnPnl": "0.00000000" // unrealized profit of crossed positions "availableBalance": "126.72469206", // available balance "maxWithdrawAmount": "103.12345678", // maximum amount for transfer out "marginAvailable": true, // whether the asset can be used as margin in Multi-Assets mode "updateTime": 1625474304765 // last update time } ], "positions": [ // positions of all symbols in the market are returned // only "BOTH" positions will be returned with One-way mode // only "LONG" and "SHORT" positions will be returned with Hedge mode { "symbol": "BTCUSDT", // symbol name "initialMargin": "0", // initial margin required with current mark price "maintMargin": "0", // maintenance margin required "unrealizedProfit": "0.00000000", // unrealized profit "positionInitialMargin": "0", // initial margin required for positions with current mark price "openOrderInitialMargin": "0", // initial margin required for open orders with current mark price "leverage": "100", // current initial leverage "isolated": true, // if the position is isolated "entryPrice": "0.00000", // average entry price "breakEvenPrice": "0.0", // average entry price "maxNotional": "250000", // maximum available notional with current leverage "bidNotional": "0", // bids notional, ignore "askNotional": "0", // ask notional, ignore "positionSide": "BOTH", // position side "positionAmt": "0", // position amount "updateTime": 0 // last update time } ] }, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 2400, "count": 20 } ]} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/websocket-api/Account-Information) +- [Method](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/websocket-api/Account-Information) +- [Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/websocket-api/Account-Information) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/websocket-api/Account-Information) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/websocket-api/Account-Information) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/websocket-api/Account-Information) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_websocket-api_Futures-Account-Balance.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_websocket-api_Futures-Account-Balance.md new file mode 100644 index 0000000..94d7150 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_account_websocket-api_Futures-Account-Balance.md @@ -0,0 +1,59 @@ +--- +title: "Futures Account Balance | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/account/websocket-api/Futures-Account-Balance" +fetched_at: "2026-01-27T05:28:26.465Z" +--- +# Futures Account Balance(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/websocket-api/Futures-Account-Balance) + +Query account balance info + +## Method[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/websocket-api/Futures-Account-Balance) + +`account.balance` + +## Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/websocket-api/Futures-Account-Balance) + +``` +{ "id": "605a6d20-6588-4cb9-afa0-b0ab087507ba", "method": "account.balance", "params": { "apiKey": "xTaDyrmvA9XT2oBHHjy39zyPzKCvMdtH3b9q4xadkAg2dNSJXQGCxzui26L823W2", "timestamp": 1702561978458, "signature": "208bb94a26f99aa122b1319490ca9cb2798fccc81d9b6449521a26268d53217a" }} +``` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/websocket-api/Futures-Account-Balance) + +**5** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/websocket-api/Futures-Account-Balance) + +Name + +Type + +Mandatory + +Description + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/websocket-api/Futures-Account-Balance) + +``` +{ "id": "605a6d20-6588-4cb9-afa0-b0ab087507ba", "status": 200, "result": [ { "accountAlias": "SgsR", // unique account code "asset": "USDT", // asset name "balance": "122607.35137903", // wallet balance "crossWalletBalance": "23.72469206", // crossed wallet balance "crossUnPnl": "0.00000000" // unrealized profit of crossed positions "availableBalance": "23.72469206", // available balance "maxWithdrawAmount": "23.72469206", // maximum amount for transfer out "marginAvailable": true, // whether the asset can be used as margin in Multi-Assets mode "updateTime": 1617939110373 } ], "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 2400, "count": 20 } ]} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/websocket-api/Futures-Account-Balance) +- [Method](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/websocket-api/Futures-Account-Balance) +- [Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/websocket-api/Futures-Account-Balance) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/websocket-api/Futures-Account-Balance) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/websocket-api/Futures-Account-Balance) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/websocket-api/Futures-Account-Balance) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_common-definition.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_common-definition.md new file mode 100644 index 0000000..55d7f03 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_common-definition.md @@ -0,0 +1,274 @@ +--- +title: "Common Definition | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/common-definition" +fetched_at: "2026-01-27T05:28:26.296Z" +--- +# Public Endpoints Info + +## Terminology[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/common-definition) + +- `base asset` refers to the asset that is the `quantity` of a symbol. +- `quote asset` refers to the asset that is the `price` of a symbol. + +## ENUM definitions[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/common-definition) + +**Symbol type:** + +- FUTURE + +**Contract type (contractType):** + +- PERPETUAL +- CURRENT\_MONTH +- NEXT\_MONTH +- CURRENT\_QUARTER +- NEXT\_QUARTER +- PERPETUAL\_DELIVERING + +**Contract status (contractStatus, status):** + +- PENDING\_TRADING +- TRADING +- PRE\_DELIVERING +- DELIVERING +- DELIVERED +- PRE\_SETTLE +- SETTLING +- CLOSE + +**Order status (status):** + +- NEW +- PARTIALLY\_FILLED +- FILLED +- CANCELED +- REJECTED +- EXPIRED +- EXPIRED\_IN\_MATCH + +**Order types (orderTypes, type):** + +- LIMIT +- MARKET +- STOP +- STOP\_MARKET +- TAKE\_PROFIT +- TAKE\_PROFIT\_MARKET +- TRAILING\_STOP\_MARKET + +**Order side (side):** + +- BUY +- SELL + +**Position side (positionSide):** + +- BOTH +- LONG +- SHORT + +**Time in force (timeInForce):** + +- GTC - Good Till Cancel(GTC order valitidy is 1 year from placement) +- IOC - Immediate or Cancel +- FOK - Fill or Kill +- GTX - Good Till Crossing (Post Only) +- GTD - Good Till Date +- RPI - Retail Price Improvement(RPI order is post only and only be matched with the order from APP or Web) + +**Working Type (workingType)** + +- MARK\_PRICE +- CONTRACT\_PRICE + +**Response Type (newOrderRespType)** + +- ACK +- RESULT + +**Kline/Candlestick chart intervals:** + +m -> minutes; h -> hours; d -> days; w -> weeks; M -> months + +- 1m +- 3m +- 5m +- 15m +- 30m +- 1h +- 2h +- 4h +- 6h +- 8h +- 12h +- 1d +- 3d +- 1w +- 1M + +**STP MODE (selfTradePreventionMode):** + +- EXPIRE\_TAKER +- EXPIRE\_BOTH +- EXPIRE\_MAKER + +**Price Match (priceMatch)** + +- NONE (No price match) +- OPPONENT (counterparty best price) +- OPPONENT\_5 (the 5th best price from the counterparty) +- OPPONENT\_10 (the 10th best price from the counterparty) +- OPPONENT\_20 (the 20th best price from the counterparty) +- QUEUE (the best price on the same side of the order book) +- QUEUE\_5 (the 5th best price on the same side of the order book) +- QUEUE\_10 (the 10th best price on the same side of the order book) +- QUEUE\_20 (the 20th best price on the same side of the order book) + +**Rate limiters (rateLimitType)** + +> REQUEST\_WEIGHT + +``` + { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 2400 } +``` + +> ORDERS + +``` + { "rateLimitType": "ORDERS", "interval": "MINUTE", "intervalNum": 1, "limit": 1200 } +``` + +- REQUEST\_WEIGHT + +- ORDERS + + +**Rate limit intervals (interval)** + +- MINUTE + +# Filters + +Filters define trading rules on a symbol or an exchange. + +## Symbol filters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/common-definition) + +### PRICE\_FILTER[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/common-definition) + +> **/exchangeInfo format:** + +``` + { "filterType": "PRICE_FILTER", "minPrice": "0.00000100", "maxPrice": "100000.00000000", "tickSize": "0.00000100" } +``` + +The `PRICE_FILTER` defines the `price` rules for a symbol. There are 3 parts: + +- `minPrice` defines the minimum `price`/`stopPrice` allowed; disabled on `minPrice` == 0. +- `maxPrice` defines the maximum `price`/`stopPrice` allowed; disabled on `maxPrice` == 0. +- `tickSize` defines the intervals that a `price`/`stopPrice` can be increased/decreased by; disabled on `tickSize` == 0. + +Any of the above variables can be set to 0, which disables that rule in the `price filter`. In order to pass the `price filter`, the following must be true for `price`/`stopPrice` of the enabled rules: + +- `price` >= `minPrice` +- `price` <= `maxPrice` +- (`price`\-`minPrice`) % `tickSize` == 0 + +### LOT\_SIZE[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/common-definition) + +> **/exchangeInfo format:** + +``` + { "filterType": "LOT_SIZE", "minQty": "0.00100000", "maxQty": "100000.00000000", "stepSize": "0.00100000" } +``` + +The `LOT_SIZE` filter defines the `quantity` (aka "lots" in auction terms) rules for a symbol. There are 3 parts: + +- `minQty` defines the minimum `quantity` allowed. +- `maxQty` defines the maximum `quantity` allowed. +- `stepSize` defines the intervals that a `quantity` can be increased/decreased by. + +In order to pass the `lot size`, the following must be true for `quantity`: + +- `quantity` >= `minQty` +- `quantity` <= `maxQty` +- (`quantity`\-`minQty`) % `stepSize` == 0 + +### MARKET\_LOT\_SIZE[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/common-definition) + +> **/exchangeInfo format:** + +``` + { "filterType": "MARKET_LOT_SIZE", "minQty": "0.00100000", "maxQty": "100000.00000000", "stepSize": "0.00100000" } +``` + +The `MARKET_LOT_SIZE` filter defines the `quantity` (aka "lots" in auction terms) rules for `MARKET` orders on a symbol. There are 3 parts: + +- `minQty` defines the minimum `quantity` allowed. +- `maxQty` defines the maximum `quantity` allowed. +- `stepSize` defines the intervals that a `quantity` can be increased/decreased by. + +In order to pass the `market lot size`, the following must be true for `quantity`: + +- `quantity` >= `minQty` +- `quantity` <= `maxQty` +- (`quantity`\-`minQty`) % `stepSize` == 0 + +### MAX\_NUM\_ORDERS[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/common-definition) + +> **/exchangeInfo format:** + +``` + { "filterType": "MAX_NUM_ORDERS", "limit": 200 } +``` + +The `MAX_NUM_ORDERS` filter defines the maximum number of orders an account is allowed to have open on a symbol. + +Note that both "algo" orders and normal orders are counted for this filter. + +### MAX\_NUM\_ALGO\_ORDERS[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/common-definition) + +> **/exchangeInfo format:** + +``` + { "filterType": "MAX_NUM_ALGO_ORDERS", "limit": 100 } +``` + +The `MAX_NUM_ALGO_ORDERS` filter defines the maximum number of all kinds of algo orders an account is allowed to have open on a symbol. + +The algo orders include `STOP`, `STOP_MARKET`, `TAKE_PROFIT`, `TAKE_PROFIT_MARKET`, and `TRAILING_STOP_MARKET` orders. + +### PERCENT\_PRICE[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/common-definition) + +> **/exchangeInfo format:** + +``` + { "filterType": "PERCENT_PRICE", "multiplierUp": "1.1500", "multiplierDown": "0.8500", "multiplierDecimal": 4 } +``` + +The `PERCENT_PRICE` filter defines valid range for a price based on the mark price. + +In order to pass the `percent price`, the following must be true for `price`: + +- BUY: `price` <= `markPrice` \* `multiplierUp` +- SELL: `price` >= `markPrice` \* `multiplierDown` + +### MIN\_NOTIONAL[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/common-definition) + +> **/exchangeInfo format:** + +``` + { "filterType": "MIN_NOTIONAL", "notional": "5.0" } +``` + +The `MIN_NOTIONAL` filter defines the minimum notional value allowed for an order on a symbol. An order's notional value is the `price` \* `quantity`. Since `MARKET` orders have no price, the mark price is used. + +- [Terminology](https://developers.binance.com/docs/derivatives/usds-margined-futures/common-definition) +- [ENUM definitions](https://developers.binance.com/docs/derivatives/usds-margined-futures/common-definition) +- [Symbol filters](https://developers.binance.com/docs/derivatives/usds-margined-futures/common-definition) + - [PRICE\_FILTER](https://developers.binance.com/docs/derivatives/usds-margined-futures/common-definition) + - [LOT\_SIZE](https://developers.binance.com/docs/derivatives/usds-margined-futures/common-definition) + - [MARKET\_LOT\_SIZE](https://developers.binance.com/docs/derivatives/usds-margined-futures/common-definition) + - [MAX\_NUM\_ORDERS](https://developers.binance.com/docs/derivatives/usds-margined-futures/common-definition) + - [MAX\_NUM\_ALGO\_ORDERS](https://developers.binance.com/docs/derivatives/usds-margined-futures/common-definition) + - [PERCENT\_PRICE](https://developers.binance.com/docs/derivatives/usds-margined-futures/common-definition) + - [MIN\_NOTIONAL](https://developers.binance.com/docs/derivatives/usds-margined-futures/common-definition) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_convert.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_convert.md new file mode 100644 index 0000000..59f7ae4 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_convert.md @@ -0,0 +1,60 @@ +--- +title: "List all convert pairs | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/convert" +fetched_at: "2026-01-27T05:28:26.536Z" +--- +# List All Convert Pairs + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/convert) + +Query for all convertible token pairs and the tokens’ respective upper/lower limits + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/convert) + +GET `/fapi/v1/convert/exchangeInfo` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/convert) + +**20(IP)** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/convert) + +Name + +Type + +Mandatory + +Description + +fromAsset + +STRING + +EITHER OR BOTH + +User spends coin + +toAsset + +STRING + +EITHER OR BOTH + +User receives coin + +> - User needs to supply either or both of the input parameter +> - If not defined for both fromAsset and toAsset, only partial token pairs will be returned +> - Asset BNFCR is only available to convert for MICA region users. + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/convert) + +``` +[ { "fromAsset":"BTC", "toAsset":"USDT", "fromAssetMinAmount":"0.0004", "fromAssetMaxAmount":"50", "toAssetMinAmount":"20", "toAssetMaxAmount":"2500000" }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/convert) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/convert) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/convert) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/convert) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/convert) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_convert_Accept-Quote.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_convert_Accept-Quote.md new file mode 100644 index 0000000..880c06d --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_convert_Accept-Quote.md @@ -0,0 +1,60 @@ +--- +title: "Accept Quote | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/convert/Accept-Quote" +fetched_at: "2026-01-27T05:28:26.549Z" +--- +# Accept the offered quote (USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/convert/Accept-Quote) + +Accept the offered quote by quote ID. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/convert/Accept-Quote) + +POST `/fapi/v1/convert/acceptQuote` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/convert/Accept-Quote) + +**200(IP)** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/convert/Accept-Quote) + +Name + +Type + +Mandatory + +Description + +quoteId + +STRING + +YES + +recvWindow + +LONG + +NO + +The value cannot be greater than 60000 + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/convert/Accept-Quote) + +``` +{ "orderId":"933256278426274426", "createTime":1623381330472, "orderStatus":"PROCESS" //PROCESS/ACCEPT_SUCCESS/SUCCESS/FAIL} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/convert/Accept-Quote) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/convert/Accept-Quote) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/convert/Accept-Quote) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/convert/Accept-Quote) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/convert/Accept-Quote) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_convert_Order-Status.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_convert_Order-Status.md new file mode 100644 index 0000000..5b11e62 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_convert_Order-Status.md @@ -0,0 +1,56 @@ +--- +title: "Order Status | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/convert/Order-Status" +fetched_at: "2026-01-27T05:28:26.676Z" +--- +# Order status(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/convert/Order-Status) + +Query order status by order ID. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/convert/Order-Status) + +GET `/fapi/v1/convert/orderStatus` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/convert/Order-Status) + +**50(IP)** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/convert/Order-Status) + +Name + +Type + +Mandatory + +Description + +orderId + +STRING + +NO + +Either orderId or quoteId is required + +quoteId + +STRING + +NO + +Either orderId or quoteId is required + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/convert/Order-Status) + +``` +{ "orderId":933256278426274426, "orderStatus":"SUCCESS", "fromAsset":"BTC", "fromAmount":"0.00054414", "toAsset":"USDT", "toAmount":"20", "ratio":"36755", "inverseRatio":"0.00002721", "createTime":1623381330472} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/convert/Order-Status) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/convert/Order-Status) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/convert/Order-Status) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/convert/Order-Status) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/convert/Order-Status) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_convert_Send-quote-request.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_convert_Send-quote-request.md new file mode 100644 index 0000000..26d7b80 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_convert_Send-quote-request.md @@ -0,0 +1,95 @@ +--- +title: "Send quote request | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/convert/Send-quote-request" +fetched_at: "2026-01-27T05:28:26.770Z" +--- +# Send Quote Request(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/convert/Send-quote-request) + +Request a quote for the requested token pairs + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/convert/Send-quote-request) + +POST `/fapi/v1/convert/getQuote` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/convert/Send-quote-request) + +**50(IP)** + +**360/hour,500/day** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/convert/Send-quote-request) + +Name + +Type + +Mandatory + +Description + +fromAsset + +STRING + +YES + +toAsset + +STRING + +YES + +fromAmount + +DECIMAL + +EITHER + +When specified, it is the amount you will be debited after the conversion + +toAmount + +DECIMAL + +EITHER + +When specified, it is the amount you will be credited after the conversion + +validTime + +ENUM + +NO + +10s, default 10s + +recvWindow + +LONG + +NO + +The value cannot be greater than 60000 + +timestamp + +LONG + +YES + +- Either fromAmount or toAmount should be sent +- `quoteId` will be returned only if you have enough funds to convert + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/convert/Send-quote-request) + +``` +{ "quoteId":"12415572564", "ratio":"38163.7", "inverseRatio":"0.0000262", "validTimestamp":1623319461670, "toAmount":"3816.37", "fromAmount":"0.1"} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/convert/Send-quote-request) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/convert/Send-quote-request) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/convert/Send-quote-request) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/convert/Send-quote-request) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/convert/Send-quote-request) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_error-code.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_error-code.md new file mode 100644 index 0000000..bac43aa --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_error-code.md @@ -0,0 +1,1079 @@ +--- +title: "Error Code | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code" +fetched_at: "2026-01-27T05:28:26.673Z" +--- +# Error Codes + +> Here is the error JSON payload: + +``` +{ "code":-1121, "msg":"Invalid symbol."} +``` + +Errors consist of two parts: an error code and a message. +Codes are universal,but messages can vary. + +## 10xx - General Server or Network issues[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +### \-1000 UNKNOWN[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- An unknown error occured while processing the request. + +### \-1001 DISCONNECTED[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Internal error; unable to process your request. Please try again. + +### \-1002 UNAUTHORIZED[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- You are not authorized to execute this request. + +### \-1003 TOO\_MANY\_REQUESTS[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Too many requests; current limit is %s requests per minute. Please use the websocket for live updates to avoid polling the API. +- Way too many requests; IP banned until %s. Please use the websocket for live updates to avoid bans. + +### \-1004 DUPLICATE\_IP[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- This IP is already on the white list + +### \-1005 NO\_SUCH\_IP[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- No such IP has been white listed + +### \-1006 UNEXPECTED\_RESP[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- An unexpected response was received from the message bus. Execution status unknown. + +### \-1007 TIMEOUT[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Timeout waiting for response from backend server. Send status unknown; execution status unknown. + +### \-1008 Request Throttled[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Server is currently overloaded with other requests. Please try again in a few minutes. +- Request throttled by system-level protection. Reduce-only/close-position orders are exempt. Please try again. + +### \-1010 ERROR\_MSG\_RECEIVED[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- ERROR\_MSG\_RECEIVED. + +### \-1011 NON\_WHITE\_LIST[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- This IP cannot access this route. + +### \-1013 INVALID\_MESSAGE[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- INVALID\_MESSAGE. + +### \-1014 UNKNOWN\_ORDER\_COMPOSITION[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Unsupported order combination. + +### \-1015 TOO\_MANY\_ORDERS[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Too many new orders. +- Too many new orders; current limit is %s orders per %s. + +### \-1016 SERVICE\_SHUTTING\_DOWN[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- This service is no longer available. + +### \-1020 UNSUPPORTED\_OPERATION[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- This operation is not supported. + +### \-1021 INVALID\_TIMESTAMP[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Timestamp for this request is outside of the recvWindow. +- Timestamp for this request was 1000ms ahead of the server's time. + +### \-1022 INVALID\_SIGNATURE[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Signature for this request is not valid. + +### \-1023 START\_TIME\_GREATER\_THAN\_END\_TIME[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Start time is greater than end time. + +### \-1099 NOT\_FOUND[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Not found, unauthenticated, or unauthorized. + +## 11xx - Request issues[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +### \-1100 ILLEGAL\_CHARS[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Illegal characters found in a parameter. +- Illegal characters found in parameter '%s'; legal range is '%s'. + +### \-1101 TOO\_MANY\_PARAMETERS[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Too many parameters sent for this endpoint. +- Too many parameters; expected '%s' and received '%s'. +- Duplicate values for a parameter detected. + +### \-1102 MANDATORY\_PARAM\_EMPTY\_OR\_MALFORMED[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- A mandatory parameter was not sent, was empty/null, or malformed. +- Mandatory parameter '%s' was not sent, was empty/null, or malformed. +- Param '%s' or '%s' must be sent, but both were empty/null! + +### \-1103 UNKNOWN\_PARAM[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- An unknown parameter was sent. + +### \-1104 UNREAD\_PARAMETERS[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Not all sent parameters were read. +- Not all sent parameters were read; read '%s' parameter(s) but was sent '%s'. + +### \-1105 PARAM\_EMPTY[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- A parameter was empty. +- Parameter '%s' was empty. + +### \-1106 PARAM\_NOT\_REQUIRED[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- A parameter was sent when not required. +- Parameter '%s' sent when not required. + +### \-1108 BAD\_ASSET[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Invalid asset. + +### \-1109 BAD\_ACCOUNT[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Invalid account. + +### \-1110 BAD\_INSTRUMENT\_TYPE[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Invalid symbolType. + +### \-1111 BAD\_PRECISION[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Precision is over the maximum defined for this asset. + +### \-1112 NO\_DEPTH[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- No orders on book for symbol. + +### \-1113 WITHDRAW\_NOT\_NEGATIVE[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Withdrawal amount must be negative. + +### \-1114 TIF\_NOT\_REQUIRED[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- TimeInForce parameter sent when not required. + +### \-1115 INVALID\_TIF[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Invalid timeInForce. + +### \-1116 INVALID\_ORDER\_TYPE[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Invalid orderType. + +### \-1117 INVALID\_SIDE[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Invalid side. + +### \-1118 EMPTY\_NEW\_CL\_ORD\_ID[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- New client order ID was empty. + +### \-1119 EMPTY\_ORG\_CL\_ORD\_ID[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Original client order ID was empty. + +### \-1120 BAD\_INTERVAL[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Invalid interval. + +### \-1121 BAD\_SYMBOL[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Invalid symbol. + +### \-1122 INVALID\_SYMBOL\_STATUS[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Invalid symbol status. + +### \-1125 INVALID\_LISTEN\_KEY[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- This listenKey does not exist. Please use `POST /fapi/v1/listenKey` to recreate `listenKey` + +### \-1126 ASSET\_NOT\_SUPPORTED[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- This asset is not supported. + +### \-1127 MORE\_THAN\_XX\_HOURS[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Lookup interval is too big. +- More than %s hours between startTime and endTime. + +### \-1128 OPTIONAL\_PARAMS\_BAD\_COMBO[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Combination of optional parameters invalid. + +### \-1130 INVALID\_PARAMETER[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Invalid data sent for a parameter. +- Data sent for parameter '%s' is not valid. + +### \-1136 INVALID\_NEW\_ORDER\_RESP\_TYPE[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Invalid newOrderRespType. + +## 20xx - Processing Issues[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +### \-2010 NEW\_ORDER\_REJECTED[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- NEW\_ORDER\_REJECTED + +### \-2011 CANCEL\_REJECTED[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- CANCEL\_REJECTED +- Cancel request failure as open order not found in the orderbook: "Unknown order sent". + +### \-2012 CANCEL\_ALL\_FAIL[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Batch cancel failure. + +### \-2013 NO\_SUCH\_ORDER[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Order does not exist. + +### \-2014 BAD\_API\_KEY\_FMT[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- API-key format invalid. + +### \-2015 REJECTED\_MBX\_KEY[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Invalid API-key, IP, or permissions for action. + +### \-2016 NO\_TRADING\_WINDOW[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- No trading window could be found for the symbol. Try ticker/24hrs instead. + +### \-2017 API\_KEYS\_LOCKED[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- API Keys are locked on this account. + +### \-2018 BALANCE\_NOT\_SUFFICIENT[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Balance is insufficient. + +### \-2019 MARGIN\_NOT\_SUFFICIEN[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Margin is insufficient. + +### \-2020 UNABLE\_TO\_FILL[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Unable to fill. + +### \-2021 ORDER\_WOULD\_IMMEDIATELY\_TRIGGER[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Order would immediately trigger. + +### \-2022 REDUCE\_ONLY\_REJECT[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- ReduceOnly Order is rejected. +- This indicates the new reduce-only order conflicts with existing open orders; cancel the existing order and resubmit the reduce-only order. + +### \-2023 USER\_IN\_LIQUIDATION[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- User in liquidation mode now. + +### \-2024 POSITION\_NOT\_SUFFICIENT[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Position is not sufficient. + +### \-2025 MAX\_OPEN\_ORDER\_EXCEEDED[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Reach max open order limit. + +### \-2026 REDUCE\_ONLY\_ORDER\_TYPE\_NOT\_SUPPORTED[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- This OrderType is not supported when reduceOnly. + +### \-2027 MAX\_LEVERAGE\_RATIO[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Exceeded the maximum allowable position at current leverage. + +### \-2028 MIN\_LEVERAGE\_RATIO[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Leverage is smaller than permitted: insufficient margin balance. + +## 40xx - Filters and other Issues[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +### \-4000 INVALID\_ORDER\_STATUS[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Invalid order status. + +### \-4001 PRICE\_LESS\_THAN\_ZERO[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Price less than 0. + +### \-4002 PRICE\_GREATER\_THAN\_MAX\_PRICE[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Price greater than max price. + +### \-4003 QTY\_LESS\_THAN\_ZERO[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Quantity less than zero. + +### \-4004 QTY\_LESS\_THAN\_MIN\_QTY[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Quantity less than min quantity. + +### \-4005 QTY\_GREATER\_THAN\_MAX\_QTY[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Quantity greater than max quantity. + +### \-4006 STOP\_PRICE\_LESS\_THAN\_ZERO[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Stop price less than zero. + +### \-4007 STOP\_PRICE\_GREATER\_THAN\_MAX\_PRICE[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Stop price greater than max price. + +### \-4008 TICK\_SIZE\_LESS\_THAN\_ZERO[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Tick size less than zero. + +### \-4009 MAX\_PRICE\_LESS\_THAN\_MIN\_PRICE[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Max price less than min price. + +### \-4010 MAX\_QTY\_LESS\_THAN\_MIN\_QTY[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Max qty less than min qty. + +### \-4011 STEP\_SIZE\_LESS\_THAN\_ZERO[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Step size less than zero. + +### \-4012 MAX\_NUM\_ORDERS\_LESS\_THAN\_ZERO[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Max mum orders less than zero. + +### \-4013 PRICE\_LESS\_THAN\_MIN\_PRICE[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Price less than min price. + +### \-4014 PRICE\_NOT\_INCREASED\_BY\_TICK\_SIZE[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Price not increased by tick size. + +### \-4015 INVALID\_CL\_ORD\_ID\_LEN[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Client order id is not valid. +- Client order id length should not be more than 36 chars + +### \-4016 PRICE\_HIGHTER\_THAN\_MULTIPLIER\_UP[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Price is higher than mark price multiplier cap. + +### \-4017 MULTIPLIER\_UP\_LESS\_THAN\_ZERO[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Multiplier up less than zero. + +### \-4018 MULTIPLIER\_DOWN\_LESS\_THAN\_ZERO[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Multiplier down less than zero. + +### \-4019 COMPOSITE\_SCALE\_OVERFLOW[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Composite scale too large. + +### \-4020 TARGET\_STRATEGY\_INVALID[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Target strategy invalid for orderType '%s',reduceOnly '%b'. + +### \-4021 INVALID\_DEPTH\_LIMIT[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Invalid depth limit. +- '%s' is not valid depth limit. + +### \-4022 WRONG\_MARKET\_STATUS[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- market status sent is not valid. + +### \-4023 QTY\_NOT\_INCREASED\_BY\_STEP\_SIZE[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Qty not increased by step size. + +### \-4024 PRICE\_LOWER\_THAN\_MULTIPLIER\_DOWN[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Price is lower than mark price multiplier floor. + +### \-4025 MULTIPLIER\_DECIMAL\_LESS\_THAN\_ZERO[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Multiplier decimal less than zero. + +### \-4026 COMMISSION\_INVALID[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Commission invalid. +- `%s` less than zero. +- `%s` absolute value greater than `%s` + +### \-4027 INVALID\_ACCOUNT\_TYPE[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Invalid account type. + +### \-4028 INVALID\_LEVERAGE[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Invalid leverage +- Leverage `%s` is not valid +- Leverage `%s` already exist with `%s` + +### \-4029 INVALID\_TICK\_SIZE\_PRECISION[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Tick size precision is invalid. + +### \-4030 INVALID\_STEP\_SIZE\_PRECISION[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Step size precision is invalid. + +### \-4031 INVALID\_WORKING\_TYPE[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Invalid parameter working type +- Invalid parameter working type: `%s` + +### \-4032 EXCEED\_MAX\_CANCEL\_ORDER\_SIZE[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Exceed maximum cancel order size. +- Invalid parameter working type: `%s` + +### \-4033 INSURANCE\_ACCOUNT\_NOT\_FOUND[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Insurance account not found. + +### \-4044 INVALID\_BALANCE\_TYPE[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Balance Type is invalid. + +### \-4045 MAX\_STOP\_ORDER\_EXCEEDED[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Reach max stop order limit. + +### \-4046 NO\_NEED\_TO\_CHANGE\_MARGIN\_TYPE[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- No need to change margin type. + +### \-4047 THERE\_EXISTS\_OPEN\_ORDERS[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Margin type cannot be changed if there exists open orders. + +### \-4048 THERE\_EXISTS\_QUANTITY[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Margin type cannot be changed if there exists position. + +### \-4049 ADD\_ISOLATED\_MARGIN\_REJECT[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Add margin only support for isolated position. + +### \-4050 CROSS\_BALANCE\_INSUFFICIENT[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Cross balance insufficient. + +### \-4051 ISOLATED\_BALANCE\_INSUFFICIENT[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Isolated balance insufficient. + +### \-4052 NO\_NEED\_TO\_CHANGE\_AUTO\_ADD\_MARGIN[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- No need to change auto add margin. + +### \-4053 AUTO\_ADD\_CROSSED\_MARGIN\_REJECT[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Auto add margin only support for isolated position. + +### \-4054 ADD\_ISOLATED\_MARGIN\_NO\_POSITION\_REJECT[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Cannot add position margin: position is 0. + +### \-4055 AMOUNT\_MUST\_BE\_POSITIVE[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Amount must be positive. + +### \-4056 INVALID\_API\_KEY\_TYPE[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Invalid api key type. + +### \-4057 INVALID\_RSA\_PUBLIC\_KEY[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Invalid api public key + +### \-4058 MAX\_PRICE\_TOO\_LARGE[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- maxPrice and priceDecimal too large,please check. + +### \-4059 NO\_NEED\_TO\_CHANGE\_POSITION\_SIDE[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- No need to change position side. + +### \-4060 INVALID\_POSITION\_SIDE[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Invalid position side. + +### \-4061 POSITION\_SIDE\_NOT\_MATCH[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Order's position side does not match user's setting. + +### \-4062 REDUCE\_ONLY\_CONFLICT[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Invalid or improper reduceOnly value. + +### \-4063 INVALID\_OPTIONS\_REQUEST\_TYPE[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Invalid options request type + +### \-4064 INVALID\_OPTIONS\_TIME\_FRAME[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Invalid options time frame + +### \-4065 INVALID\_OPTIONS\_AMOUNT[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Invalid options amount + +### \-4066 INVALID\_OPTIONS\_EVENT\_TYPE[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Invalid options event type + +### \-4067 POSITION\_SIDE\_CHANGE\_EXISTS\_OPEN\_ORDERS[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Position side cannot be changed if there exists open orders. + +### \-4068 POSITION\_SIDE\_CHANGE\_EXISTS\_QUANTITY[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Position side cannot be changed if there exists position. + +### \-4069 INVALID\_OPTIONS\_PREMIUM\_FEE[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Invalid options premium fee + +### \-4070 INVALID\_CL\_OPTIONS\_ID\_LEN[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Client options id is not valid. +- Client options id length should be less than 32 chars + +### \-4071 INVALID\_OPTIONS\_DIRECTION[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Invalid options direction + +### \-4072 OPTIONS\_PREMIUM\_NOT\_UPDATE[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- premium fee is not updated, reject order + +### \-4073 OPTIONS\_PREMIUM\_INPUT\_LESS\_THAN\_ZERO[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- input premium fee is less than 0, reject order + +### \-4074 OPTIONS\_AMOUNT\_BIGGER\_THAN\_UPPER[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Order amount is bigger than upper boundary or less than 0, reject order + +### \-4075 OPTIONS\_PREMIUM\_OUTPUT\_ZERO[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- output premium fee is less than 0, reject order + +### \-4076 OPTIONS\_PREMIUM\_TOO\_DIFF[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- original fee is too much higher than last fee + +### \-4077 OPTIONS\_PREMIUM\_REACH\_LIMIT[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- place order amount has reached to limit, reject order + +### \-4078 OPTIONS\_COMMON\_ERROR[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- options internal error + +### \-4079 INVALID\_OPTIONS\_ID[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- invalid options id +- invalid options id: %s +- duplicate options id %d for user %d + +### \-4080 OPTIONS\_USER\_NOT\_FOUND[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- user not found +- user not found with id: %s + +### \-4081 OPTIONS\_NOT\_FOUND[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- options not found +- options not found with id: %s + +### \-4082 INVALID\_BATCH\_PLACE\_ORDER\_SIZE[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Invalid number of batch place orders. +- Invalid number of batch place orders: %s + +### \-4083 PLACE\_BATCH\_ORDERS\_FAIL[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Fail to place batch orders. + +### \-4084 UPCOMING\_METHOD[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Method is not allowed currently. Upcoming soon. + +### \-4085 INVALID\_NOTIONAL\_LIMIT\_COEF[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Invalid notional limit coefficient + +### \-4086 INVALID\_PRICE\_SPREAD\_THRESHOLD[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Invalid price spread threshold + +### \-4087 REDUCE\_ONLY\_ORDER\_PERMISSION[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- User can only place reduce only order + +### \-4088 NO\_PLACE\_ORDER\_PERMISSION[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- User can not place order currently + +### \-4104 INVALID\_CONTRACT\_TYPE[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Invalid contract type + +### \-4109 INACTIVE\_ACCOUNT[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Inactive account +- Transfer any amount of asset to future wallet to reactive + +### \-4114 INVALID\_CLIENT\_TRAN\_ID\_LEN[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- clientTranId is not valid +- Client tran id length should be less than 64 chars + +### \-4115 DUPLICATED\_CLIENT\_TRAN\_ID[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- clientTranId is duplicated +- Client tran id should be unique within 7 days + +### \-4116 DUPLICATED\_CLIENT\_ORDER\_ID[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- clientOrderId is duplicated + +### \-4117 STOP\_ORDER\_TRIGGERING[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- stop order is triggering + +### \-4118 REDUCE\_ONLY\_MARGIN\_CHECK\_FAILED[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- ReduceOnly Order Failed. Please check your existing position and open orders +- This indicates that the new reduce-only order, combined with an existing same-side open order, would create an opposite-side position and lead to insufficient margin; please cancel the open order and try again. + +### \-4120 STOP\_ORDER\_SWITCH\_ALGO[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Order type not supported for this endpoint. Please use the Algo Order API endpoints instead. + +### \-4131 MARKET\_ORDER\_REJECT[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- The counterparty's best price does not meet the PERCENT\_PRICE filter limit + +### \-4135 INVALID\_ACTIVATION\_PRICE[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Invalid activation price + +### \-4137 QUANTITY\_EXISTS\_WITH\_CLOSE\_POSITION[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Quantity must be zero with closePosition equals true + +### \-4138 REDUCE\_ONLY\_MUST\_BE\_TRUE[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Reduce only must be true with closePosition equals true + +### \-4139 ORDER\_TYPE\_CANNOT\_BE\_MKT[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Order type can not be market if it's unable to cancel + +### \-4140 INVALID\_OPENING\_POSITION\_STATUS[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Invalid symbol status for opening position + +### \-4141 SYMBOL\_ALREADY\_CLOSED[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Symbol is closed + +### \-4142 STRATEGY\_INVALID\_TRIGGER\_PRICE[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- REJECT: take profit or stop order will be triggered immediately + +### \-4144 INVALID\_PAIR[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Invalid pair + +### \-4161 ISOLATED\_LEVERAGE\_REJECT\_WITH\_POSITION[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Leverage reduction is not supported in Isolated Margin Mode with open positions + +### \-4164 MIN\_NOTIONAL[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Order's notional must be no smaller than 5.0 (unless you choose reduce only) +- Order's notional must be no smaller than %s (unless you choose reduce only) + +### \-4165 INVALID\_TIME\_INTERVAL[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Invalid time interval +- Maximum time interval is %s days + +### \-4167 ISOLATED\_REJECT\_WITH\_JOINT\_MARGIN[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Unable to adjust to Multi-Assets mode with symbols of USDⓈ-M Futures under isolated-margin mode. + +### \-4168 JOINT\_MARGIN\_REJECT\_WITH\_ISOLATED[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Unable to adjust to isolated-margin mode under the Multi-Assets mode. + +### \-4169 JOINT\_MARGIN\_REJECT\_WITH\_MB[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Unable to adjust Multi-Assets Mode with insufficient margin balance in USDⓈ-M Futures. + +### \-4170 JOINT\_MARGIN\_REJECT\_WITH\_OPEN\_ORDER[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Unable to adjust Multi-Assets Mode with open orders in USDⓈ-M Futures. + +### \-4171 NO\_NEED\_TO\_CHANGE\_JOINT\_MARGIN[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Adjusted asset mode is currently set and does not need to be adjusted repeatedly. + +### \-4172 JOINT\_MARGIN\_REJECT\_WITH\_NEGATIVE\_BALANCE[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Unable to adjust Multi-Assets Mode with a negative wallet balance of margin available asset in USDⓈ-M Futures account. + +### \-4183 ISOLATED\_REJECT\_WITH\_JOINT\_MARGIN[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Price is higher than stop price multiplier cap. +- Limit price can't be higher than %s. + +### \-4184 PRICE\_LOWER\_THAN\_STOP\_MULTIPLIER\_DOWN[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Price is lower than stop price multiplier floor. +- Limit price can't be lower than %s. + +### \-4192 COOLING\_OFF\_PERIOD[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Trade forbidden due to Cooling-off Period. + +### \-4202 ADJUST\_LEVERAGE\_KYC\_FAILED[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Intermediate Personal Verification is required for adjusting leverage over 20x + +### \-4203 ADJUST\_LEVERAGE\_ONE\_MONTH\_FAILED[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- More than 20x leverage is available one month after account registration. + +### \-4205 ADJUST\_LEVERAGE\_X\_DAYS\_FAILED[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- More than 20x leverage is available %s days after Futures account registration. + +### \-4206 ADJUST\_LEVERAGE\_KYC\_LIMIT[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Users in this country has limited adjust leverage. +- Users in your location/country can only access a maximum leverage of %s + +### \-4208 ADJUST\_LEVERAGE\_ACCOUNT\_SYMBOL\_FAILED[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Current symbol leverage cannot exceed 20 when using position limit adjustment service. + +### \-4209 ADJUST\_LEVERAGE\_SYMBOL\_FAILED[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- The max leverage of Symbol is 20x +- Leverage adjustment failed. Current symbol max leverage limit is %sx + +### \-4210 STOP\_PRICE\_HIGHER\_THAN\_PRICE\_MULTIPLIER\_LIMIT[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Stop price is higher than price multiplier cap. +- Stop price can't be higher than %s + +### \-4211 STOP\_PRICE\_LOWER\_THAN\_PRICE\_MULTIPLIER\_LIMIT[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Stop price is lower than price multiplier floor. +- Stop price can't be lower than %s + +### \-4400 TRADING\_QUANTITATIVE\_RULE[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Futures Trading Quantitative Rules violated, only reduceOnly order is allowed, please try again later. + +### \-4401 LARGE\_POSITION\_SYM\_RULE[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Futures Trading Risk Control Rules of large position holding violated, only reduceOnly order is allowed, please reduce the position. . + +### \-4402 COMPLIANCE\_BLACK\_SYMBOL\_RESTRICTION[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Dear user, as per our Terms of Use and compliance with local regulations, this feature is currently not available in your region. + +### \-4403 ADJUST\_LEVERAGE\_COMPLIANCE\_FAILED[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Dear user, as per our Terms of Use and compliance with local regulations, the leverage can only up to 10x in your region +- Dear user, as per our Terms of Use and compliance with local regulations, the leverage can only up to %sx in your region + +## 50xx - Order Execution Issues[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +### \-5021 FOK\_ORDER\_REJECT[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Due to the order could not be filled immediately, the FOK order has been rejected. + +### \-5022 GTX\_ORDER\_REJECT[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Due to the order could not be executed as maker, the Post Only order will be rejected. + +### \-5024 MOVE\_ORDER\_NOT\_ALLOWED\_SYMBOL\_REASON[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Symbol is not in trading status. Order amendment is not permitted. + +### \-5025 LIMIT\_ORDER\_ONLY[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Only limit order is supported. + +### \-5026 Exceed\_Maximum\_Modify\_Order\_Limit[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Exceed maximum modify order limit. + +### \-5027 SAME\_ORDER[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- No need to modify the order. + +### \-5028 ME\_RECVWINDOW\_REJECT[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Timestamp for this request is outside of the ME recvWindow. + +### \-5029 MODIFICATION\_MIN\_NOTIONAL[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Order's notional must be no smaller than %s + +### \-5037 INVALID\_PRICE\_MATCH[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Invalid price match + +### \-5038 UNSUPPORTED\_ORDER\_TYPE\_PRICE\_MATCH[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Price match only supports order type: LIMIT, STOP AND TAKE\_PROFIT + +### \-5039 INVALID\_SELF\_TRADE\_PREVENTION\_MODE[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- Invalid self trade prevention mode + +### \-5040 FUTURE\_GOOD\_TILL\_DATE[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- The goodTillDate timestamp must be greater than the current time plus 600 seconds and smaller than 253402300799000 (UTC 9999-12-31 23:59:59) + +### \-5041 BBO\_ORDER\_REJECT[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- No depth matches this BBO order + +### \-5043 Existing\_Pending\_Modification[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + +- A pending modification already exists for this order. + +- [10xx - General Server or Network issues](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-1000 UNKNOWN](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-1001 DISCONNECTED](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-1002 UNAUTHORIZED](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-1003 TOO\_MANY\_REQUESTS](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-1004 DUPLICATE\_IP](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-1005 NO\_SUCH\_IP](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-1006 UNEXPECTED\_RESP](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-1007 TIMEOUT](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-1008 Request Throttled](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-1010 ERROR\_MSG\_RECEIVED](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-1011 NON\_WHITE\_LIST](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-1013 INVALID\_MESSAGE](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-1014 UNKNOWN\_ORDER\_COMPOSITION](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-1015 TOO\_MANY\_ORDERS](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-1016 SERVICE\_SHUTTING\_DOWN](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-1020 UNSUPPORTED\_OPERATION](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-1021 INVALID\_TIMESTAMP](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-1022 INVALID\_SIGNATURE](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-1023 START\_TIME\_GREATER\_THAN\_END\_TIME](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-1099 NOT\_FOUND](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) +- [11xx - Request issues](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-1100 ILLEGAL\_CHARS](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-1101 TOO\_MANY\_PARAMETERS](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-1102 MANDATORY\_PARAM\_EMPTY\_OR\_MALFORMED](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-1103 UNKNOWN\_PARAM](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-1104 UNREAD\_PARAMETERS](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-1105 PARAM\_EMPTY](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-1106 PARAM\_NOT\_REQUIRED](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-1108 BAD\_ASSET](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-1109 BAD\_ACCOUNT](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-1110 BAD\_INSTRUMENT\_TYPE](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-1111 BAD\_PRECISION](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-1112 NO\_DEPTH](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-1113 WITHDRAW\_NOT\_NEGATIVE](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-1114 TIF\_NOT\_REQUIRED](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-1115 INVALID\_TIF](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-1116 INVALID\_ORDER\_TYPE](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-1117 INVALID\_SIDE](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-1118 EMPTY\_NEW\_CL\_ORD\_ID](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-1119 EMPTY\_ORG\_CL\_ORD\_ID](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-1120 BAD\_INTERVAL](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-1121 BAD\_SYMBOL](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-1122 INVALID\_SYMBOL\_STATUS](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-1125 INVALID\_LISTEN\_KEY](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-1126 ASSET\_NOT\_SUPPORTED](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-1127 MORE\_THAN\_XX\_HOURS](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-1128 OPTIONAL\_PARAMS\_BAD\_COMBO](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-1130 INVALID\_PARAMETER](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-1136 INVALID\_NEW\_ORDER\_RESP\_TYPE](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) +- [20xx - Processing Issues](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-2010 NEW\_ORDER\_REJECTED](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-2011 CANCEL\_REJECTED](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-2012 CANCEL\_ALL\_FAIL](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-2013 NO\_SUCH\_ORDER](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-2014 BAD\_API\_KEY\_FMT](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-2015 REJECTED\_MBX\_KEY](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-2016 NO\_TRADING\_WINDOW](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-2017 API\_KEYS\_LOCKED](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-2018 BALANCE\_NOT\_SUFFICIENT](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-2019 MARGIN\_NOT\_SUFFICIEN](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-2020 UNABLE\_TO\_FILL](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-2021 ORDER\_WOULD\_IMMEDIATELY\_TRIGGER](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-2022 REDUCE\_ONLY\_REJECT](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-2023 USER\_IN\_LIQUIDATION](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-2024 POSITION\_NOT\_SUFFICIENT](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-2025 MAX\_OPEN\_ORDER\_EXCEEDED](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-2026 REDUCE\_ONLY\_ORDER\_TYPE\_NOT\_SUPPORTED](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-2027 MAX\_LEVERAGE\_RATIO](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-2028 MIN\_LEVERAGE\_RATIO](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) +- [40xx - Filters and other Issues](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4000 INVALID\_ORDER\_STATUS](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4001 PRICE\_LESS\_THAN\_ZERO](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4002 PRICE\_GREATER\_THAN\_MAX\_PRICE](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4003 QTY\_LESS\_THAN\_ZERO](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4004 QTY\_LESS\_THAN\_MIN\_QTY](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4005 QTY\_GREATER\_THAN\_MAX\_QTY](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4006 STOP\_PRICE\_LESS\_THAN\_ZERO](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4007 STOP\_PRICE\_GREATER\_THAN\_MAX\_PRICE](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4008 TICK\_SIZE\_LESS\_THAN\_ZERO](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4009 MAX\_PRICE\_LESS\_THAN\_MIN\_PRICE](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4010 MAX\_QTY\_LESS\_THAN\_MIN\_QTY](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4011 STEP\_SIZE\_LESS\_THAN\_ZERO](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4012 MAX\_NUM\_ORDERS\_LESS\_THAN\_ZERO](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4013 PRICE\_LESS\_THAN\_MIN\_PRICE](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4014 PRICE\_NOT\_INCREASED\_BY\_TICK\_SIZE](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4015 INVALID\_CL\_ORD\_ID\_LEN](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4016 PRICE\_HIGHTER\_THAN\_MULTIPLIER\_UP](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4017 MULTIPLIER\_UP\_LESS\_THAN\_ZERO](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4018 MULTIPLIER\_DOWN\_LESS\_THAN\_ZERO](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4019 COMPOSITE\_SCALE\_OVERFLOW](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4020 TARGET\_STRATEGY\_INVALID](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4021 INVALID\_DEPTH\_LIMIT](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4022 WRONG\_MARKET\_STATUS](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4023 QTY\_NOT\_INCREASED\_BY\_STEP\_SIZE](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4024 PRICE\_LOWER\_THAN\_MULTIPLIER\_DOWN](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4025 MULTIPLIER\_DECIMAL\_LESS\_THAN\_ZERO](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4026 COMMISSION\_INVALID](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4027 INVALID\_ACCOUNT\_TYPE](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4028 INVALID\_LEVERAGE](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4029 INVALID\_TICK\_SIZE\_PRECISION](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4030 INVALID\_STEP\_SIZE\_PRECISION](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4031 INVALID\_WORKING\_TYPE](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4032 EXCEED\_MAX\_CANCEL\_ORDER\_SIZE](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4033 INSURANCE\_ACCOUNT\_NOT\_FOUND](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4044 INVALID\_BALANCE\_TYPE](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4045 MAX\_STOP\_ORDER\_EXCEEDED](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4046 NO\_NEED\_TO\_CHANGE\_MARGIN\_TYPE](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4047 THERE\_EXISTS\_OPEN\_ORDERS](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4048 THERE\_EXISTS\_QUANTITY](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4049 ADD\_ISOLATED\_MARGIN\_REJECT](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4050 CROSS\_BALANCE\_INSUFFICIENT](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4051 ISOLATED\_BALANCE\_INSUFFICIENT](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4052 NO\_NEED\_TO\_CHANGE\_AUTO\_ADD\_MARGIN](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4053 AUTO\_ADD\_CROSSED\_MARGIN\_REJECT](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4054 ADD\_ISOLATED\_MARGIN\_NO\_POSITION\_REJECT](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4055 AMOUNT\_MUST\_BE\_POSITIVE](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4056 INVALID\_API\_KEY\_TYPE](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4057 INVALID\_RSA\_PUBLIC\_KEY](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4058 MAX\_PRICE\_TOO\_LARGE](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4059 NO\_NEED\_TO\_CHANGE\_POSITION\_SIDE](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4060 INVALID\_POSITION\_SIDE](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4061 POSITION\_SIDE\_NOT\_MATCH](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4062 REDUCE\_ONLY\_CONFLICT](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4063 INVALID\_OPTIONS\_REQUEST\_TYPE](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4064 INVALID\_OPTIONS\_TIME\_FRAME](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4065 INVALID\_OPTIONS\_AMOUNT](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4066 INVALID\_OPTIONS\_EVENT\_TYPE](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4067 POSITION\_SIDE\_CHANGE\_EXISTS\_OPEN\_ORDERS](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4068 POSITION\_SIDE\_CHANGE\_EXISTS\_QUANTITY](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4069 INVALID\_OPTIONS\_PREMIUM\_FEE](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4070 INVALID\_CL\_OPTIONS\_ID\_LEN](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4071 INVALID\_OPTIONS\_DIRECTION](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4072 OPTIONS\_PREMIUM\_NOT\_UPDATE](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4073 OPTIONS\_PREMIUM\_INPUT\_LESS\_THAN\_ZERO](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4074 OPTIONS\_AMOUNT\_BIGGER\_THAN\_UPPER](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4075 OPTIONS\_PREMIUM\_OUTPUT\_ZERO](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4076 OPTIONS\_PREMIUM\_TOO\_DIFF](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4077 OPTIONS\_PREMIUM\_REACH\_LIMIT](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4078 OPTIONS\_COMMON\_ERROR](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4079 INVALID\_OPTIONS\_ID](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4080 OPTIONS\_USER\_NOT\_FOUND](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4081 OPTIONS\_NOT\_FOUND](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4082 INVALID\_BATCH\_PLACE\_ORDER\_SIZE](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4083 PLACE\_BATCH\_ORDERS\_FAIL](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4084 UPCOMING\_METHOD](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4085 INVALID\_NOTIONAL\_LIMIT\_COEF](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4086 INVALID\_PRICE\_SPREAD\_THRESHOLD](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4087 REDUCE\_ONLY\_ORDER\_PERMISSION](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4088 NO\_PLACE\_ORDER\_PERMISSION](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4104 INVALID\_CONTRACT\_TYPE](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4109 INACTIVE\_ACCOUNT](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4114 INVALID\_CLIENT\_TRAN\_ID\_LEN](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4115 DUPLICATED\_CLIENT\_TRAN\_ID](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4116 DUPLICATED\_CLIENT\_ORDER\_ID](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4117 STOP\_ORDER\_TRIGGERING](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4118 REDUCE\_ONLY\_MARGIN\_CHECK\_FAILED](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4120 STOP\_ORDER\_SWITCH\_ALGO](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4131 MARKET\_ORDER\_REJECT](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4135 INVALID\_ACTIVATION\_PRICE](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4137 QUANTITY\_EXISTS\_WITH\_CLOSE\_POSITION](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4138 REDUCE\_ONLY\_MUST\_BE\_TRUE](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4139 ORDER\_TYPE\_CANNOT\_BE\_MKT](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4140 INVALID\_OPENING\_POSITION\_STATUS](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4141 SYMBOL\_ALREADY\_CLOSED](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4142 STRATEGY\_INVALID\_TRIGGER\_PRICE](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4144 INVALID\_PAIR](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4161 ISOLATED\_LEVERAGE\_REJECT\_WITH\_POSITION](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4164 MIN\_NOTIONAL](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4165 INVALID\_TIME\_INTERVAL](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4167 ISOLATED\_REJECT\_WITH\_JOINT\_MARGIN](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4168 JOINT\_MARGIN\_REJECT\_WITH\_ISOLATED](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4169 JOINT\_MARGIN\_REJECT\_WITH\_MB](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4170 JOINT\_MARGIN\_REJECT\_WITH\_OPEN\_ORDER](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4171 NO\_NEED\_TO\_CHANGE\_JOINT\_MARGIN](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4172 JOINT\_MARGIN\_REJECT\_WITH\_NEGATIVE\_BALANCE](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4183 ISOLATED\_REJECT\_WITH\_JOINT\_MARGIN](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4184 PRICE\_LOWER\_THAN\_STOP\_MULTIPLIER\_DOWN](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4192 COOLING\_OFF\_PERIOD](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4202 ADJUST\_LEVERAGE\_KYC\_FAILED](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4203 ADJUST\_LEVERAGE\_ONE\_MONTH\_FAILED](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4205 ADJUST\_LEVERAGE\_X\_DAYS\_FAILED](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4206 ADJUST\_LEVERAGE\_KYC\_LIMIT](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4208 ADJUST\_LEVERAGE\_ACCOUNT\_SYMBOL\_FAILED](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4209 ADJUST\_LEVERAGE\_SYMBOL\_FAILED](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4210 STOP\_PRICE\_HIGHER\_THAN\_PRICE\_MULTIPLIER\_LIMIT](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4211 STOP\_PRICE\_LOWER\_THAN\_PRICE\_MULTIPLIER\_LIMIT](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4400 TRADING\_QUANTITATIVE\_RULE](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4401 LARGE\_POSITION\_SYM\_RULE](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4402 COMPLIANCE\_BLACK\_SYMBOL\_RESTRICTION](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-4403 ADJUST\_LEVERAGE\_COMPLIANCE\_FAILED](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) +- [50xx - Order Execution Issues](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-5021 FOK\_ORDER\_REJECT](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-5022 GTX\_ORDER\_REJECT](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-5024 MOVE\_ORDER\_NOT\_ALLOWED\_SYMBOL\_REASON](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-5025 LIMIT\_ORDER\_ONLY](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-5026 Exceed\_Maximum\_Modify\_Order\_Limit](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-5027 SAME\_ORDER](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-5028 ME\_RECVWINDOW\_REJECT](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-5029 MODIFICATION\_MIN\_NOTIONAL](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-5037 INVALID\_PRICE\_MATCH](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-5038 UNSUPPORTED\_ORDER\_TYPE\_PRICE\_MATCH](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-5039 INVALID\_SELF\_TRADE\_PREVENTION\_MODE](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-5040 FUTURE\_GOOD\_TILL\_DATE](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-5041 BBO\_ORDER\_REJECT](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) + - [\-5043 Existing\_Pending\_Modification](https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_faq_stp-faq.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_faq_stp-faq.md new file mode 100644 index 0000000..86ab850 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_faq_stp-faq.md @@ -0,0 +1,196 @@ +--- +title: "Self Trade Prevention | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/faq/stp-faq" +fetched_at: "2026-01-27T05:28:26.817Z" +--- +# Self Trade Prevention (STP) FAQ + +## What is Self Trade Prevention?[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/faq/stp-faq) + +Self Trade Prevention (or STP) prevents orders of users, or the user's `tradeGroupId` to match against their own. + +## What defines a self-trade?[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/faq/stp-faq) + +A self-trade can occur in either scenario: + +- The order traded against the same account. +- The order traded against an account with the same `tradeGroupId`. + +## What happens when STP is triggered?[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/faq/stp-faq) + +There are three possible modes for what the system will do if an order could create a self-trade. + +`EXPIRE_TAKER` - This mode prevents a trade by immediately expiring the taker order's remaining quantity. + +`EXPIRE_MAKER` - This mode prevents a trade by immediately expiring the potential maker order's remaining quantity. + +`EXPIRE_BOTH` - This mode prevents a trade by immediately expiring both the taker and the potential maker orders' remaining quantities. + +The STP event will occur depending on the STP mode of the **taker order**. +Thus, the STP mode of an order that goes on the book is no longer relevant and will be ignored for all future order processing. + +## Where do I set STP mode for an order?[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/faq/stp-faq) + +STP can only be set using field `selfTradePreventionMode` through API endpoints below: + +- POST `/fapi/v1/order` +- POST `/fapi/v1/batchOrders` + +## What is a Trade Group Id?[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/faq/stp-faq) + +Different accounts with the same `tradeGroupId` are considered part of the same "trade group". Orders submitted by members of a trade group are eligible for STP according to the taker-order's STP mode. + +A user can confirm if their accounts are under the same `tradeGroupId` from the API either from `GET /fapi/v1/accountConfig` (REST API). + +If the value is `-1`, then the `tradeGroupId` has not been set for that account, so the STP may only take place between orders of the same account. + +We will release feature for user to group subaccounts to same `tradeGroupId` on website in future updates. + +## How do I know which symbol uses STP?[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/faq/stp-faq) + +Placing orders on all symbols in `GET fapi/v1/exchangeInfo` can set `selfTradePreventionMode`. + +## What order types support STP?[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/faq/stp-faq) + +`LIMIT`/`MARKET`/`STOP`/`TAKE_PROFIT`/`STOP_MARKET`/`TAKE_PROFIT_MARKET`/`TRAILING_STOP_MARKET` all supports STP when Time in force(timeInForce) set to `GTC`/ `IOC`/ `GTD`. STP won't take effect for Time in force(timeInForce) `FOK` or `GTX` + +## Does Modify order support STP?[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/faq/stp-faq) + +No. Modify order that has reset `selfTradePreventionMode` to `NONE` + +## How do I know if an order expired due to STP?[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/faq/stp-faq) + +The order will have the status `EXPIRED_IN_MATCH`. + +In user data stream event `ORDER_TRADE_UPDATE`, field `X` would be `EXPIRED_IN_MATCH` if order is expired due to STP + +``` +{ "e":"ORDER_TRADE_UPDATE", // Event Type "E":1568879465651, // Event Time "T":1568879465650, // Transaction Time "o":{ "s":"BTCUSDT", // Symbol "c":"TEST", // Client Order Id // special client order id: // starts with "autoclose-": liquidation order // "adl_autoclose": ADL auto close order // "settlement_autoclose-": settlement order for delisting or delivery "S":"SELL", // Side "o":"TRAILING_STOP_MARKET", // Order Type "f":"GTC", // Time in Force "q":"0.001", // Original Quantity "p":"0", // Original Price "ap":"0", // Average Price "sp":"7103.04", // Stop Price. Please ignore with TRAILING_STOP_MARKET order "x":"EXPIRED", // Execution Type "X":"EXPIRED_IN_MATCH", // Order Status "i":8886774, // Order Id "l":"0", // Order Last Filled Quantity "z":"0", // Order Filled Accumulated Quantity "L":"0", // Last Filled Price "N":"USDT", // Commission Asset, will not push if no commission "n":"0", // Commission, will not push if no commission "T":1568879465650, // Order Trade Time "t":0, // Trade Id "b":"0", // Bids Notional "a":"9.91", // Ask Notional "m":false, // Is this trade the maker side? "R":false, // Is this reduce only "wt":"CONTRACT_PRICE", // Stop Price Working Type "ot":"TRAILING_STOP_MARKET", // Original Order Type "ps":"LONG", // Position Side "cp":false, // If Close-All, pushed with conditional order "AP":"7476.89", // Activation Price, only puhed with TRAILING_STOP_MARKET order "cr":"5.0", // Callback Rate, only puhed with TRAILING_STOP_MARKET order "pP": false, // ignore "si": 0, // ignore "ss": 0, // ignore "rp":"0", // Realized Profit of the trade "V": "EXPIRE_MAKER", // selfTradePreventionMode "pm":"QUEUE", // price match type "gtd":1768879465650 // good till date }} +``` + +## STP Examples:[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/faq/stp-faq) + +For all these cases, assume that all orders for these examples are made on the same account. + +**Scenario A- A user sends an order with `EXPIRE_MAKER` that would match with their orders that are already on the book.** + +``` +Maker Order 1: symbol=BTCUSDT side=BUY type=LIMIT quantity=1 price=20002 selfTradePreventionMode=EXPIRE_MAKERMaker Order 2: symbol=BTCUSDT side=BUY type=LIMIT quantity=1 price=20001 selfTradePreventionMode=EXPIRE_MAKERTaker Order 1: symbol=BTCUSDT side=SELL type=LIMIT quantity=1 price=20000 selfTradePreventionMode=EXPIRE_MAKER +``` + +**Result**: The orders that were on the book will expire due to STP, and the taker order will go on the book. + +Maker Order 1 + +``` +{ "orderId": 292864710, "symbol": "BTCUSDT", "status": "FILLED", "clientOrderId": "testMaker1", "price": "20002", "avgPrice": "20002", "origQty": "1", "executedQty": "1", "cumQuote": "20002", "timeInForce": "GTC", "type": "LIMIT", "reduceOnly": false, "closePosition": false, "side": "BUY", "positionSide": "BOTH", "stopPrice": "0", "workingType": "CONTRACT_PRICE", "priceMatch": "NONE", "selfTradePreventionMode": "EXPIRE_MAKER", "goodTillDate": "null", "priceProtect": false, "origType": "LIMIT", "time": 1692849639460, "updateTime": 1692849639460} +``` + +Maker Order 2 + +``` +{ "orderId": 292864711, "symbol": "BTCUSDT", "status": "EXPIRED_IN_MATCH", "clientOrderId": "testMaker2", "price": "20001", "avgPrice": "0.0000", "origQty": "1", "executedQty": "0", "cumQuote": "0", "timeInForce": "GTC", "type": "LIMIT", "reduceOnly": false, "closePosition": false, "side": "BUY", "positionSide": "BOTH", "stopPrice": "0", "workingType": "CONTRACT_PRICE", "priceMatch": "NONE", "selfTradePreventionMode": "EXPIRE_MAKER", "goodTillDate": "null", "priceProtect": false, "origType": "LIMIT", "time": 1692849639460, "updateTime": 1692849639460} +``` + +Output of the Taker Order + +``` +{ "orderId": 292864712, "symbol": "BTCUSDT", "status": "PARTIALLY_FILLED", "clientOrderId": "testTaker1", "price": "20000", "avgPrice": "20002", "origQty": "2", "executedQty": "1", "cumQuote": "20002", "timeInForce": "GTC", "type": "LIMIT", "reduceOnly": false, "closePosition": false, "side": "SELL", "positionSide": "BOTH", "stopPrice": "0", "workingType": "CONTRACT_PRICE", "priceMatch": "NONE", "selfTradePreventionMode": "EXPIRE_MAKER", "goodTillDate": "null", "priceProtect": false, "origType": "LIMIT", "time": 1692849639460, "updateTime": 1692849639460} +``` + +**Scenario B - A user sends an order with `EXPIRE_TAKER` that would match with their orders already on the book.** + +``` +Maker Order 1: symbol=BTCUSDT side=BUY type=LIMIT quantity=1 price=20002 selfTradePreventionMode=EXPIRE_MAKERMaker Order 2: symbol=BTCUSDT side=BUY type=LIMIT quantity=1 price=20001 selfTradePreventionMode=EXPIRE_MAKERTaker Order 1: symbol=BTCUSDT side=SELL type=LIMIT quantity=2 price=3 selfTradePreventionMode=EXPIRE_TAKER +``` + +**Result**: The orders already on the book will remain, while the taker order will expire. + +Maker Order 1 + +``` +{ "orderId": 292864710, "symbol": "BTCUSDT", "status": "FILLED", "clientOrderId": "testMaker1", "price": "20002", "avgPrice": "0.0000", "origQty": "1", "executedQty": "0", "cumQuote": "0", "timeInForce": "GTC", "type": "LIMIT", "reduceOnly": false, "closePosition": false, "side": "BUY", "positionSide": "BOTH", "stopPrice": "0", "workingType": "CONTRACT_PRICE", "priceMatch": "NONE", "selfTradePreventionMode": "EXPIRE_MAKER", "goodTillDate": "null", "priceProtect": false, "origType": "LIMIT", "time": 1692849639460, "updateTime": 1692849639460} +``` + +Maker Order 2 + +``` +{ "orderId": 292864711, "symbol": "BTCUSDT", "status": "EXPIRED_IN_MATCH", "clientOrderId": "testMaker2", "price": "20001", "avgPrice": "0.0000", "origQty": "1", "executedQty": "0", "cumQuote": "0", "timeInForce": "GTC", "type": "LIMIT", "reduceOnly": false, "closePosition": false, "side": "BUY", "positionSide": "BOTH", "stopPrice": "0", "workingType": "CONTRACT_PRICE", "priceMatch": "NONE", "selfTradePreventionMode": "EXPIRE_MAKER", "goodTillDate": "null", "priceProtect": false, "origType": "LIMIT", "time": 1692849639460, "updateTime": 1692849639460} +``` + +Output of the Taker order + +``` +{ "orderId": 292864712, "symbol": "BTCUSDT", "status": "EXPIRED_IN_MATCH", "clientOrderId": "testTaker1", "price": "20000", "avgPrice": "0.0000", "origQty": "3", "executedQty": "0", "cumQuote": "0", "timeInForce": "GTC", "type": "LIMIT", "reduceOnly": false, "closePosition": false, "side": "SELL", "positionSide": "BOTH", "stopPrice": "0", "workingType": "CONTRACT_PRICE", "priceMatch": "NONE", "selfTradePreventionMode": "EXPIRE_TAKER", "goodTillDate": "null", "priceProtect": false, "origType": "LIMIT", "time": 1692849639460, "updateTime": 1692849639460} +``` + +**Scenario C- A user has an order on the book, and then sends an order with `EXPIRE_BOTH` that would match with the existing order.** + +``` +Maker Order: symbol=BTCUSDT side=BUY type=LIMIT quantity=1 price=20002 selfTradePreventionMode=EXPIRE_MAKERTaker Order: symbol=BTCUSDT side=SELL type=LIMIT quantity=3 price=20000 selfTradePreventionMode=EXPIRE_BOTH +``` + +**Result:** Both orders will expire. + +Maker Order + +``` +{ "orderId": 292864710, "symbol": "BTCUSDT", "status": "EXPIRED_IN_MATCH", "clientOrderId": "testMaker1", "price": "20002", "avgPrice": "0.0000", "origQty": "1", "executedQty": "0", "cumQuote": "0", "timeInForce": "GTC", "type": "LIMIT", "reduceOnly": false, "closePosition": false, "side": "BUY", "positionSide": "BOTH", "stopPrice": "0", "workingType": "CONTRACT_PRICE", "priceMatch": "NONE", "selfTradePreventionMode": "EXPIRE_MAKER", "goodTillDate": "null", "priceProtect": false, "origType": "LIMIT", "time": 1692849639460, "updateTime": 1692849639460} +``` + +Taker Order + +``` +{ "orderId": 292864712, "symbol": "BTCUSDT", "status": "EXPIRED_IN_MATCH", "clientOrderId": "testTaker1", "price": "20000", "avgPrice": "0.0000", "origQty": "3", "executedQty": "0", "cumQuote": "0", "timeInForce": "GTC", "type": "LIMIT", "reduceOnly": false, "closePosition": false, "side": "SELL", "positionSide": "BOTH", "stopPrice": "0", "workingType": "CONTRACT_PRICE", "priceMatch": "NONE", "selfTradePreventionMode": "EXPIRE_BOTH", "goodTillDate": "null", "priceProtect": false, "origType": "LIMIT", "time": 1692849639460, "updateTime": 1692849639460} +``` + +**Scenario D - A user has an order on the book with `EXPIRE_MAKER`, and then sends a new order with `EXPIRE_TAKER` which would match with the existing order.** + +``` +Maker Order: symbol=BTCUSDT side=BUY type=LIMIT quantity=1 price=1 selfTradePreventionMode=EXPIRE_MAKERTaker Order: symbol=BTCUSDT side=SELL type=LIMIT quantity=1 price=1 selfTradePreventionMode=EXPIRE_TAKER +``` + +**Result**: The taker order's STP mode will be used, so the taker order will be expired. + +Maker Order + +``` +{ "orderId": 292864710, "symbol": "BTCUSDT", "status": "NEW", "clientOrderId": "testMaker1", "price": "20002", "avgPrice": "0.0000", "origQty": "1", "executedQty": "0", "cumQuote": "0", "timeInForce": "GTC", "type": "LIMIT", "reduceOnly": false, "closePosition": false, "side": "BUY", "positionSide": "BOTH", "stopPrice": "0", "workingType": "CONTRACT_PRICE", "priceMatch": "NONE", "selfTradePreventionMode": "EXPIRE_MAKER", "goodTillDate": "null", "priceProtect": false, "origType": "LIMIT", "time": 1692849639460, "updateTime": 1692849639460} +``` + +Taker Order + +``` +{ "orderId": 292864712, "symbol": "BTCUSDT", "status": "EXPIRED_IN_MATCH", "clientOrderId": "testTaker1", "price": "20000", "avgPrice": "0.0000", "origQty": "3", "executedQty": "0", "cumQuote": "0", "timeInForce": "GTC", "type": "LIMIT", "reduceOnly": false, "closePosition": false, "side": "SELL", "positionSide": "BOTH", "stopPrice": "0", "workingType": "CONTRACT_PRICE", "priceMatch": "NONE", "selfTradePreventionMode": "EXPIRE_TAKER", "goodTillDate": "null", "priceProtect": false, "origType": "LIMIT", "time": 1692849639460, "updateTime": 1692849639460} +``` + +**Scenario E - A user sends a market order with `EXPIRE_MAKER` which would match with an existing order.** + +``` +Maker Order: symbol=ABCDEF side=BUY type=LIMIT quantity=1 price=1 selfTradePreventionMode=EXPIRE_MAKERTaker Order: symbol=ABCDEF side=SELL type=MARKET quantity=3 selfTradePreventionMode=EXPIRE_MAKER +``` + +**Result**: The existing order expires with the status `EXPIRED_IN_MATCH`, due to STP. The new order also expires but with status `EXPIRED`, due to low liquidity on the order book. + +Maker Order + +``` +{ "orderId": 292864710, "symbol": "BTCUSDT", "status": "EXPIRED_IN_MATCH", "clientOrderId": "testMaker1", "price": "20002", "avgPrice": "0.0000", "origQty": "1", "executedQty": "0", "cumQuote": "0", "timeInForce": "GTC", "type": "LIMIT", "reduceOnly": false, "closePosition": false, "side": "BUY", "positionSide": "BOTH", "stopPrice": "0", "workingType": "CONTRACT_PRICE", "priceMatch": "NONE", "selfTradePreventionMode": "EXPIRE_MAKER", "goodTillDate": "null", "priceProtect": false, "origType": "LIMIT", "time": 1692849639460, "updateTime": 1692849639460} +``` + +Taker Order + +``` +{ "orderId": 292864712, "symbol": "BTCUSDT", "status": "EXPIRED", "clientOrderId": "testTaker1", "price": "20000", "avgPrice": "0.0000", "origQty": "3", "executedQty": "0", "cumQuote": "0", "timeInForce": "GTC", "type": "LIMIT", "reduceOnly": false, "closePosition": false, "side": "SELL", "positionSide": "BOTH", "stopPrice": "0", "workingType": "CONTRACT_PRICE", "priceMatch": "NONE", "selfTradePreventionMode": "EXPIRE_MAKER", "goodTillDate": "null", "priceProtect": false, "origType": "LIMIT", "time": 1692849639460, "updateTime": 1692849639460} +``` + +- [What is Self Trade Prevention?](https://developers.binance.com/docs/derivatives/usds-margined-futures/faq/stp-faq) +- [What defines a self-trade?](https://developers.binance.com/docs/derivatives/usds-margined-futures/faq/stp-faq) +- [What happens when STP is triggered?](https://developers.binance.com/docs/derivatives/usds-margined-futures/faq/stp-faq) +- [Where do I set STP mode for an order?](https://developers.binance.com/docs/derivatives/usds-margined-futures/faq/stp-faq) +- [What is a Trade Group Id?](https://developers.binance.com/docs/derivatives/usds-margined-futures/faq/stp-faq) +- [How do I know which symbol uses STP?](https://developers.binance.com/docs/derivatives/usds-margined-futures/faq/stp-faq) +- [What order types support STP?](https://developers.binance.com/docs/derivatives/usds-margined-futures/faq/stp-faq) +- [Does Modify order support STP?](https://developers.binance.com/docs/derivatives/usds-margined-futures/faq/stp-faq) +- [How do I know if an order expired due to STP?](https://developers.binance.com/docs/derivatives/usds-margined-futures/faq/stp-faq) +- [STP Examples:](https://developers.binance.com/docs/derivatives/usds-margined-futures/faq/stp-faq) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_general-info.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_general-info.md new file mode 100644 index 0000000..0a45d06 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_general-info.md @@ -0,0 +1,445 @@ +--- +title: "General Info | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/general-info" +fetched_at: "2026-01-27T05:28:26.805Z" +--- +# General Info + +## General API Information[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/general-info) + +- Some endpoints will require an API Key. Please refer to [this page](https://www.binance.com/en/support/articles/360002502072) +- The base endpoint is: **[https://fapi.binance.com](https://fapi.binance.com/)** +- All endpoints return either a JSON object or array. +- Data is returned in **ascending** order. Oldest first, newest last. +- All time and timestamp related fields are in milliseconds. +- All data types adopt definition in JAVA. + +### Testnet API Information[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/general-info) + +- Most of the endpoints can be used in the testnet platform. +- The REST base url for **testnet** is "[https://demo-fapi.binance.com](https://demo-fapi.binance.com/)" +- The Websocket base url for **testnet** is "wss://fstream.binancefuture.com" + +--- + +## General Information on Endpoints[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/general-info) + +- For `GET` endpoints, parameters must be sent as a `query string`. +- For `POST`, `PUT`, and `DELETE` endpoints, the parameters may be sent as a `query string` or in the `request body` with content type `application/x-www-form-urlencoded`. You may mix parameters between both the `query string` and `request body` if you wish to do so. +- Parameters may be sent in any order. +- If a parameter sent in both the `query string` and `request body`, the `query string` parameter will be used. + +### HTTP Return Codes[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/general-info) + +- HTTP `4XX` return codes are used for for malformed requests; the issue is on the sender's side. +- HTTP `403` return code is used when the WAF Limit (Web Application Firewall) has been violated. +- HTTP `408` return code is used when a timeout has occurred while waiting for a response from the backend server. +- HTTP `429` return code is used when breaking a request rate limit. +- HTTP `418` return code is used when an IP has been auto-banned for continuing to send requests after receiving `429` codes. +- HTTP `5XX` return codes are used for internal errors; the issue is on Binance's side. + 1. If there is an error message **"Request occur unknown error."**, please retry later. +- HTTP `503` return code is used when: + 1. If there is an error message **"Unknown error, please check your request or try again later."** returned in the response, the API successfully sent the request but not get a response within the timeout period. + It is important to **NOT** treat this as a failure operation; the execution status is **UNKNOWN** and could have been a success; + 2. If there is an error message **"Service Unavailable."** returned in the response, it means this is a failure API operation and the service might be unavailable at the moment, you need to retry later. + 3. If there is an error message **"Internal error; unable to process your request. Please try again."** returned in the response, it means this is a failure API operation and you can resend your request if you need. + 4. If the response contains the error message **"Request throttled by system-level protection. Reduce-only/close-position orders are exempt. Please try again." (-1008)**, This indicates the node has exceeded its maximum concurrency and is temporarily throttled. Close-position, reduce-only, and cancel orders are exempt and will not receive this error. + +### HTTP 503 Status: Message Variants & Handling[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/general-info) + +#### A. “Unknown error, please check your request or try again later.” (Execution status **unknown**)[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/general-info) + +- **Meaning**: Request accepted but no response before timeout; **execution may have succeeded**. +- **Handling**: + - **Do not treat as immediate failure**; first verify via **WebSocket updates** or **orderId queries** to avoid duplicates. + - During peaks, prefer **single orders** over batch to reduce uncertainty. +- **Rate-limit counting**: **May or may not** count, check header to verify rate limit info + +#### B. “Service Unavailable.” (Failure)[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/general-info) + +- **Meaning**: Service temporarily unavailable; **100% failure**. +- **Handling**: **Retry with exponential backoff** (e.g., 200ms → 400ms → 800ms, max 3–5 attempts). +- **Rate-limit counting**: **not counted** + +#### C. “Request throttled by system-level protection. Reduce-only/close-position orders are exempt. Please try again.” (**\-1008**, Failure)[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/general-info) + +- **Meaning**: System overload; **100% failure**. +- **Handling**: **Retry with backoff** and **reduce concurrency**; +- **Applicable endpoints**: + - `POST /fapi/v1/order` + - `POST /fapi/v1/batchOrders` + - `POST /fapi/v1/order/test` +- **Rate-limit counting**: **Not counted** (overload protection). +- **Exception integrated here**: When a request **reduces exposure** (Reduce-only / Close-position: `closePosition = true`, or `positionSide = BOTH` with `reduceOnly = true`, or `LONG+SELL`, or `SHORT+BUY`), it is **not affected or prioritized under -1008** to ensure risk reduction. + - Covered endpoints: `POST /fapi/v1/order`、`POST /fapi/v1/batchOrders` (when parameters satisfy the condition) + +### Error Codes and Messages[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/general-info) + +- Any endpoint can return an ERROR + +> **_The error payload is as follows:_** + +``` +{ "code": -1121, "msg": "Invalid symbol."} +``` + +- Specific error codes and messages defined in [Error Codes](https://developers.binance.com/docs/derivatives/usds-margined-futures/general-info). + +--- + +## SDK and Code Demonstration[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/general-info) + +**Disclaimer:** + +- The following SDKs are provided by partners and users, and are **not officially** produced. They are only used to help users become familiar with the API endpoint. Please use it with caution and expand R&D according to your own situation. +- Binance does not make any commitment to the safety and performance of the SDKs, nor will be liable for the risks or even losses caused by using the SDKs. + +### Python3[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/general-info) + +**SDK:** To get the provided SDK for Binance Futures Connector, please visit [https://github.com/binance/binance-connector-python](https://github.com/binance/binance-connector-python), or use the command below: `pip install binance-sdk-derivatives-trading-usds-futures` + +### Java[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/general-info) + +To get the provided SDK for Binance Futures, please visit [https://github.com/binance/binance-connector-java](https://github.com/binance/binance-connector-java), or use the command below: `git clone https://github.com/binance/binance-connector-java.git` + +--- + +## LIMITS[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/general-info) + +- The `/fapi/v1/exchangeInfo` `rateLimits` array contains objects related to the exchange's `RAW_REQUEST`, `REQUEST_WEIGHT`, and `ORDER` rate limits. These are further defined in the `ENUM definitions` section under `Rate limiters (rateLimitType)`. +- A `429` will be returned when either rate limit is violated. + +### IP Limits[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/general-info) + +- Every request will contain `X-MBX-USED-WEIGHT-(intervalNum)(intervalLetter)` in the response headers which has the current used weight for the IP for all request rate limiters defined. +- Each route has a `weight` which determines for the number of requests each endpoint counts for. Heavier endpoints and endpoints that do operations on multiple symbols will have a heavier `weight`. +- When a 429 is received, it's your obligation as an API to back off and not spam the API. +- **Repeatedly violating rate limits and/or failing to back off after receiving 429s will result in an automated IP ban (HTTP status 418).** +- IP bans are tracked and **scale in duration** for repeat offenders, **from 2 minutes to 3 days**. +- **The limits on the API are based on the IPs, not the API keys.** + +### Order Rate Limits[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/general-info) + +- Every order response will contain a `X-MBX-ORDER-COUNT-(intervalNum)(intervalLetter)` header which has the current order count for the account for all order rate limiters defined. +- Rejected/unsuccessful orders are not guaranteed to have `X-MBX-ORDER-COUNT-**` headers in the response. +- **The order rate limit is counted against each account**. + +--- + +## Endpoint Security Type[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/general-info) + +- Each endpoint has a security type that determines the how you will interact with it. +- API-keys are passed into the Rest API via the `X-MBX-APIKEY` header. +- API-keys and secret-keys **are case sensitive**. +- API-keys can be configured to only access certain types of secure endpoints. For example, one API-key could be used for TRADE only, while another API-key can access everything except for TRADE routes. +- By default, API-keys can access all secure routes. + +Security Type + +Description + +NONE + +Endpoint can be accessed freely. + +TRADE + +Endpoint requires sending a valid API-Key and signature. + +USER\_DATA + +Endpoint requires sending a valid API-Key and signature. + +USER\_STREAM + +Endpoint requires sending a valid API-Key. + +MARKET\_DATA + +Endpoint requires sending a valid API-Key. + +- `TRADE` and `USER_DATA` endpoints are `SIGNED` endpoints. + +### SIGNED (TRADE and USER\_DATA) Endpoint Security[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/general-info) + +- `SIGNED` endpoints require an additional parameter, `signature`, to be sent in the `query string` or `request body`. +- Endpoints use `HMAC SHA256` signatures. The `HMAC SHA256 signature` is a keyed `HMAC SHA256` operation. Use your `secretKey` as the key and `totalParams` as the value for the HMAC operation. +- The `signature` is **not case sensitive**. +- Please make sure the `signature` is the end part of your `query string` or `request body`. +- `totalParams` is defined as the `query string` concatenated with the `request body`. + +### Timing Security[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/general-info) + +- A `SIGNED` endpoint also requires a parameter, `timestamp`, to be sent which should be the millisecond timestamp of when the request was created and sent. +- An additional parameter, `recvWindow`, may be sent to specify the number of milliseconds after `timestamp` the request is valid for. If `recvWindow` is not sent, **it defaults to 5000**. + +> The logic is as follows: + +``` +if (timestamp < serverTime + 1000 && serverTime - timestamp <= recvWindow) { // process request} else { // reject request} +``` + +**Serious trading is about timing.** Networks can be unstable and unreliable, which can lead to requests taking varying amounts of time to reach the servers. With `recvWindow`, you can specify that the request must be processed within a certain number of milliseconds or be rejected by the server. + +### SIGNED Endpoint Examples for POST /fapi/v1/order - HMAC Keys[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/general-info) + +Here is a step-by-step example of how to send a vaild signed payload from the Linux command line using `echo`, `openssl`, and `curl`. + +Key + +Value + +apiKey + +dbefbc809e3e83c283a984c3a1459732ea7db1360ca80c5c2c8867408d28cc83 + +secretKey + +2b5eb11e18796d12d88f13dc27dbbd02c2cc51ff7059765ed9821957d82bb4d9 + +Parameter + +Value + +symbol + +BTCUSDT + +side + +BUY + +type + +LIMIT + +timeInForce + +GTC + +quantity + +1 + +price + +9000 + +recvWindow + +5000 + +timestamp + +1591702613943 + +#### Example 1: As a query string[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/general-info) + +> **Example 1** + +> **HMAC SHA256 signature:** + +``` + $ echo -n "symbol=BTCUSDT&side=BUY&type=LIMIT&quantity=1&price=9000&timeInForce=GTC&recvWindow=5000×tamp=1591702613943" | openssl dgst -sha256 -hmac "2b5eb11e18796d12d88f13dc27dbbd02c2cc51ff7059765ed9821957d82bb4d9" (stdin)= 3c661234138461fcc7a7d8746c6558c9842d4e10870d2ecbedf7777cad694af9 +``` + +> **curl command:** + +``` + (HMAC SHA256) $ curl -H "X-MBX-APIKEY: dbefbc809e3e83c283a984c3a1459732ea7db1360ca80c5c2c8867408d28cc83" -X POST 'https://fapi/binance.com/fapi/v1/order?symbol=BTCUSDT&side=BUY&type=LIMIT&quantity=1&price=9000&timeInForce=GTC&recvWindow=5000×tamp=1591702613943&signature= 3c661234138461fcc7a7d8746c6558c9842d4e10870d2ecbedf7777cad694af9' +``` + +- **queryString:** + + symbol=BTCUSDT + &side=BUY + &type=LIMIT + &timeInForce=GTC + &quantity=1 + &price=9000 + &recvWindow=5000 + ×tamp=1591702613943 + + +#### Example 2: As a request body[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/general-info) + +> **Example 2** + +> **HMAC SHA256 signature:** + +``` + $ echo -n "symbol=BTCUSDT&side=BUY&type=LIMIT&quantity=1&price=9000&timeInForce=GTC&recvWindow=5000×tamp=1591702613943" | openssl dgst -sha256 -hmac "2b5eb11e18796d12d88f13dc27dbbd02c2cc51ff7059765ed9821957d82bb4d9" (stdin)= 3c661234138461fcc7a7d8746c6558c9842d4e10870d2ecbedf7777cad694af9 +``` + +> **curl command:** + +``` + (HMAC SHA256) $ curl -H "X-MBX-APIKEY: dbefbc809e3e83c283a984c3a1459732ea7db1360ca80c5c2c8867408d28cc83" -X POST 'https://fapi/binance.com/fapi/v1/order' -d 'symbol=BTCUSDT&side=BUY&type=LIMIT&quantity=1&price=9000&timeInForce=GTC&recvWindow=5000×tamp=1591702613943&signature= 3c661234138461fcc7a7d8746c6558c9842d4e10870d2ecbedf7777cad694af9' +``` + +- **requestBody:** + + symbol=BTCUSDT + &side=BUY + &type=LIMIT + &timeInForce=GTC + &quantity=1 + &price=9000 + &recvWindow=5000 + ×tamp=1591702613943 + + +#### Example 3: Mixed query string and request body[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/general-info) + +> **Example 3** + +> **HMAC SHA256 signature:** + +``` + $ echo -n "symbol=BTCUSDT&side=BUY&type=LIMIT&timeInForce=GTCquantity=1&price=9000&recvWindow=5000×tamp= 1591702613943" | openssl dgst -sha256 -hmac "2b5eb11e18796d12d88f13dc27dbbd02c2cc51ff7059765ed9821957d82bb4d9" (stdin)= f9d0ae5e813ef6ccf15c2b5a434047a0181cb5a342b903b367ca6d27a66e36f2 +``` + +> **curl command:** + +``` + (HMAC SHA256) $ curl -H "X-MBX-APIKEY: dbefbc809e3e83c283a984c3a1459732ea7db1360ca80c5c2c8867408d28cc83" -X POST 'https://fapi.binance.com/fapi/v1/order?symbol=BTCUSDT&side=BUY&type=LIMIT&timeInForce=GTC' -d 'quantity=1&price=9000&recvWindow=5000×tamp=1591702613943&signature=f9d0ae5e813ef6ccf15c2b5a434047a0181cb5a342b903b367ca6d27a66e36f2' +``` + +- **queryString:** symbol=BTCUSDT&side=BUY&type=LIMIT&timeInForce=GTC +- **requestBody:** quantity=1&price=9000&recvWindow=5000×tamp= 1591702613943 + +Note that the signature is different in example 3. +There is no & between "GTC" and "quantity=1". + +### SIGNED Endpoint Examples for POST /fapi/v1/order - RSA Keys[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/general-info) + +- This will be a step by step process how to create the signature payload to send a valid signed payload. +- We support `PKCS#8` currently. +- To get your API key, you need to upload your RSA Public Key to your account and a corresponding API key will be provided for you. + +For this example, the private key will be referenced as `test-prv-key.pem` + +Key + +Value + +apiKey + +vE3BDAL1gP1UaexugRLtteaAHg3UO8Nza20uexEuW1Kh3tVwQfFHdAiyjjY428o2 + +Parameter + +Value + +symbol + +BTCUSDT + +side + +SELL + +type + +MARKET + +quantity + +1.23 + +recvWindow + +9999999 + +timestamp + +1671090801999 + +> **Signature payload (with the listed parameters):** + +``` +timestamp=1671090801999&recvWindow=9999999&symbol=BTCUSDT&side=SELL&type=MARKET&quantity=1.23 +``` + +**Step 1: Construct the payload** + +Arrange the list of parameters into a string. Separate each parameter with a `&`. + +**Step 2: Compute the signature:** + +2.1 - Encode signature payload as ASCII data. + +> **Step 2.2** + +``` + $ echo -n 'timestamp=1671090801999&recvWindow=9999999&symbol=BTCUSDT&side=SELL&type=MARKET&quantity=1.23' | openssl dgst -keyform PEM -sha256 -sign ./test-prv-key.pem +``` + +2.2 - Sign payload using RSASSA-PKCS1-v1\_5 algorithm with SHA-256 hash function. + +> **Step 2.3** + +``` +$ echo -n 'timestamp=1671090801999&recvWindow=9999999&symbol=BTCUSDT&side=SELL&type=MARKET&quantity=1.23' | openssl dgst -keyform PEM -sha256 -sign ./test-prv-key.pem | openssl enc -base64aap36wD5loVXizxvvPI3wz9Cjqwmb3KVbxoym0XeWG1jZq8umqrnSk8H8dkLQeySjgVY91Ufs%2BBGCW%2B4sZjQEpgAfjM76riNxjlD3coGGEsPsT2lG39R%2F1q72zpDs8pYcQ4A692NgHO1zXcgScTGgdkjp%2Brp2bcddKjyz5XBrBM%3D +``` + +2.3 - Encode output as base64 string. + +> **Step 2.4** + +``` +$ echo -n 'timestamp=1671090801999&recvWindow=9999999&symbol=BTCUSDT&side=SELL&type=MARKET&quantity=1.23' | openssl dgst -keyform PEM -sha256 -sign ./test-prv-key.pem | openssl enc -base64 | tr -d '\n'aap36wD5loVXizxvvPI3wz9Cjqwmb3KVbxoym0XeWG1jZq8umqrnSk8H8dkLQeySjgVY91Ufs%2BBGCW%2B4sZjQEpgAfjM76riNxjlD3coGGEsPsT2lG39R%2F1q72zpDs8pYcQ4A692NgHO1zXcgScTGgdkjp%2Brp2bcddKjyz5XBrBM%3D +``` + +2.4 - Delete any newlines in the signature. + +> **Step 2.5** + +``` +aap36wD5loVXizxvvPI3wz9Cjqwmb3KVbxoym0XeWG1jZq8umqrnSk8H8dkLQeySjgVY91Ufs%2BBGCW%2B4sZjQEpgAfjM76riNxjlD3coGGEsPsT2lG39R%2F1q72zpDs8pYcQ4A692NgHO1zXcgScTGgdkjp%2Brp2bcddKjyz5XBrBM%3D +``` + +2.5 - Since the signature may contain `/` and `=`, this could cause issues with sending the request. So the signature has to be URL encoded. + +> **Step 2.6** + +``` + curl -H "X-MBX-APIKEY: vE3BDAL1gP1UaexugRLtteaAHg3UO8Nza20uexEuW1Kh3tVwQfFHdAiyjjY428o2" -X POST 'https://fapi.binance.com/fapi/v1/order?timestamp=1671090801999&recvWindow=9999999&symbol=BTCUSDT&side=SELL&type=MARKET&quantity=1.23&signature=aap36wD5loVXizxvvPI3wz9Cjqwmb3KVbxoym0XeWG1jZq8umqrnSk8H8dkLQeySjgVY91Ufs%2BBGCW%2B4sZjQEpgAfjM76riNxjlD3coGGEsPsT2lG39R%2F1q72zpDs8pYcQ4A692NgHO1zXcgScTGgdkjp%2Brp2bcddKjyz5XBrBM%3D' +``` + +2.6 - curl command + +> **Bash script** + +``` +#!/usr/bin/env bash# Set up authentication:apiKey="vE3BDAL1gP1UaexugRLtteaAHg3UO8Nza20uexEuW1Kh3tVwQfFHdAiyjjY428o2" ### REPLACE THIS WITH YOUR API KEY# Set up the request:apiMethod="POST"apiCall="v1/order"apiParams="timestamp=1671090801999&recvWindow=9999999&symbol=BTCUSDT&side=SELL&type=MARKET&quantity=1.23"function rawurlencode { local value="$1" local len=${#value} local encoded="" local pos c o for (( pos=0 ; pos - If the symbol is not sent, tickers for all symbols will be returned in an array. + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/24hr-Ticker-Price-Change-Statistics) + +> **Response:** + +``` +{ "symbol": "BTCUSDT", "priceChange": "-94.99999800", "priceChangePercent": "-95.960", "weightedAvgPrice": "0.29628482", "lastPrice": "4.00000200", "lastQty": "200.00000000", "openPrice": "99.00000000", "highPrice": "100.00000000", "lowPrice": "0.10000000", "volume": "8913.30000000", "quoteVolume": "15.30000000", "openTime": 1499783499040, "closeTime": 1499869899040, "firstId": 28385, // First tradeId "lastId": 28460, // Last tradeId "count": 76 // Trade count} +``` + +> OR + +``` +[ { "symbol": "BTCUSDT", "priceChange": "-94.99999800", "priceChangePercent": "-95.960", "weightedAvgPrice": "0.29628482", "lastPrice": "4.00000200", "lastQty": "200.00000000", "openPrice": "99.00000000", "highPrice": "100.00000000", "lowPrice": "0.10000000", "volume": "8913.30000000", "quoteVolume": "15.30000000", "openTime": 1499783499040, "closeTime": 1499869899040, "firstId": 28385, // First tradeId "lastId": 28460, // Last tradeId "count": 76 // Trade count }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/24hr-Ticker-Price-Change-Statistics) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/24hr-Ticker-Price-Change-Statistics) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/24hr-Ticker-Price-Change-Statistics) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/24hr-Ticker-Price-Change-Statistics) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/24hr-Ticker-Price-Change-Statistics) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_ADL-Risk.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_ADL-Risk.md new file mode 100644 index 0000000..0b301a4 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_ADL-Risk.md @@ -0,0 +1,54 @@ +--- +title: "Query ADL risk rating | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/ADL-Risk" +fetched_at: "2026-01-27T05:28:27.056Z" +--- +# ADL Risk + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/ADL-Risk) + +Query the symbol-level ADL risk rating. The ADL risk rating measures the likelihood of ADL during liquidation, and the rating takes into account the insurance fund balance, position concentration on the symbol, order book depth, price volatility, average leverage, unrealized PnL, and margin utilization at the symbol level. The rating can be high, medium and low, and is updated every 30 minutes. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/ADL-Risk) + +GET `/fapi/v1/symbolAdlRisk` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/ADL-Risk) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/ADL-Risk) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +NO + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/ADL-Risk) + +> **Response:** + +``` +{ "symbol": "BTCUSDT", "adlRisk": "low", // ADL Risk rating "updateTime": 1597370495002} +``` + +> **OR (when symbol not sent)** + +``` +[ { "symbol": "BTCUSDT", "adlRisk": "low", // ADL Risk rating "updateTime": 1597370495002 }, { "symbol": "ETHUSDT", "adlRisk": "high", // ADL Risk rating "updateTime": 1597370495004 }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/ADL-Risk) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/ADL-Risk) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/ADL-Risk) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/ADL-Risk) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/ADL-Risk) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Basis.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Basis.md new file mode 100644 index 0000000..912e0b7 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Basis.md @@ -0,0 +1,87 @@ +--- +title: "Basis | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Basis" +fetched_at: "2026-01-27T05:28:27.065Z" +--- +# Basis + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Basis) + +Query future basis + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Basis) + +GET `/futures/data/basis` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Basis) + +**0** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Basis) + +Name + +Type + +Mandatory + +Description + +pair + +STRING + +YES + +BTCUSDT + +contractType + +ENUM + +YES + +CURRENT\_QUARTER, NEXT\_QUARTER, PERPETUAL + +period + +ENUM + +YES + +"5m","15m","30m","1h","2h","4h","6h","12h","1d" + +limit + +LONG + +YES + +Default 30,Max 500 + +startTime + +LONG + +NO + +endTime + +LONG + +NO + +> - If startTime and endTime are not sent, the most recent data is returned. +> - Only the data of the latest 30 days is available. + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Basis) + +``` +[ { "indexPrice": "34400.15945055", "contractType": "PERPETUAL", "basisRate": "0.0004", "futuresPrice": "34414.10", "annualizedBasisRate": "", "basis": "13.94054945", "pair": "BTCUSDT", "timestamp": 1698742800000 }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Basis) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Basis) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Basis) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Basis) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Basis) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Check-Server-Time.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Check-Server-Time.md new file mode 100644 index 0000000..919a755 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Check-Server-Time.md @@ -0,0 +1,34 @@ +--- +title: "Check Server Time | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Check-Server-Time" +fetched_at: "2026-01-27T05:28:27.069Z" +--- +# Check Server Time + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Check-Server-Time) + +Test connectivity to the Rest API and get the current server time. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Check-Server-Time) + +GET `/fapi/v1/time` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Check-Server-Time) + +1 + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Check-Server-Time) + +NONE + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Check-Server-Time) + +``` +{ "serverTime": 1499827319559} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Check-Server-Time) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Check-Server-Time) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Check-Server-Time) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Check-Server-Time) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Check-Server-Time) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Composite-Index-Symbol-Information.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Composite-Index-Symbol-Information.md new file mode 100644 index 0000000..fd7b197 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Composite-Index-Symbol-Information.md @@ -0,0 +1,48 @@ +--- +title: "Composite Index Symbol Information | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Composite-Index-Symbol-Information" +fetched_at: "2026-01-27T05:28:27.312Z" +--- +# Composite Index Symbol Information + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Composite-Index-Symbol-Information) + +Query composite index symbol information + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Composite-Index-Symbol-Information) + +GET `/fapi/v1/indexInfo` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Composite-Index-Symbol-Information) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Composite-Index-Symbol-Information) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +NO + +> - Only for composite index symbols + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Composite-Index-Symbol-Information) + +``` +[ { "symbol": "DEFIUSDT", "time": 1589437530011, // Current time "component": "baseAsset", //Component asset "baseAssetList":[ { "baseAsset":"BAL", "quoteAsset": "USDT", "weightInQuantity":"1.04406228", "weightInPercentage":"0.02783900" }, { "baseAsset":"BAND", "quoteAsset": "USDT", "weightInQuantity":"3.53782729", "weightInPercentage":"0.03935200" } ] }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Composite-Index-Symbol-Information) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Composite-Index-Symbol-Information) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Composite-Index-Symbol-Information) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Composite-Index-Symbol-Information) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Composite-Index-Symbol-Information) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Compressed-Aggregate-Trades-List.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Compressed-Aggregate-Trades-List.md new file mode 100644 index 0000000..afb4e62 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Compressed-Aggregate-Trades-List.md @@ -0,0 +1,88 @@ +--- +title: "Compressed Aggregate Trades List | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Compressed-Aggregate-Trades-List" +fetched_at: "2026-01-27T05:28:27.321Z" +--- +# Compressed/Aggregate Trades List + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Compressed-Aggregate-Trades-List) + +Get compressed, aggregate market trades. Market trades that fill in 100ms with the same price and the same taking side will have the quantity aggregated. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Compressed-Aggregate-Trades-List) + +GET `/fapi/v1/aggTrades` + +**Note**: + +> Retail Price Improvement(RPI) orders are aggregated and without special tags to be distinguished. + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Compressed-Aggregate-Trades-List) + +20 + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Compressed-Aggregate-Trades-List) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +fromId + +LONG + +NO + +ID to get aggregate trades from INCLUSIVE. + +startTime + +LONG + +NO + +Timestamp in ms to get aggregate trades from INCLUSIVE. + +endTime + +LONG + +NO + +Timestamp in ms to get aggregate trades until INCLUSIVE. + +limit + +INT + +NO + +Default 500; max 1000. + +> - support querying futures trade histories that are not older than one year +> - If both `startTime` and `endTime` are sent, time between `startTime` and `endTime` must be less than 1 hour. +> - If `fromId`, `startTime`, and `endTime` are not sent, the most recent aggregate trades will be returned. +> - Only market trades will be aggregated and returned, which means the insurance fund trades and ADL trades won't be aggregated. +> - Sending both `startTime`/`endTime` and `fromId` might cause response timeout, please send either `fromId` or `startTime`/`endTime` + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Compressed-Aggregate-Trades-List) + +``` +[ { "a": 26129, // Aggregate tradeId "p": "0.01633102", // Price "q": "4.70443515", // Quantity "f": 27781, // First tradeId "l": 27781, // Last tradeId "T": 1498793709153, // Timestamp "m": true, // Was the buyer the maker? }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Compressed-Aggregate-Trades-List) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Compressed-Aggregate-Trades-List) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Compressed-Aggregate-Trades-List) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Compressed-Aggregate-Trades-List) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Compressed-Aggregate-Trades-List) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Continuous-Contract-Kline-Candlestick-Data.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Continuous-Contract-Kline-Candlestick-Data.md new file mode 100644 index 0000000..3bf8693 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Continuous-Contract-Kline-Candlestick-Data.md @@ -0,0 +1,106 @@ +--- +title: "Continuous Contract Kline Candlestick Data | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Continuous-Contract-Kline-Candlestick-Data" +fetched_at: "2026-01-27T05:28:27.508Z" +--- +# Continuous Contract Kline/Candlestick Data + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Continuous-Contract-Kline-Candlestick-Data) + +Kline/candlestick bars for a specific contract type. Klines are uniquely identified by their open time. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Continuous-Contract-Kline-Candlestick-Data) + +GET `/fapi/v1/continuousKlines` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Continuous-Contract-Kline-Candlestick-Data) + +based on parameter `LIMIT` + +LIMIT + +weight + +\[1,100) + +1 + +\[100, 500) + +2 + +\[500, 1000\] + +5 + +\> 1000 + +10 + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Continuous-Contract-Kline-Candlestick-Data) + +Name + +Type + +Mandatory + +Description + +pair + +STRING + +YES + +contractType + +ENUM + +YES + +interval + +ENUM + +YES + +startTime + +LONG + +NO + +endTime + +LONG + +NO + +limit + +INT + +NO + +Default 500; max 1500. + +> - If startTime and endTime are not sent, the most recent klines are returned. + +> - Contract type: +> - PERPETUAL +> - CURRENT\_QUARTER +> - NEXT\_QUARTER +> - TRADIFI\_PERPETUAL + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Continuous-Contract-Kline-Candlestick-Data) + +``` +[ [ 1607444700000, // Open time "18879.99", // Open "18900.00", // High "18878.98", // Low "18896.13", // Close (or latest price) "492.363", // Volume 1607444759999, // Close time "9302145.66080", // Quote asset volume 1874, // Number of trades "385.983", // Taker buy volume "7292402.33267", // Taker buy quote asset volume "0" // Ignore. ]] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Continuous-Contract-Kline-Candlestick-Data) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Continuous-Contract-Kline-Candlestick-Data) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Continuous-Contract-Kline-Candlestick-Data) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Continuous-Contract-Kline-Candlestick-Data) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Continuous-Contract-Kline-Candlestick-Data) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Delist-Schedule.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Delist-Schedule.md new file mode 100644 index 0000000..12e19cd --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Delist-Schedule.md @@ -0,0 +1,12 @@ +--- +title: "Delist Schedule | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Delist-Schedule" +fetched_at: "2026-01-27T05:28:27.418Z" +--- +# Delist Schedule + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Delist-Schedule) + +The Futures team will update the `deliveryDate` in the `Get /fapi/v1/exchangeInfo` endpoint to the delisting time after the delisting announcement is published. Please refer to [Exchange Info](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Exchange-Information) to check the delisting information of contract trading pairs in advance. + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Delist-Schedule) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Delivery-Price.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Delivery-Price.md new file mode 100644 index 0000000..cf1bd7f --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Delivery-Price.md @@ -0,0 +1,48 @@ +--- +title: "Query Delivery Price | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Delivery-Price" +fetched_at: "2026-01-27T05:28:27.559Z" +--- +# Quarterly Contract Settlement Price + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Delivery-Price) + +Latest price for a symbol or symbols. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Delivery-Price) + +GET `/futures/data/delivery-price` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Delivery-Price) + +**0** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Delivery-Price) + +Name + +Type + +Mandatory + +Description + +pair + +STRING + +YES + +e.g BTCUSDT + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Delivery-Price) + +``` +[ { "deliveryTime": 1695945600000, "deliveryPrice": 27103.00000000 }, { "deliveryTime": 1688083200000, "deliveryPrice": 30733.60000000 }, { "deliveryTime": 1680220800000, "deliveryPrice": 27814.20000000 }, { "deliveryTime": 1648166400000, "deliveryPrice": 44066.30000000 }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Delivery-Price) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Delivery-Price) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Delivery-Price) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Delivery-Price) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Delivery-Price) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Exchange-Information.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Exchange-Information.md new file mode 100644 index 0000000..9781532 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Exchange-Information.md @@ -0,0 +1,34 @@ +--- +title: "Exchange Information | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Exchange-Information" +fetched_at: "2026-01-27T05:28:27.572Z" +--- +# Exchange Information + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Exchange-Information) + +Current exchange trading rules and symbol information + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Exchange-Information) + +GET `/fapi/v1/exchangeInfo` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Exchange-Information) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Exchange-Information) + +NONE + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Exchange-Information) + +``` +{ "exchangeFilters": [], "rateLimits": [ { "interval": "MINUTE", "intervalNum": 1, "limit": 2400, "rateLimitType": "REQUEST_WEIGHT" }, { "interval": "MINUTE", "intervalNum": 1, "limit": 1200, "rateLimitType": "ORDERS" } ], "serverTime": 1565613908500, // Ignore please. If you want to check current server time, please check via "GET /fapi/v1/time" "assets": [ // assets information { "asset": "BTC", "marginAvailable": true, // whether the asset can be used as margin in Multi-Assets mode "autoAssetExchange": "-0.10" // auto-exchange threshold in Multi-Assets margin mode }, { "asset": "USDT", "marginAvailable": true, "autoAssetExchange": "0" }, { "asset": "BNB", "marginAvailable": false, "autoAssetExchange": null } ], "symbols": [ { "symbol": "BLZUSDT", "pair": "BLZUSDT", "contractType": "PERPETUAL", "deliveryDate": 4133404800000, "onboardDate": 1598252400000, "status": "TRADING", "maintMarginPercent": "2.5000", // ignore "requiredMarginPercent": "5.0000", // ignore "baseAsset": "BLZ", "quoteAsset": "USDT", "marginAsset": "USDT", "pricePrecision": 5, // please do not use it as tickSize "quantityPrecision": 0, // please do not use it as stepSize "baseAssetPrecision": 8, "quotePrecision": 8, "underlyingType": "COIN", "underlyingSubType": ["STORAGE"], "settlePlan": 0, "triggerProtect": "0.15", // threshold for algo order with "priceProtect" "filters": [ { "filterType": "PRICE_FILTER", "maxPrice": "300", "minPrice": "0.0001", "tickSize": "0.0001" }, { "filterType": "LOT_SIZE", "maxQty": "10000000", "minQty": "1", "stepSize": "1" }, { "filterType": "MARKET_LOT_SIZE", "maxQty": "590119", "minQty": "1", "stepSize": "1" }, { "filterType": "MAX_NUM_ORDERS", "limit": 200 }, { "filterType": "MIN_NOTIONAL", "notional": "5.0", }, { "filterType": "PERCENT_PRICE", "multiplierUp": "1.1500", "multiplierDown": "0.8500", "multiplierDecimal": "4" } ], "OrderType": [ "LIMIT", "MARKET", "STOP", "STOP_MARKET", "TAKE_PROFIT", "TAKE_PROFIT_MARKET", "TRAILING_STOP_MARKET" ], "timeInForce": [ "GTC", "IOC", "FOK", "GTX" ], "liquidationFee": "0.010000", // liquidation fee rate "marketTakeBound": "0.30", // the max price difference rate( from mark price) a market order can make } ], "timezone": "UTC" } +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Exchange-Information) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Exchange-Information) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Exchange-Information) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Exchange-Information) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Exchange-Information) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Get-Funding-Rate-History.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Get-Funding-Rate-History.md new file mode 100644 index 0000000..c9d8374 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Get-Funding-Rate-History.md @@ -0,0 +1,74 @@ +--- +title: "Get Funding Rate History | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Get-Funding-Rate-History" +fetched_at: "2026-01-27T05:28:27.721Z" +--- +# Get Funding Rate History + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Get-Funding-Rate-History) + +Get Funding Rate History + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Get-Funding-Rate-History) + +GET `/fapi/v1/fundingRate` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Get-Funding-Rate-History) + +share 500/5min/IP rate limit with GET /fapi/v1/fundingInfo + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Get-Funding-Rate-History) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +NO + +startTime + +LONG + +NO + +Timestamp in ms to get funding rate from INCLUSIVE. + +endTime + +LONG + +NO + +Timestamp in ms to get funding rate until INCLUSIVE. + +limit + +INT + +NO + +Default 100; max 1000 + +> - If `startTime` and `endTime` are not sent, the most recent 200 records are returned. +> - If the number of data between `startTime` and `endTime` is larger than `limit`, return as `startTime` + `limit`. +> - In ascending order. + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Get-Funding-Rate-History) + +``` +[ { "symbol": "BTCUSDT", "fundingRate": "-0.03750000", "fundingTime": 1570608000000, "markPrice": "34287.54619963" // mark price associated with a particular funding fee charge }, { "symbol": "BTCUSDT", "fundingRate": "0.00010000", "fundingTime": 1570636800000, "markPrice": "34287.54619963" }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Get-Funding-Rate-History) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Get-Funding-Rate-History) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Get-Funding-Rate-History) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Get-Funding-Rate-History) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Get-Funding-Rate-History) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Get-Funding-Rate-Info.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Get-Funding-Rate-Info.md new file mode 100644 index 0000000..73f0f20 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Get-Funding-Rate-Info.md @@ -0,0 +1,32 @@ +--- +title: "Get Funding Info | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Get-Funding-Rate-Info" +fetched_at: "2026-01-27T05:28:27.634Z" +--- +# Get Funding Rate Info + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Get-Funding-Rate-Info) + +Query funding rate info for symbols that had FundingRateCap/ FundingRateFloor / fundingIntervalHours adjustment + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Get-Funding-Rate-Info) + +GET `/fapi/v1/fundingInfo` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Get-Funding-Rate-Info) + +**0** share 500/5min/IP rate limit with `GET /fapi/v1/fundingInfo` + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Get-Funding-Rate-Info) + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Get-Funding-Rate-Info) + +``` +[ { "symbol": "BLZUSDT", "adjustedFundingRateCap": "0.02500000", "adjustedFundingRateFloor": "-0.02500000", "fundingIntervalHours": 8, "disclaimer": false // ingore }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Get-Funding-Rate-Info) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Get-Funding-Rate-Info) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Get-Funding-Rate-Info) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Get-Funding-Rate-Info) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Get-Funding-Rate-Info) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Index-Constituents.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Index-Constituents.md new file mode 100644 index 0000000..b8279cb --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Index-Constituents.md @@ -0,0 +1,50 @@ +--- +title: "Query Index Price Constituents | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Index-Constituents" +fetched_at: "2026-01-27T05:28:27.850Z" +--- +# Query Index Price Constituents + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Index-Constituents) + +Query index price constituents + +**Note**: + +> Prices from constituents of TradFi perps will be hiden and displayed as -1. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Index-Constituents) + +GET `/fapi/v1/constituents` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Index-Constituents) + +**2** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Index-Constituents) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Index-Constituents) + +``` +{ "symbol": "BTCUSDT", "time": 1745401553408, "constituents": [ { "exchange": "binance", "symbol": "BTCUSDT", "price": "94057.03000000", "weight": "0.51282051" }, { "exchange": "coinbase", "symbol": "BTC-USDT", "price": "94140.58000000", "weight": "0.15384615" }, { "exchange": "gateio", "symbol": "BTC_USDT", "price": "94060.10000000", "weight": "0.02564103" }, { "exchange": "kucoin", "symbol": "BTC-USDT", "price": "94096.70000000", "weight": "0.07692308" }, { "exchange": "mxc", "symbol": "BTCUSDT", "price": "94057.02000000", "weight": "0.07692308" }, { "exchange": "bitget", "symbol": "BTCUSDT", "price": "94064.03000000", "weight": "0.07692308" }, { "exchange": "bybit", "symbol": "BTCUSDT", "price": "94067.90000000", "weight": "0.07692308" } ]} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Index-Constituents) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Index-Constituents) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Index-Constituents) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Index-Constituents) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Index-Constituents) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Index-Price-Kline-Candlestick-Data.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Index-Price-Kline-Candlestick-Data.md new file mode 100644 index 0000000..a33e73a --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Index-Price-Kline-Candlestick-Data.md @@ -0,0 +1,94 @@ +--- +title: "Index Price Kline Candlestick Data | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Index-Price-Kline-Candlestick-Data" +fetched_at: "2026-01-27T05:28:27.852Z" +--- +# Index Price Kline/Candlestick Data + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Index-Price-Kline-Candlestick-Data) + +Kline/candlestick bars for the index price of a pair. Klines are uniquely identified by their open time. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Index-Price-Kline-Candlestick-Data) + +GET `/fapi/v1/indexPriceKlines` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Index-Price-Kline-Candlestick-Data) + +based on parameter `LIMIT` + +LIMIT + +weight + +\[1,100) + +1 + +\[100, 500) + +2 + +\[500, 1000\] + +5 + +\> 1000 + +10 + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Index-Price-Kline-Candlestick-Data) + +Name + +Type + +Mandatory + +Description + +pair + +STRING + +YES + +interval + +ENUM + +YES + +startTime + +LONG + +NO + +endTime + +LONG + +NO + +limit + +INT + +NO + +Default 500; max 1500. + +- If startTime and endTime are not sent, the most recent klines are returned. + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Index-Price-Kline-Candlestick-Data) + +``` +[ [ 1591256400000, // Open time "9653.69440000", // Open "9653.69640000", // High "9651.38600000", // Low "9651.55200000", // Close (or latest price) "0 ", // Ignore 1591256459999, // Close time "0", // Ignore 60, // Ignore "0", // Ignore "0", // Ignore "0" // Ignore ]] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Index-Price-Kline-Candlestick-Data) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Index-Price-Kline-Candlestick-Data) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Index-Price-Kline-Candlestick-Data) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Index-Price-Kline-Candlestick-Data) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Index-Price-Kline-Candlestick-Data) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Insurance-Fund-Balance.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Insurance-Fund-Balance.md new file mode 100644 index 0000000..9331575 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Insurance-Fund-Balance.md @@ -0,0 +1,54 @@ +--- +title: "Query Insurance Fund Balance Snapshot | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Insurance-Fund-Balance" +fetched_at: "2026-01-27T05:28:27.894Z" +--- +# Query Insurance Fund Balance Snapshot + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Insurance-Fund-Balance) + +Query Insurance Fund Balance Snapshot + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Insurance-Fund-Balance) + +GET `/fapi/v1/insuranceBalance` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Insurance-Fund-Balance) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Insurance-Fund-Balance) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +NO + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Insurance-Fund-Balance) + +pass symbol + +``` +{ "symbols":[ "BNBUSDT", "BTCUSDT", "BTCUSDT_250627", "BTCUSDT_250926", "ETHBTC", "ETHUSDT", "ETHUSDT_250627", "ETHUSDT_250926" ], "assets":[ { "asset":"USDC", "marginBalance":"299999998.6497832", "updateTime":1745366402000 }, { "asset":"USDT", "marginBalance":"793930579.315848", "updateTime":1745366402000 }, { "asset":"BTC", "marginBalance":"61.73143554", "updateTime":1745366402000 }, { "asset":"BNFCR", "marginBalance":"633223.99396922", "updateTime":1745366402000 } ]} +``` + +> or not pass symbol + +``` +[ { "symbols":[ "ADAUSDT", "BCHUSDT", "DOTUSDT", "EOSUSDT", "ETCUSDT", "LINKUSDT", "LTCUSDT", "TRXUSDT", "XLMUSDT", "XMRUSDT", "XRPUSDT" ], "assets":[ { "asset":"USDT", "marginBalance":"314151411.06482935", "updateTime":1745366402000 } ] }, { "symbols":[ "ACTUSDT", "MUBARAKUSDT", "OMUSDT", "TSTUSDT" ], "assets":[ { "asset":"USDT", "marginBalance":"5166686.84431694", "updateTime":1745366402000 } ] }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Insurance-Fund-Balance) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Insurance-Fund-Balance) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Insurance-Fund-Balance) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Insurance-Fund-Balance) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Insurance-Fund-Balance) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Kline-Candlestick-Data.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Kline-Candlestick-Data.md new file mode 100644 index 0000000..b131ada --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Kline-Candlestick-Data.md @@ -0,0 +1,94 @@ +--- +title: "Kline Candlestick Data | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Kline-Candlestick-Data" +fetched_at: "2026-01-27T05:28:28.047Z" +--- +# Kline/Candlestick Data + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Kline-Candlestick-Data) + +Kline/candlestick bars for a symbol. Klines are uniquely identified by their open time. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Kline-Candlestick-Data) + +GET `/fapi/v1/klines` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Kline-Candlestick-Data) + +based on parameter `LIMIT` + +LIMIT + +weight + +\[1,100) + +1 + +\[100, 500) + +2 + +\[500, 1000\] + +5 + +\> 1000 + +10 + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Kline-Candlestick-Data) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +interval + +ENUM + +YES + +startTime + +LONG + +NO + +endTime + +LONG + +NO + +limit + +INT + +NO + +Default 500; max 1500. + +> - If startTime and endTime are not sent, the most recent klines are returned. + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Kline-Candlestick-Data) + +``` +[ [ 1499040000000, // Open time "0.01634790", // Open "0.80000000", // High "0.01575800", // Low "0.01577100", // Close "148976.11427815", // Volume 1499644799999, // Close time "2434.19055334", // Quote asset volume 308, // Number of trades "1756.87402397", // Taker buy base asset volume "28.46694368", // Taker buy quote asset volume "17928899.62484339" // Ignore. ]] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Kline-Candlestick-Data) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Kline-Candlestick-Data) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Kline-Candlestick-Data) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Kline-Candlestick-Data) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Kline-Candlestick-Data) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Long-Short-Ratio.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Long-Short-Ratio.md new file mode 100644 index 0000000..68e9ebf --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Long-Short-Ratio.md @@ -0,0 +1,78 @@ +--- +title: "Long Short Ratio | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Long-Short-Ratio" +fetched_at: "2026-01-27T05:28:28.102Z" +--- +# Long/Short Ratio + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Long-Short-Ratio) + +Query symbol Long/Short Ratio + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Long-Short-Ratio) + +GET `/futures/data/globalLongShortAccountRatio` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Long-Short-Ratio) + +**0** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Long-Short-Ratio) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +period + +ENUM + +YES + +"5m","15m","30m","1h","2h","4h","6h","12h","1d" + +limit + +LONG + +NO + +default 30, max 500 + +startTime + +LONG + +NO + +endTime + +LONG + +NO + +> - If startTime and endTime are not sent, the most recent data is returned. +> - Only the data of the latest 30 days is available. +> - IP rate limit 1000 requests/5min + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Long-Short-Ratio) + +``` +[ { "symbol":"BTCUSDT", // long/short account num ratio of all traders "longShortRatio":"0.1960", //long account num ratio of all traders "longAccount": "0.6622", // short account num ratio of all traders "shortAccount":"0.3378", "timestamp":"1583139600000" }, { "symbol":"BTCUSDT", "longShortRatio":"1.9559", "longAccount": "0.6617", "shortAccount":"0.3382", "timestamp":"1583139900000" }, ] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Long-Short-Ratio) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Long-Short-Ratio) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Long-Short-Ratio) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Long-Short-Ratio) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Long-Short-Ratio) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Mark-Price-Kline-Candlestick-Data.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Mark-Price-Kline-Candlestick-Data.md new file mode 100644 index 0000000..584bf33 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Mark-Price-Kline-Candlestick-Data.md @@ -0,0 +1,94 @@ +--- +title: "Mark Price Kline Candlestick Data | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Mark-Price-Kline-Candlestick-Data" +fetched_at: "2026-01-27T05:28:28.150Z" +--- +# Mark Price Kline/Candlestick Data + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Mark-Price-Kline-Candlestick-Data) + +Kline/candlestick bars for the mark price of a symbol. Klines are uniquely identified by their open time. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Mark-Price-Kline-Candlestick-Data) + +GET `/fapi/v1/markPriceKlines` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Mark-Price-Kline-Candlestick-Data) + +based on parameter `LIMIT` + +LIMIT + +weight + +\[1,100) + +1 + +\[100, 500) + +2 + +\[500, 1000\] + +5 + +\> 1000 + +10 + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Mark-Price-Kline-Candlestick-Data) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +interval + +ENUM + +YES + +startTime + +LONG + +NO + +endTime + +LONG + +NO + +limit + +INT + +NO + +Default 500; max 1500. + +> - If startTime and endTime are not sent, the most recent klines are returned. + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Mark-Price-Kline-Candlestick-Data) + +``` +[ [ 1591256460000, // Open time "9653.29201333", // Open "9654.56401333", // High "9653.07367333", // Low "9653.07367333", // Close (or latest price) "0 ", // Ignore 1591256519999, // Close time "0", // Ignore 60, // Ignore "0", // Ignore "0", // Ignore "0" // Ignore ]] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Mark-Price-Kline-Candlestick-Data) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Mark-Price-Kline-Candlestick-Data) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Mark-Price-Kline-Candlestick-Data) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Mark-Price-Kline-Candlestick-Data) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Mark-Price-Kline-Candlestick-Data) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Mark-Price.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Mark-Price.md new file mode 100644 index 0000000..190ab9f --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Mark-Price.md @@ -0,0 +1,54 @@ +--- +title: "Mark Price | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Mark-Price" +fetched_at: "2026-01-27T05:28:28.104Z" +--- +# Mark Price + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Mark-Price) + +Mark Price and Funding Rate + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Mark-Price) + +GET `/fapi/v1/premiumIndex` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Mark-Price) + +**1** with symbol, **10** without symbol + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Mark-Price) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +NO + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Mark-Price) + +> **Response:** + +``` +{ "symbol": "BTCUSDT", "markPrice": "11793.63104562", // mark price "indexPrice": "11781.80495970", // index price "estimatedSettlePrice": "11781.16138815", // Estimated Settle Price, only useful in the last hour before the settlement starts. "lastFundingRate": "0.00038246", // This is the Latest funding rate "interestRate": "0.00010000", "nextFundingTime": 1597392000000, "time": 1597370495002} +``` + +> **OR (when symbol not sent)** + +``` +[ { "symbol": "BTCUSDT", "markPrice": "11793.63104562", // mark price "indexPrice": "11781.80495970", // index price "estimatedSettlePrice": "11781.16138815", // Estimated Settle Price, only useful in the last hour before the settlement starts. "lastFundingRate": "0.00038246", // This is the Latest funding rate "interestRate": "0.00010000", "nextFundingTime": 1597392000000, "time": 1597370495002 }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Mark-Price) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Mark-Price) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Mark-Price) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Mark-Price) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Mark-Price) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Multi-Assets-Mode-Asset-Index.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Multi-Assets-Mode-Asset-Index.md new file mode 100644 index 0000000..47aa40b --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Multi-Assets-Mode-Asset-Index.md @@ -0,0 +1,56 @@ +--- +title: "Multi Assets Mode Asset Index | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Multi-Assets-Mode-Asset-Index" +fetched_at: "2026-01-27T05:28:28.308Z" +--- +# Multi-Assets Mode Asset Index + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Multi-Assets-Mode-Asset-Index) + +asset index for Multi-Assets mode + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Multi-Assets-Mode-Asset-Index) + +GET `/fapi/v1/assetIndex` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Multi-Assets-Mode-Asset-Index) + +**1** for a single symbol; **10** when the symbol parameter is omitted + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Multi-Assets-Mode-Asset-Index) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +NO + +Asset pair + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Multi-Assets-Mode-Asset-Index) + +> **Response:** + +``` +{ "symbol": "ADAUSD", "time": 1635740268004, "index": "1.92957370", "bidBuffer": "0.10000000", "askBuffer": "0.10000000", "bidRate": "1.73661633", "askRate": "2.12253107", "autoExchangeBidBuffer": "0.05000000", "autoExchangeAskBuffer": "0.05000000", "autoExchangeBidRate": "1.83309501", "autoExchangeAskRate": "2.02605238"} +``` + +> Or(without symbol) + +``` +[ { "symbol": "ADAUSD", "time": 1635740268004, "index": "1.92957370", "bidBuffer": "0.10000000", "askBuffer": "0.10000000", "bidRate": "1.73661633", "askRate": "2.12253107", "autoExchangeBidBuffer": "0.05000000", "autoExchangeAskBuffer": "0.05000000", "autoExchangeBidRate": "1.83309501", "autoExchangeAskRate": "2.02605238" }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Multi-Assets-Mode-Asset-Index) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Multi-Assets-Mode-Asset-Index) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Multi-Assets-Mode-Asset-Index) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Multi-Assets-Mode-Asset-Index) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Multi-Assets-Mode-Asset-Index) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Old-Trades-Lookup.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Old-Trades-Lookup.md new file mode 100644 index 0000000..2b7cb5b --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Old-Trades-Lookup.md @@ -0,0 +1,65 @@ +--- +title: "Old Trades Lookup | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Old-Trades-Lookup" +fetched_at: "2026-01-27T05:28:28.496Z" +--- +# Old Trades Lookup (MARKET\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Old-Trades-Lookup) + +Get older market historical trades. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Old-Trades-Lookup) + +GET `/fapi/v1/historicalTrades` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Old-Trades-Lookup) + +**20** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Old-Trades-Lookup) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +limit + +INT + +NO + +Default 100; max 500. + +fromId + +LONG + +NO + +TradeId to fetch from. Default gets most recent trades. + +> - Market trades means trades filled in the order book. Only market trades will be returned, which means the insurance fund trades and ADL trades won't be returned. +> - Only supports data from within the last three months + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Old-Trades-Lookup) + +``` +[ { "id": 28457, "price": "4.00000100", "qty": "12.00000000", "quoteQty": "8000.00", "time": 1499865549590, "isBuyerMaker": true, "isRPITrade": true, }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Old-Trades-Lookup) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Old-Trades-Lookup) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Old-Trades-Lookup) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Old-Trades-Lookup) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Old-Trades-Lookup) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Open-Interest-Statistics.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Open-Interest-Statistics.md new file mode 100644 index 0000000..5390369 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Open-Interest-Statistics.md @@ -0,0 +1,78 @@ +--- +title: "Open Interest Statistics | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Open-Interest-Statistics" +fetched_at: "2026-01-27T05:28:28.399Z" +--- +# Open Interest Statistics + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Open-Interest-Statistics) + +Open Interest Statistics + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Open-Interest-Statistics) + +GET `/futures/data/openInterestHist` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Open-Interest-Statistics) + +**0** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Open-Interest-Statistics) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +period + +ENUM + +YES + +"5m","15m","30m","1h","2h","4h","6h","12h","1d" + +limit + +LONG + +NO + +default 30, max 500 + +startTime + +LONG + +NO + +endTime + +LONG + +NO + +> - If startTime and endTime are not sent, the most recent data is returned. +> - Only the data of the latest 1 month is available. +> - IP rate limit 1000 requests/5min + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Open-Interest-Statistics) + +``` +[ { "symbol":"BTCUSDT", "sumOpenInterest":"20403.63700000", // total open interest "sumOpenInterestValue": "150570784.07809979", // total open interest value "CMCCirculatingSupply": "165880.538", // circulating supply provided by CMC "timestamp":"1583127900000" }, { "symbol":"BTCUSDT", "sumOpenInterest":"20401.36700000", "sumOpenInterestValue":"149940752.14464448", "CMCCirculatingSupply": "165900.14853", "timestamp":"1583128200000" }, ] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Open-Interest-Statistics) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Open-Interest-Statistics) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Open-Interest-Statistics) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Open-Interest-Statistics) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Open-Interest-Statistics) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Open-Interest.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Open-Interest.md new file mode 100644 index 0000000..2859d7d --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Open-Interest.md @@ -0,0 +1,46 @@ +--- +title: "Open Interest | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Open-Interest" +fetched_at: "2026-01-27T05:28:28.352Z" +--- +# Open Interest + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Open-Interest) + +Get present open interest of a specific symbol. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Open-Interest) + +GET `/fapi/v1/openInterest` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Open-Interest) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Open-Interest) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Open-Interest) + +``` +{ "openInterest": "10659.509", "symbol": "BTCUSDT", "time": 1589437530011 // Transaction time} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Open-Interest) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Open-Interest) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Open-Interest) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Open-Interest) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Open-Interest) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Order-Book-RPI.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Order-Book-RPI.md new file mode 100644 index 0000000..d57f1f6 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Order-Book-RPI.md @@ -0,0 +1,66 @@ +--- +title: "RPI Order Book | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Order-Book-RPI" +fetched_at: "2026-01-27T05:28:28.603Z" +--- +# RPI Order Book + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Order-Book-RPI) + +Query symbol orderbook with RPI orders + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Order-Book-RPI) + +GET `/fapi/v1/rpiDepth` + +**Note**: + +> RPI(Retail Price Improvement) orders are included and aggreated in the response message. Crossed price levels are hidden and invisible. + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Order-Book-RPI) + +Adjusted based on the limit: + +Limit + +Weight + +1000 + +20 + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Order-Book-RPI) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +limit + +INT + +NO + +Default 1000; Valid limits:\[1000\] + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Order-Book-RPI) + +``` +{ "lastUpdateId": 1027024, "E": 1589436922972, // Message output time "T": 1589436922959, // Transaction time "bids": [ [ "4.00000000", // PRICE "431.00000000" // QTY ] ], "asks": [ [ "4.00000200", "12.00000000" ] ]} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Order-Book-RPI) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Order-Book-RPI) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Order-Book-RPI) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Order-Book-RPI) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Order-Book-RPI) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Order-Book.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Order-Book.md new file mode 100644 index 0000000..daa08c5 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Order-Book.md @@ -0,0 +1,78 @@ +--- +title: "Order Book | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Order-Book" +fetched_at: "2026-01-27T05:28:28.692Z" +--- +# Order Book + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Order-Book) + +Query symbol orderbook + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Order-Book) + +GET `/fapi/v1/depth` + +**Note**: + +> Retail Price Improvement(RPI) orders are not visible and excluded in the response message. + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Order-Book) + +Adjusted based on the limit: + +Limit + +Weight + +5, 10, 20, 50 + +2 + +100 + +5 + +500 + +10 + +1000 + +20 + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Order-Book) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +limit + +INT + +NO + +Default 500; Valid limits:\[5, 10, 20, 50, 100, 500, 1000\] + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Order-Book) + +``` +{ "lastUpdateId": 1027024, "E": 1589436922972, // Message output time "T": 1589436922959, // Transaction time "bids": [ [ "4.00000000", // PRICE "431.00000000" // QTY ] ], "asks": [ [ "4.00000200", "12.00000000" ] ]} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Order-Book) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Order-Book) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Order-Book) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Order-Book) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Order-Book) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Premium-Index-Kline-Data.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Premium-Index-Kline-Data.md new file mode 100644 index 0000000..966a772 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Premium-Index-Kline-Data.md @@ -0,0 +1,94 @@ +--- +title: "Premium Index Kline Data | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Premium-Index-Kline-Data" +fetched_at: "2026-01-27T05:28:28.789Z" +--- +# Premium index Kline Data + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Premium-Index-Kline-Data) + +Premium index kline bars of a symbol. Klines are uniquely identified by their open time. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Premium-Index-Kline-Data) + +GET `/fapi/v1/premiumIndexKlines` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Premium-Index-Kline-Data) + +based on parameter `LIMIT` + +LIMIT + +weight + +\[1,100) + +1 + +\[100, 500) + +2 + +\[500, 1000\] + +5 + +\> 1000 + +10 + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Premium-Index-Kline-Data) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +interval + +ENUM + +YES + +startTime + +LONG + +NO + +endTime + +LONG + +NO + +limit + +INT + +NO + +Default 500; max 1500. + +> - If startTime and endTime are not sent, the most recent klines are returned. + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Premium-Index-Kline-Data) + +``` +[ [ 1691603820000, // Open time "-0.00042931", // Open "-0.00023641", // High "-0.00059406", // Low "-0.00043659", // Close "0", // Ignore 1691603879999, // Close time "0", // Ignore 12, // Ignore "0", // Ignore "0", // Ignore "0" // Ignore ]] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Premium-Index-Kline-Data) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Premium-Index-Kline-Data) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Premium-Index-Kline-Data) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Premium-Index-Kline-Data) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Premium-Index-Kline-Data) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Recent-Trades-List.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Recent-Trades-List.md new file mode 100644 index 0000000..0289e18 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Recent-Trades-List.md @@ -0,0 +1,56 @@ +--- +title: "Recent Trades List | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Recent-Trades-List" +fetched_at: "2026-01-27T05:28:28.747Z" +--- +# Recent Trades List + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Recent-Trades-List) + +Get recent market trades + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Recent-Trades-List) + +GET `/fapi/v1/trades` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Recent-Trades-List) + +**5** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Recent-Trades-List) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +limit + +INT + +NO + +Default 500; max 1000. + +> - Market trades means trades filled in the order book. Only market trades will be returned, which means the insurance fund trades and ADL trades won't be returned. + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Recent-Trades-List) + +``` +[ { "id": 28457, "price": "4.00000100", "qty": "12.00000000", "quoteQty": "48.00", "time": 1499865549590, "isBuyerMaker": true, "isRPITrade": true, }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Recent-Trades-List) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Recent-Trades-List) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Recent-Trades-List) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Recent-Trades-List) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Recent-Trades-List) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Symbol-Order-Book-Ticker.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Symbol-Order-Book-Ticker.md new file mode 100644 index 0000000..9d6cecb --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Symbol-Order-Book-Ticker.md @@ -0,0 +1,60 @@ +--- +title: "Symbol Order Book Ticker | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Symbol-Order-Book-Ticker" +fetched_at: "2026-01-27T05:28:28.911Z" +--- +# Symbol Order Book Ticker + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Symbol-Order-Book-Ticker) + +Best price/qty on the order book for a symbol or symbols. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Symbol-Order-Book-Ticker) + +GET `/fapi/v1/ticker/bookTicker` + +**Note**: + +> Retail Price Improvement(RPI) orders are not visible and excluded in the response message. + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Symbol-Order-Book-Ticker) + +**2** for a single symbol; +**5** when the symbol parameter is omitted + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Symbol-Order-Book-Ticker) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +NO + +> - If the symbol is not sent, bookTickers for all symbols will be returned in an array. +> - The field `X-MBX-USED-WEIGHT-1M` in response header is not accurate from this endpoint, please ignore. + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Symbol-Order-Book-Ticker) + +``` +{ "symbol": "BTCUSDT", "bidPrice": "4.00000000", "bidQty": "431.00000000", "askPrice": "4.00000200", "askQty": "9.00000000", "time": 1589437530011 // Transaction time} +``` + +> OR + +``` +[ { "symbol": "BTCUSDT", "bidPrice": "4.00000000", "bidQty": "431.00000000", "askPrice": "4.00000200", "askQty": "9.00000000", "time": 1589437530011 }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Symbol-Order-Book-Ticker) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Symbol-Order-Book-Ticker) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Symbol-Order-Book-Ticker) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Symbol-Order-Book-Ticker) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Symbol-Order-Book-Ticker) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Symbol-Price-Ticker-v2.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Symbol-Price-Ticker-v2.md new file mode 100644 index 0000000..910a937 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Symbol-Price-Ticker-v2.md @@ -0,0 +1,55 @@ +--- +title: "Symbol Price Ticker V2 | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Symbol-Price-Ticker-v2" +fetched_at: "2026-01-27T05:28:29.006Z" +--- +# Symbol Price Ticker V2 + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Symbol-Price-Ticker-v2) + +Latest price for a symbol or symbols. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Symbol-Price-Ticker-v2) + +GET `/fapi/v2/ticker/price` + +**Weight:** + +**1** for a single symbol; +**2** when the symbol parameter is omitted + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Symbol-Price-Ticker-v2) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +NO + +> - If the symbol is not sent, prices for all symbols will be returned in an array. +> - The field `X-MBX-USED-WEIGHT-1M` in response header is not accurate from this endpoint, please ignore. + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Symbol-Price-Ticker-v2) + +``` +{ "symbol": "BTCUSDT", "price": "6000.01", "time": 1589437530011 // Transaction time} +``` + +> OR + +``` +[ { "symbol": "BTCUSDT", "price": "6000.01", "time": 1589437530011 }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Symbol-Price-Ticker-v2) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Symbol-Price-Ticker-v2) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Symbol-Price-Ticker-v2) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Symbol-Price-Ticker-v2) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Symbol-Price-Ticker.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Symbol-Price-Ticker.md new file mode 100644 index 0000000..91dd2df --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Symbol-Price-Ticker.md @@ -0,0 +1,54 @@ +--- +title: "Symbol Price Ticker(Deprecated) | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Symbol-Price-Ticker" +fetched_at: "2026-01-27T05:28:28.950Z" +--- +# Symbol Price Ticker(Deprecated) + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Symbol-Price-Ticker) + +Latest price for a symbol or symbols. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Symbol-Price-Ticker) + +GET `/fapi/v1/ticker/price` + +**Weight:** + +**1** for a single symbol; +**2** when the symbol parameter is omitted + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Symbol-Price-Ticker) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +NO + +> - If the symbol is not sent, prices for all symbols will be returned in an array. + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Symbol-Price-Ticker) + +``` +{ "symbol": "BTCUSDT", "price": "6000.01", "time": 1589437530011 // Transaction time} +``` + +> OR + +``` +[ { "symbol": "BTCUSDT", "price": "6000.01", "time": 1589437530011 }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Symbol-Price-Ticker) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Symbol-Price-Ticker) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Symbol-Price-Ticker) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Symbol-Price-Ticker) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Taker-BuySell-Volume.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Taker-BuySell-Volume.md new file mode 100644 index 0000000..84b56f1 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Taker-BuySell-Volume.md @@ -0,0 +1,78 @@ +--- +title: "Taker Buysell Volume | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Taker-BuySell-Volume" +fetched_at: "2026-01-27T05:28:29.050Z" +--- +# Taker Buy/Sell Volume + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Taker-BuySell-Volume) + +Taker Buy/Sell Volume + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Taker-BuySell-Volume) + +GET `/futures/data/takerlongshortRatio` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Taker-BuySell-Volume) + +**0** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Taker-BuySell-Volume) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +period + +ENUM + +YES + +"5m","15m","30m","1h","2h","4h","6h","12h","1d" + +limit + +LONG + +NO + +default 30, max 500 + +startTime + +LONG + +NO + +endTime + +LONG + +NO + +> - If startTime and endTime are not sent, the most recent data is returned. +> - Only the data of the latest 30 days is available. +> - IP rate limit 1000 requests/5min + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Taker-BuySell-Volume) + +``` +[ { "buySellRatio":"1.5586", "buyVol": "387.3300", "sellVol":"248.5030", "timestamp":"1585614900000" }, { "buySellRatio":"1.3104", "buyVol": "343.9290", "sellVol":"248.5030", "timestamp":"1583139900000" }, ] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Taker-BuySell-Volume) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Taker-BuySell-Volume) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Taker-BuySell-Volume) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Taker-BuySell-Volume) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Taker-BuySell-Volume) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Top-Long-Short-Account-Ratio.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Top-Long-Short-Account-Ratio.md new file mode 100644 index 0000000..7b6b8ab --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Top-Long-Short-Account-Ratio.md @@ -0,0 +1,73 @@ +--- +title: "Top Trader Long Short Account Ratio | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Top-Long-Short-Account-Ratio" +fetched_at: "2026-01-27T05:28:29.166Z" +--- +# Top Trader Long/Short Ratio (Accounts) + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Top-Long-Short-Account-Ratio) + +The proportion of net long and net short accounts to total accounts of the top 20% users with the highest margin balance. Each account is counted once only. Long Account % = Accounts of top traders with net long positions / Total accounts of top traders with open positions Short Account % = Accounts of top traders with net short positions / Total accounts of top traders with open positions Long/Short Ratio (Accounts) = Long Account % / Short Account % + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Top-Long-Short-Account-Ratio) + +GET `/futures/data/topLongShortAccountRatio` + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Top-Long-Short-Account-Ratio) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +period + +ENUM + +YES + +"5m","15m","30m","1h","2h","4h","6h","12h","1d" + +limit + +LONG + +NO + +default 30, max 500 + +startTime + +LONG + +NO + +endTime + +LONG + +NO + +> - If startTime and endTime are not sent, the most recent data is returned. +> - Only the data of the latest 30 days is available. +> - IP rate limit 1000 requests/5min + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Top-Long-Short-Account-Ratio) + +``` +[ { "symbol":"BTCUSDT", "longShortRatio":"1.8105", // long/short account num ratio of top traders "longAccount": "0.6442", // long account num ratio of top traders "shortAccount":"0.3558", // long account num ratio of top traders "timestamp":"1583139600000" }, { "symbol":"BTCUSDT", "longShortRatio":"0.5576", "longAccount": "0.3580", "shortAccount":"0.6420", "timestamp":"1583139900000" } ] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Top-Long-Short-Account-Ratio) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Top-Long-Short-Account-Ratio) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Top-Long-Short-Account-Ratio) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Top-Long-Short-Account-Ratio) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Top-Trader-Long-Short-Ratio.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Top-Trader-Long-Short-Ratio.md new file mode 100644 index 0000000..a1448f2 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Top-Trader-Long-Short-Ratio.md @@ -0,0 +1,78 @@ +--- +title: "Top Trader Long Short Position Ratio | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Top-Trader-Long-Short-Ratio" +fetched_at: "2026-01-27T05:28:29.348Z" +--- +# Top Trader Long/Short Ratio (Positions) + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Top-Trader-Long-Short-Ratio) + +The proportion of net long and net short positions to total open positions of the top 20% users with the highest margin balance. Long Position % = Long positions of top traders / Total open positions of top traders Short Position % = Short positions of top traders / Total open positions of top traders Long/Short Ratio (Positions) = Long Position % / Short Position % + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Top-Trader-Long-Short-Ratio) + +GET `/futures/data/topLongShortPositionRatio` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Top-Trader-Long-Short-Ratio) + +**0** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Top-Trader-Long-Short-Ratio) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +period + +ENUM + +YES + +"5m","15m","30m","1h","2h","4h","6h","12h","1d" + +limit + +LONG + +NO + +default 30, max 500 + +startTime + +LONG + +NO + +endTime + +LONG + +NO + +> - If startTime and endTime are not sent, the most recent data is returned. +> - Only the data of the latest 30 days is available. +> - IP rate limit 1000 requests/5min + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Top-Trader-Long-Short-Ratio) + +``` +[ { "symbol":"BTCUSDT", "longShortRatio":"1.4342",// long/short position ratio of top traders "longAccount": "0.5891", // long positions ratio of top traders "shortAccount":"0.4108", // short positions ratio of top traders "timestamp":"1583139600000" }, { "symbol":"BTCUSDT", "longShortRatio":"1.4337", "longAccount": "0.3583", "shortAccount":"0.6417", "timestamp":"1583139900000" }, ] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Top-Trader-Long-Short-Ratio) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Top-Trader-Long-Short-Ratio) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Top-Trader-Long-Short-Ratio) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Top-Trader-Long-Short-Ratio) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Top-Trader-Long-Short-Ratio) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Trading-Schedule.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Trading-Schedule.md new file mode 100644 index 0000000..0816c54 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_rest-api_Trading-Schedule.md @@ -0,0 +1,34 @@ +--- +title: "Query Trading Schedule | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Trading-Schedule" +fetched_at: "2026-01-27T05:28:29.276Z" +--- +# Trading Schedule + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Trading-Schedule) + +Trading session schedules for the underlying assets of TradFi Perps are provided for a one-week period starting from the day prior to the query time, covering both the U.S. equity and commodity markets. Equity market session types include "PRE\_MARKET", "REGULAR", "AFTER\_MARKET", "OVERNIGHT", and "NO\_TRADING", while commodity market session types include "REGULAR" and "NO\_TRADING". + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Trading-Schedule) + +GET `/fapi/v1/tradingSchedule` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Trading-Schedule) + +**5** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Trading-Schedule) + +NONE + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Trading-Schedule) + +``` +{ "updateTime": 1761286643918, "marketSchedules": { "EQUITY": { "sessions": [ { "startTime": 1761177600000, "endTime": 1761206400000, "type": "OVERNIGHT" }, { "startTime": 1761206400000, "endTime": 1761226200000, "type": "PRE_MARKET" } ] }, "COMMODITY": { "sessions": [ { "startTime": 1761724800000, "endTime": 1761744600000, "type": "NO_TRADING" }, { "startTime": 1761744600000, "endTime": 1761768000000, "type": "REGULAR" } ] } }} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Trading-Schedule) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Trading-Schedule) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Trading-Schedule) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Trading-Schedule) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Trading-Schedule) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_websocket-api.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_websocket-api.md new file mode 100644 index 0000000..7880e3b --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_websocket-api.md @@ -0,0 +1,90 @@ +--- +title: "Order Book | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/websocket-api" +fetched_at: "2026-01-27T05:28:29.442Z" +--- +# Order Book + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/websocket-api) + +Get current order book. Note that this request returns limited market depth. If you need to continuously monitor order book updates, please consider using Websocket Market Streams: + +- `@depth` +- `@depth` + +You can use `depth` request together with `@depth` streams to maintain a local order book. + +## Method[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/websocket-api) + +`depth` + +**Note**: + +> Retail Price Improvement(RPI) orders are not visible and excluded in the response message. + +## Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/websocket-api) + +``` +{ "id": "51e2affb-0aba-4821-ba75-f2625006eb43", "method": "depth", "params": { "symbol": "BTCUSDT" }} +``` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/websocket-api) + +Adjusted based on the limit: + +Limit + +Weight + +5, 10, 20, 50 + +2 + +100 + +5 + +500 + +10 + +1000 + +20 + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/websocket-api) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +limit + +INT + +NO + +Default 500; Valid limits:\[5, 10, 20, 50, 100, 500, 1000\] + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/websocket-api) + +``` +{ "id": "51e2affb-0aba-4821-ba75-f2625006eb43", "status": 200, "result": { "lastUpdateId": 1027024, "E": 1589436922972, // Message output time "T": 1589436922959, // Transaction time "bids": [ [ "4.00000000", // PRICE "431.00000000" // QTY ] ], "asks": [ [ "4.00000200", "12.00000000" ] ] }, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 2400, "count": 5 } ]} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/websocket-api) +- [Method](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/websocket-api) +- [Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/websocket-api) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/websocket-api) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/websocket-api) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/websocket-api) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_websocket-api_Symbol-Order-Book-Ticker.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_websocket-api_Symbol-Order-Book-Ticker.md new file mode 100644 index 0000000..9ac682e --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_websocket-api_Symbol-Order-Book-Ticker.md @@ -0,0 +1,67 @@ +--- +title: "Symbol Order Book Ticker | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/websocket-api/Symbol-Order-Book-Ticker" +fetched_at: "2026-01-27T05:28:29.431Z" +--- +# Symbol Order Book Ticker + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/websocket-api/Symbol-Order-Book-Ticker) + +Best price/qty on the order book for a symbol or symbols. + +## Method[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/websocket-api/Symbol-Order-Book-Ticker) + +`ticker.book` + +**Note**: + +> Retail Price Improvement(RPI) orders are not visible and excluded in the response message. + +## Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/websocket-api/Symbol-Order-Book-Ticker) + +``` +{ "id": "9d32157c-a556-4d27-9866-66760a174b57", "method": "ticker.book", "params": { "symbol": "BTCUSDT" }} +``` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/websocket-api/Symbol-Order-Book-Ticker) + +**2** for a single symbol; +**5** when the symbol parameter is omitted + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/websocket-api/Symbol-Order-Book-Ticker) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +NO + +> - If the symbol is not sent, bookTickers for all symbols will be returned in an array. +> - The field `X-MBX-USED-WEIGHT-1M` in response header is not accurate from this endpoint, please ignore. + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/websocket-api/Symbol-Order-Book-Ticker) + +``` +{ "id": "9d32157c-a556-4d27-9866-66760a174b57", "status": 200, "result": { "lastUpdateId": 1027024, "symbol": "BTCUSDT", "bidPrice": "4.00000000", "bidQty": "431.00000000", "askPrice": "4.00000200", "askQty": "9.00000000", "time": 1589437530011 // Transaction time }, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 2400, "count": 2 } ]} +``` + +> OR + +``` +{ "id": "9d32157c-a556-4d27-9866-66760a174b57", "status": 200, "result": [ { "lastUpdateId": 1027024, "symbol": "BTCUSDT", "bidPrice": "4.00000000", "bidQty": "431.00000000", "askPrice": "4.00000200", "askQty": "9.00000000", "time": 1589437530011 } ], "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 2400, "count": 2 } ]} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/websocket-api/Symbol-Order-Book-Ticker) +- [Method](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/websocket-api/Symbol-Order-Book-Ticker) +- [Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/websocket-api/Symbol-Order-Book-Ticker) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/websocket-api/Symbol-Order-Book-Ticker) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/websocket-api/Symbol-Order-Book-Ticker) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/websocket-api/Symbol-Order-Book-Ticker) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_websocket-api_Symbol-Price-Ticker.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_websocket-api_Symbol-Price-Ticker.md new file mode 100644 index 0000000..02ce634 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_market-data_websocket-api_Symbol-Price-Ticker.md @@ -0,0 +1,61 @@ +--- +title: "Symbol Price Ticker | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/websocket-api/Symbol-Price-Ticker" +fetched_at: "2026-01-27T05:28:29.671Z" +--- +# Symbol Price Ticker + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/websocket-api/Symbol-Price-Ticker) + +Latest price for a symbol or symbols. + +## Method[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/websocket-api/Symbol-Price-Ticker) + +`ticker.price` + +## Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/websocket-api/Symbol-Price-Ticker) + +``` +{ "id": "9d32157c-a556-4d27-9866-66760a174b57", "method": "ticker.price", "params": { "symbol": "BTCUSDT" }} +``` + +**Weight:** + +**1** for a single symbol; +**2** when the symbol parameter is omitted + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/websocket-api/Symbol-Price-Ticker) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +NO + +> - If the symbol is not sent, prices for all symbols will be returned in an array. + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/websocket-api/Symbol-Price-Ticker) + +``` +{ "id": "9d32157c-a556-4d27-9866-66760a174b57", "status": 200, "result": { "symbol": "BTCUSDT", "price": "6000.01", "time": 1589437530011 // Transaction time }, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 2400, "count": 2 } ]} +``` + +> OR + +``` +{ "id": "9d32157c-a556-4d27-9866-66760a174b57", "status": 200, "result": [ { "symbol": "BTCUSDT", "price": "6000.01", "time": 1589437530011 } ], "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 2400, "count": 2 } ]} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/websocket-api/Symbol-Price-Ticker) +- [Method](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/websocket-api/Symbol-Price-Ticker) +- [Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/websocket-api/Symbol-Price-Ticker) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/websocket-api/Symbol-Price-Ticker) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/websocket-api/Symbol-Price-Ticker) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_portfolio-margin-endpoints.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_portfolio-margin-endpoints.md new file mode 100644 index 0000000..8c80c4b --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_portfolio-margin-endpoints.md @@ -0,0 +1,60 @@ +--- +title: "Classic Portfolio Margin Account Information | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/portfolio-margin-endpoints" +fetched_at: "2026-01-27T05:28:29.603Z" +--- +# Classic Portfolio Margin Account Information (USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/portfolio-margin-endpoints) + +Get Classic Portfolio Margin current account information. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/portfolio-margin-endpoints) + +GET `/fapi/v1/pmAccountInfo` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/portfolio-margin-endpoints) + +**5** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/portfolio-margin-endpoints) + +Name + +Type + +Mandatory + +Description + +asset + +STRING + +YES + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +> - maxWithdrawAmount is for asset transfer out to the spot wallet. + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/portfolio-margin-endpoints) + +``` +{ "maxWithdrawAmountUSD": "1627523.32459208", // Classic Portfolio margin maximum virtual amount for transfer out in USD "asset": "BTC", // asset name "maxWithdrawAmount": "27.43689636", // maximum amount for transfer out} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/portfolio-margin-endpoints) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/portfolio-margin-endpoints) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/portfolio-margin-endpoints) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/portfolio-margin-endpoints) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/portfolio-margin-endpoints) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api.md new file mode 100644 index 0000000..f030335 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api.md @@ -0,0 +1,164 @@ +--- +title: "New Order | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api" +fetched_at: "2026-01-27T05:28:29.833Z" +--- +# New Order(TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api) + +Send in a new order. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api) + +POST `/fapi/v1/order` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api) + +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) + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +side + +ENUM + +YES + +positionSide + +ENUM + +NO + +Default `BOTH` for One-way Mode ; `LONG` or `SHORT` for Hedge Mode. It must be sent in Hedge Mode. + +type + +ENUM + +YES + +timeInForce + +ENUM + +NO + +quantity + +DECIMAL + +NO + +reduceOnly + +STRING + +NO + +"true" or "false". default "false". Cannot be sent in Hedge Mode + +price + +DECIMAL + +NO + +newClientOrderId + +STRING + +NO + +A unique id among open orders. Automatically generated if not sent. Can only be string following the rule: `^[\.A-Z\:/a-z0-9_-]{1,36}$` + +newOrderRespType + +ENUM + +NO + +"ACK", "RESULT", default "ACK" + +priceMatch + +ENUM + +NO + +only avaliable for `LIMIT`/`STOP`/`TAKE_PROFIT` order; can be set to `OPPONENT`/ `OPPONENT_5`/ `OPPONENT_10`/ `OPPONENT_20`: /`QUEUE`/ `QUEUE_5`/ `QUEUE_10`/ `QUEUE_20`; Can't be passed together with `price` + +selfTradePreventionMode + +ENUM + +NO + +`EXPIRE_TAKER`:expire taker order when STP triggers/ `EXPIRE_MAKER`:expire taker order when STP triggers/ `EXPIRE_BOTH`:expire both orders when STP triggers; default `EXPIRE_MAKER` + +goodTillDate + +LONG + +NO + +order cancel time for timeInForce `GTD`, mandatory when `timeInforce` set to `GTD`; order the timestamp only retains second-level precision, ms part will be ignored; The goodTillDate timestamp must be greater than the current time plus 600 seconds and smaller than 253402300799000 + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +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 return directly. +> - `LIMIT` order with special `timeInForce`: the final status result of the order(FILLED or EXPIRED) will be returned directly. +> - `selfTradePreventionMode` is only effective when `timeInForce` set to `IOC` or `GTC` or `GTD`. +> - In extreme market conditions, timeInForce `GTD` order auto cancel time might be delayed comparing to `goodTillDate` + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api) + +``` +{ "clientOrderId": "testOrder", "cumQty": "0", "cumQuote": "0", "executedQty": "0", "orderId": 22542179, "avgPrice": "0.00000", "origQty": "10", "price": "0", "reduceOnly": false, "side": "BUY", "positionSide": "SHORT", "status": "NEW", "stopPrice": "9300", // please ignore when order type is TRAILING_STOP_MARKET "closePosition": false, // if Close-All "symbol": "BTCUSDT", "timeInForce": "GTD", "type": "TRAILING_STOP_MARKET", "origType": "TRAILING_STOP_MARKET", "updateTime": 1566818724722, "workingType": "CONTRACT_PRICE", "priceProtect": false, // if conditional order trigger is protected "priceMatch": "NONE", //price match mode "selfTradePreventionMode": "NONE", //self trading preventation mode "goodTillDate": 1693207680000 //order pre-set auot cancel time for TIF GTD order} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Account-Trade-List.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Account-Trade-List.md new file mode 100644 index 0000000..6bfbe3f --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Account-Trade-List.md @@ -0,0 +1,99 @@ +--- +title: "Query Account Trade List | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Account-Trade-List" +fetched_at: "2026-01-27T05:28:29.884Z" +--- +# Account Trade List (USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Account-Trade-List) + +Get trades for a specific account and symbol. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Account-Trade-List) + +GET `/fapi/v1/userTrades` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Account-Trade-List) + +**5** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Account-Trade-List) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +orderId + +LONG + +NO + +This can only be used in combination with `symbol` + +startTime + +LONG + +NO + +endTime + +LONG + +NO + +fromId + +LONG + +NO + +Trade id to fetch from. Default gets most recent trades. + +limit + +INT + +NO + +Default 500; max 1000. + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +> - 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 6 months + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Account-Trade-List) + +``` +[ { "buyer": false, "commission": "-0.07819010", "commissionAsset": "USDT", "id": 698759, "maker": false, "orderId": 25851813, "price": "7819.01", "qty": "0.002", "quoteQty": "15.63802", "realizedPnl": "-0.91539999", "side": "SELL", "positionSide": "SHORT", "symbol": "BTCUSDT", "time": 1569514978020 }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Account-Trade-List) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Account-Trade-List) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Account-Trade-List) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Account-Trade-List) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Account-Trade-List) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_All-Orders.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_All-Orders.md new file mode 100644 index 0000000..90533fb --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_All-Orders.md @@ -0,0 +1,93 @@ +--- +title: "Query All Orders | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/All-Orders" +fetched_at: "2026-01-27T05:28:29.862Z" +--- +# All Orders (USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/All-Orders) + +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 + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/All-Orders) + +GET `/fapi/v1/allOrders` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/All-Orders) + +**5** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/All-Orders) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +orderId + +LONG + +NO + +startTime + +LONG + +NO + +endTime + +LONG + +NO + +limit + +INT + +NO + +Default 500; max 1000. + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +**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). + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/All-Orders) + +``` +[ { "avgPrice": "0.00000", "clientOrderId": "abc", "cumQuote": "0", "executedQty": "0", "orderId": 1917641, "origQty": "0.40", "origType": "TRAILING_STOP_MARKET", "price": "0", "reduceOnly": false, "side": "BUY", "positionSide": "SHORT", "status": "NEW", "stopPrice": "9300", // please ignore when order type is TRAILING_STOP_MARKET "closePosition": false, // if Close-All "symbol": "BTCUSDT", "time": 1579276756075, // order time "timeInForce": "GTC", "type": "TRAILING_STOP_MARKET", "activatePrice": "9020", // activation price, only return with TRAILING_STOP_MARKET order "priceRate": "0.3", // callback rate, only return with TRAILING_STOP_MARKET order "updateTime": 1579276756075, // update time "workingType": "CONTRACT_PRICE", "priceProtect": false, // if conditional order trigger is protected "priceMatch": "NONE", //price match mode "selfTradePreventionMode": "NONE", //self trading preventation mode "goodTillDate": 0 //order pre-set auot cancel time for TIF GTD order }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/All-Orders) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/All-Orders) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/All-Orders) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/All-Orders) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/All-Orders) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Auto-Cancel-All-Open-Orders.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Auto-Cancel-All-Open-Orders.md new file mode 100644 index 0000000..f06e3e3 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Auto-Cancel-All-Open-Orders.md @@ -0,0 +1,69 @@ +--- +title: "Auto Cancel All Open Orders | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Auto-Cancel-All-Open-Orders" +fetched_at: "2026-01-27T05:28:29.930Z" +--- +# Auto-Cancel All Open Orders (TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Auto-Cancel-All-Open-Orders) + +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. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Auto-Cancel-All-Open-Orders) + +POST `/fapi/v1/countdownCancelAll` + +**Weight:** **10** + +**Parameters:** + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +countdownTime + +LONG + +YES + +countdown time, 1000 for 1 second. 0 to cancel the timer + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Auto-Cancel-All-Open-Orders) + +``` +{ "symbol": "BTCUSDT", "countdownTime": "100000"} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Auto-Cancel-All-Open-Orders) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Auto-Cancel-All-Open-Orders) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Auto-Cancel-All-Open-Orders) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Cancel-Algo-Order.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Cancel-Algo-Order.md new file mode 100644 index 0000000..d40ae3e --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Cancel-Algo-Order.md @@ -0,0 +1,66 @@ +--- +title: "Cancel Algo Order | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-Algo-Order" +fetched_at: "2026-01-27T05:28:30.085Z" +--- +# Cancel Algo Order (TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-Algo-Order) + +Cancel an active algo order. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-Algo-Order) + +DELETE `/fapi/v1/algoOrder` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-Algo-Order) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-Algo-Order) + +Name + +Type + +Mandatory + +Description + +algoId + +LONG + +NO + +clientAlgoId + +STRING + +NO + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +> - Either `algoId` or `clientAlgoId` must be sent. + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-Algo-Order) + +``` +{ "algoId": 2146760, "clientAlgoId": "6B2I9XVcJpCjqPAJ4YoFX7", "code": "200", "msg": "success"} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-Algo-Order) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-Algo-Order) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-Algo-Order) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-Algo-Order) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-Algo-Order) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Cancel-All-Algo-Open-Orders.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Cancel-All-Algo-Open-Orders.md new file mode 100644 index 0000000..567a1ee --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Cancel-All-Algo-Open-Orders.md @@ -0,0 +1,58 @@ +--- +title: "Cancel All Algo Open Orders | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-All-Algo-Open-Orders" +fetched_at: "2026-01-27T05:28:30.114Z" +--- +# Cancel All Algo Open Orders (TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-All-Algo-Open-Orders) + +Cancel All Algo Open Orders + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-All-Algo-Open-Orders) + +DELETE `/fapi/v1/algoOpenOrders` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-All-Algo-Open-Orders) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-All-Algo-Open-Orders) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-All-Algo-Open-Orders) + +``` +{ "code": 200, "msg": "The operation of cancel all open order is done."} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-All-Algo-Open-Orders) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-All-Algo-Open-Orders) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-All-Algo-Open-Orders) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-All-Algo-Open-Orders) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-All-Algo-Open-Orders) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Cancel-All-Open-Orders.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Cancel-All-Open-Orders.md new file mode 100644 index 0000000..7a8c74b --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Cancel-All-Open-Orders.md @@ -0,0 +1,58 @@ +--- +title: "Cancel All Open Orders | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-All-Open-Orders" +fetched_at: "2026-01-27T05:28:30.138Z" +--- +# Cancel All Open Orders (TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-All-Open-Orders) + +Cancel All Open Orders + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-All-Open-Orders) + +DELETE `/fapi/v1/allOpenOrders` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-All-Open-Orders) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-All-Open-Orders) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-All-Open-Orders) + +``` +{ "code": 200, "msg": "The operation of cancel all open order is done."} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-All-Open-Orders) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-All-Open-Orders) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-All-Open-Orders) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-All-Open-Orders) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-All-Open-Orders) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Cancel-Multiple-Orders.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Cancel-Multiple-Orders.md new file mode 100644 index 0000000..9282b85 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Cancel-Multiple-Orders.md @@ -0,0 +1,78 @@ +--- +title: "Cancel Multiple Orders | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-Multiple-Orders" +fetched_at: "2026-01-27T05:28:30.189Z" +--- +# Cancel Multiple Orders (TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-Multiple-Orders) + +Cancel Multiple Orders + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-Multiple-Orders) + +DELETE `/fapi/v1/batchOrders` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-Multiple-Orders) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-Multiple-Orders) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +orderIdList + +LIST + +NO + +max length 10 +e.g. \[1234567,2345678\] + +origClientOrderIdList + +LIST + +NO + +max length 10 +e.g. \["my\_id\_1","my\_id\_2"\], encode the double quotes. No space after comma. + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +> - Either `orderIdList` or `origClientOrderIdList` must be sent. + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-Multiple-Orders) + +``` +[ { "clientOrderId": "myOrder1", "cumQty": "0", "cumQuote": "0", "executedQty": "0", "orderId": 283194212, "origQty": "11", "origType": "TRAILING_STOP_MARKET", "price": "0", "reduceOnly": false, "side": "BUY", "positionSide": "SHORT", "status": "CANCELED", "stopPrice": "9300", // please ignore when order type is TRAILING_STOP_MARKET "closePosition": false, // if Close-All "symbol": "BTCUSDT", "timeInForce": "GTC", "type": "TRAILING_STOP_MARKET", "activatePrice": "9020", // activation price, only return with TRAILING_STOP_MARKET order "priceRate": "0.3", // callback rate, only return with TRAILING_STOP_MARKET order "updateTime": 1571110484038, "workingType": "CONTRACT_PRICE", "priceProtect": false, // if conditional order trigger is protected "priceMatch": "NONE", //price match mode "selfTradePreventionMode": "NONE", //self trading preventation mode "goodTillDate": 1693207680000 //order pre-set auot cancel time for TIF GTD order }, { "code": -2011, "msg": "Unknown order sent." }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-Multiple-Orders) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-Multiple-Orders) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-Multiple-Orders) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-Multiple-Orders) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-Multiple-Orders) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Cancel-Order.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Cancel-Order.md new file mode 100644 index 0000000..f2e0fab --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Cancel-Order.md @@ -0,0 +1,72 @@ +--- +title: "Cancel Order | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-Order" +fetched_at: "2026-01-27T05:28:30.347Z" +--- +# Cancel Order (TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-Order) + +Cancel an active order. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-Order) + +DELETE `/fapi/v1/order` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-Order) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-Order) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +orderId + +LONG + +NO + +origClientOrderId + +STRING + +NO + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +> - Either `orderId` or `origClientOrderId` must be sent. + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-Order) + +``` +{ "clientOrderId": "myOrder1", "cumQty": "0", "cumQuote": "0", "executedQty": "0", "orderId": 283194212, "origQty": "11", "origType": "TRAILING_STOP_MARKET", "price": "0", "reduceOnly": false, "side": "BUY", "positionSide": "SHORT", "status": "CANCELED", "stopPrice": "9300", // please ignore when order type is TRAILING_STOP_MARKET "closePosition": false, // if Close-All "symbol": "BTCUSDT", "timeInForce": "GTC", "type": "TRAILING_STOP_MARKET", "activatePrice": "9020", // activation price, only return with TRAILING_STOP_MARKET order "priceRate": "0.3", // callback rate, only return with TRAILING_STOP_MARKET order "updateTime": 1571110484038, "workingType": "CONTRACT_PRICE", "priceProtect": false, // if conditional order trigger is protected "priceMatch": "NONE", //price match mode "selfTradePreventionMode": "NONE", //self trading preventation mode "goodTillDate": 1693207680000 //order pre-set auot cancel time for TIF GTD order} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-Order) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-Order) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-Order) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-Order) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-Order) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Change-Initial-Leverage.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Change-Initial-Leverage.md new file mode 100644 index 0000000..7bd59cc --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Change-Initial-Leverage.md @@ -0,0 +1,66 @@ +--- +title: "Change Initial Leverage | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Change-Initial-Leverage" +fetched_at: "2026-01-27T05:28:30.364Z" +--- +# Change Initial Leverage(TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Change-Initial-Leverage) + +Change user's initial leverage of specific symbol market. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Change-Initial-Leverage) + +POST `/fapi/v1/leverage` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Change-Initial-Leverage) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Change-Initial-Leverage) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +leverage + +INT + +YES + +target initial leverage: int from 1 to 125 + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Change-Initial-Leverage) + +``` +{ "leverage": 21, "maxNotionalValue": "1000000", "symbol": "BTCUSDT"} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Change-Initial-Leverage) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Change-Initial-Leverage) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Change-Initial-Leverage) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Change-Initial-Leverage) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Change-Initial-Leverage) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Change-Margin-Type.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Change-Margin-Type.md new file mode 100644 index 0000000..9d609ee --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Change-Margin-Type.md @@ -0,0 +1,66 @@ +--- +title: "Change Margin Type | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Change-Margin-Type" +fetched_at: "2026-01-27T05:28:30.387Z" +--- +# Change Margin Type(TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Change-Margin-Type) + +Change symbol level margin type + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Change-Margin-Type) + +POST `/fapi/v1/marginType` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Change-Margin-Type) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Change-Margin-Type) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +marginType + +ENUM + +YES + +ISOLATED, CROSSED + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Change-Margin-Type) + +``` +{ "code": 200, "msg": "success"} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Change-Margin-Type) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Change-Margin-Type) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Change-Margin-Type) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Change-Margin-Type) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Change-Margin-Type) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Change-Multi-Assets-Mode.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Change-Multi-Assets-Mode.md new file mode 100644 index 0000000..638b7b0 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Change-Multi-Assets-Mode.md @@ -0,0 +1,60 @@ +--- +title: "Change Multi Assets Mode | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Change-Multi-Assets-Mode" +fetched_at: "2026-01-27T05:28:30.471Z" +--- +# Change Multi-Assets Mode (TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Change-Multi-Assets-Mode) + +Change user's Multi-Assets mode (Multi-Assets Mode or Single-Asset Mode) on _**Every symbol**_ + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Change-Multi-Assets-Mode) + +POST `/fapi/v1/multiAssetsMargin` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Change-Multi-Assets-Mode) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Change-Multi-Assets-Mode) + +Name + +Type + +Mandatory + +Description + +multiAssetsMargin + +STRING + +YES + +"true": Multi-Assets Mode; "false": Single-Asset Mode + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Change-Multi-Assets-Mode) + +``` +{ "code": 200, "msg": "success"} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Change-Multi-Assets-Mode) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Change-Multi-Assets-Mode) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Change-Multi-Assets-Mode) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Change-Multi-Assets-Mode) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Change-Multi-Assets-Mode) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Change-Position-Mode.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Change-Position-Mode.md new file mode 100644 index 0000000..514bc13 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Change-Position-Mode.md @@ -0,0 +1,60 @@ +--- +title: "Change Position Mode | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Change-Position-Mode" +fetched_at: "2026-01-27T05:28:30.595Z" +--- +# Change Position Mode(TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Change-Position-Mode) + +Change user's position mode (Hedge Mode or One-way Mode ) on _**EVERY symbol**_ + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Change-Position-Mode) + +POST `/fapi/v1/positionSide/dual` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Change-Position-Mode) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Change-Position-Mode) + +Name + +Type + +Mandatory + +Description + +dualSidePosition + +STRING + +YES + +"true": Hedge Mode; "false": One-way Mode + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Change-Position-Mode) + +``` +{ "code": 200, "msg": "success"} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Change-Position-Mode) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Change-Position-Mode) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Change-Position-Mode) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Change-Position-Mode) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Change-Position-Mode) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Current-All-Algo-Open-Orders.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Current-All-Algo-Open-Orders.md new file mode 100644 index 0000000..63ff9d6 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Current-All-Algo-Open-Orders.md @@ -0,0 +1,74 @@ +--- +title: "Current All Algo Open Orders | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Current-All-Algo-Open-Orders" +fetched_at: "2026-01-27T05:28:30.610Z" +--- +# Current All Algo Open Orders (USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Current-All-Algo-Open-Orders) + +Get all algo open orders on a symbol. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Current-All-Algo-Open-Orders) + +GET `/fapi/v1/openAlgoOrders` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Current-All-Algo-Open-Orders) + +**1** for a single symbol; **40** when the symbol parameter is omitted + +**Careful** when accessing this with no symbol. + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Current-All-Algo-Open-Orders) + +Name + +Type + +Mandatory + +Description + +algoType + +STRING + +NO + +symbol + +STRING + +NO + +algoId + +LONG + +NO + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +> - If the symbol is not sent, orders for all symbols will be returned in an array. + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Current-All-Algo-Open-Orders) + +``` +[ { "algoId": 2148627, "clientAlgoId": "MRumok0dkhrP4kCm12AHaB", "algoType": "CONDITIONAL", "orderType": "TAKE_PROFIT", "symbol": "BNBUSDT", "side": "SELL", "positionSide": "BOTH", "timeInForce": "GTC", "quantity": "0.01", "algoStatus": "NEW", "actualOrderId": "", "actualPrice": "0.00000", "triggerPrice": "750.000", "price": "750.000", "icebergQuantity": null, "tpTriggerPrice": "0.000", "tpPrice": "0.000", "slTriggerPrice": "0.000", "slPrice": "0.000", "tpOrderType": "", "selfTradePreventionMode": "EXPIRE_MAKER", "workingType": "CONTRACT_PRICE", "priceMatch": "NONE", "closePosition": false, "priceProtect": false, "reduceOnly": false, "createTime": 1750514941540, "updateTime": 1750514941540, "triggerTime": 0, "goodTillDate": 0 }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Current-All-Algo-Open-Orders) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Current-All-Algo-Open-Orders) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Current-All-Algo-Open-Orders) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Current-All-Algo-Open-Orders) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Current-All-Algo-Open-Orders) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Current-All-Open-Orders.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Current-All-Open-Orders.md new file mode 100644 index 0000000..703f30a --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Current-All-Open-Orders.md @@ -0,0 +1,62 @@ +--- +title: "Query Current All Open Orders | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Current-All-Open-Orders" +fetched_at: "2026-01-27T05:28:30.646Z" +--- +# Current All Open Orders (USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Current-All-Open-Orders) + +Get all open orders on a symbol. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Current-All-Open-Orders) + +GET `/fapi/v1/openOrders` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Current-All-Open-Orders) + +**1** for a single symbol; **40** when the symbol parameter is omitted + +**Careful** when accessing this with no symbol. + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Current-All-Open-Orders) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +NO + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +> - If the symbol is not sent, orders for all symbols will be returned in an array. + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Current-All-Open-Orders) + +``` +[ { "avgPrice": "0.00000", "clientOrderId": "abc", "cumQuote": "0", "executedQty": "0", "orderId": 1917641, "origQty": "0.40", "origType": "TRAILING_STOP_MARKET", "price": "0", "reduceOnly": false, "side": "BUY", "positionSide": "SHORT", "status": "NEW", "stopPrice": "9300", // please ignore when order type is TRAILING_STOP_MARKET "closePosition": false, // if Close-All "symbol": "BTCUSDT", "time": 1579276756075, // order time "timeInForce": "GTC", "type": "TRAILING_STOP_MARKET", "activatePrice": "9020", // activation price, only return with TRAILING_STOP_MARKET order "priceRate": "0.3", // callback rate, only return with TRAILING_STOP_MARKET order "updateTime": 1579276756075, // update time "workingType": "CONTRACT_PRICE", "priceProtect": false, // if conditional order trigger is protected "priceMatch": "NONE", //price match mode "selfTradePreventionMode": "NONE", //self trading preventation mode "goodTillDate": 0 //order pre-set auot cancel time for TIF GTD order }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Current-All-Open-Orders) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Current-All-Open-Orders) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Current-All-Open-Orders) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Current-All-Open-Orders) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Current-All-Open-Orders) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Get-Order-Modify-History.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Get-Order-Modify-History.md new file mode 100644 index 0000000..0e9ec4a --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Get-Order-Modify-History.md @@ -0,0 +1,97 @@ +--- +title: "Get Order Modify History | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Get-Order-Modify-History" +fetched_at: "2026-01-27T05:28:30.726Z" +--- +# Get Order Modify History (USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Get-Order-Modify-History) + +Get order modification history + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Get-Order-Modify-History) + +GET `/fapi/v1/orderAmendment` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Get-Order-Modify-History) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Get-Order-Modify-History) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +orderId + +LONG + +NO + +origClientOrderId + +STRING + +NO + +startTime + +LONG + +NO + +Timestamp in ms to get modification history from INCLUSIVE + +endTime + +LONG + +NO + +Timestamp in ms to get modification history until INCLUSIVE + +limit + +INT + +NO + +Default 50; max 100 + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +> - 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 + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Get-Order-Modify-History) + +``` +[ { "amendmentId": 5363, // Order modification ID "symbol": "BTCUSDT", "pair": "BTCUSDT", "orderId": 20072994037, "clientOrderId": "LJ9R4QZDihCaS8UAOOLpgW", "time": 1629184560899, // Order modification time "amendment": { "price": { "before": "30004", "after": "30003.2" }, "origQty": { "before": "1", "after": "1" }, "count": 3 // Order modification count, representing the number of times the order has been modified } }, { "amendmentId": 5361, "symbol": "BTCUSDT", "pair": "BTCUSDT", "orderId": 20072994037, "clientOrderId": "LJ9R4QZDihCaS8UAOOLpgW", "time": 1629184533946, "amendment": { "price": { "before": "30005", "after": "30004" }, "origQty": { "before": "1", "after": "1" }, "count": 2 } }, { "amendmentId": 5325, "symbol": "BTCUSDT", "pair": "BTCUSDT", "orderId": 20072994037, "clientOrderId": "LJ9R4QZDihCaS8UAOOLpgW", "time": 1629182711787, "amendment": { "price": { "before": "30002", "after": "30005" }, "origQty": { "before": "1", "after": "1" }, "count": 1 } }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Get-Order-Modify-History) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Get-Order-Modify-History) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Get-Order-Modify-History) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Get-Order-Modify-History) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Get-Order-Modify-History) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Get-Position-Margin-Change-History.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Get-Position-Margin-Change-History.md new file mode 100644 index 0000000..f12b3a2 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Get-Position-Margin-Change-History.md @@ -0,0 +1,91 @@ +--- +title: "Get Position Margin Change History | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Get-Position-Margin-Change-History" +fetched_at: "2026-01-27T05:28:30.844Z" +--- +# Get Position Margin Change History (TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Get-Position-Margin-Change-History) + +Get Position Margin Change History + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Get-Position-Margin-Change-History) + +GET `/fapi/v1/positionMargin/history` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Get-Position-Margin-Change-History) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Get-Position-Margin-Change-History) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +type + +INT + +NO + +1: Add position margin,2: Reduce position margin + +startTime + +LONG + +NO + +endTime + +LONG + +NO + +Default current time if not pass + +limit + +INT + +NO + +Default: 500 + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +> - Support querying future histories that are not older than 30 days +> - The time between `startTime` and `endTime`can't be more than 30 days + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Get-Position-Margin-Change-History) + +``` +[ { "symbol": "BTCUSDT", "type": 1, "deltaType": "USER_ADJUST", "amount": "23.36332311", "asset": "USDT", "time": 1578047897183, "positionSide": "BOTH" }, { "symbol": "BTCUSDT", "type": 1, "deltaType": "USER_ADJUST", "amount": "100", "asset": "USDT", "time": 1578047900425, "positionSide": "LONG" }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Get-Position-Margin-Change-History) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Get-Position-Margin-Change-History) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Get-Position-Margin-Change-History) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Get-Position-Margin-Change-History) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Get-Position-Margin-Change-History) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Modify-Isolated-Position-Margin.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Modify-Isolated-Position-Margin.md new file mode 100644 index 0000000..0b86bc1 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Modify-Isolated-Position-Margin.md @@ -0,0 +1,82 @@ +--- +title: "Modify Isolated Position Margin | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Modify-Isolated-Position-Margin" +fetched_at: "2026-01-27T05:28:30.858Z" +--- +# Modify Isolated Position Margin(TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Modify-Isolated-Position-Margin) + +Modify Isolated Position Margin + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Modify-Isolated-Position-Margin) + +POST `/fapi/v1/positionMargin` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Modify-Isolated-Position-Margin) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Modify-Isolated-Position-Margin) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +positionSide + +ENUM + +NO + +Default `BOTH` for One-way Mode ; `LONG` or `SHORT` for Hedge Mode. It must be sent with Hedge Mode. + +amount + +DECIMAL + +YES + +type + +INT + +YES + +1: Add position margin,2: Reduce position margin + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +> - Only for isolated symbol + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Modify-Isolated-Position-Margin) + +``` +{ "amount": 100.0, "code": 200, "msg": "Successfully modify position margin.", "type": 1} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Modify-Isolated-Position-Margin) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Modify-Isolated-Position-Margin) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Modify-Isolated-Position-Margin) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Modify-Isolated-Position-Margin) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Modify-Isolated-Position-Margin) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Modify-Multiple-Orders.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Modify-Multiple-Orders.md new file mode 100644 index 0000000..68ed2fd --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Modify-Multiple-Orders.md @@ -0,0 +1,143 @@ +--- +title: "Modify Multiple Orders | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Modify-Multiple-Orders" +fetched_at: "2026-01-27T05:28:30.963Z" +--- +# Modify Multiple Orders(TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Modify-Multiple-Orders) + +Modify Multiple Orders (TRADE) + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Modify-Multiple-Orders) + +PUT `/fapi/v1/batchOrders` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Modify-Multiple-Orders) + +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); + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Modify-Multiple-Orders) + +Name + +Type + +Mandatory + +Description + +batchOrders + +list + +YES + +order list. Max 5 orders + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +**Where `batchOrders` is the list of order parameters in JSON** + +Name + +Type + +Mandatory + +Description + +orderId + +LONG + +NO + +origClientOrderId + +STRING + +NO + +symbol + +STRING + +YES + +side + +ENUM + +YES + +`SELL`, `BUY` + +quantity + +DECIMAL + +YES + +Order quantity, cannot be sent with `closePosition=true` + +price + +DECIMAL + +YES + +priceMatch + +ENUM + +NO + +only avaliable for `LIMIT`/`STOP`/`TAKE_PROFIT` order; can be set to `OPPONENT`/ `OPPONENT_5`/ `OPPONENT_10`/ `OPPONENT_20`: /`QUEUE`/ `QUEUE_5`/ `QUEUE_10`/ `QUEUE_20`; Can't be passed together with `price` + +stopPrice + +DECIMAL + +NO + +stop price, only `STOP`, `STOP_MARKET`, `TAKE_PROFIT`, `TAKE_PROFIT_MARKET` need + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +> - 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 + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Modify-Multiple-Orders) + +``` +[ { "orderId": 20072994037, "symbol": "BTCUSDT", "pair": "BTCUSDT", "status": "NEW", "clientOrderId": "LJ9R4QZDihCaS8UAOOLpgW", "price": "30005", "avgPrice": "0.0", "origQty": "1", "executedQty": "0", "cumQty": "0", "cumBase": "0", "timeInForce": "GTC", "type": "LIMIT", "reduceOnly": false, "closePosition": false, "side": "BUY", "positionSide": "LONG", "stopPrice": "0", "workingType": "CONTRACT_PRICE", "priceProtect": false, "origType": "LIMIT", "priceMatch": "NONE", //price match mode "selfTradePreventionMode": "NONE", //self trading preventation mode "goodTillDate": 0, //order pre-set auot cancel time for TIF GTD order "updateTime": 1629182711600 }, { "code": -2022, "msg": "ReduceOnly Order is rejected." }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Modify-Multiple-Orders) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Modify-Multiple-Orders) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Modify-Multiple-Orders) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Modify-Multiple-Orders) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Modify-Multiple-Orders) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Modify-Order.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Modify-Order.md new file mode 100644 index 0000000..1d966b2 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Modify-Order.md @@ -0,0 +1,108 @@ +--- +title: "Modify Order | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Modify-Order" +fetched_at: "2026-01-27T05:28:31.016Z" +--- +# Modify Order (TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Modify-Order) + +Order modify function, currently only LIMIT order modification is supported, modified orders will be reordered in the match queue + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Modify-Order) + +PUT `/fapi/v1/order` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Modify-Order) + +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) + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Modify-Order) + +Name + +Type + +Mandatory + +Description + +orderId + +LONG + +NO + +origClientOrderId + +STRING + +NO + +symbol + +STRING + +YES + +side + +ENUM + +YES + +`SELL`, `BUY` + +quantity + +DECIMAL + +YES + +Order quantity, cannot be sent with `closePosition=true` + +price + +DECIMAL + +YES + +priceMatch + +ENUM + +NO + +only avaliable for `LIMIT`/`STOP`/`TAKE_PROFIT` order; can be set to `OPPONENT`/ `OPPONENT_5`/ `OPPONENT_10`/ `OPPONENT_20`: /`QUEUE`/ `QUEUE_5`/ `QUEUE_10`/ `QUEUE_20`; Can't be passed together with `price` + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +> - 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 + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Modify-Order) + +``` +{ "orderId": 20072994037, "symbol": "BTCUSDT", "pair": "BTCUSDT", "status": "NEW", "clientOrderId": "LJ9R4QZDihCaS8UAOOLpgW", "price": "30005", "avgPrice": "0.0", "origQty": "1", "executedQty": "0", "cumQty": "0", "cumBase": "0", "timeInForce": "GTC", "type": "LIMIT", "reduceOnly": false, "closePosition": false, "side": "BUY", "positionSide": "LONG", "stopPrice": "0", "workingType": "CONTRACT_PRICE", "priceProtect": false, "origType": "LIMIT", "priceMatch": "NONE", //price match mode "selfTradePreventionMode": "NONE", //self trading preventation mode "goodTillDate": 0, //order pre-set auot cancel time for TIF GTD order "updateTime": 1629182711600} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Modify-Order) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Modify-Order) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Modify-Order) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Modify-Order) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Modify-Order) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_New-Algo-Order.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_New-Algo-Order.md new file mode 100644 index 0000000..67aeb38 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_New-Algo-Order.md @@ -0,0 +1,237 @@ +--- +title: "New Algo Order | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/New-Algo-Order" +fetched_at: "2026-01-27T05:28:31.146Z" +--- +# New Algo Order(TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/New-Algo-Order) + +Send in a new Algo order. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/New-Algo-Order) + +POST `/fapi/v1/algoOrder` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/New-Algo-Order) + +0 on IP rate limit(x-mbx-used-weight-1m) + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/New-Algo-Order) + +Name + +Type + +Mandatory + +Description + +algoType + +ENUM + +YES + +Only support `CONDITIONAL` + +symbol + +STRING + +YES + +side + +ENUM + +YES + +positionSide + +ENUM + +NO + +Default `BOTH` for One-way Mode ; `LONG` or `SHORT` for Hedge Mode. It must be sent in Hedge Mode. + +type + +ENUM + +YES + +For `CONDITIONAL` algoType, `STOP_MARKET`/`TAKE_PROFIT_MARKET`/`STOP`/`TAKE_PROFIT`/`TRAILING_STOP_MARKET` as order type + +timeInForce + +ENUM + +NO + +`IOC` or `GTC` or `FOK` or `GTX` , default `GTC` + +quantity + +DECIMAL + +NO + +Cannot be sent with `closePosition`\=`true`(Close-All) + +price + +DECIMAL + +NO + +triggerPrice + +DECIMAL + +NO + +workingType + +ENUM + +NO + +triggerPrice triggered by: `MARK_PRICE`, `CONTRACT_PRICE`. Default `CONTRACT_PRICE` + +priceMatch + +ENUM + +NO + +only avaliable for `LIMIT`/`STOP`/`TAKE_PROFIT` order; can be set to `OPPONENT`/ `OPPONENT_5`/ `OPPONENT_10`/ `OPPONENT_20`: /`QUEUE`/ `QUEUE_5`/ `QUEUE_10`/ `QUEUE_20`; Can't be passed together with `price` + +closePosition + +STRING + +NO + +true, false;Close-All,used with `STOP_MARKET` or `TAKE_PROFIT_MARKET`. + +priceProtect + +STRING + +NO + +"TRUE" or "FALSE", default "FALSE". Used with `STOP_MARKET` or `TAKE_PROFIT_MARKET` order. when price reaches the triggerPrice ,the difference rate between "MARK\_PRICE" and "CONTRACT\_PRICE" cannot be larger than the Price Protection Threshold of the symbol. + +reduceOnly + +STRING + +NO + +"true" or "false". default "false". Cannot be sent in Hedge Mode; cannot be sent with `closePosition`\=`true` + +activatePrice + +DECIMAL + +NO + +Used with `TRAILING_STOP_MARKET` orders, default as the latest price(supporting different `workingType`) + +callbackRate + +DECIMAL + +NO + +Used with `TRAILING_STOP_MARKET` orders, min 0.1, max 10 where 1 for 1% + +clientAlgoId + +STRING + +NO + +A unique id among open orders. Automatically generated if not sent. Can only be string following the rule: `^[\.A-Z\:/a-z0-9_-]{1,36}$` + +newOrderRespType + +ENUM + +NO + +"ACK", "RESULT", default "ACK" + +selfTradePreventionMode + +ENUM + +NO + +`EXPIRE_TAKER`:expire taker order when STP triggers/ `EXPIRE_MAKER`:expire taker order when STP triggers/ `EXPIRE_BOTH`:expire both orders when STP triggers; default `NONE` + +goodTillDate + +LONG + +NO + +order cancel time for timeInForce `GTD`, mandatory when `timeInforce` set to `GTD`; order the timestamp only retains second-level precision, ms part will be ignored; The goodTillDate timestamp must be greater than the current time plus 600 seconds and smaller than 253402300799000 + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +> - 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 parameter`priceProtect`is 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`. +> + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/New-Algo-Order) + +``` +{ "algoId": 2146760, "clientAlgoId": "6B2I9XVcJpCjqPAJ4YoFX7", "algoType": "CONDITIONAL", "orderType": "TAKE_PROFIT", "symbol": "BNBUSDT", "side": "SELL", "positionSide": "BOTH", "timeInForce": "GTC", "quantity": "0.01", "algoStatus": "NEW", "triggerPrice": "750.000", "price": "750.000", "icebergQuantity": null, "selfTradePreventionMode": "EXPIRE_MAKER", "workingType": "CONTRACT_PRICE", "priceMatch": "NONE", "closePosition": false, "priceProtect": false, "reduceOnly": false, "activatePrice": "", //TRAILING_STOP_MARKET order "callbackRate": "", //TRAILING_STOP_MARKET order "createTime": 1750485492076, "updateTime": 1750485492076, "triggerTime": 0, "goodTillDate": 0} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/New-Algo-Order) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/New-Algo-Order) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/New-Algo-Order) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/New-Algo-Order) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/New-Algo-Order) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_New-Order-Test.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_New-Order-Test.md new file mode 100644 index 0000000..a181295 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_New-Order-Test.md @@ -0,0 +1,255 @@ +--- +title: "Test New Order | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/New-Order-Test" +fetched_at: "2026-01-27T05:28:31.129Z" +--- +# Test Order(TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/New-Order-Test) + +Testing order request, this order will not be submitted to matching engine + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/New-Order-Test) + +POST `/fapi/v1/order/test` + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/New-Order-Test) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +side + +ENUM + +YES + +positionSide + +ENUM + +NO + +Default `BOTH` for One-way Mode ; `LONG` or `SHORT` for Hedge Mode. It must be sent in Hedge Mode. + +type + +ENUM + +YES + +timeInForce + +ENUM + +NO + +quantity + +DECIMAL + +NO + +Cannot be sent with `closePosition`\=`true`(Close-All) + +reduceOnly + +STRING + +NO + +"true" or "false". default "false". Cannot be sent in Hedge Mode; cannot be sent with `closePosition`\=`true` + +price + +DECIMAL + +NO + +newClientOrderId + +STRING + +NO + +A unique id among open orders. Automatically generated if not sent. Can only be string following the rule: `^[\.A-Z\:/a-z0-9_-]{1,36}$` + +stopPrice + +DECIMAL + +NO + +Used with `STOP/STOP_MARKET` or `TAKE_PROFIT/TAKE_PROFIT_MARKET` orders. + +closePosition + +STRING + +NO + +`true`, `false`;Close-All,used with `STOP_MARKET` or `TAKE_PROFIT_MARKET`. + +activationPrice + +DECIMAL + +NO + +Used with `TRAILING_STOP_MARKET` orders, default as the latest price(supporting different `workingType`) + +callbackRate + +DECIMAL + +NO + +Used with `TRAILING_STOP_MARKET` orders, min 0.1, max 5 where 1 for 1% + +workingType + +ENUM + +NO + +stopPrice triggered by: "MARK\_PRICE", "CONTRACT\_PRICE". Default "CONTRACT\_PRICE" + +priceProtect + +STRING + +NO + +"TRUE" or "FALSE", default "FALSE". Used with `STOP/STOP_MARKET` or `TAKE_PROFIT/TAKE_PROFIT_MARKET` orders. + +newOrderRespType + +ENUM + +NO + +"ACK", "RESULT", default "ACK" + +priceMatch + +ENUM + +NO + +only avaliable for `LIMIT`/`STOP`/`TAKE_PROFIT` order; can be set to `OPPONENT`/ `OPPONENT_5`/ `OPPONENT_10`/ `OPPONENT_20`: /`QUEUE`/ `QUEUE_5`/ `QUEUE_10`/ `QUEUE_20`; Can't be passed together with `price` + +selfTradePreventionMode + +ENUM + +NO + +`NONE`:No STP / `EXPIRE_TAKER`:expire taker order when STP triggers/ `EXPIRE_MAKER`:expire taker order when STP triggers/ `EXPIRE_BOTH`:expire both orders when STP triggers; default `NONE` + +goodTillDate + +LONG + +NO + +order cancel time for timeInForce `GTD`, mandatory when `timeInforce` set to `GTD`; order the timestamp only retains second-level precision, ms part will be ignored; The goodTillDate timestamp must be greater than the current time plus 600 seconds and smaller than 253402300799000 + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +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 parameter`priceProtect`is 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` +> + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/New-Order-Test) + +``` +{ "clientOrderId": "testOrder", "cumQty": "0", "cumQuote": "0", "executedQty": "0", "orderId": 22542179, "avgPrice": "0.00000", "origQty": "10", "price": "0", "reduceOnly": false, "side": "BUY", "positionSide": "SHORT", "status": "NEW", "stopPrice": "9300", // please ignore when order type is TRAILING_STOP_MARKET "closePosition": false, // if Close-All "symbol": "BTCUSDT", "timeInForce": "GTD", "type": "TRAILING_STOP_MARKET", "origType": "TRAILING_STOP_MARKET", "activatePrice": "9020", // activation price, only return with TRAILING_STOP_MARKET order "priceRate": "0.3", // callback rate, only return with TRAILING_STOP_MARKET order "updateTime": 1566818724722, "workingType": "CONTRACT_PRICE", "priceProtect": false, // if conditional order trigger is protected "priceMatch": "NONE", //price match mode "selfTradePreventionMode": "NONE", //self trading preventation mode "goodTillDate": 1693207680000 //order pre-set auot cancel time for TIF GTD order} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/New-Order-Test) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/New-Order-Test) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/New-Order-Test) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/New-Order-Test) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Place-Multiple-Orders.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Place-Multiple-Orders.md new file mode 100644 index 0000000..f151ec9 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Place-Multiple-Orders.md @@ -0,0 +1,169 @@ +--- +title: "Place Multiple Orders | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Place-Multiple-Orders" +fetched_at: "2026-01-27T05:28:31.223Z" +--- +# Place Multiple Orders(TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Place-Multiple-Orders) + +Place Multiple Orders + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Place-Multiple-Orders) + +POST `/fapi/v1/batchOrders` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Place-Multiple-Orders) + +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); + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Place-Multiple-Orders) + +Name + +Type + +Mandatory + +Description + +batchOrders + +LIST + +YES + +order list. Max 5 orders + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +**Where `batchOrders` is the list of order parameters in JSON** + +- **Example:** /fapi/v1/batchOrders?batchOrders=\[{"type":"LIMIT","timeInForce":"GTC", + "symbol":"BTCUSDT","side":"BUY","price":"10001","quantity":"0.001"}\] + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +side + +ENUM + +YES + +positionSide + +ENUM + +NO + +Default `BOTH` for One-way Mode ; `LONG` or `SHORT` for Hedge Mode. It must be sent with Hedge Mode. + +type + +ENUM + +YES + +timeInForce + +ENUM + +NO + +quantity + +DECIMAL + +YES + +reduceOnly + +STRING + +NO + +"true" or "false". default "false". + +price + +DECIMAL + +NO + +newClientOrderId + +STRING + +NO + +A unique id among open orders. Automatically generated if not sent. Can only be string following the rule: `^[\.A-Z\:/a-z0-9_-]{1,36}$` + +newOrderRespType + +ENUM + +NO + +"ACK", "RESULT", default "ACK" + +priceMatch + +ENUM + +NO + +only avaliable for `LIMIT`/`STOP`/`TAKE_PROFIT` order; can be set to `OPPONENT`/ `OPPONENT_5`/ `OPPONENT_10`/ `OPPONENT_20`: /`QUEUE`/ `QUEUE_5`/ `QUEUE_10`/ `QUEUE_20`; Can't be passed together with `price` + +selfTradePreventionMode + +ENUM + +NO + +`EXPIRE_TAKER`:expire taker order when STP triggers/ `EXPIRE_MAKER`:expire taker order when STP triggers/ `EXPIRE_BOTH`:expire both orders when STP triggers; default `NONE` + +goodTillDate + +LONG + +NO + +order cancel time for timeInForce `GTD`, mandatory when `timeInforce` set to `GTD`; order the timestamp only retains second-level precision, ms part will be ignored; The goodTillDate timestamp must be greater than the current time plus 600 seconds and smaller than 253402300799000 + +> - 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. + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Place-Multiple-Orders) + +``` +[ { "clientOrderId": "testOrder", "cumQty": "0", "cumQuote": "0", "executedQty": "0", "orderId": 22542179, "avgPrice": "0.00000", "origQty": "10", "price": "0", "reduceOnly": false, "side": "BUY", "positionSide": "SHORT", "status": "NEW", "stopPrice": "0", "closePosition": false, "symbol": "BTCUSDT", "timeInForce": "GTC", "type": "TRAILING_STOP_MARKET", "origType": "TRAILING_STOP_MARKET", "updateTime": 1566818724722, "workingType": "CONTRACT_PRICE", "priceProtect": false, // if conditional order trigger is protected "priceMatch": "NONE", //price match mode "selfTradePreventionMode": "NONE", //self trading preventation mode "goodTillDate": 1693207680000 //order pre-set auto cancel time for TIF GTD order }, { "code": -2022, "msg": "ReduceOnly Order is rejected." }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Place-Multiple-Orders) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Place-Multiple-Orders) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Place-Multiple-Orders) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Place-Multiple-Orders) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Place-Multiple-Orders) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Position-ADL-Quantile-Estimation.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Position-ADL-Quantile-Estimation.md new file mode 100644 index 0000000..4955d60 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Position-ADL-Quantile-Estimation.md @@ -0,0 +1,65 @@ +--- +title: "Position Adl Quantile Estimation | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Position-ADL-Quantile-Estimation" +fetched_at: "2026-01-27T05:28:31.269Z" +--- +# Position ADL Quantile Estimation(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Position-ADL-Quantile-Estimation) + +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. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Position-ADL-Quantile-Estimation) + +GET `/fapi/v1/adlQuantile` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Position-ADL-Quantile-Estimation) + +**5** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Position-ADL-Quantile-Estimation) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +NO + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Position-ADL-Quantile-Estimation) + +``` +[ { "symbol": "ETHUSDT", "adlQuantile": { // if the positions of the symbol are crossed margined in Hedge Mode, "LONG" and "SHORT" will be returned a same quantile value, and "HEDGE" will be returned instead of "BOTH". "LONG": 3, "SHORT": 3, "HEDGE": 0 // only a sign, ignore the value } }, { "symbol": "BTCUSDT", "adlQuantile": { // for positions of the symbol are in One-way Mode or isolated margined in Hedge Mode "LONG": 1, // adl quantile for "LONG" position in hedge mode "SHORT": 2, // adl qauntile for "SHORT" position in hedge mode "BOTH": 0 // adl qunatile for position in one-way mode } } ] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Position-ADL-Quantile-Estimation) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Position-ADL-Quantile-Estimation) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Position-ADL-Quantile-Estimation) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Position-ADL-Quantile-Estimation) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Position-ADL-Quantile-Estimation) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Position-Information-V2.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Position-Information-V2.md new file mode 100644 index 0000000..15a3f7e --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Position-Information-V2.md @@ -0,0 +1,70 @@ +--- +title: "Position Information V2 | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Position-Information-V2" +fetched_at: "2026-01-27T05:28:31.398Z" +--- +# Position Information V2 (USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Position-Information-V2) + +Get current position information. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Position-Information-V2) + +GET `/fapi/v2/positionRisk` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Position-Information-V2) + +**5** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Position-Information-V2) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +NO + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +**Note** + +> Please use with user data stream `ACCOUNT_UPDATE` to meet your timeliness and accuracy needs. + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Position-Information-V2) + +> For One-way position mode: + +``` +[ { "entryPrice": "0.00000", "breakEvenPrice": "0.0", "marginType": "isolated", "isAutoAddMargin": "false", "isolatedMargin": "0.00000000", "leverage": "10", "liquidationPrice": "0", "markPrice": "6679.50671178", "maxNotionalValue": "20000000", "positionAmt": "0.000", "notional": "0",, "isolatedWallet": "0", "symbol": "BTCUSDT", "unRealizedProfit": "0.00000000", "positionSide": "BOTH", "updateTime": 0 }] +``` + +> For Hedge position mode: + +``` +[ { "symbol": "BTCUSDT", "positionAmt": "0.001", "entryPrice": "22185.2", "breakEvenPrice": "0.0", "markPrice": "21123.05052574", "unRealizedProfit": "-1.06214947", "liquidationPrice": "19731.45529116", "leverage": "4", "maxNotionalValue": "100000000", "marginType": "cross", "isolatedMargin": "0.00000000", "isAutoAddMargin": "false", "positionSide": "LONG", "notional": "21.12305052", "isolatedWallet": "0", "updateTime": 1655217461579 }, { "symbol": "BTCUSDT", "positionAmt": "0.000", "entryPrice": "0.0", "breakEvenPrice": "0.0", "markPrice": "21123.05052574", "unRealizedProfit": "0.00000000", "liquidationPrice": "0", "leverage": "4", "maxNotionalValue": "100000000", "marginType": "cross", "isolatedMargin": "0.00000000", "isAutoAddMargin": "false", "positionSide": "SHORT", "notional": "0", "isolatedWallet": "0", "updateTime": 0 }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Position-Information-V2) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Position-Information-V2) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Position-Information-V2) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Position-Information-V2) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Position-Information-V2) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Position-Information-V3.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Position-Information-V3.md new file mode 100644 index 0000000..fa05fef --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Position-Information-V3.md @@ -0,0 +1,70 @@ +--- +title: "Position Information V3 | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Position-Information-V3" +fetched_at: "2026-01-27T05:28:31.409Z" +--- +# Position Information V3 (USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Position-Information-V3) + +Get current position information(only symbol that has position or open orders will be returned). + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Position-Information-V3) + +GET `/fapi/v3/positionRisk` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Position-Information-V3) + +**5** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Position-Information-V3) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +NO + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +**Note** + +> Please use with user data stream `ACCOUNT_UPDATE` to meet your timeliness and accuracy needs. + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Position-Information-V3) + +> For One-way position mode: + +``` +[ { "symbol": "ADAUSDT", "positionSide": "BOTH", // position side "positionAmt": "30", "entryPrice": "0.385", "breakEvenPrice": "0.385077", "markPrice": "0.41047590", "unRealizedProfit": "0.76427700", // unrealized profit "liquidationPrice": "0", "isolatedMargin": "0", "notional": "12.31427700", "marginAsset": "USDT", "isolatedWallet": "0", "initialMargin": "0.61571385", // initial margin required with current mark price "maintMargin": "0.08004280", // maintenance margin required "positionInitialMargin": "0.61571385",// initial margin required for positions with current mark price "openOrderInitialMargin": "0", // initial margin required for open orders with current mark price "adl": 2, "bidNotional": "0", // bids notional, ignore "askNotional": "0", // ask notional, ignore "updateTime": 1720736417660 }] +``` + +> For Hedge position mode: + +``` +[ { "symbol": "ADAUSDT", "positionSide": "LONG", // position side "positionAmt": "30", "entryPrice": "0.385", "breakEvenPrice": "0.385077", "markPrice": "0.41047590", "unRealizedProfit": "0.76427700", // unrealized profit "liquidationPrice": "0", "isolatedMargin": "0", "notional": "12.31427700", "marginAsset": "USDT", "isolatedWallet": "0", "initialMargin": "0.61571385", // initial margin required with current mark price "maintMargin": "0.08004280", // maintenance margin required "positionInitialMargin": "0.61571385",// initial margin required for positions with current mark price "openOrderInitialMargin": "0", // initial margin required for open orders with current mark price "adl": 2, "bidNotional": "0", // bids notional, ignore "askNotional": "0", // ask notional, ignore "updateTime": 1720736417660 }, { "symbol": "COMPUSDT", "positionSide": "SHORT", "positionAmt": "-1.000", "entryPrice": "70.92841", "breakEvenPrice": "70.900038636", "markPrice": "49.72023376", "unRealizedProfit": "21.20817624", "liquidationPrice": "2260.56757210", "isolatedMargin": "0", "notional": "-49.72023376", "marginAsset": "USDT", "isolatedWallet": "0", "initialMargin": "2.48601168", "maintMargin": "0.49720233", "positionInitialMargin": "2.48601168", "openOrderInitialMargin": "0", "adl": 2, "bidNotional": "0", "askNotional": "0", "updateTime": 1708943511656 }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Position-Information-V3) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Position-Information-V3) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Position-Information-V3) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Position-Information-V3) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Position-Information-V3) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Query-Algo-Order.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Query-Algo-Order.md new file mode 100644 index 0000000..1dfc838 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Query-Algo-Order.md @@ -0,0 +1,73 @@ +--- +title: "Query Algo Order | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Query-Algo-Order" +fetched_at: "2026-01-27T05:28:31.483Z" +--- +# Query Algo Order (USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Query-Algo-Order) + +Check an algo 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 + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Query-Algo-Order) + +GET `/fapi/v1/algoOrder` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Query-Algo-Order) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Query-Algo-Order) + +Name + +Type + +Mandatory + +Description + +algoId + +LONG + +NO + +clientAlgoId + +STRING + +NO + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +Notes: + +> - Either `algoId` or `clientAlgoId` must be sent. +> - `algoId` is self-increment for each specific `symbol` + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Query-Algo-Order) + +``` +{ "algoId": 2146760, "clientAlgoId": "6B2I9XVcJpCjqPAJ4YoFX7", "algoType": "CONDITIONAL", "orderType": "TAKE_PROFIT", "symbol": "BNBUSDT", "side": "SELL", "positionSide": "BOTH", "timeInForce": "GTC", "quantity": "0.01", "algoStatus": "CANCELED", "actualOrderId": "", "actualPrice": "0.00000", "triggerPrice": "750.000", "price": "750.000", "icebergQuantity": null, "tpTriggerPrice": "0.000", "tpPrice": "0.000", "slTriggerPrice": "0.000", "slPrice": "0.000", "tpOrderType": "", "selfTradePreventionMode": "EXPIRE_MAKER", "workingType": "CONTRACT_PRICE", "priceMatch": "NONE", "closePosition": false, "priceProtect": false, "reduceOnly": false, "createTime": 1750485492076, "updateTime": 1750514545091, "triggerTime": 0, "goodTillDate": 0} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Query-Algo-Order) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Query-Algo-Order) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Query-Algo-Order) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Query-Algo-Order) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Query-Algo-Order) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Query-All-Algo-Orders.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Query-All-Algo-Orders.md new file mode 100644 index 0000000..ed46c81 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Query-All-Algo-Orders.md @@ -0,0 +1,99 @@ +--- +title: "Query All Algo Orders | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Query-All-Algo-Orders" +fetched_at: "2026-01-27T05:28:31.539Z" +--- +# Query All Algo Orders (USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Query-All-Algo-Orders) + +Get all algo orders; active, CANCELED, TRIGGERED or FINISHED . + +- 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 + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Query-All-Algo-Orders) + +GET `/fapi/v1/allAlgoOrders` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Query-All-Algo-Orders) + +**5** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Query-All-Algo-Orders) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +algoId + +LONG + +NO + +startTime + +LONG + +NO + +endTime + +LONG + +NO + +page + +INT + +NO + +limit + +INT + +NO + +Default 500; max 1000. + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +**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). + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Query-All-Algo-Orders) + +``` +[ { "algoId": 2146760, "clientAlgoId": "6B2I9XVcJpCjqPAJ4YoFX7", "algoType": "CONDITIONAL", "orderType": "TAKE_PROFIT", "symbol": "BNBUSDT", "side": "SELL", "positionSide": "BOTH", "timeInForce": "GTC", "quantity": "0.01", "algoStatus": "CANCELED", "actualOrderId": "", "actualPrice": "0.00000", "triggerPrice": "750.000", "price": "750.000", "icebergQuantity": null, "tpTriggerPrice": "0.000", "tpPrice": "0.000", "slTriggerPrice": "0.000", "slPrice": "0.000", "tpOrderType": "", "selfTradePreventionMode": "EXPIRE_MAKER", "workingType": "CONTRACT_PRICE", "priceMatch": "NONE", "closePosition": false, "priceProtect": false, "reduceOnly": false, "createTime": 1750485492076, "updateTime": 1750514545091, "triggerTime": 0, "goodTillDate": 0 }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Query-All-Algo-Orders) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Query-All-Algo-Orders) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Query-All-Algo-Orders) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Query-All-Algo-Orders) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Query-All-Algo-Orders) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Query-Current-Open-Order.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Query-Current-Open-Order.md new file mode 100644 index 0000000..a66527c --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Query-Current-Open-Order.md @@ -0,0 +1,73 @@ +--- +title: "Query Current Open Order | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Query-Current-Open-Order" +fetched_at: "2026-01-27T05:28:31.660Z" +--- +# Query Current Open Order (USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Query-Current-Open-Order) + +Query open order + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Query-Current-Open-Order) + +GET `/fapi/v1/openOrder` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Query-Current-Open-Order) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Query-Current-Open-Order) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +orderId + +LONG + +NO + +origClientOrderId + +STRING + +NO + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +> - Either`orderId` or `origClientOrderId` must be sent +> - If the queried order has been filled or cancelled, the error message "Order does not exist" will be returned. + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Query-Current-Open-Order) + +``` +{ "avgPrice": "0.00000", "clientOrderId": "abc", "cumQuote": "0", "executedQty": "0", "orderId": 1917641, "origQty": "0.40", "origType": "TRAILING_STOP_MARKET", "price": "0", "reduceOnly": false, "side": "BUY", "positionSide": "SHORT", "status": "NEW", "stopPrice": "9300", // please ignore when order type is TRAILING_STOP_MARKET "closePosition": false, // if Close-All "symbol": "BTCUSDT", "time": 1579276756075, // order time "timeInForce": "GTC", "type": "TRAILING_STOP_MARKET", "activatePrice": "9020", // activation price, only return with TRAILING_STOP_MARKET order "priceRate": "0.3", // callback rate, only return with TRAILING_STOP_MARKET order "updateTime": 1579276756075, "workingType": "CONTRACT_PRICE", "priceProtect": false, // if conditional order trigger is protected "priceMatch": "NONE", //price match mode "selfTradePreventionMode": "NONE", //self trading preventation mode "goodTillDate": 0 //order pre-set auot cancel time for TIF GTD order} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Query-Current-Open-Order) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Query-Current-Open-Order) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Query-Current-Open-Order) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Query-Current-Open-Order) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Query-Current-Open-Order) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Query-Order.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Query-Order.md new file mode 100644 index 0000000..1f65c94 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Query-Order.md @@ -0,0 +1,79 @@ +--- +title: "Query Order | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Query-Order" +fetched_at: "2026-01-27T05:28:31.807Z" +--- +# Query Order (USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Query-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 + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Query-Order) + +GET `/fapi/v1/order` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Query-Order) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Query-Order) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +orderId + +LONG + +NO + +origClientOrderId + +STRING + +NO + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +Notes: + +> - Either `orderId` or `origClientOrderId` must be sent. +> - `orderId` is self-increment for each specific `symbol` + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Query-Order) + +``` +{ "id": "605a6d20-6588-4cb9-afa0-b0ab087507ba", "status": 200, "result": { "avgPrice": "0.00000", "clientOrderId": "abc", "cumQuote": "0", "executedQty": "0", "orderId": 1917641, "origQty": "0.40", "origType": "TRAILING_STOP_MARKET", "price": "0", "reduceOnly": false, "side": "BUY", "positionSide": "SHORT", "status": "NEW", "stopPrice": "9300", // please ignore when order type is TRAILING_STOP_MARKET "closePosition": false, // if Close-All "symbol": "BTCUSDT", "time": 1579276756075, // order time "timeInForce": "GTC", "type": "TRAILING_STOP_MARKET", "activatePrice": "9020", // activation price, only return with TRAILING_STOP_MARKET order "priceRate": "0.3", // callback rate, only return with TRAILING_STOP_MARKET order "updateTime": 1579276756075, // update time "workingType": "CONTRACT_PRICE", "priceProtect": false // if conditional order trigger is protected }} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Query-Order) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Query-Order) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Query-Order) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Query-Order) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Query-Order) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_TradFi-Perps.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_TradFi-Perps.md new file mode 100644 index 0000000..4c9b43c --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_TradFi-Perps.md @@ -0,0 +1,52 @@ +--- +title: "Sign TradFi-Perps agreement | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/TradFi-Perps" +fetched_at: "2026-01-27T05:28:31.944Z" +--- +# Futures TradFi Perps Contract(USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/TradFi-Perps) + +Sign TradFi-Perps agreement contract + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/TradFi-Perps) + +POST `/fapi/v1/stock/contract` + +## Request Weigh[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/TradFi-Perps) + +**50** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/TradFi-Perps) + +Name + +Type + +Mandatory + +Description + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/TradFi-Perps) + +``` +{ "code": 200, "msg": "success"} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/TradFi-Perps) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/TradFi-Perps) +- [Request Weigh](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/TradFi-Perps) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/TradFi-Perps) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/TradFi-Perps) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Users-Force-Orders.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Users-Force-Orders.md new file mode 100644 index 0000000..5536abc --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_rest-api_Users-Force-Orders.md @@ -0,0 +1,89 @@ +--- +title: "Query Users Force Orders | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Users-Force-Orders" +fetched_at: "2026-01-27T05:28:31.799Z" +--- +# User's Force Orders (USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Users-Force-Orders) + +Query user's Force Orders + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Users-Force-Orders) + +GET `/fapi/v1/forceOrders` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Users-Force-Orders) + +**20** with symbol, **50** without symbol + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Users-Force-Orders) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +NO + +autoCloseType + +ENUM + +NO + +"LIQUIDATION" for liquidation orders, "ADL" for ADL orders. + +startTime + +LONG + +NO + +endTime + +LONG + +NO + +limit + +INT + +NO + +Default 50; max 100. + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +> - 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 + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Users-Force-Orders) + +``` +[ { "orderId": 6071832819, "symbol": "BTCUSDT", "status": "FILLED", "clientOrderId": "autoclose-1596107620040000020", "price": "10871.09", "avgPrice": "10913.21000", "origQty": "0.001", "executedQty": "0.001", "cumQuote": "10.91321", "timeInForce": "IOC", "type": "LIMIT", "reduceOnly": false, "closePosition": false, "side": "SELL", "positionSide": "BOTH", "stopPrice": "0", "workingType": "CONTRACT_PRICE", "origType": "LIMIT", "time": 1596107620044, "updateTime": 1596107620087 } { "orderId": 6072734303, "symbol": "BTCUSDT", "status": "FILLED", "clientOrderId": "adl_autoclose", "price": "11023.14", "avgPrice": "10979.82000", "origQty": "0.001", "executedQty": "0.001", "cumQuote": "10.97982", "timeInForce": "GTC", "type": "LIMIT", "reduceOnly": false, "closePosition": false, "side": "BUY", "positionSide": "SHORT", "stopPrice": "0", "workingType": "CONTRACT_PRICE", "origType": "LIMIT", "time": 1596110725059, "updateTime": 1596110725071 }] +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Users-Force-Orders) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Users-Force-Orders) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Users-Force-Orders) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Users-Force-Orders) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Users-Force-Orders) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_websocket-api.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_websocket-api.md new file mode 100644 index 0000000..d33c484 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_websocket-api.md @@ -0,0 +1,263 @@ +--- +title: "New Order | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api" +fetched_at: "2026-01-27T05:28:31.928Z" +--- +# New Order(TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api) + +Send in a new order. + +## Method[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api) + +`order.place` + +## Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api) + +``` +{ "id": "3f7df6e3-2df4-44b9-9919-d2f38f90a99a", "method": "order.place", "params": { "apiKey": "HMOchcfii9ZRZnhjp2XjGXhsOBd6msAhKz9joQaWwZ7arcJTlD2hGPHQj1lGdTjR", "positionSide": "BOTH", "price": 43187.00, "quantity": 0.1, "side": "BUY", "symbol": "BTCUSDT", "timeInForce": "GTC", "timestamp": 1702555533821, "type": "LIMIT", "signature": "0f04368b2d22aafd0ggc8809ea34297eff602272917b5f01267db4efbc1c9422" }} +``` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api) + +**0** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +side + +ENUM + +YES + +positionSide + +ENUM + +NO + +Default `BOTH` for One-way Mode ; `LONG` or `SHORT` for Hedge Mode. It must be sent in Hedge Mode. + +type + +ENUM + +YES + +timeInForce + +ENUM + +NO + +quantity + +DECIMAL + +NO + +Cannot be sent with `closePosition`\=`true`(Close-All) + +reduceOnly + +STRING + +NO + +"true" or "false". default "false". Cannot be sent in Hedge Mode; cannot be sent with `closePosition`\=`true` + +price + +DECIMAL + +NO + +newClientOrderId + +STRING + +NO + +A unique id among open orders. Automatically generated if not sent. Can only be string following the rule: `^[\.A-Z\:/a-z0-9_-]{1,36}$` + +stopPrice + +DECIMAL + +NO + +Used with `STOP/STOP_MARKET` or `TAKE_PROFIT/TAKE_PROFIT_MARKET` orders. + +closePosition + +STRING + +NO + +`true`, `false`;Close-All,used with `STOP_MARKET` or `TAKE_PROFIT_MARKET`. + +activationPrice + +DECIMAL + +NO + +Used with `TRAILING_STOP_MARKET` orders, default as the latest price(supporting different `workingType`) + +callbackRate + +DECIMAL + +NO + +Used with `TRAILING_STOP_MARKET` orders, min 0.1, max 10 where 1 for 1% + +workingType + +ENUM + +NO + +stopPrice triggered by: "MARK\_PRICE", "CONTRACT\_PRICE". Default "CONTRACT\_PRICE" + +priceProtect + +STRING + +NO + +"TRUE" or "FALSE", default "FALSE". Used with `STOP/STOP_MARKET` or `TAKE_PROFIT/TAKE_PROFIT_MARKET` orders. + +newOrderRespType + +ENUM + +NO + +"ACK", "RESULT", default "ACK" + +priceMatch + +ENUM + +NO + +only avaliable for `LIMIT`/`STOP`/`TAKE_PROFIT` order; can be set to `OPPONENT`/ `OPPONENT_5`/ `OPPONENT_10`/ `OPPONENT_20`: /`QUEUE`/ `QUEUE_5`/ `QUEUE_10`/ `QUEUE_20`; Can't be passed together with `price` + +selfTradePreventionMode + +ENUM + +NO + +`NONE`:No STP / `EXPIRE_TAKER`:expire taker order when STP triggers/ `EXPIRE_MAKER`:expire taker order when STP triggers/ `EXPIRE_BOTH`:expire both orders when STP triggers; default `NONE` + +goodTillDate + +LONG + +NO + +order cancel time for timeInForce `GTD`, mandatory when `timeInforce` set to `GTD`; order the timestamp only retains second-level precision, ms part will be ignored; The goodTillDate timestamp must be greater than the current time plus 600 seconds and smaller than 253402300799000 + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +Additional mandatory parameters based on `type`: + +Type + +Additional mandatory parameters + +`LIMIT` + +`timeInForce`, `quantity`, `price` or `priceMatch` + +`MARKET` + +`quantity` + +`STOP/TAKE_PROFIT` + +`quantity`, `stopPrice`, `price` or `priceMatch` + +`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 parameter`priceProtect`is 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 + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api) + +``` +{ "id": "3f7df6e3-2df4-44b9-9919-d2f38f90a99a", "status": 200, "result": { "orderId": 325078477, "symbol": "BTCUSDT", "status": "NEW", "clientOrderId": "iCXL1BywlBaf2sesNUrVl3", "price": "43187.00", "avgPrice": "0.00", "origQty": "0.100", "executedQty": "0.000", "cumQty": "0.000", "cumQuote": "0.00000", "timeInForce": "GTC", "type": "LIMIT", "reduceOnly": false, "closePosition": false, "side": "BUY", "positionSide": "BOTH", "stopPrice": "0.00", "workingType": "CONTRACT_PRICE", "priceProtect": false, "origType": "LIMIT", "priceMatch": "NONE", "selfTradePreventionMode": "NONE", "goodTillDate": 0, "updateTime": 1702555534435 }, "rateLimits": [ { "rateLimitType": "ORDERS", "interval": "SECOND", "intervalNum": 10, "limit": 300, "count": 1 }, { "rateLimitType": "ORDERS", "interval": "MINUTE", "intervalNum": 1, "limit": 1200, "count": 1 }, { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 2400, "count": 1 } ]} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api) +- [Method](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api) +- [Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_websocket-api_Cancel-Algo-Order.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_websocket-api_Cancel-Algo-Order.md new file mode 100644 index 0000000..86b3aa8 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_websocket-api_Cancel-Algo-Order.md @@ -0,0 +1,73 @@ +--- +title: "Cancel Algo Order | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Cancel-Algo-Order" +fetched_at: "2026-01-27T05:28:32.068Z" +--- +# Cancel Algo Order (TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Cancel-Algo-Order) + +Cancel an active algo order. + +## Method[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Cancel-Algo-Order) + +`algoOrder.cancel` + +## Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Cancel-Algo-Order) + +``` +{ "id": "5633b6a2-90a9-4192-83e7-925c90b6a2fd", "method": "algoOrder.cancel", "params": { "apiKey": "HsOehcfih8ZRxnhjp2XjGXhsOBd6msAhKz9joQaWwZ7arcJTlD2hGOGQj1lGdTjR", "algoId": 283194212, "clientAlgoId": "DolwRKnQNjoc1E9Bbh03ER", "timestamp": 1703439070722, "signature": "b09c49815b4e3f1f6098cd9fbe26a933a9af79803deaaaae03c29f719c08a8a8" }} +``` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Cancel-Algo-Order) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Cancel-Algo-Order) + +Name + +Type + +Mandatory + +Description + +algoId + +LONG + +NO + +clientAlgoId + +STRING + +NO + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +> - Either `algoId` or `clientAlgoId` must be sent. + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Cancel-Algo-Order) + +``` +{ "id": "unique-cancel-request-id-5678", "status": 200, "result": { "algoId": 2000000002162519, "clientAlgoId": "rDMG8WSde6LkyMNtk6s825", "code": "200", "msg": "success" }, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 2400, "count": 6 } ]} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Cancel-Algo-Order) +- [Method](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Cancel-Algo-Order) +- [Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Cancel-Algo-Order) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Cancel-Algo-Order) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Cancel-Algo-Order) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Cancel-Algo-Order) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_websocket-api_Cancel-Order.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_websocket-api_Cancel-Order.md new file mode 100644 index 0000000..addeb0f --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_websocket-api_Cancel-Order.md @@ -0,0 +1,79 @@ +--- +title: "Cancel Order | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Cancel-Order" +fetched_at: "2026-01-27T05:28:32.079Z" +--- +# Cancel Order (TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Cancel-Order) + +Cancel an active order. + +## Method[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Cancel-Order) + +`order.cancel` + +## Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Cancel-Order) + +``` +{ "id": "5633b6a2-90a9-4192-83e7-925c90b6a2fd", "method": "order.cancel", "params": { "apiKey": "HsOehcfih8ZRxnhjp2XjGXhsOBd6msAhKz9joQaWwZ7arcJTlD2hGOGQj1lGdTjR", "orderId": 283194212, "symbol": "BTCUSDT", "timestamp": 1703439070722, "signature": "b09c49815b4e3f1f6098cd9fbe26a933a9af79803deaaaae03c29f719c08a8a8" }} +``` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Cancel-Order) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Cancel-Order) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +orderId + +LONG + +NO + +origClientOrderId + +STRING + +NO + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +> - Either `orderId` or `origClientOrderId` must be sent. + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Cancel-Order) + +``` +{ "id": "5633b6a2-90a9-4192-83e7-925c90b6a2fd", "status": 200, "result": { "clientOrderId": "myOrder1", "cumQty": "0", "cumQuote": "0", "executedQty": "0", "orderId": 283194212, "origQty": "11", "origType": "TRAILING_STOP_MARKET", "price": "0", "reduceOnly": false, "side": "BUY", "positionSide": "SHORT", "status": "CANCELED", "stopPrice": "9300", "closePosition": false, "symbol": "BTCUSDT", "timeInForce": "GTC", "type": "TRAILING_STOP_MARKET", "activatePrice": "9020", "priceRate": "0.3", "updateTime": 1571110484038, "workingType": "CONTRACT_PRICE", "priceProtect": false, "priceMatch": "NONE", "selfTradePreventionMode": "NONE", "goodTillDate": 0 }, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 2400, "count": 1 } ]} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Cancel-Order) +- [Method](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Cancel-Order) +- [Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Cancel-Order) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Cancel-Order) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Cancel-Order) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Cancel-Order) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_websocket-api_Modify-Order.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_websocket-api_Modify-Order.md new file mode 100644 index 0000000..d4f7487 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_websocket-api_Modify-Order.md @@ -0,0 +1,115 @@ +--- +title: "Modify Order | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Modify-Order" +fetched_at: "2026-01-27T05:28:32.436Z" +--- +# Modify Order (TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Modify-Order) + +Order modify function, currently only LIMIT order modification is supported, modified orders will be reordered in the match queue + +## Method[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Modify-Order) + +`order.modify` + +## Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Modify-Order) + +``` +{ "id": "c8c271ba-de70-479e-870c-e64951c753d9", "method": "order.modify", "params": { "apiKey": "HMOchcfiT9ZRZnhjp2XjGXhsOBd6msAhKz9joQaWwZ7arcJTlD2hGPHQj1lGdTjR", "orderId": 328971409, "origType": "LIMIT", "positionSide": "SHORT", "price": "43769.1", "priceMatch": "NONE", "quantity": "0.11", "side": "SELL", "symbol": "BTCUSDT", "timestamp": 1703426755754, "signature": "d30c9f0736a307f5a9988d4a40b688662d18324b17367d51421da5484e835923" }} +``` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Modify-Order) + +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) + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Modify-Order) + +Name + +Type + +Mandatory + +Description + +orderId + +LONG + +NO + +origClientOrderId + +STRING + +NO + +symbol + +STRING + +YES + +side + +ENUM + +YES + +`SELL`, `BUY` + +quantity + +DECIMAL + +YES + +Order quantity, cannot be sent with `closePosition=true` + +price + +DECIMAL + +YES + +priceMatch + +ENUM + +NO + +only avaliable for `LIMIT`/`STOP`/`TAKE_PROFIT` order; can be set to `OPPONENT`/ `OPPONENT_5`/ `OPPONENT_10`/ `OPPONENT_20`: /`QUEUE`/ `QUEUE_5`/ `QUEUE_10`/ `QUEUE_20`; Can't be passed together with `price` + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +> - 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 + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Modify-Order) + +``` +{ "id": "c8c271ba-de70-479e-870c-e64951c753d9", "status": 200, "result": { "orderId": 328971409, "symbol": "BTCUSDT", "status": "NEW", "clientOrderId": "xGHfltUMExx0TbQstQQfRX", "price": "43769.10", "avgPrice": "0.00", "origQty": "0.110", "executedQty": "0.000", "cumQty": "0.000", "cumQuote": "0.00000", "timeInForce": "GTC", "type": "LIMIT", "reduceOnly": false, "closePosition": false, "side": "SELL", "positionSide": "SHORT", "stopPrice": "0.00", "workingType": "CONTRACT_PRICE", "priceProtect": false, "origType": "LIMIT", "priceMatch": "NONE", "selfTradePreventionMode": "NONE", "goodTillDate": 0, "updateTime": 1703426756190 }, "rateLimits": [ { "rateLimitType": "ORDERS", "interval": "SECOND", "intervalNum": 10, "limit": 300, "count": 1 }, { "rateLimitType": "ORDERS", "interval": "MINUTE", "intervalNum": 1, "limit": 1200, "count": 1 }, { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 2400, "count": 1 } ]} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Modify-Order) +- [Method](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Modify-Order) +- [Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Modify-Order) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Modify-Order) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Modify-Order) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Modify-Order) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_websocket-api_New-Algo-Order.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_websocket-api_New-Algo-Order.md new file mode 100644 index 0000000..ab63b8a --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_websocket-api_New-Algo-Order.md @@ -0,0 +1,241 @@ +--- +title: "New Algo Order | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/New-Algo-Order" +fetched_at: "2026-01-27T05:28:32.273Z" +--- +# New Algo Order(TRADE) + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/New-Algo-Order) + +Send in a new algo order. + +## Method[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/New-Algo-Order) + +`algoOrder.place` + +## Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/New-Algo-Order) + +``` +{ "id": "7731f6b5-8d5e-419c-a424-016b0a5fe8d7", "method": "algoOrder.place", "params": { "algoType": "CONDITIONAL", "apiKey": "autoApiKey7mM4kPWaRuTUypdTEZKG8U8tDjO64xdBJBrmE1nXU2XSwdxGPyXcYx", "newOrderRespType": "RESULT", "positionSide": "SHORT", "price": "160000", "quantity": "1", "recvWindow": "99999999", "side": "SELL", "symbol": "BTCUSDT", "timeInForce": "GTC", "timestamp": 1762506268690, "triggerprice": 120000, "type": "TAKE_PROFIT", "signature": "ec6e529c69fd8193b19484907bc713114eae06259fcab9728dafd5910f9cac5a" }} +``` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/New-Algo-Order) + +**0** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/New-Algo-Order) + +Name + +Type + +Mandatory + +Description + +algoType + +ENUM + +YES + +Only support `CONDITIONAL` + +symbol + +STRING + +YES + +side + +ENUM + +YES + +positionSide + +ENUM + +NO + +Default `BOTH` for One-way Mode ; `LONG` or `SHORT` for Hedge Mode. It must be sent in Hedge Mode. + +type + +ENUM + +YES + +For `CONDITIONAL` algoType, `STOP_MARKET`/`TAKE_PROFIT_MARKET`/`STOP`/`TAKE_PROFIT`/`TRAILING_STOP_MARKET` as order type + +timeInForce + +ENUM + +NO + +`IOC` or `GTC` or `FOK`, default `GTC` + +quantity + +DECIMAL + +NO + +Cannot be sent with `closePosition`\=`true`(Close-All) + +price + +DECIMAL + +NO + +triggerPrice + +DECIMAL + +NO + +workingType + +ENUM + +NO + +triggerPrice triggered by: `MARK_PRICE`, `CONTRACT_PRICE`. Default `CONTRACT_PRICE` + +priceMatch + +ENUM + +NO + +only avaliable for `LIMIT`/`STOP`/`TAKE_PROFIT` order; can be set to `OPPONENT`/ `OPPONENT_5`/ `OPPONENT_10`/ `OPPONENT_20`: /`QUEUE`/ `QUEUE_5`/ `QUEUE_10`/ `QUEUE_20`; Can't be passed together with `price` + +closePosition + +STRING + +NO + +true, false;Close-All,used with `STOP_MARKET` or `TAKE_PROFIT_MARKET`. + +priceProtect + +STRING + +NO + +"TRUE" or "FALSE", default "FALSE". Used with `STOP_MARKET` or `TAKE_PROFIT_MARKET` order. when price reaches the triggerPrice ,the difference rate between "MARK\_PRICE" and "CONTRACT\_PRICE" cannot be larger than the Price Protection Threshold of the symbol. + +reduceOnly + +STRING + +NO + +"true" or "false". default "false". Cannot be sent in Hedge Mode; cannot be sent with `closePosition`\=`true` + +activatePrice + +DECIMAL + +NO + +Used with `TRAILING_STOP_MARKET` orders, default as the latest price(supporting different `workingType`) + +callbackRate + +DECIMAL + +NO + +Used with `TRAILING_STOP_MARKET` orders, min 0.1, max 10 where 1 for 1% + +clientAlgoId + +STRING + +NO + +A unique id among open orders. Automatically generated if not sent. Can only be string following the rule: `^[\.A-Z\:/a-z0-9_-]{1,36}$` + +newOrderRespType + +ENUM + +NO + +"ACK", "RESULT", default "ACK" + +selfTradePreventionMode + +ENUM + +NO + +`EXPIRE_TAKER`:expire taker order when STP triggers/ `EXPIRE_MAKER`:expire taker order when STP triggers/ `EXPIRE_BOTH`:expire both orders when STP triggers; default `NONE` + +goodTillDate + +LONG + +NO + +order cancel time for timeInForce `GTD`, mandatory when `timeInforce` set to `GTD`; order the timestamp only retains second-level precision, ms part will be ignored; The goodTillDate timestamp must be greater than the current time plus 600 seconds and smaller than 253402300799000 + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +> - Condition orders will be triggered when: +> +> - If parameter`priceProtect`is 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`. +> + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/New-Algo-Order) + +``` +{ "id": "06c9dbd8-ccbf-4ecf-a29c-fe31495ac73f", "status": 200, "result": { "algoId": 3000000000003505, "clientAlgoId": "0Xkl1p621E4EryvufmYre1", "algoType": "CONDITIONAL", "orderType": "TAKE_PROFIT", "symbol": "BTCUSDT", "side": "SELL", "positionSide": "SHORT", "timeInForce": "GTC", "quantity": "1.000", "algoStatus": "NEW", "triggerPrice": "120000.00", "price": "160000.00", "icebergQuantity": null, "selfTradePreventionMode": "EXPIRE_MAKER", "workingType": "CONTRACT_PRICE", "priceMatch": "NONE", "closePosition": false, "priceProtect": false, "reduceOnly": false, "createTime": 1762507264142, "updateTime": 1762507264143, "triggerTime": 0, "goodTillDate": 0 }, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 2400, "count": 1 } ]} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/New-Algo-Order) +- [Method](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/New-Algo-Order) +- [Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/New-Algo-Order) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/New-Algo-Order) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/New-Algo-Order) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/New-Algo-Order) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_websocket-api_Position-Info-V2.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_websocket-api_Position-Info-V2.md new file mode 100644 index 0000000..788c1ed --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_websocket-api_Position-Info-V2.md @@ -0,0 +1,77 @@ +--- +title: "Position Information V2 | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Position-Info-V2" +fetched_at: "2026-01-27T05:28:32.326Z" +--- +# Position Information V2 (USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Position-Info-V2) + +Get current position information(only symbol that has position or open orders will be returned). + +## Method[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Position-Info-V2) + +`v2/account.position` + +## Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Position-Info-V2) + +``` +{ "id": "605a6d20-6588-4cb9-afa0-b0ab087507ba", "method": "v2/account.position", "params": { "apiKey": "xTaDyrmvA9XT2oBHHjy39zyPzKCvMdtH3b9q4xadkAg2dNSJXQGCxzui26L823W2", "symbol": "BTCUSDT", "timestamp": 1702920680303, "signature": "31ab02a51a3989b66c29d40fcdf78216978a60afc6d8dc1c753ae49fa3164a2a" }} +``` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Position-Info-V2) + +**5** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Position-Info-V2) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +NO + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +**Note** + +> - Please use with user data stream `ACCOUNT_UPDATE` to meet your timeliness and accuracy needs. + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Position-Info-V2) + +> For One-way position mode: + +``` +{ "id": "605a6d20-6588-4cb9-afa0-b0ab087507ba", "status": 200, "result": [ { "symbol": "BTCUSDT", "positionSide": "BOTH", // Position Side "positionAmt": "1.000", "entryPrice": "0.00000", "breakEvenPrice": "0.0", "markPrice": "6679.50671178", "unRealizedProfit": "0.00000000", // Unrealized Profit "liquidationPrice": "0", "isolatedMargin": "0.00000000", "notional": "0", "marginAsset": "USDT", "isolatedWallet": "0", "initialMargin": "0", // Initial Margin "maintMargin": "0", // Maintainance Margin "positionInitialMargin": "0", // Position Initial Margin "openOrderInitialMargin": "0", // Open Order Initial Margin "adl": 0, "bidNotional": "0", "askNotional": "0", "updateTime": 0 // Update Time }], "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 2400, "count": 20 } ]} +``` + +> For Hedge position mode: + +``` +{ "id": "605a6d20-6588-4cb9-afa0-b0ab087507ba", "status": 200, "result": [ { "symbol": "BTCUSDT", "positionSide": "LONG", "positionAmt": "1.000", "entryPrice": "0.00000", "breakEvenPrice": "0.0", "markPrice": "6679.50671178", "unRealizedProfit": "0.00000000", "liquidationPrice": "0", "isolatedMargin": "0.00000000", "notional": "0", "marginAsset": "USDT", "isolatedWallet": "0", "initialMargin": "0", "maintMargin": "0", "positionInitialMargin": "0", "openOrderInitialMargin": "0", "adl": 0, "bidNotional": "0", "askNotional": "0", "updateTime": 0 }, { "symbol": "BTCUSDT", "positionSide": "SHORT", "positionAmt": "1.000", "entryPrice": "0.00000", "breakEvenPrice": "0.0", "markPrice": "6679.50671178", "unRealizedProfit": "0.00000000", "liquidationPrice": "0", "isolatedMargin": "0.00000000", "notional": "0", "marginAsset": "USDT", "isolatedWallet": "0", "initialMargin": "0", "maintMargin": "0", "positionInitialMargin": "0", "openOrderInitialMargin": "0", "adl": 0, "bidNotional": "0", "askNotional": "0", "updateTime": 0 } ], "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 2400, "count": 20 } ]} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Position-Info-V2) +- [Method](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Position-Info-V2) +- [Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Position-Info-V2) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Position-Info-V2) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Position-Info-V2) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Position-Info-V2) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_websocket-api_Position-Information.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_websocket-api_Position-Information.md new file mode 100644 index 0000000..80fc66c --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_websocket-api_Position-Information.md @@ -0,0 +1,77 @@ +--- +title: "Position Information | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Position-Information" +fetched_at: "2026-01-27T05:28:32.344Z" +--- +# Position Information (USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Position-Information) + +Get current position information. + +## Method[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Position-Information) + +`account.position` + +## Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Position-Information) + +``` +{ "id": "605a6d20-6588-4cb9-afa0-b0ab087507ba", "method": "account.position", "params": { "apiKey": "xTaDyrmvA9XT2oBHHjy39zyPzKCvMdtH3b9q4xadkAg2dNSJXQGCxzui26L823W2", "symbol": "BTCUSDT", "timestamp": 1702920680303, "signature": "31ab02a51a3989b66c29d40fcdf78216978a60afc6d8dc1c753ae49fa3164a2a" }} +``` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Position-Information) + +**5** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Position-Information) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +NO + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +**Note** + +> - Please use with user data stream `ACCOUNT_UPDATE` to meet your timeliness and accuracy needs. + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Position-Information) + +> For One-way position mode: + +``` +{ "id": "605a6d20-6588-4cb9-afa0-b0ab087507ba", "status": 200, "result": [ { "entryPrice": "0.00000", "breakEvenPrice": "0.0", "marginType": "isolated", "isAutoAddMargin": "false", "isolatedMargin": "0.00000000", "leverage": "10", "liquidationPrice": "0", "markPrice": "6679.50671178", "maxNotionalValue": "20000000", "positionAmt": "0.000", "notional": "0", "isolatedWallet": "0", "symbol": "BTCUSDT", "unRealizedProfit": "0.00000000", "positionSide": "BOTH", "updateTime": 0 }], "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 2400, "count": 20 } ]} +``` + +> For Hedge position mode: + +``` +{ "id": "605a6d20-6588-4cb9-afa0-b0ab087507ba", "status": 200, "result": [ { "symbol": "BTCUSDT", "positionAmt": "0.001", "entryPrice": "22185.2", "breakEvenPrice": "0.0", "markPrice": "21123.05052574", "unRealizedProfit": "-1.06214947", "liquidationPrice": "19731.45529116", "leverage": "4", "maxNotionalValue": "100000000", "marginType": "cross", "isolatedMargin": "0.00000000", "isAutoAddMargin": "false", "positionSide": "LONG", "notional": "21.12305052", "isolatedWallet": "0", "updateTime": 1655217461579 }, { "symbol": "BTCUSDT", "positionAmt": "0.000", "entryPrice": "0.0", "breakEvenPrice": "0.0", "markPrice": "21123.05052574", "unRealizedProfit": "0.00000000", "liquidationPrice": "0", "leverage": "4", "maxNotionalValue": "100000000", "marginType": "cross", "isolatedMargin": "0.00000000", "isAutoAddMargin": "false", "positionSide": "SHORT", "notional": "0", "isolatedWallet": "0", "updateTime": 0 }], "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 2400, "count": 20 } ]} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Position-Information) +- [Method](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Position-Information) +- [Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Position-Information) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Position-Information) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Position-Information) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Position-Information) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_websocket-api_Query-Order.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_websocket-api_Query-Order.md new file mode 100644 index 0000000..ccfaf16 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_trade_websocket-api_Query-Order.md @@ -0,0 +1,86 @@ +--- +title: "Query Order | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Query-Order" +fetched_at: "2026-01-27T05:28:32.656Z" +--- +# Query Order (USER\_DATA) + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Query-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 + +## Method[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Query-Order) + +`order.status` + +## Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Query-Order) + +``` +{ "id": "0ce5d070-a5e5-4ff2-b57f-1556741a4204", "method": "order.status", "params": { "apiKey": "HMOchcfii9ZRZnhjp2XjGXhsOBd6msAhKz9joQaWwZ7arcJTlD2hGPHQj1lGdTjR", "orderId": 328999071, "symbol": "BTCUSDT", "timestamp": 1703441060152, "signature": "ba48184fc38a71d03d2b5435bd67c1206e3191e989fe99bda1bc643a880dfdbf" }} +``` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Query-Order) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Query-Order) + +Name + +Type + +Mandatory + +Description + +symbol + +STRING + +YES + +orderId + +LONG + +NO + +origClientOrderId + +STRING + +NO + +recvWindow + +LONG + +NO + +timestamp + +LONG + +YES + +Notes: + +> - Either `orderId` or `origClientOrderId` must be sent. +> - `orderId` is self-increment for each specific `symbol` + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Query-Order) + +``` +{ "id": "605a6d20-6588-4cb9-afa0-b0ab087507ba", "status": 200, "result": { "avgPrice": "0.00000", "clientOrderId": "abc", "cumQuote": "0", "executedQty": "0", "orderId": 1917641, "origQty": "0.40", "origType": "TRAILING_STOP_MARKET", "price": "0", "reduceOnly": false, "side": "BUY", "positionSide": "SHORT", "status": "NEW", "stopPrice": "9300", // please ignore when order type is TRAILING_STOP_MARKET "closePosition": false, // if Close-All "symbol": "BTCUSDT", "time": 1579276756075, // order time "timeInForce": "GTC", "type": "TRAILING_STOP_MARKET", "activatePrice": "9020", // activation price, only return with TRAILING_STOP_MARKET order "priceRate": "0.3", // callback rate, only return with TRAILING_STOP_MARKET order "updateTime": 1579276756075, // update time "workingType": "CONTRACT_PRICE", "priceProtect": false // if conditional order trigger is protected }} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Query-Order) +- [Method](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Query-Order) +- [Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Query-Order) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Query-Order) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Query-Order) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Query-Order) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_user-data-streams.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_user-data-streams.md new file mode 100644 index 0000000..10d251b --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_user-data-streams.md @@ -0,0 +1,25 @@ +--- +title: "Connect | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams" +fetched_at: "2026-01-27T05:28:32.620Z" +--- +# User Data Streams Connect + +- The base API endpoint is: **[https://fapi.binance.com](https://fapi.binance.com/)** + +- A User Data Stream `listenKey` is valid for 60 minutes after creation. + +- Doing a `PUT` on a `listenKey` will extend its validity for 60 minutes, if response `-1125` error "This listenKey does not exist." Please use `POST /fapi/v1/listenKey` to recreate `listenKey`. + +- Doing a `DELETE` on a `listenKey` will close the stream and invalidate the `listenKey`. + +- Doing a `POST` on an account with an active `listenKey` will return the currently active `listenKey` and extend its validity for 60 minutes. + +- The connection method for Websocket: + + - Base Url: **wss://fstream.binance.com** + - User Data Streams are accessed at **/ws/** + - Example: `wss://fstream.binance.com/ws/XaEAKTsQSRLZAGH9tuIu37plSRsdjmlAVBoNYPUITlTAko1WI22PgmBMpI1rS8Yh` +- For one connection(one user data), the user data stream payloads can guaranteed to be in order during heavy periods; **Strongly recommend you order your updates using E** + +- A single connection is only valid for 24 hours; expect to be disconnected at the 24 hour mark diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_user-data-streams_Close-User-Data-Stream-Wsp.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_user-data-streams_Close-User-Data-Stream-Wsp.md new file mode 100644 index 0000000..e2deebf --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_user-data-streams_Close-User-Data-Stream-Wsp.md @@ -0,0 +1,41 @@ +--- +title: "Close User Data Stream(Websocket API) | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Close-User-Data-Stream-Wsp" +fetched_at: "2026-01-27T05:28:32.884Z" +--- +# Close User Data Stream (USER\_STREAM) + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Close-User-Data-Stream-Wsp) + +Close out a user data stream. + +## Method[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Close-User-Data-Stream-Wsp) + +`userDataStream.stop` + +## Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Close-User-Data-Stream-Wsp) + +``` +{ "id": "819e1b1b-8c06-485b-a13e-131326c69599", "method": "userDataStream.stop", "params": { "apiKey": "vmPUZE6mv9SD5VNHk9HlWFsOr9aLE2zvsw0MuIgwCIPy8atIco14y7Ju91duEh8A" }} +``` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Close-User-Data-Stream-Wsp) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Close-User-Data-Stream-Wsp) + +None + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Close-User-Data-Stream-Wsp) + +``` +{ "id": "819e1b1b-8c06-485b-a13e-131326c69599", "status": 200, "result": {}, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 2400, "count": 2 } ]} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Close-User-Data-Stream-Wsp) +- [Method](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Close-User-Data-Stream-Wsp) +- [Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Close-User-Data-Stream-Wsp) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Close-User-Data-Stream-Wsp) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Close-User-Data-Stream-Wsp) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Close-User-Data-Stream-Wsp) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_user-data-streams_Close-User-Data-Stream.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_user-data-streams_Close-User-Data-Stream.md new file mode 100644 index 0000000..7c37e66 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_user-data-streams_Close-User-Data-Stream.md @@ -0,0 +1,34 @@ +--- +title: "Close User Data Stream | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Close-User-Data-Stream" +fetched_at: "2026-01-27T05:28:32.621Z" +--- +# Close User Data Stream (USER\_STREAM) + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Close-User-Data-Stream) + +Close out a user data stream. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Close-User-Data-Stream) + +DELETE `/fapi/v1/listenKey` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Close-User-Data-Stream) + +1 + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Close-User-Data-Stream) + +None + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Close-User-Data-Stream) + +``` +{} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Close-User-Data-Stream) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Close-User-Data-Stream) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Close-User-Data-Stream) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Close-User-Data-Stream) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Close-User-Data-Stream) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_user-data-streams_Event-Account-Configuration-Update-previous-Leverage-Update.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_user-data-streams_Event-Account-Configuration-Update-previous-Leverage-Update.md new file mode 100644 index 0000000..08ab053 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_user-data-streams_Event-Account-Configuration-Update-previous-Leverage-Update.md @@ -0,0 +1,32 @@ +--- +title: "Event Account Configuration Update Previous Leverage Update | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Event-Account-Configuration-Update-previous-Leverage-Update" +fetched_at: "2026-01-27T05:28:32.874Z" +--- +# Event: Account Configuration Update previous Leverage Update + +## Event Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Event-Account-Configuration-Update-previous-Leverage-Update) + +When the account configuration is changed, the event type will be pushed as `ACCOUNT_CONFIG_UPDATE` When the leverage of a trade pair changes, the payload will contain the object `ac` to represent the account configuration of the trade pair, where `s` represents the specific trade pair and `l` represents the leverage When the user Multi-Assets margin mode changes the payload will contain the object `ai` representing the user account configuration, where `j` represents the user Multi-Assets margin mode + +## Event Name[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Event-Account-Configuration-Update-previous-Leverage-Update) + +`ACCOUNT_CONFIG_UPDATE` + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Event-Account-Configuration-Update-previous-Leverage-Update) + +> **Payload:** + +``` +{ "e":"ACCOUNT_CONFIG_UPDATE", // Event Type "E":1611646737479, // Event Time "T":1611646737476, // Transaction Time "ac":{ "s":"BTCUSDT", // symbol "l":25 // leverage }} +``` + +> **Or** + +``` +{ "e":"ACCOUNT_CONFIG_UPDATE", // Event Type "E":1611646737479, // Event Time "T":1611646737476, // Transaction Time "ai":{ // User's Account Configuration "j":true // Multi-Assets Mode }} +``` + +- [Event Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Event-Account-Configuration-Update-previous-Leverage-Update) +- [Event Name](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Event-Account-Configuration-Update-previous-Leverage-Update) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Event-Account-Configuration-Update-previous-Leverage-Update) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_user-data-streams_Event-Algo-Order-Update.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_user-data-streams_Event-Algo-Order-Update.md new file mode 100644 index 0000000..0ab1205 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_user-data-streams_Event-Algo-Order-Update.md @@ -0,0 +1,34 @@ +--- +title: "Event Algo Order Update | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Event-Algo-Order-Update" +fetched_at: "2026-01-27T05:28:33.016Z" +--- +# Event: Algo Order Update + +## Event Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Event-Algo-Order-Update) + +When new algo order created, order status changed will push such event. event type is `ALGO_UPDATE`. + +**Algo Status** + +- `NEW`: This status indicates that the conditional order was successfully placed into the Algo Service but has not yet been triggered. +- `CANCELED`: This status signifies that the conditional order has been canceled. +- `TRIGGERING`: This status suggests that the order has met the triggering condition and has been forwarded to the matching engine. +- `TRIGGERED`: This status means that the order has been successfully placed into the matching engine. +- `FINISHED`: This status shows that the triggered conditional order has been filled or canceled in the matching engine. +- `REJECTED`: This status signifies that the conditional order has been denied by the matching engine, such as in scenarios of margin check failures. +- `EXPIRED`: This status denotes that the conditional order has been canceled by the system. An example would be when a user places a GTE\_GTC Time-In-Force conditional order but then closes all positions on that symbol, resulting in system-led cancellation of the conditional order. + +## Event Name[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Event-Algo-Order-Update) + +`ALGO_UPDATE` + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Event-Algo-Order-Update) + +``` +{ "e":"ALGO_UPDATE", // Event Type "T":1750515742297, // Transaction Time "E":1750515742303, // Event Time "o":{ "caid":"Q5xaq5EGKgXXa0fD7fs0Ip", // Client Algo Id "aid":2148719, // Algo Id "at":"CONDITIONAL", // Algo Type "o":"TAKE_PROFIT", //Order Type "s":"BNBUSDT", //Symbol "S":"SELL", //Side "ps":"BOTH", //Position Side "f":"GTC", //Time in force "q":"0.01", //quantity "X":"CANCELED", //Algo status "ai":"", // order id "ap": "0.00000", // avg fill price in matching engine, only display when order is triggered and placed in matching engine "aq": "0.00000", // execuated quantity in matching engine, only display when order is triggered and placed in matching engine "act": "0", // actual order type in matching engine, only display when order is triggered and placed in matching engine "tp":"750", //Trigger price "p":"750", //Order Price "V":"EXPIRE_MAKER", //STP mode "wt":"CONTRACT_PRICE", //Working type "pm":"NONE", // Price match mode "cp":false, //If Close-All "pP":false, //If price protection is turned on "R":false, // Is this reduce only "tt":0, //Trigger time "gtd":0, // good till time for GTD time in force "rm": "Reduce Only reject" // algo order failed reason }} +``` + +- [Event Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Event-Algo-Order-Update) +- [Event Name](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Event-Algo-Order-Update) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Event-Algo-Order-Update) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_user-data-streams_Event-Balance-and-Position-Update.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_user-data-streams_Event-Balance-and-Position-Update.md new file mode 100644 index 0000000..e057eab --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_user-data-streams_Event-Balance-and-Position-Update.md @@ -0,0 +1,55 @@ +--- +title: "Event Balance And Position Update | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Event-Balance-and-Position-Update" +fetched_at: "2026-01-27T05:28:32.911Z" +--- +# Event: Balance and Position Update + +## Event Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Event-Balance-and-Position-Update) + +Event type is `ACCOUNT_UPDATE`. + +- When balance or position get updated, this event will be pushed. + + - `ACCOUNT_UPDATE` will be pushed only when update happens on user's account, including changes on balances, positions, or margin type. + - Unfilled orders or cancelled orders will not make the event `ACCOUNT_UPDATE` pushed, since there's no change on positions. + - "position" in `ACCOUNT_UPDATE`: Only symbols of changed positions will be pushed. +- When "FUNDING FEE" changes to the user's balance, the event will be pushed with the brief message: + + - When "FUNDING FEE" occurs in a **crossed position**, `ACCOUNT_UPDATE` will be pushed with only the balance `B`(including the "FUNDING FEE" asset only), without any position `P` message. + - When "FUNDING FEE" occurs in an **isolated position**, `ACCOUNT_UPDATE` will be pushed with only the balance `B`(including the "FUNDING FEE" asset only) and the relative position message `P`( including the isolated position on which the "FUNDING FEE" occurs only, without any other position message). +- The field "m" represents the reason type for the event and may shows the following possible types: + + - DEPOSIT + - WITHDRAW + - ORDER + - FUNDING\_FEE + - WITHDRAW\_REJECT + - ADJUSTMENT + - INSURANCE\_CLEAR + - ADMIN\_DEPOSIT + - ADMIN\_WITHDRAW + - MARGIN\_TRANSFER + - MARGIN\_TYPE\_CHANGE + - ASSET\_TRANSFER + - OPTIONS\_PREMIUM\_FEE + - OPTIONS\_SETTLE\_PROFIT + - AUTO\_EXCHANGE + - COIN\_SWAP\_DEPOSIT + - COIN\_SWAP\_WITHDRAW +- The field "bc" represents the balance change except for PnL and commission. + + +## Event Name[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Event-Balance-and-Position-Update) + +`ACCOUNT_UPDATE` + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Event-Balance-and-Position-Update) + +``` +{ "e": "ACCOUNT_UPDATE", // Event Type "E": 1564745798939, // Event Time "T": 1564745798938 , // Transaction "a": // Update Data { "m":"ORDER", // Event reason type "B":[ // Balances { "a":"USDT", // Asset "wb":"122624.12345678", // Wallet Balance "cw":"100.12345678", // Cross Wallet Balance "bc":"50.12345678" // Balance Change except PnL and Commission }, { "a":"BUSD", "wb":"1.00000000", "cw":"0.00000000", "bc":"-49.12345678" } ], "P":[ { "s":"BTCUSDT", // Symbol "pa":"0", // Position Amount "ep":"0.00000", // Entry Price "bep":"0", // breakeven price "cr":"200", // (Pre-fee) Accumulated Realized "up":"0", // Unrealized PnL "mt":"isolated", // Margin Type "iw":"0.00000000", // Isolated Wallet (if isolated position) "ps":"BOTH" // Position Side }, { "s":"BTCUSDT", "pa":"20", "ep":"6563.66500", "bep":"0", // breakeven price "cr":"0", "up":"2850.21200", "mt":"isolated", "iw":"13200.70726908", "ps":"LONG" }, { "s":"BTCUSDT", "pa":"-10", "ep":"6563.86000", "bep":"6563.6", // breakeven price "cr":"-45.04000000", "up":"-1423.15600", "mt":"isolated", "iw":"6570.42511771", "ps":"SHORT" } ] }} +``` + +- [Event Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Event-Balance-and-Position-Update) +- [Event Name](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Event-Balance-and-Position-Update) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Event-Balance-and-Position-Update) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_user-data-streams_Event-Conditional-Order-Trigger-Reject.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_user-data-streams_Event-Conditional-Order-Trigger-Reject.md new file mode 100644 index 0000000..3b221e0 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_user-data-streams_Event-Conditional-Order-Trigger-Reject.md @@ -0,0 +1,24 @@ +--- +title: "Event Conditional Order Trigger Reject | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Event-Conditional-Order-Trigger-Reject" +fetched_at: "2026-01-27T05:28:33.127Z" +--- +# Event: Conditional\_Order\_Trigger\_Reject + +## Event Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Event-Conditional-Order-Trigger-Reject) + +`CONDITIONAL_ORDER_TRIGGER_REJECT` update when a triggered TP/SL order got rejected. + +## Event Name[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Event-Conditional-Order-Trigger-Reject) + +`CONDITIONAL_ORDER_TRIGGER_REJECT` + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Event-Conditional-Order-Trigger-Reject) + +``` +{ "e":"CONDITIONAL_ORDER_TRIGGER_REJECT", // Event Type "E":1685517224945, // Event Time "T":1685517224955, // me message send Time "or":{ "s":"ETHUSDT", // Symbol "i":155618472834, // orderId "r":"Due to the order could not be filled immediately, the FOK order has been rejected. The order will not be recorded in the order history", // reject reason }} +``` + +- [Event Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Event-Conditional-Order-Trigger-Reject) +- [Event Name](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Event-Conditional-Order-Trigger-Reject) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Event-Conditional-Order-Trigger-Reject) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_user-data-streams_Event-GRID-UPDATE.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_user-data-streams_Event-GRID-UPDATE.md new file mode 100644 index 0000000..1067f66 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_user-data-streams_Event-GRID-UPDATE.md @@ -0,0 +1,29 @@ +--- +title: "Event Grid Update | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Event-GRID-UPDATE" +fetched_at: "2026-01-27T05:28:33.132Z" +--- +# Event: GRID\_UPDATE + +## Event Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Event-GRID-UPDATE) + +`GRID_UPDATE` update when a sub order of a grid is filled or partially filled. **Strategy Status** + +- NEW +- WORKING +- CANCELLED +- EXPIRED + +## Event Name[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Event-GRID-UPDATE) + +`GRID_UPDATE` + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Event-GRID-UPDATE) + +``` +{ "e": "GRID_UPDATE", // Event Type "T": 1669262908216, // Transaction Time "E": 1669262908218, // Event Time "gu": { "si": 176057039, // Strategy ID "st": "GRID", // Strategy Type "ss": "WORKING", // Strategy Status "s": "BTCUSDT", // Symbol "r": "-0.00300716", // Realized PNL "up": "16720", // Unmatched Average Price "uq": "-0.001", // Unmatched Qty "uf": "-0.00300716", // Unmatched Fee "mp": "0.0", // Matched PNL "ut": 1669262908197 // Update Time }} +``` + +- [Event Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Event-GRID-UPDATE) +- [Event Name](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Event-GRID-UPDATE) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Event-GRID-UPDATE) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_user-data-streams_Event-Margin-Call.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_user-data-streams_Event-Margin-Call.md new file mode 100644 index 0000000..fd9bc5e --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_user-data-streams_Event-Margin-Call.md @@ -0,0 +1,26 @@ +--- +title: "Event Margin Call | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Event-Margin-Call" +fetched_at: "2026-01-27T05:28:33.164Z" +--- +# Event: Margin Call + +## Event Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Event-Margin-Call) + +- When the user's position risk ratio is too high, this stream will be pushed. +- This message is only used as risk guidance information and is not recommended for investment strategies. +- In the case of a highly volatile market, there may be the possibility that the user's position has been liquidated at the same time when this stream is pushed out. + +## Event Name[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Event-Margin-Call) + +`MARGIN_CALL` + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Event-Margin-Call) + +``` +{ "e":"MARGIN_CALL", // Event Type "E":1587727187525, // Event Time "cw":"3.16812045", // Cross Wallet Balance. Only pushed with crossed position margin call "p":[ // Position(s) of Margin Call { "s":"ETHUSDT", // Symbol "ps":"LONG", // Position Side "pa":"1.327", // Position Amount "mt":"CROSSED", // Margin Type "iw":"0", // Isolated Wallet (if isolated position) "mp":"187.17127", // Mark Price "up":"-1.166074", // Unrealized PnL "mm":"1.614445" // Maintenance Margin Required } ]} +``` + +- [Event Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Event-Margin-Call) +- [Event Name](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Event-Margin-Call) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Event-Margin-Call) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_user-data-streams_Event-Order-Update.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_user-data-streams_Event-Order-Update.md new file mode 100644 index 0000000..5511006 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_user-data-streams_Event-Order-Update.md @@ -0,0 +1,92 @@ +--- +title: "Event Order Update | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Event-Order-Update" +fetched_at: "2026-01-27T05:28:33.273Z" +--- +# Event: Order Update + +## Event Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Event-Order-Update) + +When new order created, order status changed will push such event. event type is `ORDER_TRADE_UPDATE`. + +**Side** + +- BUY +- SELL + +**Order Type** + +- LIMIT +- MARKET +- STOP +- STOP\_MARKET +- TAKE\_PROFIT +- TAKE\_PROFIT\_MARKET +- TRAILING\_STOP\_MARKET +- LIQUIDATION + +**Execution Type** + +- NEW +- CANCELED +- CALCULATED - Liquidation Execution +- EXPIRED +- TRADE +- AMENDMENT - Order Modified + +**Order Status** + +- NEW +- PARTIALLY\_FILLED +- FILLED +- CANCELED +- EXPIRED +- EXPIRED\_IN\_MATCH + +**Time in force** + +- GTC +- IOC +- FOK +- GTX + +**Working Type** + +- MARK\_PRICE +- CONTRACT\_PRICE + +**Liquidation and ADL:** + +- If user gets liquidated due to insufficient margin balance: + + - `c` shows as "autoclose-XXX",`X` shows as "NEW" +- If user has enough margin balance but gets ADL: + + - `c` shows as “adl\_autoclose”,`X` shows as “NEW” + +**Expiry Reason** + +- `0`: None, the default value +- `1`: Order has expired to prevent users from inadvertently trading against themselves +- `2`: IOC order could not be filled completely, remaining quantity is canceled +- `3`: IOC order could not be filled completely to prevent users from inadvertently trading against themselves, remaining quantity is canceled +- `4`: Order has been canceled, as it's knocked out by another higher priority RO (market) order or reversed positions would be opened +- `5`: Order has expired when the account was liquidated +- `6`: Order has expired as GTE condition unsatisfied +- `7`: Order has been canceled as the symbol is delisted +- `8`: The initial order has expired after the stop order is triggered +- `9`: Market order could not be filled completely, remaining quantity is canceled + +## Event Name[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Event-Order-Update) + +`ORDER_TRADE_UPDATE` + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Event-Order-Update) + +``` +{ "e":"ORDER_TRADE_UPDATE", // Event Type "E":1568879465651, // Event Time "T":1568879465650, // Transaction Time "o":{ "s":"BTCUSDT", // Symbol "c":"TEST", // Client Order Id // special client order id: // starts with "autoclose-": liquidation order // "adl_autoclose": ADL auto close order // "settlement_autoclose-": settlement order for delisting or delivery "S":"SELL", // Side "o":"TRAILING_STOP_MARKET", // Order Type "f":"GTC", // Time in Force "q":"0.001", // Original Quantity "p":"0", // Original Price "ap":"0", // Average Price "sp":"7103.04", // Stop Price. Please ignore with TRAILING_STOP_MARKET order "x":"NEW", // Execution Type "X":"NEW", // Order Status "i":8886774, // Order Id "l":"0", // Order Last Filled Quantity "z":"0", // Order Filled Accumulated Quantity "L":"0", // Last Filled Price "N":"USDT", // Commission Asset "n":"0", // Commission "T":1568879465650, // Order Trade Time "t":0, // Trade Id "b":"0", // Bids Notional "a":"9.91", // Ask Notional "m":false, // Is this trade the maker side? "R":false, // Is this reduce only "wt":"CONTRACT_PRICE", // Stop Price Working Type "ot":"TRAILING_STOP_MARKET", // Original Order Type "ps":"LONG", // Position Side "cp":false, // If Close-All, pushed with conditional order "AP":"7476.89", // Activation Price, only puhed with TRAILING_STOP_MARKET order "cr":"5.0", // Callback Rate, only puhed with TRAILING_STOP_MARKET order "pP": false, // If price protection is turned on "si": 0, // ignore "ss": 0, // ignore "rp":"0", // Realized Profit of the trade "V":"EXPIRE_TAKER", // STP mode "pm":"OPPONENT", // Price match mode "gtd":0, // TIF GTD order auto cancel time "er":"0" // Expiry Reason }} +``` + +- [Event Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Event-Order-Update) +- [Event Name](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Event-Order-Update) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Event-Order-Update) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_user-data-streams_Event-STRATEGY-UPDATE.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_user-data-streams_Event-STRATEGY-UPDATE.md new file mode 100644 index 0000000..209ea77 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_user-data-streams_Event-STRATEGY-UPDATE.md @@ -0,0 +1,49 @@ +--- +title: "Event Strategy Update | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Event-STRATEGY-UPDATE" +fetched_at: "2026-01-27T05:28:33.447Z" +--- +# Event: STRATEGY\_UPDATE + +## Event Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Event-STRATEGY-UPDATE) + +`STRATEGY_UPDATE` update when a strategy is created/cancelled/expired, ...etc. + +**Strategy Status** + +- NEW +- WORKING +- CANCELLED +- EXPIRED + +**opCode** + +- 8001: The strategy params have been updated +- 8002: User cancelled the strategy +- 8003: User manually placed or cancelled an order +- 8004: The stop limit of this order reached +- 8005: User position liquidated +- 8006: Max open order limit reached +- 8007: New grid order +- 8008: Margin not enough +- 8009: Price out of bounds +- 8010: Market is closed or paused +- 8011: Close position failed, unable to fill +- 8012: Exceeded the maximum allowable notional value at current leverage +- 8013: Grid expired due to incomplete KYC verification or access from a restricted jurisdiction +- 8014: Violated Futures Trading Quantitative Rules. Strategy stopped +- 8015: User position empty or liquidated + +## Event Name[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Event-STRATEGY-UPDATE) + +`STRATEGY_UPDATE` + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Event-STRATEGY-UPDATE) + +``` +{ "e": "STRATEGY_UPDATE", // Event Type "T": 1669261797627, // Transaction Time "E": 1669261797628, // Event Time "su": { "si": 176054594, // Strategy ID "st": "GRID", // Strategy Type "ss": "NEW", // Strategy Status "s": "BTCUSDT", // Symbol "ut": 1669261797627, // Update Time "c": 8007 // opCode }} +``` + +- [Event Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Event-STRATEGY-UPDATE) +- [Event Name](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Event-STRATEGY-UPDATE) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Event-STRATEGY-UPDATE) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_user-data-streams_Event-Trade-Lite.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_user-data-streams_Event-Trade-Lite.md new file mode 100644 index 0000000..ef054ba --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_user-data-streams_Event-Trade-Lite.md @@ -0,0 +1,24 @@ +--- +title: "Event Trade Lite | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Event-Trade-Lite" +fetched_at: "2026-01-27T05:28:33.389Z" +--- +# Event: Trade Lite Update + +## Event Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Event-Trade-Lite) + +Fast trade stream reduces data latency compared original `ORDER_TRADE_UPDATE` stream. However, it only pushes TRADE Execution Type, and fewer data fields. + +## Event Name[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Event-Trade-Lite) + +`TRADE_LITE` + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Event-Trade-Lite) + +``` +{ "e":"TRADE_LITE", // Event Type "E":1721895408092, // Event Time "T":1721895408214, // Transaction Time "s":"BTCUSDT", // Symbol "q":"0.001", // Original Quantity "p":"0", // Original Price "m":false, // Is this trade the maker side? "c":"z8hcUoOsqEdKMeKPSABslD", // Client Order Id // special client order id: // starts with "autoclose-": liquidation order // "adl_autoclose": ADL auto close order // "settlement_autoclose-": settlement order for delisting or delivery "S":"BUY", // Side "L":"64089.20", // Last Filled Price "l":"0.040", // Order Last Filled Quantity "t":109100866, // Trade Id "i":8886774, // Order Id} +``` + +- [Event Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Event-Trade-Lite) +- [Event Name](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Event-Trade-Lite) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Event-Trade-Lite) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_user-data-streams_Event-User-Data-Stream-Expired.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_user-data-streams_Event-User-Data-Stream-Expired.md new file mode 100644 index 0000000..96fdac4 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_user-data-streams_Event-User-Data-Stream-Expired.md @@ -0,0 +1,30 @@ +--- +title: "Event User Data Stream Expired | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Event-User-Data-Stream-Expired" +fetched_at: "2026-01-27T05:28:33.416Z" +--- +# Event: User Data Stream Expired + +## Event Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Event-User-Data-Stream-Expired) + +When the `listenKey` used for the user data stream turns expired, this event will be pushed. + +**Notice:** + +> - This event is not related to the websocket disconnection. +> - This event will be received only when a valid `listenKey` in connection got expired. +> - No more user data event will be updated after this event received until a new valid `listenKey` used. + +## Event Name[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Event-User-Data-Stream-Expired) + +`listenKeyExpired` + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Event-User-Data-Stream-Expired) + +``` +{ "e": "listenKeyExpired", // event type "E": "1736996475556", // event time "listenKey":"WsCMN0a4KHUPTQuX6IUnqEZfB1inxmv1qR4kbf1LuEjur5VdbzqvyxqG9TSjVVxv"} +``` + +- [Event Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Event-User-Data-Stream-Expired) +- [Event Name](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Event-User-Data-Stream-Expired) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Event-User-Data-Stream-Expired) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_user-data-streams_Keepalive-User-Data-Stream-Wsp.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_user-data-streams_Keepalive-User-Data-Stream-Wsp.md new file mode 100644 index 0000000..fa41c13 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_user-data-streams_Keepalive-User-Data-Stream-Wsp.md @@ -0,0 +1,41 @@ +--- +title: "Keepalive User Data Stream(Websocket API) | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Keepalive-User-Data-Stream-Wsp" +fetched_at: "2026-01-27T05:28:33.664Z" +--- +# Keepalive User Data Stream (USER\_STREAM) + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Keepalive-User-Data-Stream-Wsp) + +Keepalive a user data stream to prevent a time out. User data streams will close after 60 minutes. It's recommended to send a ping about every 60 minutes. + +## Method[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Keepalive-User-Data-Stream-Wsp) + +`userDataStream.ping` + +## Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Keepalive-User-Data-Stream-Wsp) + +``` +{ "id": "815d5fce-0880-4287-a567-80badf004c74", "method": "userDataStream.ping", "params": { "apiKey": "vmPUZE6mv9SD5VNHk9HlWFsOr9aLE2zvsw0MuIgwCIPy8atIco14y7Ju91duEh8A"  }} +``` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Keepalive-User-Data-Stream-Wsp) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Keepalive-User-Data-Stream-Wsp) + +None + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Keepalive-User-Data-Stream-Wsp) + +``` +{ "id": "815d5fce-0880-4287-a567-80badf004c74", "status": 200, "result": { "listenKey": "3HBntNTepshgEdjIwSUIBgB9keLyOCg5qv3n6bYAtktG8ejcaW5HXz9Vx1JgIieg" }, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 2400, "count": 2 } ]} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Keepalive-User-Data-Stream-Wsp) +- [Method](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Keepalive-User-Data-Stream-Wsp) +- [Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Keepalive-User-Data-Stream-Wsp) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Keepalive-User-Data-Stream-Wsp) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Keepalive-User-Data-Stream-Wsp) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Keepalive-User-Data-Stream-Wsp) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_user-data-streams_Keepalive-User-Data-Stream.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_user-data-streams_Keepalive-User-Data-Stream.md new file mode 100644 index 0000000..cb4a2ea --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_user-data-streams_Keepalive-User-Data-Stream.md @@ -0,0 +1,34 @@ +--- +title: "Keepalive User Data Stream | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Keepalive-User-Data-Stream" +fetched_at: "2026-01-27T05:28:33.524Z" +--- +# Keepalive User Data Stream (USER\_STREAM) + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Keepalive-User-Data-Stream) + +Keepalive a user data stream to prevent a time out. User data streams will close after 60 minutes. It's recommended to send a ping about every 60 minutes. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Keepalive-User-Data-Stream) + +PUT `/fapi/v1/listenKey` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Keepalive-User-Data-Stream) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Keepalive-User-Data-Stream) + +None + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Keepalive-User-Data-Stream) + +``` +{ "listenKey": "3HBntNTepshgEdjIwSUIBgB9keLyOCg5qv3n6bYAtktG8ejcaW5HXz9Vx1JgIieg" //the listenkey which got extended} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Keepalive-User-Data-Stream) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Keepalive-User-Data-Stream) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Keepalive-User-Data-Stream) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Keepalive-User-Data-Stream) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Keepalive-User-Data-Stream) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_user-data-streams_Start-User-Data-Stream-Wsp.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_user-data-streams_Start-User-Data-Stream-Wsp.md new file mode 100644 index 0000000..cbd24c9 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_user-data-streams_Start-User-Data-Stream-Wsp.md @@ -0,0 +1,53 @@ +--- +title: "Start User Data Stream(Websocket API) | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Start-User-Data-Stream-Wsp" +fetched_at: "2026-01-27T05:28:33.921Z" +--- +# Start User Data Stream (USER\_STREAM) + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Start-User-Data-Stream-Wsp) + +Start a new user data stream. The stream will close after 60 minutes unless a keepalive is sent. If the account has an active `listenKey`, that `listenKey` will be returned and its validity will be extended for 60 minutes. + +## Method[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Start-User-Data-Stream-Wsp) + +`userDataStream.start` + +## Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Start-User-Data-Stream-Wsp) + +``` +{ "id": "d3df8a61-98ea-4fe0-8f4e-0fcea5d418b0", "method": "userDataStream.start", "params": { "apiKey": "vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A" }} +``` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Start-User-Data-Stream-Wsp) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Start-User-Data-Stream-Wsp) + +Name + +Type + +Mandatory + +Description + +apiKey + +STRING + +YES + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Start-User-Data-Stream-Wsp) + +``` +{ "id": "d3df8a61-98ea-4fe0-8f4e-0fcea5d418b0", "status": 200, "result": { "listenKey": "xs0mRXdAKlIPDRFrlPcw0qI41Eh3ixNntmymGyhrhgqo7L6FuLaWArTD7RLP" }, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 2400, "count": 2 } ]} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Start-User-Data-Stream-Wsp) +- [Method](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Start-User-Data-Stream-Wsp) +- [Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Start-User-Data-Stream-Wsp) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Start-User-Data-Stream-Wsp) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Start-User-Data-Stream-Wsp) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Start-User-Data-Stream-Wsp) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_user-data-streams_Start-User-Data-Stream.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_user-data-streams_Start-User-Data-Stream.md new file mode 100644 index 0000000..df99eaa --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_user-data-streams_Start-User-Data-Stream.md @@ -0,0 +1,34 @@ +--- +title: "Start User Data Stream | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Start-User-Data-Stream" +fetched_at: "2026-01-27T05:28:33.666Z" +--- +# Start User Data Stream (USER\_STREAM) + +## API Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Start-User-Data-Stream) + +Start a new user data stream. The stream will close after 60 minutes unless a keepalive is sent. If the account has an active `listenKey`, that `listenKey` will be returned and its validity will be extended for 60 minutes. + +## HTTP Request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Start-User-Data-Stream) + +POST `/fapi/v1/listenKey` + +## Request Weight[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Start-User-Data-Stream) + +**1** + +## Request Parameters[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Start-User-Data-Stream) + +None + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Start-User-Data-Stream) + +``` +{ "listenKey": "pqia91ma19a5s61cv6a81va65sdf19v8a65a1a5s61cv6a81va65sdf19v8a65a1"} +``` + +- [API Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Start-User-Data-Stream) +- [HTTP Request](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Start-User-Data-Stream) +- [Request Weight](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Start-User-Data-Stream) +- [Request Parameters](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Start-User-Data-Stream) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Start-User-Data-Stream) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-api-general-info.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-api-general-info.md new file mode 100644 index 0000000..b953ca8 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-api-general-info.md @@ -0,0 +1,336 @@ +--- +title: "Websocket API General Info | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-api-general-info" +fetched_at: "2026-01-27T05:28:33.661Z" +--- +# WebSocket API General Info + +- The base endpoint is: **`wss://ws-fapi.binance.com/ws-fapi/v1`** + - The base endpoint for testnet is: `wss://testnet.binancefuture.com/ws-fapi/v1` +- A single connection to the API is only valid for 24 hours; expect to be disconnected after the 24-hour mark. +- Websocket server will send a ping frame every 3 minutes. + - If the websocket server does not receive a `pong frame` back from the connection within a 10 minute period, the connection will be disconnected. + - When you receive a ping, you must send a pong with a copy of ping's payload as soon as possible. + - Unsolicited pong frames are allowed, but will not prevent disconnection. **It is recommended that the payload for these pong frames are empty.** +- Signature payload must be generated by taking all request params except for the signature and sorting them by name in alphabetical order. +- Lists are returned in **chronological order**, unless noted otherwise. +- All timestamps are in **milliseconds in UTC**, unless noted otherwise. +- All field names and values are **case-sensitive**, unless noted otherwise. +- **`INT` parameters such as timestamp are expected as JSON integers, not strings.** +- **`DECIMAL` parameters such as price are expected as JSON strings, not floats.** +- **User Data Stream requests - you will need to establish a separate WebSocket connection to listen to [user data streams](https://binance-docs.github.io/apidocs/futures/en)** + +## WebSocket API Request format[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-api-general-info) + +Requests must be sent as JSON in **text frames**, one request per frame. + +> Example of request: + +``` +{ "id": "9ca10e58-7452-467e-9454-f669bb9c764e", "method": "order.place", "params": { "apiKey": "yeqKcXjtA9Eu4Tr3nJk61UJAGzXsEmFqqfVterxpMpR4peNfqE7Zl7oans8Qj089", "price": "42088.0", "quantity": "0.1", "recvWindow": 5000, "side": "BUY", "signature": "996962a19802b5a09d7bc6ab1524227894533322a2f8a1f8934991689cabf8fe", "symbol": "BTCUSDT", "timeInForce": "GTC", "timestamp": 1705311512994, "type": "LIMIT" }} +``` + +Request fields: + +Name + +Type + +Mandatory + + Description + +`id` + +INT/STRING/null + +YES + +Arbitrary ID used to match responses to requests + +`method` + +STRING + +YES + +Request method name + +`params` + +OBJECT + +NO + +Request parameters. May be omitted if there are no parameters + +   + +- Request `id` is truly arbitrary. You can use UUIDs, sequential IDs, current timestamp, etc. The server does not interpret `id` in any way, simply echoing it back in the response. + +You can freely reuse IDs within a session. However, be careful to not send more than one request at a time with the same ID, since otherwise it might be impossible to tell the responses apart.   + +- Request method names may be prefixed with explicit version: e.g., "`v3/order.place`". +- The order of `params` is not significant. + +## Response format[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-api-general-info) + +Responses are returned as JSON in text frames, one response per frame. + +> Example of successful response: + +``` +{ "id": "43a3843a-2321-4e45-8f79-351e5c354563", "status": 200, "result": { "orderId": 336829446, "symbol": "BTCUSDT", "status": "NEW", "clientOrderId": "FqEw6cn0vDhrkmfiwLYPeo", "price": "42088.00", "avgPrice": "0.00", "origQty": "0.100", "executedQty": "0.000", "cumQty": "0.000", "cumQuote": "0.00000", "timeInForce": "GTC", "type": "LIMIT", "reduceOnly": false, "closePosition": false, "side": "BUY", "positionSide": "BOTH", "stopPrice": "0.00", "workingType": "CONTRACT_PRICE", "priceProtect": false, "origType": "LIMIT", "priceMatch": "NONE", "selfTradePreventionMode": "NONE", "goodTillDate": 0, "updateTime": 1705385954229 }, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 2400, "count": 1 }, { "rateLimitType": "ORDERS", "interval": "SECOND", "intervalNum": 10, "limit": 300, "count": 1 }, { "rateLimitType": "ORDERS", "interval": "MINUTE", "intervalNum": 1, "limit": 1200, "count": 0 } ]} +``` + +> Example of failed response: + +``` +{ "id": "5761b939-27b1-4948-ab87-4a372a3f6b72", "status": 400, "error": { "code": -1102, "msg": "Mandatory parameter 'quantity' was not sent, was empty/null, or malformed." }, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 2400, "count": 1 }, { "rateLimitType": "ORDERS", "interval": "SECOND", "intervalNum": 10, "limit": 300, "count": 1 }, { "rateLimitType": "ORDERS", "interval": "MINUTE", "intervalNum": 1, "limit": 1200, "count": 1 } ]} +``` + +Response fields: + +Name + +Type + +Mandatory + + Description + +`id` + +INT/STRING/null + +YES + +Same as in the original request + +`status` + +INT + +YES + +Response status. See status codes + +`result` + +OBJECT/ARRAY + +YES + +Response content. Present if request succeeded + +`error` + +OBJECT + +YES + +Error description. Present if request failed + +`rateLimits` + +ARRAY + +NO + +Rate limiting status. See Rate limits + +## WebSocket API Rate limits[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-api-general-info) + +- Rate limits are the same as on REST API and are shared with REST API. +- WebSocket handshake attempt costs 5 weight. +- Rate limit for ping/pong frames: maximum 5 per second. +- Rate limit information is included in responses by default, see the `rateLimits` field. +- `rateLimits` field visibility can be controlled with `returnRateLimits` boolean parameter in connection string or individual requests. +- E.g., use `wss://ws-fapi.binance.com/ws-fapi/v1?returnRateLimits=false` to hide `rateLimits` in responses by default. With that, you can pass extra `"returnRateLimits": true` parameter in requests to show rate limit in response when it is otherwise hidden by default. + +## WebSocket API Authenticate after connection[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-api-general-info) + +You can authenticate an already established connection using session authentication requests: + +- `session.logon` - authenticate, or change the API key associated with the connection +- `session.status` - check connection status and the current API key +- `session.logout` - forget the API key associated with the connection + +## WebSocket API API key revocation[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-api-general-info) + +If during an active session the API key becomes invalid for any reason (e.g. IP address is not whitelisted, API key was deleted, API key doesn't have correct permissions, etc), after the next request the session will be revoked with the following error message: + +``` +{ "id": null, "status": 401, "error": { "code": -2015, "msg": "Invalid API-key, IP, or permissions for action." }} +``` + +## WebSocket API Authorize ad hoc requests[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-api-general-info) + +Only one API key can be authenticated with the WebSocket connection. The authenticated API key is used by default for requests that require an apiKey parameter. However, you can always specify the apiKey and signature explicitly for individual requests, overriding the authenticated API key and using a different one to authorize a specific request. + +For example, you might want to authenticate your USER\_DATA key to be used by default, but specify the TRADE key with an explicit signature when placing orders. + +## WebSocket API Authentication request[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-api-general-info) + +**Note**: + +> Only _Ed25519_ keys are supported for this feature. + +### Log in with API key (SIGNED)[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-api-general-info) + +> **Request** + +``` +{ "id": "c174a2b1-3f51-4580-b200-8528bd237cb7", "method": "session.logon", "params": { "apiKey": "vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A", "signature": "1cf54395b336b0a9727ef27d5d98987962bc47aca6e13fe978612d0adee066ed", "timestamp": 1649729878532 }} +``` + +> **Response** + +``` +{ "id": "c174a2b1-3f51-4580-b200-8528bd237cb7", "status": 200, "result": { "apiKey": "vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A", "authorizedSince": 1649729878532, "connectedSince": 1649729873021, "returnRateLimits": false, "serverTime": 1649729878630 }} +``` + +Authenticate WebSocket connection using the provided API key. + +After calling `session.logon`, you can omit `apiKey` and `signature` parameters for future requests that require them. + +Note that only one API key can be authenticated. Calling `session.logon` multiple times changes the current authenticated API key. + +**Weight:** 2 + +**Method**: "session.logon" + +**Parameters** + +Name + +Type + +Mandatory + + Description + +`apiKey` + +STRING + +YES + +`recvWindow` + +INT + +NO + +`signature` + +STRING + +YES + +`timestamp` + +INT + +YES + +### Query session status[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-api-general-info) + +> **Request** + +``` +{ "id": "b50c16cd-62c9-4e29-89e4-37f10111f5bf", "method": "session.status"} +``` + +> **Response** + +``` +{ "id": "b50c16cd-62c9-4e29-89e4-37f10111f5bf", "status": 200, "result": { // if the connection is not authenticated, "apiKey" and "authorizedSince" will be shown as null "apiKey": "vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A", "authorizedSince": 1649729878532, "connectedSince": 1649729873021, "returnRateLimits": false, "serverTime": 1649730611671 }} +``` + +Query the status of the WebSocket connection, inspecting which API key (if any) is used to authorize requests. + +**Weight:** 2 + +**Method**: "session.status" + +**Parameters**: None + +### Log out of the session[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-api-general-info) + +> **Request** + +``` +{ "id": "c174a2b1-3f51-4580-b200-8528bd237cb7", "method": "session.logout"} +``` + +> **Response** + +``` +{ "id": "c174a2b1-3f51-4580-b200-8528bd237cb7", "status": 200, "result": { "apiKey": null, "authorizedSince": null, "connectedSince": 1649729873021, "returnRateLimits": false, "serverTime": 1649730611671 }} +``` + +Forget the API key previously authenticated. If the connection is not authenticated, this request does nothing. + +Note that the WebSocket connection stays open after `session.logout` request. You can continue using the connection, but now you will have to explicitly provide the `apiKey` and `signature` parameters where needed. + +**Weight:** 2 + +**Method**: "session.logout" + +**Parameters**: None + +## SIGNED (TRADE and USER\_DATA) Endpoint Security[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-api-general-info) + +### SIGNED request example (Ed25519)[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-api-general-info) + +Parameter + +Value + +symbol + +BTCUSDT + +side + +SELL + +type + +LIMIT + +timeInForce + +GTC + +quantity + +1 + +price + +0.2 + +timestamp + +1668481559918 + +``` +#!/usr/bin/env python3import base64import timeimport jsonfrom cryptography.hazmat.primitives.serialization import load_pem_private_keyfrom websocket import create_connection# Set up authenticationAPI_KEY='put your own API Key here'PRIVATE_KEY_PATH='test-prv-key.pem'# Load the private key.# In this example the key is expected to be stored without encryption,# but we recommend using a strong password for improved security.with open(PRIVATE_KEY_PATH, 'rb') as f: private_key = load_pem_private_key(data=f.read(), password=None)# Set up the request parametersparams = { 'apiKey': API_KEY, 'symbol': 'BTCUSDT', 'side': 'SELL', 'type': 'LIMIT', 'timeInForce': 'GTC', 'quantity': '1.0000000', 'price': '0.20'}# Timestamp the requesttimestamp = int(time.time() * 1000) # UNIX timestamp in millisecondsparams['timestamp'] = timestamp# Sign the requestpayload = '&'.join([f'{param}={value}' for param, value in sorted(params.items())])signature = base64.b64encode(private_key.sign(payload.encode('ASCII')))params['signature'] = signature.decode('ASCII')# Send the requestrequest = { 'id': 'my_new_order', 'method': 'order.place', 'params': params}ws = create_connection("wss://ws-fapi.binance.com/ws-fapi/v1")ws.send(json.dumps(request))result = ws.recv()ws.close()print(result) +``` + +A sample code in Python to show how to sign the payload with an Ed25519 key is available on the right side. + +- [WebSocket API Request format](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-api-general-info) +- [Response format](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-api-general-info) +- [WebSocket API Rate limits](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-api-general-info) +- [WebSocket API Authenticate after connection](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-api-general-info) +- [WebSocket API API key revocation](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-api-general-info) +- [WebSocket API Authorize ad hoc requests](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-api-general-info) +- [WebSocket API Authentication request](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-api-general-info) + - [Log in with API key (SIGNED)](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-api-general-info) + - [Query session status](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-api-general-info) + - [Log out of the session](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-api-general-info) +- [SIGNED (TRADE and USER\_DATA) Endpoint Security](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-api-general-info) + - [SIGNED request example (Ed25519)](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-api-general-info) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams.md new file mode 100644 index 0000000..3a71151 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams.md @@ -0,0 +1,31 @@ +--- +title: "Connect | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams" +fetched_at: "2026-01-27T05:28:33.918Z" +--- +# Websocket Market Streams + +- The connection method for Websocket is: + + - Base Url: **wss://fstream.binance.com** + - Streams can be access either in a single raw stream or a combined stream + - Raw streams are accessed at **/ws/** + - Combined streams are accessed at **/stream?streams=//** + - Example: + - `wss://fstream.binance.com/ws/bnbusdt@aggTrade` + - `wss://fstream.binance.com/stream?streams=bnbusdt@aggTrade/btcusdt@markPrice` +- Combined stream events are wrapped as follows: **{"stream":"","data":}** + +- All symbols for streams are **lowercase** + +- A single connection is only valid for 24 hours; expect to be disconnected at the 24 hour mark + +- The websocket server will send a `ping frame` every 3 minutes. If the websocket server does not receive a `pong frame` back from the connection within a 10 minute period, the connection will be disconnected. Unsolicited `pong frames` are allowed(the client can send pong frames at a frequency higher than every 15 minutes to maintain the connection). + +- WebSocket connections have a limit of 10 incoming messages per second. + +- A connection that goes beyond the limit will be disconnected; IPs that are repeatedly disconnected may be banned. + +- A single connection can listen to a maximum of **1024** streams. + +- Considering the possible data latency from RESTful endpoints during an extremely volatile market, it is highly recommended to get the order status, position, etc from the Websocket user data stream. diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_Aggregate-Trade-Streams.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_Aggregate-Trade-Streams.md new file mode 100644 index 0000000..3851c70 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_Aggregate-Trade-Streams.md @@ -0,0 +1,33 @@ +--- +title: "Aggregate Trade Streams | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Aggregate-Trade-Streams" +fetched_at: "2026-01-27T05:28:33.970Z" +--- +# Aggregate Trade Streams + +## Stream Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Aggregate-Trade-Streams) + +The Aggregate Trade Streams push market trade information that is aggregated for fills with same price and taking side every 100 milliseconds. Only market trades will be aggregated, which means the insurance fund trades and ADL trades won't be aggregated. + +## Stream Name[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Aggregate-Trade-Streams) + +`@aggTrade` + +**Note**: + +> Retail Price Improvement(RPI) orders are aggregated into field `q` and without special tags to be distinguished. + +## Update Speed[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Aggregate-Trade-Streams) + +**100ms** + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Aggregate-Trade-Streams) + +``` +{ "e": "aggTrade", // Event type "E": 123456789, // Event time "s": "BTCUSDT", // Symbol "a": 5933014, // Aggregate trade ID "p": "0.001", // Price "q": "100", // Quantity with all the market trades "nq": "100", // Normal quantity without the trades involving RPI orders "f": 100, // First trade ID "l": 105, // Last trade ID "T": 123456785, // Trade time "m": true, // Is the buyer the market maker?} +``` + +- [Stream Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Aggregate-Trade-Streams) +- [Stream Name](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Aggregate-Trade-Streams) +- [Update Speed](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Aggregate-Trade-Streams) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Aggregate-Trade-Streams) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_All-Book-Tickers-Stream.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_All-Book-Tickers-Stream.md new file mode 100644 index 0000000..f9ee6ba --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_All-Book-Tickers-Stream.md @@ -0,0 +1,33 @@ +--- +title: "All Book Tickers Stream | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/All-Book-Tickers-Stream" +fetched_at: "2026-01-27T05:28:33.951Z" +--- +# All Book Tickers Stream + +## Stream Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/All-Book-Tickers-Stream) + +Pushes any update to the best bid or ask's price or quantity in real-time for all symbols. + +## Stream Name[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/All-Book-Tickers-Stream) + +`!bookTicker` + +**Note**: + +> Retail Price Improvement(RPI) orders are not visible and excluded in the response message. + +## Update Speed[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/All-Book-Tickers-Stream) + +**5s** + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/All-Book-Tickers-Stream) + +``` +{ "e":"bookTicker", // event type "u":400900217, // order book updateId "E": 1568014460893, // event time "T": 1568014460891, // transaction time "s":"BNBUSDT", // symbol "b":"25.35190000", // best bid price "B":"31.21000000", // best bid qty "a":"25.36520000", // best ask price "A":"40.66000000" // best ask qty} +``` + +- [Stream Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/All-Book-Tickers-Stream) +- [Stream Name](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/All-Book-Tickers-Stream) +- [Update Speed](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/All-Book-Tickers-Stream) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/All-Book-Tickers-Stream) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_All-Market-Liquidation-Order-Streams.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_All-Market-Liquidation-Order-Streams.md new file mode 100644 index 0000000..d9b8feb --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_All-Market-Liquidation-Order-Streams.md @@ -0,0 +1,29 @@ +--- +title: "All Market Liquidation Order Streams | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/All-Market-Liquidation-Order-Streams" +fetched_at: "2026-01-27T05:28:34.171Z" +--- +# All Market Liquidation Order Streams + +## Stream Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/All-Market-Liquidation-Order-Streams) + +The All Liquidation Order Snapshot Streams push force liquidation order information for all symbols in the market. For each symbol,only the latest one liquidation order within 1000ms will be pushed as the snapshot. If no liquidation happens in the interval of 1000ms, no stream will be pushed. + +## Stream Name[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/All-Market-Liquidation-Order-Streams) + +`!forceOrder@arr` + +## Update Speed[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/All-Market-Liquidation-Order-Streams) + +**1000ms** + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/All-Market-Liquidation-Order-Streams) + +``` +{ "e":"forceOrder",                   // Event Type "E":1568014460893,                  // Event Time "o":{ "s":"BTCUSDT",                   // Symbol "S":"SELL",                      // Side "o":"LIMIT",                     // Order Type "f":"IOC",                       // Time in Force "q":"0.014",                     // Original Quantity "p":"9910",                      // Price "ap":"9910",                     // Average Price "X":"FILLED",                    // Order Status "l":"0.014",                     // Order Last Filled Quantity "z":"0.014",                     // Order Filled Accumulated Quantity "T":1568014460893,          // Order Trade Time }} +``` + +- [Stream Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/All-Market-Liquidation-Order-Streams) +- [Stream Name](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/All-Market-Liquidation-Order-Streams) +- [Update Speed](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/All-Market-Liquidation-Order-Streams) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/All-Market-Liquidation-Order-Streams) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_All-Market-Mini-Tickers-Stream.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_All-Market-Mini-Tickers-Stream.md new file mode 100644 index 0000000..f9b10fa --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_All-Market-Mini-Tickers-Stream.md @@ -0,0 +1,29 @@ +--- +title: "All Market Mini Tickers Stream | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/All-Market-Mini-Tickers-Stream" +fetched_at: "2026-01-27T05:28:34.304Z" +--- +# All Market Mini Tickers Stream + +## Stream Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/All-Market-Mini-Tickers-Stream) + +24hr rolling window mini-ticker statistics for all symbols. These are NOT the statistics of the UTC day, but a 24hr rolling window from requestTime to 24hrs before. Note that only tickers that have changed will be present in the array. + +## Stream Name[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/All-Market-Mini-Tickers-Stream) + +`!miniTicker@arr` + +## Update Speed[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/All-Market-Mini-Tickers-Stream) + +**1000ms** + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/All-Market-Mini-Tickers-Stream) + +``` +[ { "e": "24hrMiniTicker", // Event type "E": 123456789, // Event time "s": "BTCUSDT", // Symbol "c": "0.0025", // Close price "o": "0.0010", // Open price "h": "0.0025", // High price "l": "0.0010", // Low price "v": "10000", // Total traded base asset volume "q": "18" // Total traded quote asset volume }] +``` + +- [Stream Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/All-Market-Mini-Tickers-Stream) +- [Stream Name](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/All-Market-Mini-Tickers-Stream) +- [Update Speed](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/All-Market-Mini-Tickers-Stream) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/All-Market-Mini-Tickers-Stream) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_All-Market-Tickers-Streams.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_All-Market-Tickers-Streams.md new file mode 100644 index 0000000..eb0820e --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_All-Market-Tickers-Streams.md @@ -0,0 +1,29 @@ +--- +title: "All Market Tickers Streams | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/All-Market-Tickers-Streams" +fetched_at: "2026-01-27T05:28:34.201Z" +--- +# All Market Tickers Streams + +## Stream Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/All-Market-Tickers-Streams) + +24hr rolling window ticker statistics for all symbols. These are NOT the statistics of the UTC day, but a 24hr rolling window from requestTime to 24hrs before. Note that only tickers that have changed will be present in the array. + +## Stream Name[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/All-Market-Tickers-Streams) + +`!ticker@arr` + +## Update Speed[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/All-Market-Tickers-Streams) + +**1000ms** + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/All-Market-Tickers-Streams) + +``` +[ { "e": "24hrTicker", // Event type "E": 123456789, // Event time "s": "BTCUSDT", // Symbol "p": "0.0015", // Price change "P": "250.00", // Price change percent "w": "0.0018", // Weighted average price "c": "0.0025", // Last price "Q": "10", // Last quantity "o": "0.0010", // Open price "h": "0.0025", // High price "l": "0.0010", // Low price "v": "10000", // Total traded base asset volume "q": "18", // Total traded quote asset volume "O": 0, // Statistics open time "C": 86400000, // Statistics close time "F": 0, // First trade ID "L": 18150, // Last trade Id "n": 18151 // Total number of trades }] +``` + +- [Stream Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/All-Market-Tickers-Streams) +- [Stream Name](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/All-Market-Tickers-Streams) +- [Update Speed](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/All-Market-Tickers-Streams) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/All-Market-Tickers-Streams) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_Composite-Index-Symbol-Information-Streams.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_Composite-Index-Symbol-Information-Streams.md new file mode 100644 index 0000000..712de74 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_Composite-Index-Symbol-Information-Streams.md @@ -0,0 +1,29 @@ +--- +title: "Composite Index Symbol Information Streams | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Composite-Index-Symbol-Information-Streams" +fetched_at: "2026-01-27T05:28:34.354Z" +--- +# Composite Index Symbol Information Streams + +## Stream Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Composite-Index-Symbol-Information-Streams) + +Composite index information for index symbols pushed every second. + +## Stream Name[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Composite-Index-Symbol-Information-Streams) + +`@compositeIndex` + +## Update Speed[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Composite-Index-Symbol-Information-Streams) + +**1000ms** + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Composite-Index-Symbol-Information-Streams) + +``` +{ "e":"compositeIndex", // Event type "E":1602310596000, // Event time "s":"DEFIUSDT", // Symbol "p":"554.41604065", // Price "C":"baseAsset", "c":[ // Composition { "b":"BAL", // Base asset "q":"USDT", // Quote asset "w":"1.04884844", // Weight in quantity "W":"0.01457800", // Weight in percentage "i":"24.33521021" // Index price }, { "b":"BAND", "q":"USDT" , "w":"3.53782729", "W":"0.03935200", "i":"7.26420084" } ]} +``` + +- [Stream Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Composite-Index-Symbol-Information-Streams) +- [Stream Name](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Composite-Index-Symbol-Information-Streams) +- [Update Speed](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Composite-Index-Symbol-Information-Streams) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Composite-Index-Symbol-Information-Streams) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_Continuous-Contract-Kline-Candlestick-Streams.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_Continuous-Contract-Kline-Candlestick-Streams.md new file mode 100644 index 0000000..2417422 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_Continuous-Contract-Kline-Candlestick-Streams.md @@ -0,0 +1,55 @@ +--- +title: "Continuous Contract Kline Candlestick Streams | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Continuous-Contract-Kline-Candlestick-Streams" +fetched_at: "2026-01-27T05:28:34.425Z" +--- +# Continuous Contract Kline/Candlestick Streams + +## Stream Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Continuous-Contract-Kline-Candlestick-Streams) + +**Contract type:** + +- perpetual +- current\_quarter +- next\_quarter +- tradifi\_perpetual + +**Kline/Candlestick chart intervals:** + +s -> seconds; m -> minutes; h -> hours; d -> days; w -> weeks; M -> months + +- 1s +- 1m +- 3m +- 5m +- 15m +- 30m +- 1h +- 2h +- 4h +- 6h +- 8h +- 12h +- 1d +- 3d +- 1w +- 1M + +## Stream Name[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Continuous-Contract-Kline-Candlestick-Streams) + +`_@continuousKline_` + +## Update Speed[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Continuous-Contract-Kline-Candlestick-Streams) + +**250ms** + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Continuous-Contract-Kline-Candlestick-Streams) + +``` +{ "e":"continuous_kline", // Event type "E":1607443058651, // Event time "ps":"BTCUSDT", // Pair "ct":"PERPETUAL" // Contract type "k":{ "t":1607443020000, // Kline start time "T":1607443079999, // Kline close time "i":"1m", // Interval "f":116467658886, // First updateId "L":116468012423, // Last updateId "o":"18787.00", // Open price "c":"18804.04", // Close price "h":"18804.04", // High price "l":"18786.54", // Low price "v":"197.664", // volume "n": 543, // Number of trades "x":false, // Is this kline closed? "q":"3715253.19494", // Quote asset volume "V":"184.769", // Taker buy volume "Q":"3472925.84746", //Taker buy quote asset volume "B":"0" // Ignore }} +``` + +- [Stream Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Continuous-Contract-Kline-Candlestick-Streams) +- [Stream Name](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Continuous-Contract-Kline-Candlestick-Streams) +- [Update Speed](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Continuous-Contract-Kline-Candlestick-Streams) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Continuous-Contract-Kline-Candlestick-Streams) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_Contract-Info-Stream.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_Contract-Info-Stream.md new file mode 100644 index 0000000..b24cf1f --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_Contract-Info-Stream.md @@ -0,0 +1,29 @@ +--- +title: "Contract Info Stream | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Contract-Info-Stream" +fetched_at: "2026-01-27T05:28:34.589Z" +--- +# Contract Info Stream + +## Stream Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Contract-Info-Stream) + +ContractInfo stream pushes when contract info updates(listing/settlement/contract bracket update). `bks` field only shows up when bracket gets updated. + +## Stream Name[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Contract-Info-Stream) + +`!contractInfo` + +## Update Speed[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Contract-Info-Stream) + +**Real-time** + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Contract-Info-Stream) + +``` +{ "e":"contractInfo", // Event Type "E":1669356423908, // Event Time "s":"IOTAUSDT", // Symbol "ps":"IOTAUSDT", // Pair "ct":"PERPETUAL", // Contract type "dt":4133404800000, // Delivery date time "ot":1569398400000, // onboard date time "cs":"TRADING", // Contract status "bks":[ { "bs":1, // Notional bracket "bnf":0, // Floor notional of this bracket "bnc":5000, // Cap notional of this bracket "mmr":0.01, // Maintenance ratio for this bracket "cf":0, // Auxiliary number for quick calculation "mi":21, // Min leverage for this bracket "ma":50 // Max leverage for this bracket }, { "bs":2, "bnf":5000, "bnc":25000, "mmr":0.025, "cf":75, "mi":11, "ma":20 } ]} +``` + +- [Stream Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Contract-Info-Stream) +- [Stream Name](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Contract-Info-Stream) +- [Update Speed](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Contract-Info-Stream) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Contract-Info-Stream) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_Diff-Book-Depth-Streams-RPI.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_Diff-Book-Depth-Streams-RPI.md new file mode 100644 index 0000000..b6654a0 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_Diff-Book-Depth-Streams-RPI.md @@ -0,0 +1,33 @@ +--- +title: "RPI Diff Book Depth Streams | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Diff-Book-Depth-Streams-RPI" +fetched_at: "2026-01-27T05:28:34.603Z" +--- +# RPI Diff. Book Depth Streams + +## Stream Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Diff-Book-Depth-Streams-RPI) + +Bids and asks including RPI orders, pushed every 500 milliseconds + +## Stream Name[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Diff-Book-Depth-Streams-RPI) + +`@rpiDepth@500ms` + +**Note**: + +> RPI(Retail Price Improvement) orders are included and aggreated in the response message. When the quantity of a price level to be updated is equal to 0, it means either all quotations for this price have been filled/canceled, or the quantity of crossed RPI orders for this price are hidden + +## Update Speed[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Diff-Book-Depth-Streams-RPI) + +**500ms** + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Diff-Book-Depth-Streams-RPI) + +``` +{ "e": "depthUpdate", // Event type "E": 123456789, // Event time "T": 123456788, // Transaction time "s": "BTCUSDT", // Symbol "U": 157, // First update ID in event "u": 160, // Final update ID in event "pu": 149, // Final update Id in last stream(ie `u` in last stream) "b": [ // Bids to be updated [ "0.0024", // Price level to be updated "10" // Quantity ] ], "a": [ // Asks to be updated [ "0.0026", // Price level to be updated "100" // Quantity ] ]} +``` + +- [Stream Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Diff-Book-Depth-Streams-RPI) +- [Stream Name](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Diff-Book-Depth-Streams-RPI) +- [Update Speed](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Diff-Book-Depth-Streams-RPI) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Diff-Book-Depth-Streams-RPI) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_Diff-Book-Depth-Streams.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_Diff-Book-Depth-Streams.md new file mode 100644 index 0000000..9839f95 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_Diff-Book-Depth-Streams.md @@ -0,0 +1,33 @@ +--- +title: "Diff Book Depth Streams | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Diff-Book-Depth-Streams" +fetched_at: "2026-01-27T05:28:34.559Z" +--- +# Diff. Book Depth Streams + +## Stream Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Diff-Book-Depth-Streams) + +Bids and asks, pushed every 250 milliseconds, 500 milliseconds, 100 milliseconds (if existing) + +## Stream Name[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Diff-Book-Depth-Streams) + +`@depth` OR `@depth@500ms` OR `@depth@100ms` + +**Note**: + +> Retail Price Improvement(RPI) orders are not visible and excluded in the response message. + +## Update Speed[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Diff-Book-Depth-Streams) + +**250ms**, **500ms**, **100ms** + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Diff-Book-Depth-Streams) + +``` +{ "e": "depthUpdate", // Event type "E": 123456789, // Event time "T": 123456788, // Transaction time "s": "BTCUSDT", // Symbol "U": 157, // First update ID in event "u": 160, // Final update ID in event "pu": 149, // Final update Id in last stream(ie `u` in last stream) "b": [ // Bids to be updated [ "0.0024", // Price level to be updated "10" // Quantity ] ], "a": [ // Asks to be updated [ "0.0026", // Price level to be updated "100" // Quantity ] ]} +``` + +- [Stream Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Diff-Book-Depth-Streams) +- [Stream Name](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Diff-Book-Depth-Streams) +- [Update Speed](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Diff-Book-Depth-Streams) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Diff-Book-Depth-Streams) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_How-to-manage-a-local-order-book-correctly.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_How-to-manage-a-local-order-book-correctly.md new file mode 100644 index 0000000..200dd8c --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_How-to-manage-a-local-order-book-correctly.md @@ -0,0 +1,21 @@ +--- +title: "How To Manage A Local Order Book Correctly | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/How-to-manage-a-local-order-book-correctly" +fetched_at: "2026-01-27T05:28:34.677Z" +--- +# How to manage a local order book correctly + +1. Open a stream to **wss://fstream.binance.com/stream?streams=btcusdt@depth**. +2. Buffer the events you receive from the stream. For same price, latest received update covers the previous one. +3. Get a depth snapshot from **[https://fapi.binance.com/fapi/v1/depth?symbol=BTCUSDT&limit=1000](https://fapi.binance.com/fapi/v1/depth?symbol=BTCUSDT&limit=1000)** . +4. Drop any event where `u` is < `lastUpdateId` in the snapshot. +5. The first processed event should have `U` `<= ``lastUpdateId` **AND** `u` >`= ``lastUpdateId` + +- U = firstUpdateId (the first update ID) from the WebSocket stream. +- u = finalUpdateId (the last update ID) from the WebSocket stream. +- lastUpdateId = the update ID you got from the REST depth snapshot. + +6. While listening to the stream, each new event's `pu` should be equal to the previous event's `u`, otherwise initialize the process from step 3.ß +7. The data in each event is the **absolute** quantity for a price level. +8. If the quantity is 0, **remove** the price level. +9. Receiving an event that removes a price level that is not in your local order book can happen and is normal. diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_Individual-Symbol-Book-Ticker-Streams.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_Individual-Symbol-Book-Ticker-Streams.md new file mode 100644 index 0000000..cb2cd8f --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_Individual-Symbol-Book-Ticker-Streams.md @@ -0,0 +1,33 @@ +--- +title: "Individual Symbol Book Ticker Streams | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Individual-Symbol-Book-Ticker-Streams" +fetched_at: "2026-01-27T05:28:34.806Z" +--- +# Individual Symbol Book Ticker Streams + +## Stream Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Individual-Symbol-Book-Ticker-Streams) + +Pushes any update to the best bid or ask's price or quantity in real-time for a specified symbol. + +## Stream Name[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Individual-Symbol-Book-Ticker-Streams) + +`@bookTicker` + +**Note**: + +> Retail Price Improvement(RPI) orders are not visible and excluded in the response message. + +## Update Speed[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Individual-Symbol-Book-Ticker-Streams) + +**Real-time** + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Individual-Symbol-Book-Ticker-Streams) + +``` +{ "e":"bookTicker", // event type "u":400900217, // order book updateId "E": 1568014460893, // event time "T": 1568014460891, // transaction time "s":"BNBUSDT", // symbol "b":"25.35190000", // best bid price "B":"31.21000000", // best bid qty "a":"25.36520000", // best ask price "A":"40.66000000" // best ask qty} +``` + +- [Stream Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Individual-Symbol-Book-Ticker-Streams) +- [Stream Name](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Individual-Symbol-Book-Ticker-Streams) +- [Update Speed](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Individual-Symbol-Book-Ticker-Streams) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Individual-Symbol-Book-Ticker-Streams) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_Individual-Symbol-Mini-Ticker-Stream.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_Individual-Symbol-Mini-Ticker-Stream.md new file mode 100644 index 0000000..86a03df --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_Individual-Symbol-Mini-Ticker-Stream.md @@ -0,0 +1,29 @@ +--- +title: "Individual Symbol Mini Ticker Stream | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Individual-Symbol-Mini-Ticker-Stream" +fetched_at: "2026-01-27T05:28:34.847Z" +--- +# Individual Symbol Mini Ticker Stream + +## Stream Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Individual-Symbol-Mini-Ticker-Stream) + +24hr rolling window mini-ticker statistics for a single symbol. These are NOT the statistics of the UTC day, but a 24hr rolling window from requestTime to 24hrs before. + +## Stream Name[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Individual-Symbol-Mini-Ticker-Stream) + +`@miniTicker` + +## Update Speed[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Individual-Symbol-Mini-Ticker-Stream) + +**2s** + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Individual-Symbol-Mini-Ticker-Stream) + +``` + { "e": "24hrMiniTicker", // Event type "E": 123456789, // Event time "s": "BTCUSDT", // Symbol "c": "0.0025", // Close price "o": "0.0010", // Open price "h": "0.0025", // High price "l": "0.0010", // Low price "v": "10000", // Total traded base asset volume "q": "18" // Total traded quote asset volume } +``` + +- [Stream Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Individual-Symbol-Mini-Ticker-Stream) +- [Stream Name](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Individual-Symbol-Mini-Ticker-Stream) +- [Update Speed](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Individual-Symbol-Mini-Ticker-Stream) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Individual-Symbol-Mini-Ticker-Stream) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_Individual-Symbol-Ticker-Streams.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_Individual-Symbol-Ticker-Streams.md new file mode 100644 index 0000000..632ef7c --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_Individual-Symbol-Ticker-Streams.md @@ -0,0 +1,29 @@ +--- +title: "Individual Symbol Ticker Streams | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Individual-Symbol-Ticker-Streams" +fetched_at: "2026-01-27T05:28:34.997Z" +--- +# Individual Symbol Ticker Streams + +## Stream Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Individual-Symbol-Ticker-Streams) + +24hr rolling window ticker statistics for a single symbol. These are NOT the statistics of the UTC day, but a 24hr rolling window from requestTime to 24hrs before. + +## Stream Name[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Individual-Symbol-Ticker-Streams) + +`@ticker` + +## Update Speed[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Individual-Symbol-Ticker-Streams) + +**2000ms** + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Individual-Symbol-Ticker-Streams) + +``` +{ "e": "24hrTicker", // Event type "E": 123456789, // Event time "s": "BTCUSDT", // Symbol "p": "0.0015", // Price change "P": "250.00", // Price change percent "w": "0.0018", // Weighted average price "c": "0.0025", // Last price "Q": "10", // Last quantity "o": "0.0010", // Open price "h": "0.0025", // High price "l": "0.0010", // Low price "v": "10000", // Total traded base asset volume "q": "18", // Total traded quote asset volume "O": 0, // Statistics open time "C": 86400000, // Statistics close time "F": 0, // First trade ID "L": 18150, // Last trade Id "n": 18151 // Total number of trades} +``` + +- [Stream Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Individual-Symbol-Ticker-Streams) +- [Stream Name](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Individual-Symbol-Ticker-Streams) +- [Update Speed](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Individual-Symbol-Ticker-Streams) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Individual-Symbol-Ticker-Streams) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_Kline-Candlestick-Streams.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_Kline-Candlestick-Streams.md new file mode 100644 index 0000000..996787a --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_Kline-Candlestick-Streams.md @@ -0,0 +1,49 @@ +--- +title: "Kline Candlestick Streams | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Kline-Candlestick-Streams" +fetched_at: "2026-01-27T05:28:34.931Z" +--- +# Kline/Candlestick Streams + +## Stream Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Kline-Candlestick-Streams) + +The Kline/Candlestick Stream push updates to the current klines/candlestick every 250 milliseconds (if existing). + +**Kline/Candlestick chart intervals:** + +m -> minutes; h -> hours; d -> days; w -> weeks; M -> months + +- 1m +- 3m +- 5m +- 15m +- 30m +- 1h +- 2h +- 4h +- 6h +- 8h +- 12h +- 1d +- 3d +- 1w +- 1M + +## Stream Name[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Kline-Candlestick-Streams) + +`@kline_` + +## Update Speed[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Kline-Candlestick-Streams) + +**250ms** + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Kline-Candlestick-Streams) + +``` +{ "e": "kline", // Event type "E": 1638747660000, // Event time "s": "BTCUSDT", // Symbol "k": { "t": 1638747660000, // Kline start time "T": 1638747719999, // Kline close time "s": "BTCUSDT", // Symbol "i": "1m", // Interval "f": 100, // First trade ID "L": 200, // Last trade ID "o": "0.0010", // Open price "c": "0.0020", // Close price "h": "0.0025", // High price "l": "0.0015", // Low price "v": "1000", // Base asset volume "n": 100, // Number of trades "x": false, // Is this kline closed? "q": "1.0000", // Quote asset volume "V": "500", // Taker buy base asset volume "Q": "0.500", // Taker buy quote asset volume "B": "123456" // Ignore }} +``` + +- [Stream Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Kline-Candlestick-Streams) +- [Stream Name](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Kline-Candlestick-Streams) +- [Update Speed](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Kline-Candlestick-Streams) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Kline-Candlestick-Streams) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_Liquidation-Order-Streams.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_Liquidation-Order-Streams.md new file mode 100644 index 0000000..42aaaf3 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_Liquidation-Order-Streams.md @@ -0,0 +1,29 @@ +--- +title: "Liquidation Order Streams | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Liquidation-Order-Streams" +fetched_at: "2026-01-27T05:28:35.120Z" +--- +# Liquidation Order Streams + +## Stream Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Liquidation-Order-Streams) + +The Liquidation Order Snapshot Streams push force liquidation order information for specific symbol. For each symbol,only the latest one liquidation order within 1000ms will be pushed as the snapshot. If no liquidation happens in the interval of 1000ms, no stream will be pushed. + +## Stream Name[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Liquidation-Order-Streams) + +   `@forceOrder` + +## Update Speed[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Liquidation-Order-Streams) + +1000ms + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Liquidation-Order-Streams) + +``` +{ "e":"forceOrder",                   // Event Type "E":1568014460893,                  // Event Time "o":{ "s":"BTCUSDT",                   // Symbol "S":"SELL",                      // Side "o":"LIMIT",                     // Order Type "f":"IOC",                       // Time in Force "q":"0.014",                     // Original Quantity "p":"9910",                      // Price "ap":"9910",                     // Average Price "X":"FILLED",                    // Order Status "l":"0.014",                     // Order Last Filled Quantity "z":"0.014",                     // Order Filled Accumulated Quantity "T":1568014460893,          // Order Trade Time }} +``` + +- [Stream Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Liquidation-Order-Streams) +- [Stream Name](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Liquidation-Order-Streams) +- [Update Speed](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Liquidation-Order-Streams) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Liquidation-Order-Streams) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_Live-Subscribing-Unsubscribing-to-streams.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_Live-Subscribing-Unsubscribing-to-streams.md new file mode 100644 index 0000000..a0ebff2 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_Live-Subscribing-Unsubscribing-to-streams.md @@ -0,0 +1,130 @@ +--- +title: "Live Subscribing Unsubscribing To Streams | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Live-Subscribing-Unsubscribing-to-streams" +fetched_at: "2026-01-27T05:28:35.108Z" +--- +# Live Subscribing/Unsubscribing to streams + +- The following data can be sent through the websocket instance in order to subscribe/unsubscribe from streams. Examples can be seen below. +- The `id` used in the JSON payloads is an unsigned INT used as an identifier to uniquely identify the messages going back and forth. + +## Subscribe to a stream[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Live-Subscribing-Unsubscribing-to-streams) + +> **Request** + +``` +{ "method": "SUBSCRIBE", "params": [ "btcusdt@aggTrade", "btcusdt@depth" ], "id": 1 } +``` + +> **Response** + +``` +{ "result": null, "id": 1} +``` + +## Unsubscribe to a stream[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Live-Subscribing-Unsubscribing-to-streams) + +> **Request** + +``` +{ "method": "UNSUBSCRIBE", "params": [ "btcusdt@depth" ], "id": 312 } +``` + +> **Response** + +``` +{ "result": null, "id": 312} +``` + +## Listing Subscriptions[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Live-Subscribing-Unsubscribing-to-streams) + +> **Request** + +``` +{ "method": "LIST_SUBSCRIPTIONS", "id": 3 } +``` + +> **Response** + +``` +{ "result": [ "btcusdt@aggTrade" ], "id": 3} +``` + +## Setting Properties[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Live-Subscribing-Unsubscribing-to-streams) + +Currently, the only property can be set is to set whether `combined` stream payloads are enabled are not. The combined property is set to `false` when connecting using `/ws/` ("raw streams") and `true` when connecting using `/stream/`. + +> **Request** + +``` +{ "method": "SET_PROPERTY", "params": [ "combined", true ], "id": 5 } +``` + +> **Response** + +``` +{ "result": null, "id": 5} +``` + +## Retrieving Properties[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Live-Subscribing-Unsubscribing-to-streams) + +> **Request** + +``` +{ "method": "GET_PROPERTY", "params": [ "combined" ], "id": 2 } +``` + +> **Response** + +``` +{ "result": true, // Indicates that combined is set to true. "id": 2} +``` + +### Error Messages[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Live-Subscribing-Unsubscribing-to-streams) + +Error Message + +Description + +{"code": 0, "msg": "Unknown property"} + +Parameter used in the `SET_PROPERTY` or `GET_PROPERTY` was invalid + +{"code": 1, "msg": "Invalid value type: expected Boolean"} + +Value should only be `true` or `false` + +{"code": 2, "msg": "Invalid request: property name must be a string"} + +Property name provided was invalid + +{"code": 2, "msg": "Invalid request: request ID must be an unsigned integer"} + +Parameter `id` had to be provided or the value provided in the `id` parameter is an unsupported type + +{"code": 2, "msg": "Invalid request: unknown variant %s, expected one of `SUBSCRIBE`, `UNSUBSCRIBE`, `LIST_SUBSCRIPTIONS`, `SET_PROPERTY`, `GET_PROPERTY` at line 1 column 28"} + +Possible typo in the provided method or provided method was neither of the expected values + +{"code": 2, "msg": "Invalid request: too many parameters"} + +Unnecessary parameters provided in the data + +{"code": 2, "msg": "Invalid request: property name must be a string"} + +Property name was not provided + +{"code": 2, "msg": "Invalid request: missing field `method` at line 1 column 73"} + +`method` was not provided in the data + +{"code":3,"msg":"Invalid JSON: expected value at line %s column %s"} + +JSON data sent has incorrect syntax. + +- [Subscribe to a stream](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Live-Subscribing-Unsubscribing-to-streams) +- [Unsubscribe to a stream](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Live-Subscribing-Unsubscribing-to-streams) +- [Listing Subscriptions](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Live-Subscribing-Unsubscribing-to-streams) +- [Setting Properties](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Live-Subscribing-Unsubscribing-to-streams) +- [Retrieving Properties](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Live-Subscribing-Unsubscribing-to-streams) + - [Error Messages](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Live-Subscribing-Unsubscribing-to-streams) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_Mark-Price-Stream-for-All-market.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_Mark-Price-Stream-for-All-market.md new file mode 100644 index 0000000..b57495d --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_Mark-Price-Stream-for-All-market.md @@ -0,0 +1,33 @@ +--- +title: "Mark Price Stream For All Market | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Mark-Price-Stream-for-All-market" +fetched_at: "2026-01-27T05:28:35.382Z" +--- +# Mark Price Stream for All market + +## Stream Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Mark-Price-Stream-for-All-market) + +Mark price and funding rate for all symbols pushed every 3 seconds or every second. + +**Note**: + +> TradFi symbols will be pushed through a seperate message. + +## Stream Name[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Mark-Price-Stream-for-All-market) + +`!markPrice@arr` or `!markPrice@arr@1s` + +## Update Speed[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Mark-Price-Stream-for-All-market) + +**3000ms** or **1000ms** + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Mark-Price-Stream-for-All-market) + +``` +[ { "e": "markPriceUpdate", // Event type "E": 1562305380000, // Event time "s": "BTCUSDT", // Symbol "p": "11185.87786614", // Mark price "i": "11784.62659091" // Index price "P": "11784.25641265", // Estimated Settle Price, only useful in the last hour before the settlement starts "r": "0.00030000", // Funding rate "T": 1562306400000 // Next funding time }] +``` + +- [Stream Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Mark-Price-Stream-for-All-market) +- [Stream Name](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Mark-Price-Stream-for-All-market) +- [Update Speed](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Mark-Price-Stream-for-All-market) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Mark-Price-Stream-for-All-market) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_Mark-Price-Stream.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_Mark-Price-Stream.md new file mode 100644 index 0000000..2f52232 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_Mark-Price-Stream.md @@ -0,0 +1,29 @@ +--- +title: "Mark Price Stream | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Mark-Price-Stream" +fetched_at: "2026-01-27T05:28:35.181Z" +--- +# Mark Price Stream + +## Stream Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Mark-Price-Stream) + +Mark price and funding rate for a single symbol pushed every 3 seconds or every second. + +## Stream Name[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Mark-Price-Stream) + +`@markPrice` or `@markPrice@1s` + +## Update Speed[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Mark-Price-Stream) + +**3000ms** or **1000ms** + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Mark-Price-Stream) + +``` + { "e": "markPriceUpdate", // Event type "E": 1562305380000, // Event time "s": "BTCUSDT", // Symbol "p": "11794.15000000", // Mark price "i": "11784.62659091", // Index price "P": "11784.25641265", // Estimated Settle Price, only useful in the last hour before the settlement starts "r": "0.00038167", // Funding rate "T": 1562306400000 // Next funding time } +``` + +- [Stream Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Mark-Price-Stream) +- [Stream Name](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Mark-Price-Stream) +- [Update Speed](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Mark-Price-Stream) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Mark-Price-Stream) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_Multi-Assets-Mode-Asset-Index.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_Multi-Assets-Mode-Asset-Index.md new file mode 100644 index 0000000..a8ea085 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_Multi-Assets-Mode-Asset-Index.md @@ -0,0 +1,29 @@ +--- +title: "Multi Assets Mode Asset Index | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Multi-Assets-Mode-Asset-Index" +fetched_at: "2026-01-27T05:28:35.363Z" +--- +# Multi-Assets Mode Asset Index + +## Stream Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Multi-Assets-Mode-Asset-Index) + +Asset index for multi-assets mode user + +## Stream Name[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Multi-Assets-Mode-Asset-Index) + +`!assetIndex@arr` OR `@assetIndex` + +## Update Speed[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Multi-Assets-Mode-Asset-Index) + +**1s** + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Multi-Assets-Mode-Asset-Index) + +``` +[ { "e":"assetIndexUpdate", "E":1686749230000, "s":"ADAUSD", // asset index symbol "i":"0.27462452", // index price "b":"0.10000000", // bid buffer "a":"0.10000000", // ask buffer "B":"0.24716207", // bid rate "A":"0.30208698", // ask rate "q":"0.05000000", // auto exchange bid buffer "g":"0.05000000", // auto exchange ask buffer "Q":"0.26089330", // auto exchange bid rate "G":"0.28835575" // auto exchange ask rate }, { "e":"assetIndexUpdate", "E":1686749230000, "s":"USDTUSD", "i":"0.99987691", "b":"0.00010000", "a":"0.00010000", "B":"0.99977692", "A":"0.99997689", "q":"0.00010000", "g":"0.00010000", "Q":"0.99977692", "G":"0.99997689" }] +``` + +- [Stream Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Multi-Assets-Mode-Asset-Index) +- [Stream Name](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Multi-Assets-Mode-Asset-Index) +- [Update Speed](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Multi-Assets-Mode-Asset-Index) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Multi-Assets-Mode-Asset-Index) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_Partial-Book-Depth-Streams.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_Partial-Book-Depth-Streams.md new file mode 100644 index 0000000..e10cd87 --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_Partial-Book-Depth-Streams.md @@ -0,0 +1,33 @@ +--- +title: "Partial Book Depth Streams | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Partial-Book-Depth-Streams" +fetched_at: "2026-01-27T05:28:35.291Z" +--- +# Partial Book Depth Streams + +## Stream Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Partial-Book-Depth-Streams) + +Top **** bids and asks, Valid **** are 5, 10, or 20. + +## Stream Name[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Partial-Book-Depth-Streams) + +`@depth` OR `@depth@500ms` OR `@depth@100ms`. + +**Note**: + +> Retail Price Improvement(RPI) orders are not visible and excluded in the response message. + +## Update Speed[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Partial-Book-Depth-Streams) + +**250ms**, **500ms** or **100ms** + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Partial-Book-Depth-Streams) + +``` +{ "e": "depthUpdate", // Event type "E": 1571889248277, // Event time "T": 1571889248276, // Transaction time "s": "BTCUSDT", "U": 390497796, // First update ID in event "u": 390497878, // Final update ID in event "pu": 390497794, // Final update Id in last stream(ie `u` in last stream) "b": [ // Bids to be updated [ "7403.89", // Price Level to be updated "0.002" // Quantity ], [ "7403.90", "3.906" ], [ "7404.00", "1.428" ], [ "7404.85", "5.239" ], [ "7405.43", "2.562" ] ], "a": [ // Asks to be updated [ "7405.96", // Price level to be "3.340" // Quantity ], [ "7406.63", "4.525" ], [ "7407.08", "2.475" ], [ "7407.15", "4.800" ], [ "7407.20", "0.175" ] ]} +``` + +- [Stream Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Partial-Book-Depth-Streams) +- [Stream Name](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Partial-Book-Depth-Streams) +- [Update Speed](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Partial-Book-Depth-Streams) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Partial-Book-Depth-Streams) diff --git a/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_Trading-Session-Stream.md b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_Trading-Session-Stream.md new file mode 100644 index 0000000..b31eecc --- /dev/null +++ b/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_websocket-market-streams_Trading-Session-Stream.md @@ -0,0 +1,29 @@ +--- +title: "Trading Session Stream | Binance Open Platform" +source: "https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Trading-Session-Stream" +fetched_at: "2026-01-27T05:28:35.491Z" +--- +# Trading Session Stream + +## Stream Description[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Trading-Session-Stream) + +Trading session information for the underlying assets of TradFi Perpetual contracts—covering the U.S. equity market and the commodity market—is updated every second. Trading session information for different underlying markets is pushed in separate messages. Session types for the equity market include "PRE\_MARKET", "REGULAR", "AFTER\_MARKET", "OVERNIGHT", and "NO\_TRADING". Session types for the commodity market include "REGULAR" and "NO\_TRADING". + +## Stream Name[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Trading-Session-Stream) + +`tradingSession` + +## Update Speed[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Trading-Session-Stream) + +**1s** + +## Response Example[​](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Trading-Session-Stream) + +``` + { "e": "EquityUpdate", // Event type, can also be CommodityUpdate "E": 1765244143062, // Event time "t": 1765242000000, // Session start time "T": 1765270800000, // Session end time "S": "OVERNIGHT" // Session type } +``` + +- [Stream Description](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Trading-Session-Stream) +- [Stream Name](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Trading-Session-Stream) +- [Update Speed](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Trading-Session-Stream) +- [Response Example](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Trading-Session-Stream) diff --git a/package.json b/package.json index 5b7773d..82e1025 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "dev": "bun run index.ts", "start": "bun run index.ts", "test": "bun x vitest run", + "test:exchange-contract": "bun x vitest run tests/exchange-contract-suite.test.ts tests/exchange-factory.test.ts tests/config.test.ts", "test:watch": "bun x vitest", "start:trend:silent": "bun run index.ts --strategy trend --silent", "start:maker:silent": "bun run index.ts --strategy maker --silent", diff --git a/src/cli/args.ts b/src/cli/args.ts index 5aac2f6..42c5ffd 100644 --- a/src/cli/args.ts +++ b/src/cli/args.ts @@ -1,10 +1,12 @@ +import { SUPPORTED_EXCHANGE_IDS, type SupportedExchangeId } from "../exchanges/create-adapter"; + export type StrategyId = "trend" | "swing" | "guardian" | "maker" | "maker-points" | "offset-maker" | "liquidity-maker" | "basis" | "grid"; export interface CliOptions { strategy?: StrategyId; silent: boolean; help: boolean; - exchange?: "aster" | "grvt" | "lighter" | "backpack" | "paradex" | "nado" | "standx"; + exchange?: SupportedExchangeId; } const STRATEGY_VALUES = new Set([ @@ -82,15 +84,7 @@ function assignStrategy(options: CliOptions, raw: string): void { function assignExchange(options: CliOptions, raw: string): void { const normalized = raw.trim().toLowerCase(); if (!normalized) return; - if ( - normalized === "aster" || - normalized === "grvt" || - normalized === "lighter" || - normalized === "backpack" || - normalized === "paradex" || - normalized === "nado" || - normalized === "standx" - ) { + if (SUPPORTED_EXCHANGE_IDS.includes(normalized as SupportedExchangeId)) { options.exchange = normalized as CliOptions["exchange"]; } else if (normalized === "gravity" || normalized === "grav" || normalized === "grv") { options.exchange = "grvt"; @@ -98,8 +92,9 @@ function assignExchange(options: CliOptions, raw: string): void { } export function printCliHelp(): void { + const exchangeList = SUPPORTED_EXCHANGE_IDS.join("|"); // eslint-disable-next-line no-console - console.log(`Usage: bun run index.ts [--strategy ] [--exchange ] [--silent]\n\n` + + console.log(`Usage: bun run index.ts [--strategy ] [--exchange <${exchangeList}>] [--silent]\n\n` + `Options:\n` + ` --strategy, -s Automatically start the specified strategy without the interactive menu.\n` + ` Aliases: offset, offset-maker for the offset maker engine.\n` + diff --git a/src/cli/strategy-runner.ts b/src/cli/strategy-runner.ts index e950ba2..32e2543 100644 --- a/src/cli/strategy-runner.ts +++ b/src/cli/strategy-runner.ts @@ -1,5 +1,5 @@ import { basisConfig, gridConfig, isBasisStrategyEnabled, liquidityMakerConfig, makerConfig, makerPointsConfig, swingConfig, tradingConfig } from "../config"; -import { getExchangeDisplayName, resolveExchangeId } from "../exchanges/create-adapter"; +import { getExchangeDisplayName, isBasisSupportedExchangeId, resolveExchangeId } from "../exchanges/create-adapter"; import type { ExchangeAdapter } from "../exchanges/adapter"; import { buildAdapterFromEnv } from "../exchanges/resolve-from-env"; import { MakerEngine, type MakerEngineSnapshot } from "../strategy/maker-engine"; @@ -141,8 +141,8 @@ const STRATEGY_FACTORIES: Record = { throw new Error("Basis arbitrage strategy is disabled. Set ENABLE_BASIS_STRATEGY=true to enable it."); } const exchangeId = resolveExchangeId(); - if (exchangeId !== "aster" && exchangeId !== "nado" && exchangeId !== "standx") { - throw new Error("Basis arbitrage strategy currently only supports the Aster, Nado, and StandX exchanges"); + if (!isBasisSupportedExchangeId(exchangeId)) { + throw new Error("Basis arbitrage strategy currently only supports the Aster, Nado, StandX, and Binance exchanges"); } const adapter = createAdapterOrThrow(basisConfig.futuresSymbol); const engine = new BasisArbEngine(basisConfig, adapter); diff --git a/src/config.ts b/src/config.ts index a7beb6c..77de7ed 100644 --- a/src/config.ts +++ b/src/config.ts @@ -97,6 +97,7 @@ const SYMBOL_PRIORITY_BY_EXCHANGE: Record | null = null; + private readonly initContexts = new Set(); + private retryTimer: ReturnType | null = null; + private retryDelayMs = 3000; + private lastInitErrorAt = 0; + + constructor(credentials: BinanceCredentials = {}) { + const apiKey = credentials.apiKey ?? process.env.BINANCE_API_KEY; + const apiSecret = credentials.apiSecret ?? process.env.BINANCE_API_SECRET; + if (!apiKey || !apiSecret) { + throw new Error("Missing BINANCE_API_KEY or BINANCE_API_SECRET environment variable"); + } + + this.symbol = (credentials.symbol ?? process.env.BINANCE_SYMBOL ?? process.env.TRADE_SYMBOL ?? "BTCUSDT").trim().toUpperCase(); + const modeRaw = (credentials.marketType ?? process.env.BINANCE_MARKET_TYPE ?? "perp").trim().toLowerCase(); + this.marketType = modeRaw === "spot" ? "spot" : modeRaw === "auto" ? "auto" : "perp"; + + this.gateway = new BinanceGateway({ + apiKey, + apiSecret, + symbol: this.symbol, + marketType: this.marketType, + sandbox: credentials.sandbox, + spotRestUrl: credentials.spotRestUrl, + futuresRestUrl: credentials.futuresRestUrl, + spotWsUrl: credentials.spotWsUrl, + futuresWsUrl: credentials.futuresWsUrl, + logger: credentials.logger, + }); + } + + supportsTrailingStops(): boolean { + return this.marketType !== "spot"; + } + + watchAccount(cb: AccountListener): void { + const safe = this.safeInvoke("watchAccount", cb); + void this.ensureInitialized("watchAccount") + .then(() => { + this.gateway.onAccount(safe); + }) + .catch((error) => this.handleInitError("watchAccount", error)); + } + + watchOrders(cb: OrderListener): void { + const safe = this.safeInvoke("watchOrders", cb); + void this.ensureInitialized("watchOrders") + .then(() => { + this.gateway.onOrders(safe); + }) + .catch((error) => this.handleInitError("watchOrders", error)); + } + + watchDepth(symbol: string, cb: DepthListener): void { + const safe = this.safeInvoke("watchDepth", cb); + void this.ensureInitialized(`watchDepth:${symbol}`) + .then(() => { + this.gateway.onDepth(symbol, safe); + }) + .catch((error) => this.handleInitError("watchDepth", error)); + } + + watchTicker(symbol: string, cb: TickerListener): void { + const safe = this.safeInvoke("watchTicker", cb); + void this.ensureInitialized(`watchTicker:${symbol}`) + .then(() => { + this.gateway.onTicker(symbol, safe); + }) + .catch((error) => this.handleInitError("watchTicker", error)); + } + + watchKlines(symbol: string, interval: string, cb: KlineListener): void { + const safe = this.safeInvoke("watchKlines", cb); + void this.ensureInitialized(`watchKlines:${symbol}:${interval}`) + .then(() => { + this.gateway.onKlines(symbol, interval, safe); + }) + .catch((error) => this.handleInitError("watchKlines", error)); + } + + watchFundingRate(symbol: string, cb: FundingRateListener): void { + const safe = this.safeInvoke("watchFundingRate", cb); + void this.ensureInitialized(`watchFundingRate:${symbol}`) + .then(() => { + this.gateway.onFundingRate(symbol, safe); + }) + .catch((error) => this.handleInitError("watchFundingRate", error)); + } + + async createOrder(params: CreateOrderParams): Promise { + await this.ensureInitialized("createOrder"); + return this.gateway.createOrder(params); + } + + async cancelOrder(params: { symbol: string; orderId: number | string }): Promise { + await this.ensureInitialized("cancelOrder"); + await this.gateway.cancelOrder(params); + } + + async cancelOrders(params: { symbol: string; orderIdList: Array }): Promise { + await this.ensureInitialized("cancelOrders"); + await this.gateway.cancelOrders(params); + } + + async cancelAllOrders(params: { symbol: string }): Promise { + await this.ensureInitialized("cancelAllOrders"); + await this.gateway.cancelAllOrders(params); + } + + async getPrecision(): Promise { + await this.ensureInitialized("getPrecision"); + return this.gateway.getPrecision(this.symbol); + } + + async queryOpenOrders(): Promise { + await this.ensureInitialized("queryOpenOrders"); + return this.gateway.queryOpenOrders(); + } + + async queryAccountSnapshot() { + await this.ensureInitialized("queryAccountSnapshot"); + return this.gateway.queryAccountSnapshot(); + } + + async changeMarginMode(params: { symbol: string; marginMode: "isolated" | "cross" }): Promise { + await this.ensureInitialized("changeMarginMode"); + await this.gateway.changeMarginMode(params.symbol, params.marginMode); + } + + async forceCancelAllOrders(): Promise { + await this.ensureInitialized("forceCancelAllOrders"); + return this.gateway.forceCancelAllOrders(); + } + + private safeInvoke void>(context: string, cb: T): T { + const wrapped = ((...args: any[]) => { + try { + cb(...args); + } catch (error) { + console.error(`[BinanceExchangeAdapter] ${context} handler failed: ${extractMessage(error)}`); + } + }) as T; + return wrapped; + } + + private ensureInitialized(context?: string): Promise { + if (!this.initPromise) { + this.initContexts.clear(); + this.initPromise = this.gateway + .ensureInitialized(this.symbol) + .then((value) => { + this.clearRetry(); + return value; + }) + .catch((error) => { + this.handleInitError("initialize", error); + this.initPromise = null; + this.scheduleRetry(); + throw error; + }); + } + + if (context && !this.initContexts.has(context)) { + this.initContexts.add(context); + this.initPromise.catch((error) => { + this.handleInitError(context, error); + this.scheduleRetry(); + }); + } + return this.initPromise; + } + + private scheduleRetry(): void { + if (this.retryTimer) return; + this.retryTimer = setTimeout(() => { + this.retryTimer = null; + if (this.initPromise) return; + this.retryDelayMs = Math.min(this.retryDelayMs * 2, 60_000); + void this.ensureInitialized("retry"); + }, this.retryDelayMs); + } + + private clearRetry(): void { + if (this.retryTimer) { + clearTimeout(this.retryTimer); + this.retryTimer = null; + } + this.retryDelayMs = 3000; + } + + private handleInitError(context: string, error: unknown): void { + const now = Date.now(); + if (now - this.lastInitErrorAt < 5000) return; + this.lastInitErrorAt = now; + console.error(`[BinanceExchangeAdapter] ${context} failed`, error); + } +} diff --git a/src/exchanges/binance/gateway.ts b/src/exchanges/binance/gateway.ts new file mode 100644 index 0000000..569fb9e --- /dev/null +++ b/src/exchanges/binance/gateway.ts @@ -0,0 +1,1703 @@ +import ccxt, { + type Balances, + type Order as CcxtOrder, + type OrderBook as CcxtOrderBook, + type OHLCV as CcxtOhlcv, + type Ticker as CcxtTicker, +} from "ccxt"; +import axios from "axios"; +import { createHash } from "crypto"; +import NodeWebSocket from "ws"; +import type { + AsterAccountAsset, + AsterAccountPosition, + AsterAccountSnapshot, + AsterDepth, + AsterKline, + AsterOrder, + AsterTicker, + CreateOrderParams, + OrderType, + PositionSide, + TimeInForce, +} from "../types"; +import type { + AccountListener, + DepthListener, + ExchangePrecision, + FundingRateListener, + KlineListener, + OrderListener, + TickerListener, +} from "../adapter"; +import { extractMessage } from "../../utils/errors"; + +const WebSocketCtor: typeof globalThis.WebSocket = + typeof globalThis.WebSocket !== "undefined" + ? globalThis.WebSocket + : ((NodeWebSocket as unknown) as typeof globalThis.WebSocket); + +const DEFAULT_SPOT_REST_URL = "https://api.binance.com"; +const DEFAULT_FUTURES_REST_URL = "https://fapi.binance.com"; +const DEFAULT_SPOT_WS_URL = "wss://stream.binance.com:9443/ws"; +const DEFAULT_FUTURES_WS_URL = "wss://fstream.binance.com/ws"; + +const RECONNECT_BASE_DELAY_MS = 3000; +const RECONNECT_MAX_DELAY_MS = 60_000; +const LISTEN_KEY_KEEPALIVE_MS = 25 * 60 * 1000; + +type MarketKind = "spot" | "perp"; + +interface BinanceMarketRef { + kind: MarketKind; + symbol: string; + id: string; + base?: string; + quote?: string; +} + +interface PublicSubscription { + kind: MarketKind; + stream: string; + listeners: Set<(payload: T) => void>; + transform: (payload: unknown) => T | null; + ws: WebSocket | null; + reconnectTimer: ReturnType | null; + reconnectDelayMs: number; +} + +interface UserStreamState { + kind: MarketKind; + active: boolean; + listenKey: string | null; + ws: WebSocket | null; + reconnectTimer: ReturnType | null; + reconnectDelayMs: number; + keepaliveTimer: ReturnType | null; +} + +export interface BinanceGatewayOptions { + apiKey: string; + apiSecret: string; + symbol: string; + marketType?: "spot" | "perp" | "auto"; + sandbox?: boolean; + spotRestUrl?: string; + futuresRestUrl?: string; + spotWsUrl?: string; + futuresWsUrl?: string; + logger?: (context: string, error: unknown) => void; + pollIntervals?: { + account?: number; + orders?: number; + }; +} + +interface ParsedSymbolHint { + normalized: string; + forcedKind?: MarketKind; +} + +const FUTURES_SUFFIX = /(?:[_-]?PERP|[_-]?USDM)$/i; +const SPOT_SUFFIX = /(?:[_-]?SPOT)$/i; + +function normalizeMode(value: string | undefined): "spot" | "perp" | "auto" { + const raw = (value ?? "").trim().toLowerCase(); + if (raw === "spot") return "spot"; + if (raw === "auto") return "auto"; + return "perp"; +} + +function normalizeSymbolKey(value: string): string { + return value.toUpperCase().replace(/[^A-Z0-9]/g, ""); +} + +function parseSymbolHint(raw: string): ParsedSymbolHint { + const source = (raw ?? "").trim().toUpperCase(); + if (!source) return { normalized: "" }; + + if (source.includes(":") || source.includes("PERP")) { + return { + normalized: source.replace(FUTURES_SUFFIX, ""), + forcedKind: "perp", + }; + } + + if (SPOT_SUFFIX.test(source)) { + return { + normalized: source.replace(SPOT_SUFFIX, ""), + forcedKind: "spot", + }; + } + + if (FUTURES_SUFFIX.test(source)) { + return { + normalized: source.replace(FUTURES_SUFFIX, ""), + forcedKind: "perp", + }; + } + + return { normalized: source }; +} + +function normalizeTimeInForce(value: unknown): TimeInForce | undefined { + const upper = String(value ?? "").toUpperCase(); + if (upper === "GTC" || upper === "IOC" || upper === "FOK" || upper === "GTX") { + return upper; + } + return undefined; +} + +function normalizePositionSide(value: unknown): PositionSide { + const upper = String(value ?? "").toUpperCase(); + if (upper === "LONG") return "LONG"; + if (upper === "SHORT") return "SHORT"; + return "BOTH"; +} + +function toNumber(value: unknown): number { + const n = Number(value); + return Number.isFinite(n) ? n : 0; +} + +function hashOrderKey(kind: MarketKind, symbol: string, orderId: string): string { + const digest = createHash("sha1") + .update(`${kind}:${symbol}:${orderId}`) + .digest("hex"); + return `${kind}:${digest}`; +} + +function decodeWsData(data: unknown): unknown { + if (typeof data === "string") { + try { + return JSON.parse(data); + } catch { + return null; + } + } + if (data instanceof ArrayBuffer) { + try { + return JSON.parse(Buffer.from(data).toString("utf8")); + } catch { + return null; + } + } + if (ArrayBuffer.isView(data)) { + try { + return JSON.parse(Buffer.from(data.buffer, data.byteOffset, data.byteLength).toString("utf8")); + } catch { + return null; + } + } + if (data && typeof data === "object") { + return data; + } + return null; +} + +export class BinanceGateway { + private readonly apiKey: string; + private readonly apiSecret: string; + private readonly defaultSymbol: string; + private readonly requestedMode: "spot" | "perp" | "auto"; + private readonly logger: (context: string, error: unknown) => void; + private readonly pollIntervals: { account: number; orders: number }; + + private readonly spotRestUrl: string; + private readonly futuresRestUrl: string; + private readonly spotWsUrl: string; + private readonly futuresWsUrl: string; + + private readonly spotExchange: any; + private readonly perpExchange: any; + + private initialized = false; + private initPromise: Promise | null = null; + private destroyed = false; + + private defaultKind: MarketKind = "perp"; + private defaultMarket: BinanceMarketRef | null = null; + + private readonly marketIndex: Record> = { + spot: new Map(), + perp: new Map(), + }; + + private readonly symbolAliasByKey = new Map(); + private readonly activeKinds = new Set(); + + private readonly accountListeners = new Set(); + private readonly orderListeners = new Set(); + private readonly depthSubs = new Map>(); + private readonly tickerSubs = new Map>(); + private readonly klineSubs = new Map>(); + private readonly fundingSubs = new Map>(); + + private accountPollTimer: ReturnType | null = null; + private orderPollTimer: ReturnType | null = null; + + private readonly userStreams: Record = { + spot: { + kind: "spot", + active: false, + listenKey: null, + ws: null, + reconnectTimer: null, + reconnectDelayMs: RECONNECT_BASE_DELAY_MS, + keepaliveTimer: null, + }, + perp: { + kind: "perp", + active: false, + listenKey: null, + ws: null, + reconnectTimer: null, + reconnectDelayMs: RECONNECT_BASE_DELAY_MS, + keepaliveTimer: null, + }, + }; + + private readonly localOrders = new Map(); + + private readonly spotBalances = new Map(); + private readonly perpBalances = new Map(); + private readonly perpPositions = new Map(); + private readonly lastMarkPriceBySymbol = new Map(); + + private lastSpotSnapshot: AsterAccountSnapshot | null = null; + private lastPerpSnapshot: AsterAccountSnapshot | null = null; + + constructor(options: BinanceGatewayOptions) { + this.apiKey = options.apiKey; + this.apiSecret = options.apiSecret; + this.defaultSymbol = (options.symbol ?? process.env.BINANCE_SYMBOL ?? process.env.TRADE_SYMBOL ?? "BTCUSDT").trim().toUpperCase(); + this.requestedMode = normalizeMode(options.marketType ?? process.env.BINANCE_MARKET_TYPE); + this.logger = options.logger ?? ((context, error) => console.error(`[BinanceGateway] ${context}:`, error)); + this.pollIntervals = { + account: Math.max(1000, Number(options.pollIntervals?.account ?? process.env.BINANCE_ACCOUNT_POLL_MS ?? 5000)), + orders: Math.max(1000, Number(options.pollIntervals?.orders ?? process.env.BINANCE_ORDERS_POLL_MS ?? 3000)), + }; + + this.spotRestUrl = (options.spotRestUrl ?? process.env.BINANCE_SPOT_REST_URL ?? DEFAULT_SPOT_REST_URL).replace(/\/+$/, ""); + this.futuresRestUrl = (options.futuresRestUrl ?? process.env.BINANCE_FUTURES_REST_URL ?? DEFAULT_FUTURES_REST_URL).replace(/\/+$/, ""); + this.spotWsUrl = (options.spotWsUrl ?? process.env.BINANCE_SPOT_WS_URL ?? DEFAULT_SPOT_WS_URL).replace(/\/+$/, ""); + this.futuresWsUrl = (options.futuresWsUrl ?? process.env.BINANCE_FUTURES_WS_URL ?? DEFAULT_FUTURES_WS_URL).replace(/\/+$/, ""); + + this.spotExchange = new (ccxt as any).binance({ + apiKey: this.apiKey, + secret: this.apiSecret, + enableRateLimit: true, + timeout: 30_000, + options: { defaultType: "spot" }, + }); + this.perpExchange = new (ccxt as any).binanceusdm({ + apiKey: this.apiKey, + secret: this.apiSecret, + enableRateLimit: true, + timeout: 30_000, + options: { defaultType: "future" }, + }); + + const sandboxRaw = String(options.sandbox ?? process.env.BINANCE_SANDBOX ?? "false").trim().toLowerCase(); + if (sandboxRaw === "1" || sandboxRaw === "true" || sandboxRaw === "yes" || sandboxRaw === "on") { + try { + this.spotExchange.setSandboxMode(true); + } catch (error) { + this.logger("spotSandbox", error); + } + try { + this.perpExchange.setSandboxMode(true); + } catch (error) { + this.logger("perpSandbox", error); + } + } + } + + async ensureInitialized(symbol?: string): Promise { + if (this.destroyed) { + throw new Error("Binance gateway destroyed"); + } + if (this.initialized) { + if (symbol) this.resolveMarket(symbol); + return; + } + if (this.initPromise) { + await this.initPromise; + if (symbol) this.resolveMarket(symbol); + return; + } + this.initPromise = this.doInitialize() + .then(() => { + this.initialized = true; + }) + .catch((error) => { + this.initPromise = null; + throw error; + }); + await this.initPromise; + if (symbol) this.resolveMarket(symbol); + } + + private async doInitialize(): Promise { + try { + await Promise.all([this.spotExchange.loadMarkets(), this.perpExchange.loadMarkets()]); + this.rebuildMarketIndex("spot"); + this.rebuildMarketIndex("perp"); + + const preferredKind = this.requestedMode === "auto" ? undefined : this.requestedMode; + const resolved = this.resolveMarket(this.defaultSymbol, preferredKind); + this.defaultKind = resolved.kind; + this.defaultMarket = resolved; + this.activeKinds.add(resolved.kind); + this.registerAlias(resolved.kind, resolved.id, this.defaultSymbol); + } catch (error) { + this.logger("initialize", error); + throw error; + } + } + + destroy(): void { + this.destroyed = true; + this.stopPolling(); + this.closeAllSubscriptions(this.depthSubs); + this.closeAllSubscriptions(this.tickerSubs); + this.closeAllSubscriptions(this.klineSubs); + this.closeAllSubscriptions(this.fundingSubs); + for (const kind of ["spot", "perp"] as const) { + this.stopUserStream(kind); + } + for (const client of [this.spotExchange, this.perpExchange]) { + if (typeof client.close === "function") { + try { + void client.close(); + } catch (error) { + this.logger("destroy", error); + } + } + } + } + + private closeAllSubscriptions(map: Map>): void { + for (const sub of map.values()) { + this.closeSubscription(sub); + } + map.clear(); + } + + onAccount(cb: AccountListener): void { + this.accountListeners.add(cb); + const snapshot = this.buildCombinedAccountSnapshot(); + if (snapshot) { + try { + cb(snapshot); + } catch (error) { + this.logger("accountReplay", error); + } + } + this.ensurePrivateStreaming(); + this.startAccountPolling(); + } + + onOrders(cb: OrderListener): void { + this.orderListeners.add(cb); + this.emitOrders(); + this.ensurePrivateStreaming(); + this.startOrderPolling(); + } + + onDepth(symbol: string, cb: DepthListener): void { + const market = this.resolveMarket(symbol); + this.activateKind(market.kind); + const key = `${market.kind}:${market.id}:depth`; + const stream = `${market.id.toLowerCase()}@depth@100ms`; + const sub = this.ensureSubscription( + this.depthSubs, + key, + market.kind, + stream, + (payload) => this.mapDepthPayload(payload, market) + ); + sub.listeners.add(cb); + } + + onTicker(symbol: string, cb: TickerListener): void { + const market = this.resolveMarket(symbol); + this.activateKind(market.kind); + const key = `${market.kind}:${market.id}:ticker`; + const stream = `${market.id.toLowerCase()}@ticker`; + const sub = this.ensureSubscription( + this.tickerSubs, + key, + market.kind, + stream, + (payload) => this.mapTickerPayload(payload, market) + ); + sub.listeners.add(cb); + } + + onKlines(symbol: string, interval: string, cb: KlineListener): void { + const market = this.resolveMarket(symbol); + this.activateKind(market.kind); + const normalizedInterval = (interval ?? "1m").trim(); + const key = `${market.kind}:${market.id}:kline:${normalizedInterval}`; + const stream = `${market.id.toLowerCase()}@kline_${normalizedInterval}`; + const sub = this.ensureSubscription( + this.klineSubs, + key, + market.kind, + stream, + (payload) => this.mapKlinePayload(payload, normalizedInterval) + ); + sub.listeners.add(cb); + } + + onFundingRate(symbol: string, cb: FundingRateListener): void { + const market = this.resolveMarket(symbol, "perp"); + this.activateKind(market.kind); + const key = `${market.kind}:${market.id}:funding`; + const stream = `${market.id.toLowerCase()}@markPrice@1s`; + const sub = this.ensureSubscription( + this.fundingSubs, + key, + market.kind, + stream, + (payload) => this.mapFundingPayload(payload, market) + ); + sub.listeners.add((snapshot) => { + cb(snapshot); + }); + } + + async createOrder(params: CreateOrderParams): Promise { + await this.ensureInitialized(params.symbol); + const market = this.resolveMarket(params.symbol); + const exchange = this.getExchange(market.kind); + let type = this.mapOrderTypeToCcxt(params.type, market.kind); + const side = params.side.toLowerCase(); + const amount = params.quantity; + const price = params.price; + const extra: Record = {}; + + if (params.timeInForce) { + extra.timeInForce = params.timeInForce; + } + if (params.stopPrice != null) { + extra.stopPrice = params.stopPrice; + } + if (params.activationPrice != null) { + extra.activationPrice = params.activationPrice; + } + if (params.callbackRate != null) { + extra.callbackRate = params.callbackRate; + } + + if (market.kind === "perp") { + if (params.reduceOnly != null) { + extra.reduceOnly = params.reduceOnly === "true"; + } + if (params.closePosition != null) { + extra.closePosition = params.closePosition === "true"; + } + if (params.triggerType === "STOP_LOSS") { + extra.workingType = "MARK_PRICE"; + } + } else { + if (type === "limit" && params.timeInForce === "GTX") { + type = "limit_maker"; + delete extra.timeInForce; + } + } + + try { + const raw = (await exchange.createOrder(market.symbol, type, side, amount, price, extra)) as CcxtOrder; + const mapped = this.mapCcxtOrder(raw, market.kind, market.id); + this.upsertOrder(mapped, market.kind, market.id); + return mapped; + } catch (error) { + throw new Error(`Binance createOrder failed: ${extractMessage(error)}`); + } + } + + async cancelOrder(params: { symbol: string; orderId: number | string }): Promise { + await this.ensureInitialized(params.symbol); + const market = this.resolveMarket(params.symbol); + const exchange = this.getExchange(market.kind); + try { + await exchange.cancelOrder(params.orderId, market.symbol); + this.removeOrder(market.kind, market.id, String(params.orderId)); + } catch (error) { + throw new Error(`Binance cancelOrder failed: ${extractMessage(error)}`); + } + } + + async cancelOrders(params: { symbol: string; orderIdList: Array }): Promise { + await this.ensureInitialized(params.symbol); + const market = this.resolveMarket(params.symbol); + const exchange = this.getExchange(market.kind); + const errors: Array<{ orderId: number | string; error: unknown }> = []; + await Promise.all( + params.orderIdList.map(async (orderId) => { + try { + await exchange.cancelOrder(orderId, market.symbol); + this.removeOrder(market.kind, market.id, String(orderId)); + } catch (error) { + errors.push({ orderId, error }); + } + }) + ); + if (errors.length) { + const detail = errors.map((entry) => `${entry.orderId}: ${extractMessage(entry.error)}`).join("; "); + throw new Error(`Binance cancelOrders failed: ${detail}`); + } + } + + async cancelAllOrders(params: { symbol: string }): Promise { + await this.ensureInitialized(params.symbol); + const market = this.resolveMarket(params.symbol); + const exchange = this.getExchange(market.kind); + try { + if (typeof exchange.cancelAllOrders === "function") { + await exchange.cancelAllOrders(market.symbol); + } else { + const openOrders = (await exchange.fetchOpenOrders(market.symbol)) as CcxtOrder[]; + await Promise.all(openOrders.map((order) => exchange.cancelOrder(order.id, market.symbol))); + } + this.removeOrdersByMarket(market.kind, market.id); + } catch (error) { + throw new Error(`Binance cancelAllOrders failed: ${extractMessage(error)}`); + } + } + + async getPrecision(symbol?: string): Promise { + await this.ensureInitialized(symbol ?? this.defaultSymbol); + const market = this.resolveMarket(symbol ?? this.defaultSymbol); + const exchange = this.getExchange(market.kind); + const marketInfo = exchange.markets?.[market.symbol] ?? null; + if (!marketInfo) return null; + + const filters = Array.isArray(marketInfo?.info?.filters) ? marketInfo.info.filters : []; + const priceFilter = filters.find((f: any) => String(f?.filterType ?? "").toUpperCase() === "PRICE_FILTER"); + const lotFilter = filters.find((f: any) => String(f?.filterType ?? "").toUpperCase() === "LOT_SIZE"); + const notionalFilter = filters.find((f: any) => + ["MIN_NOTIONAL", "NOTIONAL"].includes(String(f?.filterType ?? "").toUpperCase()) + ); + + const tickSize = Number(priceFilter?.tickSize ?? 0); + const qtyStep = Number(lotFilter?.stepSize ?? 0); + const minBase = Number(lotFilter?.minQty ?? 0); + const minQuote = Number(notionalFilter?.minNotional ?? 0); + + const priceTick = Number.isFinite(tickSize) && tickSize > 0 + ? tickSize + : Math.pow(10, -(Number(marketInfo.precision?.price ?? 1))); + const step = Number.isFinite(qtyStep) && qtyStep > 0 + ? qtyStep + : Math.pow(10, -(Number(marketInfo.precision?.amount ?? 1))); + + return { + priceTick, + qtyStep: step, + priceDecimals: Number.isFinite(Number(marketInfo.precision?.price)) ? Number(marketInfo.precision.price) : undefined, + sizeDecimals: Number.isFinite(Number(marketInfo.precision?.amount)) ? Number(marketInfo.precision.amount) : undefined, + minBaseAmount: Number.isFinite(minBase) && minBase > 0 ? minBase : undefined, + minQuoteAmount: Number.isFinite(minQuote) && minQuote > 0 ? minQuote : undefined, + }; + } + + async queryOpenOrders(): Promise { + await this.ensureInitialized(this.defaultSymbol); + const kinds = this.getPrivateKinds(); + const result: AsterOrder[] = []; + for (const kind of kinds) { + const exchange = this.getExchange(kind); + const openOrders = (await exchange.fetchOpenOrders()) as CcxtOrder[]; + for (const order of openOrders) { + const market = this.resolveMarketByCcxtSymbol(kind, String(order.symbol ?? "")); + const mapped = this.mapCcxtOrder(order, kind, market?.id ?? String(order.symbol ?? "")); + if (this.isOrderActive(mapped)) { + result.push(mapped); + } + } + } + return result; + } + + async queryAccountSnapshot(): Promise { + await this.ensureInitialized(this.defaultSymbol); + const kinds = this.getPrivateKinds(); + for (const kind of kinds) { + await this.fetchAndUpdateAccount(kind); + } + return this.buildCombinedAccountSnapshot(); + } + + async changeMarginMode(symbol: string, marginMode: "isolated" | "cross"): Promise { + await this.ensureInitialized(symbol); + const market = this.resolveMarket(symbol, "perp"); + const exchange = this.getExchange("perp"); + if (typeof exchange.setMarginMode !== "function") { + throw new Error("Binance setMarginMode is not supported by current ccxt build"); + } + await exchange.setMarginMode(marginMode, market.symbol); + } + + async forceCancelAllOrders(): Promise { + await this.ensureInitialized(this.defaultSymbol); + const market = this.defaultMarket ?? this.resolveMarket(this.defaultSymbol); + await this.cancelAllOrders({ symbol: this.resolveDisplaySymbol(market.kind, market.id) }); + const open = await this.queryOpenOrders(); + return open.length === 0; + } + + private activateKind(kind: MarketKind): void { + if (!this.activeKinds.has(kind)) { + this.activeKinds.add(kind); + } + if (this.accountListeners.size || this.orderListeners.size) { + this.ensureUserStream(kind); + } + } + + private ensurePrivateStreaming(): void { + for (const kind of this.getPrivateKinds()) { + this.ensureUserStream(kind); + } + } + + private ensureUserStream(kind: MarketKind): void { + const state = this.userStreams[kind]; + if (state.active) return; + state.active = true; + state.reconnectDelayMs = RECONNECT_BASE_DELAY_MS; + void this.bootstrapUserStream(state); + } + + private stopUserStream(kind: MarketKind): void { + const state = this.userStreams[kind]; + state.active = false; + if (state.keepaliveTimer) { + clearInterval(state.keepaliveTimer); + state.keepaliveTimer = null; + } + if (state.reconnectTimer) { + clearTimeout(state.reconnectTimer); + state.reconnectTimer = null; + } + if (state.ws) { + try { + state.ws.close(); + } catch { + // ignore + } + state.ws = null; + } + state.listenKey = null; + } + + private async bootstrapUserStream(state: UserStreamState): Promise { + if (!state.active || this.destroyed) return; + try { + const listenKey = await this.createListenKey(state.kind); + state.listenKey = listenKey; + this.startListenKeyKeepAlive(state); + this.connectUserSocket(state); + } catch (error) { + this.logger(`userStream:${state.kind}:bootstrap`, error); + this.scheduleUserReconnect(state); + } + } + + private connectUserSocket(state: UserStreamState): void { + if (!state.active || !state.listenKey || this.destroyed) return; + if (state.ws && (state.ws.readyState === WebSocketCtor.OPEN || state.ws.readyState === WebSocketCtor.CONNECTING)) { + return; + } + const url = this.buildWsUrl(state.kind, state.listenKey); + const ws = new WebSocketCtor(url); + state.ws = ws; + + const handleOpen = () => { + state.reconnectDelayMs = RECONNECT_BASE_DELAY_MS; + }; + + const handleClose = () => { + if (state.ws === ws) { + state.ws = null; + } + if (!state.active || this.destroyed) return; + this.scheduleUserReconnect(state); + }; + + const handleError = (error: unknown) => { + this.logger(`userStream:${state.kind}:error`, error); + }; + + const handleMessage = (payload: unknown) => { + this.handleUserPayload(state.kind, payload); + }; + + this.bindWsListeners(ws, handleOpen, handleMessage, handleClose, handleError); + } + + private scheduleUserReconnect(state: UserStreamState): void { + if (!state.active || this.destroyed) return; + if (state.reconnectTimer) return; + state.reconnectTimer = setTimeout(() => { + state.reconnectTimer = null; + state.reconnectDelayMs = Math.min(state.reconnectDelayMs * 2, RECONNECT_MAX_DELAY_MS); + void this.bootstrapUserStream(state); + }, state.reconnectDelayMs); + } + + private startListenKeyKeepAlive(state: UserStreamState): void { + if (state.keepaliveTimer) { + clearInterval(state.keepaliveTimer); + } + state.keepaliveTimer = setInterval(() => { + void this.keepAliveListenKey(state); + }, LISTEN_KEY_KEEPALIVE_MS); + } + + private async keepAliveListenKey(state: UserStreamState): Promise { + if (!state.active || !state.listenKey) return; + try { + await this.callListenKeyEndpoint(state.kind, "PUT", state.listenKey); + } catch (error) { + this.logger(`listenKeyKeepalive:${state.kind}`, error); + } + } + + private async createListenKey(kind: MarketKind): Promise { + const data = await this.callListenKeyEndpoint(kind, "POST"); + const listenKey = String(data?.listenKey ?? ""); + if (!listenKey) { + throw new Error(`Binance ${kind} listenKey is missing`); + } + return listenKey; + } + + private async callListenKeyEndpoint(kind: MarketKind, method: "POST" | "PUT", listenKey?: string): Promise { + const endpoint = kind === "spot" ? "/api/v3/userDataStream" : "/fapi/v1/listenKey"; + const base = kind === "spot" ? this.spotRestUrl : this.futuresRestUrl; + const url = `${base}${endpoint}`; + const payload = new URLSearchParams(); + if (listenKey) payload.set("listenKey", listenKey); + const response = await axios.request({ + method, + url, + headers: { "X-MBX-APIKEY": this.apiKey }, + data: payload.toString(), + timeout: 15_000, + }); + return response.data; + } + + private handleUserPayload(kind: MarketKind, rawPayload: unknown): void { + const decoded = decodeWsData(rawPayload); + const payload = decoded && typeof decoded === "object" && "data" in (decoded as any) + ? (decoded as any).data + : decoded; + if (!payload || typeof payload !== "object") return; + + const eventType = String((payload as any).e ?? "").toUpperCase(); + if (!eventType) return; + + if (kind === "spot") { + if (eventType === "EXECUTIONREPORT") { + const order = this.mapSpotExecutionReport(payload); + if (order) { + this.upsertOrder(order, "spot", order.symbol); + } + return; + } + if (eventType === "OUTBOUNDACCOUNTPOSITION") { + this.applySpotAccountPositionEvent(payload); + this.emitAccount(); + return; + } + if (eventType === "BALANCEUPDATE") { + this.applySpotBalanceUpdateEvent(payload); + this.emitAccount(); + return; + } + return; + } + + if (eventType === "ORDER_TRADE_UPDATE") { + const order = this.mapPerpOrderTradeUpdate(payload); + if (order) { + this.upsertOrder(order, "perp", order.symbol); + } + return; + } + if (eventType === "ACCOUNT_UPDATE") { + this.applyPerpAccountUpdateEvent(payload); + this.emitAccount(); + return; + } + } + + private applySpotAccountPositionEvent(payload: any): void { + const balances = Array.isArray(payload?.B) ? payload.B : []; + for (const entry of balances) { + const asset = String(entry?.a ?? "").toUpperCase(); + if (!asset) continue; + const free = toNumber(entry?.f); + const locked = toNumber(entry?.l); + if (Math.abs(free) < 1e-12 && Math.abs(locked) < 1e-12) { + this.spotBalances.delete(asset); + } else { + this.spotBalances.set(asset, { free, locked }); + } + } + this.lastSpotSnapshot = this.buildSpotSnapshot(); + } + + private applySpotBalanceUpdateEvent(payload: any): void { + const asset = String(payload?.a ?? "").toUpperCase(); + if (!asset) return; + const delta = toNumber(payload?.d); + const prev = this.spotBalances.get(asset) ?? { free: 0, locked: 0 }; + const next = { ...prev, free: prev.free + delta }; + if (Math.abs(next.free) < 1e-12 && Math.abs(next.locked) < 1e-12) { + this.spotBalances.delete(asset); + } else { + this.spotBalances.set(asset, next); + } + this.lastSpotSnapshot = this.buildSpotSnapshot(); + } + + private applyPerpAccountUpdateEvent(payload: any): void { + const account = payload?.a; + const balances = Array.isArray(account?.B) ? account.B : []; + const positions = Array.isArray(account?.P) ? account.P : []; + const updateTime = Number(payload?.E ?? payload?.T ?? Date.now()); + + for (const entry of balances) { + const asset = String(entry?.a ?? "").toUpperCase(); + if (!asset) continue; + const wallet = toNumber(entry?.wb); + const available = toNumber(entry?.cw ?? entry?.wb); + if (Math.abs(wallet) < 1e-12 && Math.abs(available) < 1e-12) { + this.perpBalances.delete(asset); + } else { + this.perpBalances.set(asset, { wallet, available }); + } + } + + for (const position of positions) { + const symbolRaw = String(position?.s ?? "").toUpperCase(); + if (!symbolRaw) continue; + const amount = toNumber(position?.pa); + const symbol = this.resolveDisplaySymbol("perp", symbolRaw); + const key = symbol; + if (Math.abs(amount) < 1e-12) { + this.perpPositions.delete(key); + continue; + } + + const mark = this.lastMarkPriceBySymbol.get(symbolRaw); + this.perpPositions.set(key, { + symbol, + positionAmt: String(amount), + entryPrice: String(toNumber(position?.ep)), + unrealizedProfit: String(toNumber(position?.up)), + positionSide: normalizePositionSide(position?.ps), + updateTime: Number.isFinite(updateTime) ? updateTime : Date.now(), + marginType: position?.mt != null ? String(position.mt) : undefined, + isolatedMargin: position?.iw != null ? String(position.iw) : undefined, + markPrice: mark != null ? String(mark) : undefined, + }); + } + + this.lastPerpSnapshot = this.buildPerpSnapshot(); + } + + private mapSpotExecutionReport(payload: any): AsterOrder | null { + const order = payload; + const symbolRaw = String(order?.s ?? "").toUpperCase(); + if (!symbolRaw) return null; + const symbol = this.resolveDisplaySymbol("spot", symbolRaw); + const executedQty = toNumber(order?.z); + const cumQuote = toNumber(order?.Z); + const avgPrice = executedQty > 0 ? cumQuote / executedQty : 0; + + return { + orderId: String(order?.i ?? ""), + clientOrderId: String(order?.c ?? ""), + symbol, + side: String(order?.S ?? "BUY").toUpperCase() === "SELL" ? "SELL" : "BUY", + type: this.mapBinanceOrderTypeToAster(order?.o, "spot"), + status: String(order?.X ?? ""), + price: String(order?.p ?? "0"), + origQty: String(order?.q ?? "0"), + executedQty: String(order?.z ?? "0"), + stopPrice: String(order?.P ?? "0"), + time: Number(order?.O ?? order?.T ?? Date.now()), + updateTime: Number(order?.E ?? order?.T ?? Date.now()), + reduceOnly: false, + closePosition: false, + avgPrice: Number.isFinite(avgPrice) ? String(avgPrice) : undefined, + cumQuote: String(order?.Z ?? "0"), + timeInForce: normalizeTimeInForce(order?.f), + }; + } + + private mapPerpOrderTradeUpdate(payload: any): AsterOrder | null { + const order = payload?.o; + if (!order) return null; + const symbolRaw = String(order?.s ?? "").toUpperCase(); + if (!symbolRaw) return null; + const symbol = this.resolveDisplaySymbol("perp", symbolRaw); + return { + orderId: String(order?.i ?? ""), + clientOrderId: String(order?.c ?? ""), + symbol, + side: String(order?.S ?? "BUY").toUpperCase() === "SELL" ? "SELL" : "BUY", + type: this.mapBinanceOrderTypeToAster(order?.o, "perp"), + status: String(order?.X ?? ""), + price: String(order?.p ?? "0"), + origQty: String(order?.q ?? "0"), + executedQty: String(order?.z ?? "0"), + stopPrice: String(order?.sp ?? "0"), + time: Number(order?.T ?? payload?.E ?? Date.now()), + updateTime: Number(payload?.E ?? order?.T ?? Date.now()), + reduceOnly: Boolean(order?.R), + closePosition: Boolean(order?.cp), + workingType: order?.wt != null ? String(order.wt) : undefined, + activationPrice: order?.AP != null ? String(order.AP) : undefined, + avgPrice: order?.ap != null ? String(order.ap) : undefined, + cumQuote: order?.Z != null ? String(order.Z) : undefined, + positionSide: normalizePositionSide(order?.ps), + timeInForce: normalizeTimeInForce(order?.f), + }; + } + + private ensureSubscription( + map: Map>, + key: string, + kind: MarketKind, + stream: string, + transform: (payload: unknown) => T | null + ): PublicSubscription { + const existing = map.get(key); + if (existing) return existing; + + const subscription: PublicSubscription = { + kind, + stream, + listeners: new Set(), + transform, + ws: null, + reconnectTimer: null, + reconnectDelayMs: RECONNECT_BASE_DELAY_MS, + }; + map.set(key, subscription); + this.connectSubscription(map, key, subscription); + return subscription; + } + + private connectSubscription( + map: Map>, + key: string, + subscription: PublicSubscription + ): void { + if (this.destroyed) return; + const url = this.buildWsUrl(subscription.kind, subscription.stream); + const ws = new WebSocketCtor(url); + subscription.ws = ws; + + const handleOpen = () => { + subscription.reconnectDelayMs = RECONNECT_BASE_DELAY_MS; + }; + + const handleClose = () => { + if (subscription.ws === ws) { + subscription.ws = null; + } + if (this.destroyed) return; + this.scheduleSubscriptionReconnect(map, key, subscription); + }; + + const handleError = (error: unknown) => { + this.logger(`publicWs:${key}`, error); + }; + + const handleMessage = (rawPayload: unknown) => { + const decoded = decodeWsData(rawPayload); + const payload = decoded && typeof decoded === "object" && "data" in (decoded as any) + ? (decoded as any).data + : decoded; + if (!payload) return; + const mapped = subscription.transform(payload); + if (!mapped) return; + for (const listener of subscription.listeners) { + try { + listener(mapped); + } catch (error) { + this.logger(`publicListener:${key}`, error); + } + } + }; + + this.bindWsListeners(ws, handleOpen, handleMessage, handleClose, handleError); + } + + private scheduleSubscriptionReconnect( + map: Map>, + key: string, + subscription: PublicSubscription + ): void { + if (this.destroyed) return; + if (subscription.reconnectTimer) return; + subscription.reconnectTimer = setTimeout(() => { + subscription.reconnectTimer = null; + subscription.reconnectDelayMs = Math.min(subscription.reconnectDelayMs * 2, RECONNECT_MAX_DELAY_MS); + this.connectSubscription(map, key, subscription); + }, subscription.reconnectDelayMs); + } + + private closeSubscription(subscription: PublicSubscription): void { + if (subscription.reconnectTimer) { + clearTimeout(subscription.reconnectTimer); + subscription.reconnectTimer = null; + } + if (subscription.ws) { + try { + subscription.ws.close(); + } catch { + // ignore + } + subscription.ws = null; + } + } + + private bindWsListeners( + ws: WebSocket, + onOpen: () => void, + onMessage: (data: unknown) => void, + onClose: () => void, + onError: (error: unknown) => void + ): void { + const handlePing = (data: unknown) => { + if (ws && "pong" in ws && typeof (ws as any).pong === "function") { + try { + (ws as any).pong(data as any); + } catch (error) { + this.logger("wsPong", error); + } + } + }; + + if ("addEventListener" in ws && typeof ws.addEventListener === "function") { + ws.addEventListener("open", onOpen as any); + ws.addEventListener("message", ((event: MessageEvent) => onMessage(event.data)) as any); + ws.addEventListener("close", onClose as any); + ws.addEventListener("error", ((event: Event) => onError((event as any)?.error ?? event)) as any); + ws.addEventListener("ping", (handlePing as any)); + return; + } + + if ("on" in ws && typeof (ws as any).on === "function") { + const socket = ws as any; + socket.on("open", onOpen); + socket.on("message", onMessage); + socket.on("close", onClose); + socket.on("error", onError); + socket.on("ping", handlePing); + return; + } + + (ws as any).onopen = onOpen; + (ws as any).onmessage = (event: any) => onMessage(event?.data); + (ws as any).onclose = onClose; + (ws as any).onerror = (event: any) => onError(event?.error ?? event); + } + + private mapDepthPayload(payload: unknown, market: BinanceMarketRef): AsterDepth | null { + const data = payload as any; + const bids = Array.isArray(data?.b) ? data.b : []; + const asks = Array.isArray(data?.a) ? data.a : []; + if (!bids.length || !asks.length) return null; + return { + lastUpdateId: Number(data?.u ?? data?.lastUpdateId ?? Date.now()), + bids: bids + .filter((entry: any) => Array.isArray(entry) && entry.length >= 2) + .map((entry: any) => [String(entry[0]), String(entry[1])]), + asks: asks + .filter((entry: any) => Array.isArray(entry) && entry.length >= 2) + .map((entry: any) => [String(entry[0]), String(entry[1])]), + eventTime: Number(data?.E ?? Date.now()), + symbol: this.resolveDisplaySymbol(market.kind, market.id), + }; + } + + private mapTickerPayload(payload: unknown, market: BinanceMarketRef): AsterTicker | null { + const data = payload as any; + const lastPrice = String(data?.c ?? ""); + if (!lastPrice) return null; + const displaySymbol = this.resolveDisplaySymbol(market.kind, market.id); + const mark = toNumber(data?.w); + if (Number.isFinite(mark) && mark > 0) { + this.lastMarkPriceBySymbol.set(market.id, mark); + } + return { + symbol: displaySymbol, + lastPrice, + openPrice: String(data?.o ?? "0"), + highPrice: String(data?.h ?? "0"), + lowPrice: String(data?.l ?? "0"), + volume: String(data?.v ?? "0"), + quoteVolume: String(data?.q ?? "0"), + eventTime: Number(data?.E ?? Date.now()), + priceChange: data?.p != null ? String(data.p) : undefined, + priceChangePercent: data?.P != null ? String(data.P) : undefined, + weightedAvgPrice: data?.w != null ? String(data.w) : undefined, + bidPrice: data?.b != null ? String(data.b) : undefined, + askPrice: data?.a != null ? String(data.a) : undefined, + markPrice: data?.w != null ? String(data.w) : undefined, + }; + } + + private mapKlinePayload(payload: unknown, interval: string): AsterKline[] | null { + const data = payload as any; + const kline = data?.k; + if (!kline) return null; + return [ + { + eventType: String(data?.e ?? "kline"), + eventTime: Number(data?.E ?? Date.now()), + symbol: String(data?.s ?? ""), + interval, + openTime: Number(kline?.t ?? Date.now()), + closeTime: Number(kline?.T ?? Date.now()), + open: String(kline?.o ?? "0"), + close: String(kline?.c ?? "0"), + high: String(kline?.h ?? "0"), + low: String(kline?.l ?? "0"), + volume: String(kline?.v ?? "0"), + numberOfTrades: Number(kline?.n ?? 0), + quoteAssetVolume: kline?.q != null ? String(kline.q) : undefined, + takerBuyBaseAssetVolume: kline?.V != null ? String(kline.V) : undefined, + takerBuyQuoteAssetVolume: kline?.Q != null ? String(kline.Q) : undefined, + isClosed: Boolean(kline?.x), + }, + ]; + } + + private mapFundingPayload( + payload: unknown, + market: BinanceMarketRef + ): { symbol: string; fundingRate: number; updateTime: number } | null { + const data = payload as any; + const rate = Number(data?.r); + if (!Number.isFinite(rate)) return null; + const markPrice = Number(data?.p); + if (Number.isFinite(markPrice) && markPrice > 0) { + this.lastMarkPriceBySymbol.set(market.id, markPrice); + } + return { + symbol: this.resolveDisplaySymbol(market.kind, market.id), + fundingRate: rate, + updateTime: Number(data?.E ?? Date.now()), + }; + } + + private startAccountPolling(): void { + if (this.accountPollTimer) return; + const poll = async () => { + if (!this.accountListeners.size) return; + try { + for (const kind of this.getPrivateKinds()) { + await this.fetchAndUpdateAccount(kind); + } + this.emitAccount(); + } catch (error) { + this.logger("accountPoll", error); + } + }; + void poll(); + this.accountPollTimer = setInterval(() => { + void poll(); + }, this.pollIntervals.account); + } + + private startOrderPolling(): void { + if (this.orderPollTimer) return; + const poll = async () => { + if (!this.orderListeners.size) return; + try { + for (const kind of this.getPrivateKinds()) { + await this.fetchAndUpdateOrders(kind); + } + this.emitOrders(); + } catch (error) { + this.logger("ordersPoll", error); + } + }; + void poll(); + this.orderPollTimer = setInterval(() => { + void poll(); + }, this.pollIntervals.orders); + } + + private stopPolling(): void { + if (this.accountPollTimer) { + clearInterval(this.accountPollTimer); + this.accountPollTimer = null; + } + if (this.orderPollTimer) { + clearInterval(this.orderPollTimer); + this.orderPollTimer = null; + } + } + + private async fetchAndUpdateAccount(kind: MarketKind): Promise { + if (kind === "spot") { + const balance = (await this.spotExchange.fetchBalance()) as Balances; + this.applySpotBalanceSnapshot(balance); + this.lastSpotSnapshot = this.buildSpotSnapshot(); + return; + } + const balance = (await this.perpExchange.fetchBalance()) as Balances; + this.applyPerpBalanceSnapshot(balance); + await this.attachPerpPositions(); + this.lastPerpSnapshot = this.buildPerpSnapshot(); + } + + private applySpotBalanceSnapshot(balance: Balances): void { + const freeMap = (balance.free ?? {}) as Record; + const usedMap = (balance.used ?? {}) as Record; + const keys = new Set([...Object.keys(freeMap), ...Object.keys(usedMap)]); + this.spotBalances.clear(); + for (const asset of keys) { + const free = toNumber(freeMap[asset]); + const locked = toNumber(usedMap[asset]); + if (Math.abs(free) < 1e-12 && Math.abs(locked) < 1e-12) continue; + this.spotBalances.set(asset.toUpperCase(), { free, locked }); + } + } + + private applyPerpBalanceSnapshot(balance: Balances): void { + const total = (balance.total ?? {}) as Record; + const free = (balance.free ?? {}) as Record; + this.perpBalances.clear(); + for (const asset of Object.keys(total)) { + const wallet = toNumber(total[asset]); + const available = toNumber(free[asset] ?? wallet); + if (Math.abs(wallet) < 1e-12 && Math.abs(available) < 1e-12) continue; + this.perpBalances.set(asset.toUpperCase(), { wallet, available }); + } + } + + private async attachPerpPositions(): Promise { + const next = new Map(); + try { + const raw = (await this.perpExchange.fetchPositions()) as any[]; + for (const row of raw ?? []) { + const amount = toNumber(row?.contracts ?? row?.positionAmt ?? row?.info?.positionAmt); + if (Math.abs(amount) < 1e-12) continue; + const id = String(row?.id ?? row?.symbol ?? row?.info?.symbol ?? "").toUpperCase(); + if (!id) continue; + const market = this.resolveMarketByCcxtSymbol("perp", String(row?.symbol ?? "")); + const symbol = this.resolveDisplaySymbol("perp", market?.id ?? id); + const markFromTicker = this.lastMarkPriceBySymbol.get(market?.id ?? id); + next.set(symbol, { + symbol, + positionAmt: String(amount), + entryPrice: String(toNumber(row?.entryPrice ?? row?.info?.entryPrice)), + unrealizedProfit: String(toNumber(row?.unrealizedPnl ?? row?.info?.unrealizedProfit)), + positionSide: normalizePositionSide(row?.side ?? row?.info?.positionSide), + updateTime: Date.now(), + markPrice: Number.isFinite(toNumber(row?.markPrice)) + ? String(toNumber(row?.markPrice)) + : markFromTicker != null + ? String(markFromTicker) + : undefined, + }); + } + } catch (error) { + this.logger("fetchPositions", error); + } + this.perpPositions.clear(); + for (const [key, value] of next.entries()) { + this.perpPositions.set(key, value); + } + } + + private async fetchAndUpdateOrders(kind: MarketKind): Promise { + const exchange = this.getExchange(kind); + const openOrders = (await exchange.fetchOpenOrders()) as CcxtOrder[]; + const remote = new Map(); + for (const order of openOrders) { + const market = this.resolveMarketByCcxtSymbol(kind, String(order?.symbol ?? "")); + const mapped = this.mapCcxtOrder(order, kind, market?.id ?? String(order?.symbol ?? "")); + if (!this.isOrderActive(mapped)) continue; + remote.set(hashOrderKey(kind, mapped.symbol, String(mapped.orderId)), mapped); + } + + for (const key of Array.from(this.localOrders.keys())) { + if (!key.startsWith(`${kind}:`)) continue; + if (!remote.has(key)) this.localOrders.delete(key); + } + for (const [key, value] of remote.entries()) { + this.localOrders.set(key, value); + } + } + + private emitAccount(): void { + if (!this.accountListeners.size) return; + const snapshot = this.buildCombinedAccountSnapshot(); + if (!snapshot) return; + for (const listener of this.accountListeners) { + try { + listener(snapshot); + } catch (error) { + this.logger("emitAccount", error); + } + } + } + + private emitOrders(): void { + if (!this.orderListeners.size) return; + const orders = Array.from(this.localOrders.values()).filter((order) => this.isOrderActive(order)); + for (const listener of this.orderListeners) { + try { + listener(orders); + } catch (error) { + this.logger("emitOrders", error); + } + } + } + + private upsertOrder(order: AsterOrder, kind: MarketKind, marketId: string): void { + const id = String(order.orderId); + const symbol = this.resolveDisplaySymbol(kind, marketId); + const normalized = { ...order, symbol }; + const key = hashOrderKey(kind, symbol, id); + if (!this.isOrderActive(normalized)) { + this.localOrders.delete(key); + this.emitOrders(); + return; + } + this.localOrders.set(key, normalized); + this.emitOrders(); + } + + private removeOrder(kind: MarketKind, marketId: string, orderId: string): void { + const symbol = this.resolveDisplaySymbol(kind, marketId); + const key = hashOrderKey(kind, symbol, orderId); + if (this.localOrders.delete(key)) { + this.emitOrders(); + } + } + + private removeOrdersByMarket(kind: MarketKind, marketId: string): void { + const symbol = this.resolveDisplaySymbol(kind, marketId); + const prefix = `${kind}:`; + let changed = false; + for (const [key, order] of this.localOrders.entries()) { + if (!key.startsWith(prefix)) continue; + if (order.symbol !== symbol) continue; + this.localOrders.delete(key); + changed = true; + } + if (changed) this.emitOrders(); + } + + private isOrderActive(order: AsterOrder): boolean { + const status = String(order.status ?? "").toUpperCase(); + if (!status) return true; + if (status === "FILLED" || status === "CANCELED" || status === "CANCELLED" || status === "REJECTED" || status === "EXPIRED") { + return false; + } + if (status.includes("CLOSE")) return false; + return true; + } + + private buildCombinedAccountSnapshot(): AsterAccountSnapshot | null { + const kinds = this.getPrivateKinds(); + if (kinds.length === 0) return null; + if (kinds.length === 1) { + return kinds[0] === "spot" ? this.buildSpotSnapshot() : this.buildPerpSnapshot(); + } + + const spot = this.buildSpotSnapshot(); + const perp = this.buildPerpSnapshot(); + const perpAssetsTagged: AsterAccountAsset[] = perp.assets.map((asset) => ({ + ...asset, + asset: `${asset.asset}0`, + })); + const assets = [...spot.assets, ...perpAssetsTagged]; + return { + canTrade: true, + canDeposit: true, + canWithdraw: true, + updateTime: Math.max(spot.updateTime, perp.updateTime), + totalWalletBalance: String(toNumber(spot.totalWalletBalance) + toNumber(perp.totalWalletBalance)), + totalUnrealizedProfit: perp.totalUnrealizedProfit, + positions: perp.positions, + assets, + marketType: "perp", + baseAsset: perp.baseAsset, + quoteAsset: perp.quoteAsset, + }; + } + + private buildSpotSnapshot(): AsterAccountSnapshot { + const assets: AsterAccountAsset[] = []; + let totalWallet = 0; + const now = Date.now(); + for (const [asset, balance] of this.spotBalances.entries()) { + const wallet = balance.free + balance.locked; + totalWallet += wallet; + assets.push({ + asset, + walletBalance: String(wallet), + availableBalance: String(balance.free), + updateTime: now, + }); + } + const market = this.defaultKind === "spot" ? this.defaultMarket : null; + return { + canTrade: true, + canDeposit: true, + canWithdraw: true, + updateTime: now, + totalWalletBalance: String(totalWallet), + totalUnrealizedProfit: "0", + positions: [], + assets, + marketType: "spot", + baseAsset: market?.base, + quoteAsset: market?.quote, + }; + } + + private buildPerpSnapshot(): AsterAccountSnapshot { + const now = Date.now(); + const assets: AsterAccountAsset[] = []; + let totalWallet = 0; + for (const [asset, balance] of this.perpBalances.entries()) { + totalWallet += balance.wallet; + assets.push({ + asset, + walletBalance: String(balance.wallet), + availableBalance: String(balance.available), + updateTime: now, + }); + } + + const positions = Array.from(this.perpPositions.values()); + let totalUnrealized = 0; + for (const position of positions) { + totalUnrealized += toNumber(position.unrealizedProfit); + } + const market = this.defaultKind === "perp" ? this.defaultMarket : null; + return { + canTrade: true, + canDeposit: true, + canWithdraw: true, + updateTime: now, + totalWalletBalance: String(totalWallet), + totalUnrealizedProfit: String(totalUnrealized), + positions, + assets, + marketType: "perp", + baseAsset: market?.base, + quoteAsset: market?.quote, + }; + } + + private mapCcxtOrder(order: CcxtOrder, kind: MarketKind, marketId: string): AsterOrder { + const symbol = this.resolveDisplaySymbol(kind, marketId); + const side = String(order.side ?? "buy").toUpperCase() === "SELL" ? "SELL" : "BUY"; + return { + orderId: String(order.id ?? ""), + clientOrderId: String(order.clientOrderId ?? ""), + symbol, + side, + type: this.mapCcxtOrderTypeToAster(order.type, kind), + status: String(order.status ?? ""), + price: String(order.price ?? 0), + origQty: String(order.amount ?? 0), + executedQty: String(order.filled ?? 0), + stopPrice: String(order.stopPrice ?? 0), + time: Number(order.timestamp ?? Date.now()), + updateTime: Number(order.lastUpdateTimestamp ?? order.timestamp ?? Date.now()), + reduceOnly: Boolean((order.info as any)?.reduceOnly ?? false), + closePosition: Boolean((order.info as any)?.closePosition ?? false), + avgPrice: order.average != null ? String(order.average) : undefined, + cumQuote: order.cost != null ? String(order.cost) : undefined, + timeInForce: normalizeTimeInForce(order.timeInForce), + positionSide: normalizePositionSide((order.info as any)?.positionSide), + }; + } + + private mapOrderTypeToCcxt(type: OrderType, kind: MarketKind): string { + if (kind === "spot") { + if (type === "STOP_MARKET") return "stop_loss"; + if (type === "TAKE_PROFIT_MARKET") return "take_profit"; + return type.toLowerCase(); + } + const map: Record = { + LIMIT: "limit", + MARKET: "market", + STOP: "stop", + STOP_MARKET: "stop_market", + TAKE_PROFIT: "take_profit", + TAKE_PROFIT_MARKET: "take_profit_market", + TRAILING_STOP_MARKET: "trailing_stop_market", + }; + return map[type] ?? "limit"; + } + + private mapCcxtOrderTypeToAster(type: string | undefined, kind: MarketKind): OrderType { + const normalized = String(type ?? "").toLowerCase(); + if (kind === "spot") { + if (normalized.includes("stop")) return "STOP_MARKET"; + if (normalized.includes("take_profit")) return "TAKE_PROFIT_MARKET"; + if (normalized.includes("market")) return "MARKET"; + return "LIMIT"; + } + if (normalized === "market") return "MARKET"; + if (normalized === "stop" || normalized === "stop_market") return "STOP_MARKET"; + if (normalized === "trailing_stop_market" || normalized === "trailing-stop") return "TRAILING_STOP_MARKET"; + if (normalized === "take_profit_market") return "TAKE_PROFIT_MARKET"; + if (normalized === "take_profit") return "TAKE_PROFIT"; + return "LIMIT"; + } + + private mapBinanceOrderTypeToAster(type: unknown, kind: MarketKind): OrderType { + const upper = String(type ?? "").toUpperCase(); + if (upper === "MARKET") return "MARKET"; + if (upper === "TRAILING_STOP_MARKET") return "TRAILING_STOP_MARKET"; + if (upper.includes("STOP")) return "STOP_MARKET"; + if (upper.includes("TAKE_PROFIT")) return "TAKE_PROFIT_MARKET"; + if (kind === "spot" && upper === "STOP_LOSS_LIMIT") return "STOP_MARKET"; + return "LIMIT"; + } + + private getExchange(kind: MarketKind): any { + return kind === "spot" ? this.spotExchange : this.perpExchange; + } + + private getPrivateKinds(): MarketKind[] { + if (this.activeKinds.size > 0) { + return Array.from(this.activeKinds.values()); + } + return [this.defaultKind]; + } + + private rebuildMarketIndex(kind: MarketKind): void { + const index = this.marketIndex[kind]; + index.clear(); + const exchange = this.getExchange(kind); + const markets = exchange.markets ?? {}; + for (const market of Object.values(markets) as any[]) { + const symbol = String(market?.symbol ?? "").trim(); + if (!symbol) continue; + const id = String(market?.id ?? symbol).trim().toUpperCase(); + const ref: BinanceMarketRef = { + kind, + symbol, + id, + base: market?.base != null ? String(market.base).toUpperCase() : undefined, + quote: market?.quote != null ? String(market.quote).toUpperCase() : undefined, + }; + + const keys = new Set([ + symbol.toUpperCase(), + id, + normalizeSymbolKey(symbol), + normalizeSymbolKey(id), + ]); + if (ref.base && ref.quote) { + keys.add(`${ref.base}${ref.quote}`); + } + for (const key of keys) { + if (!key) continue; + if (!index.has(key)) index.set(key, ref); + } + } + } + + private resolveMarket(symbol: string, preferredKind?: MarketKind): BinanceMarketRef { + const parsed = parseSymbolHint(symbol); + const normalized = parsed.normalized; + if (!normalized) { + throw new Error("Binance symbol is required"); + } + + const keys = [normalized.toUpperCase(), normalizeSymbolKey(normalized)]; + const tryResolveIn = (kind: MarketKind): BinanceMarketRef | null => { + const index = this.marketIndex[kind]; + for (const key of keys) { + const found = index.get(key); + if (found) return found; + } + return null; + }; + + const forced = parsed.forcedKind; + if (forced) { + const target = tryResolveIn(forced); + if (!target) { + throw new Error(`Binance symbol ${symbol} is not available on ${forced}`); + } + this.registerAlias(forced, target.id, symbol); + return target; + } + + if (preferredKind) { + const target = tryResolveIn(preferredKind); + if (target) { + this.registerAlias(preferredKind, target.id, symbol); + return target; + } + } + + const spot = tryResolveIn("spot"); + const perp = tryResolveIn("perp"); + if (spot && !perp) { + this.registerAlias("spot", spot.id, symbol); + return spot; + } + if (perp && !spot) { + this.registerAlias("perp", perp.id, symbol); + return perp; + } + if (spot && perp) { + const target = this.defaultKind === "spot" ? spot : perp; + this.registerAlias(target.kind, target.id, symbol); + return target; + } + + throw new Error(`Binance symbol not found: ${symbol}`); + } + + private resolveMarketByCcxtSymbol(kind: MarketKind, ccxtSymbol: string): BinanceMarketRef | null { + const index = this.marketIndex[kind]; + const keyA = ccxtSymbol.toUpperCase(); + const keyB = normalizeSymbolKey(ccxtSymbol); + return index.get(keyA) ?? index.get(keyB) ?? null; + } + + private registerAlias(kind: MarketKind, marketId: string, requestedSymbol: string): void { + const normalized = (requestedSymbol ?? "").trim().toUpperCase(); + if (!normalized) return; + this.symbolAliasByKey.set(`${kind}:${marketId.toUpperCase()}`, normalized); + } + + private resolveDisplaySymbol(kind: MarketKind, marketId: string): string { + const key = `${kind}:${marketId.toUpperCase()}`; + return this.symbolAliasByKey.get(key) ?? marketId.toUpperCase(); + } + + private buildWsUrl(kind: MarketKind, stream: string): string { + const base = kind === "spot" ? this.spotWsUrl : this.futuresWsUrl; + if (base.endsWith("/ws")) return `${base}/${stream}`; + if (base.includes("/stream")) return `${base}?streams=${encodeURIComponent(stream)}`; + return `${base}/ws/${stream}`; + } +} diff --git a/src/exchanges/binance/order.ts b/src/exchanges/binance/order.ts new file mode 100644 index 0000000..9e45889 --- /dev/null +++ b/src/exchanges/binance/order.ts @@ -0,0 +1,100 @@ +import type { AsterOrder, CreateOrderParams } from "../types"; +import type { + BaseOrderIntent, + ClosePositionIntent, + LimitOrderIntent, + MarketOrderIntent, + StopOrderIntent, + TrailingStopOrderIntent, +} from "../order-schema"; +import { toStringBoolean } from "../order-schema"; + +function applyCommonFields(params: CreateOrderParams, intent: BaseOrderIntent): CreateOrderParams { + if (params.quantity === undefined) { + params.quantity = intent.quantity; + } + if (params.timeInForce === undefined && intent.timeInForce) { + params.timeInForce = intent.timeInForce; + } + if (intent.reduceOnly !== undefined) { + params.reduceOnly = toStringBoolean(intent.reduceOnly); + } + if (intent.closePosition !== undefined) { + params.closePosition = toStringBoolean(intent.closePosition); + } + return params; +} + +export async function createLimitOrder(intent: LimitOrderIntent): Promise { + const params: CreateOrderParams = applyCommonFields( + { + symbol: intent.symbol, + side: intent.side, + type: "LIMIT", + quantity: intent.quantity, + price: intent.price, + timeInForce: intent.timeInForce ?? "GTX", + }, + intent + ); + return intent.adapter.createOrder(params); +} + +export async function createMarketOrder(intent: MarketOrderIntent): Promise { + const params: CreateOrderParams = applyCommonFields( + { + symbol: intent.symbol, + side: intent.side, + type: "MARKET", + quantity: intent.quantity, + }, + intent + ); + return intent.adapter.createOrder(params); +} + +export async function createStopOrder(intent: StopOrderIntent): Promise { + const params: CreateOrderParams = applyCommonFields( + { + symbol: intent.symbol, + side: intent.side, + type: "STOP_MARKET", + quantity: intent.quantity, + stopPrice: intent.stopPrice, + timeInForce: intent.timeInForce ?? "GTC", + triggerType: intent.triggerType, + }, + intent + ); + return intent.adapter.createOrder(params); +} + +export async function createTrailingStopOrder(intent: TrailingStopOrderIntent): Promise { + const params: CreateOrderParams = applyCommonFields( + { + symbol: intent.symbol, + side: intent.side, + type: "TRAILING_STOP_MARKET", + quantity: intent.quantity, + activationPrice: intent.activationPrice, + callbackRate: intent.callbackRate, + timeInForce: intent.timeInForce ?? "GTC", + }, + intent + ); + return intent.adapter.createOrder(params); +} + +export async function createClosePositionOrder(intent: ClosePositionIntent): Promise { + const params: CreateOrderParams = applyCommonFields( + { + symbol: intent.symbol, + side: intent.side, + type: "MARKET", + quantity: intent.quantity, + reduceOnly: "true", + }, + intent + ); + return intent.adapter.createOrder(params); +} diff --git a/src/exchanges/create-adapter.ts b/src/exchanges/create-adapter.ts index dfe0c3b..f7980e2 100644 --- a/src/exchanges/create-adapter.ts +++ b/src/exchanges/create-adapter.ts @@ -6,6 +6,25 @@ import { BackpackExchangeAdapter, type BackpackCredentials } from "./backpack/ad import { ParadexExchangeAdapter, type ParadexCredentials } from "./paradex/adapter"; import { NadoExchangeAdapter, type NadoCredentials } from "./nado/adapter"; import { StandxExchangeAdapter, type StandxCredentials } from "./standx/adapter"; +import { BinanceExchangeAdapter, type BinanceCredentials } from "./binance/adapter"; + +export const SUPPORTED_EXCHANGE_IDS = [ + "aster", + "grvt", + "lighter", + "backpack", + "paradex", + "nado", + "standx", + "binance", +] as const; + +export const BASIS_SUPPORTED_EXCHANGE_IDS = [ + "aster", + "nado", + "standx", + "binance", +] as const; export interface ExchangeFactoryOptions { symbol: string; @@ -17,60 +36,73 @@ export interface ExchangeFactoryOptions { paradex?: ParadexCredentials; nado?: NadoCredentials; standx?: StandxCredentials; + binance?: BinanceCredentials; } -export type SupportedExchangeId = - | "aster" - | "grvt" - | "lighter" - | "backpack" - | "paradex" - | "nado" - | "standx"; +export type SupportedExchangeId = (typeof SUPPORTED_EXCHANGE_IDS)[number]; +export type BasisSupportedExchangeId = (typeof BASIS_SUPPORTED_EXCHANGE_IDS)[number]; + +const EXCHANGE_DISPLAY_NAME: Record = { + aster: "AsterDex", + grvt: "GRVT", + lighter: "Lighter", + backpack: "Backpack", + paradex: "Paradex", + nado: "Nado", + standx: "StandX", + binance: "Binance", +}; + +const EXCHANGE_ALIAS_MAP: Record = { + aster: "aster", + grvt: "grvt", + lighter: "lighter", + backpack: "backpack", + paradex: "paradex", + nado: "nado", + standx: "standx", + binance: "binance", + bnb: "binance", +}; + +export function isSupportedExchangeId(value: string): value is SupportedExchangeId { + return SUPPORTED_EXCHANGE_IDS.includes(value as SupportedExchangeId); +} + +export function isBasisSupportedExchangeId(value: string): value is BasisSupportedExchangeId { + return BASIS_SUPPORTED_EXCHANGE_IDS.includes(value as BasisSupportedExchangeId); +} export function resolveExchangeId(value?: string | null): SupportedExchangeId { const fallback = (value ?? process.env.EXCHANGE ?? process.env.TRADE_EXCHANGE ?? "aster") .toString() .trim() .toLowerCase(); - if (fallback === "grvt") return "grvt"; - if (fallback === "lighter") return "lighter"; - if (fallback === "backpack") return "backpack"; - if (fallback === "paradex") return "paradex"; - if (fallback === "nado") return "nado"; - if (fallback === "standx") return "standx"; - return "aster"; + return EXCHANGE_ALIAS_MAP[fallback] ?? "aster"; } export function getExchangeDisplayName(id: SupportedExchangeId): string { - if (id === "grvt") return "GRVT"; - if (id === "lighter") return "Lighter"; - if (id === "backpack") return "Backpack"; - if (id === "paradex") return "Paradex"; - if (id === "nado") return "Nado"; - if (id === "standx") return "StandX"; - return "AsterDex"; + return EXCHANGE_DISPLAY_NAME[id]; } export function createExchangeAdapter(options: ExchangeFactoryOptions): ExchangeAdapter { const id = resolveExchangeId(options.exchange); - if (id === "grvt") { - return new GrvtExchangeAdapter({ ...options.grvt, symbol: options.symbol }); + switch (id) { + case "aster": + return new AsterExchangeAdapter({ ...options.aster, symbol: options.symbol }); + case "grvt": + return new GrvtExchangeAdapter({ ...options.grvt, symbol: options.symbol }); + case "lighter": + return new LighterExchangeAdapter({ ...options.lighter, displaySymbol: options.symbol }); + case "backpack": + return new BackpackExchangeAdapter({ ...options.backpack, symbol: options.symbol }); + case "paradex": + return new ParadexExchangeAdapter({ ...options.paradex, symbol: options.symbol }); + case "nado": + return new NadoExchangeAdapter({ ...options.nado, symbol: options.symbol }); + case "standx": + return new StandxExchangeAdapter({ ...options.standx, symbol: options.symbol }); + case "binance": + return new BinanceExchangeAdapter({ ...options.binance, symbol: options.symbol }); } - if (id === "lighter") { - return new LighterExchangeAdapter({ ...options.lighter, displaySymbol: options.symbol }); - } - if (id === "backpack") { - return new BackpackExchangeAdapter({ ...options.backpack, symbol: options.symbol }); - } - if (id === "paradex") { - return new ParadexExchangeAdapter({ ...options.paradex, symbol: options.symbol }); - } - if (id === "nado") { - return new NadoExchangeAdapter({ ...options.nado, symbol: options.symbol }); - } - if (id === "standx") { - return new StandxExchangeAdapter({ ...options.standx, symbol: options.symbol }); - } - return new AsterExchangeAdapter({ ...options.aster, symbol: options.symbol }); } diff --git a/src/exchanges/order-router.ts b/src/exchanges/order-router.ts index ac7fe3b..714ccb7 100644 --- a/src/exchanges/order-router.ts +++ b/src/exchanges/order-router.ts @@ -1,5 +1,6 @@ import type { ExchangeAdapter } from "./adapter"; import type { AsterOrder } from "./types"; +import { SUPPORTED_EXCHANGE_IDS, type SupportedExchangeId } from "./create-adapter"; import type { BaseOrderIntent, ClosePositionIntent, @@ -15,8 +16,9 @@ import * as lighterOrders from "./lighter/order"; import * as paradexOrders from "./paradex/order"; import * as nadoOrders from "./nado/order"; import * as standxOrders from "./standx/order"; +import * as binanceOrders from "./binance/order"; -type ExchangeKey = "aster" | "backpack" | "grvt" | "lighter" | "paradex" | "nado" | "standx"; +type ExchangeKey = SupportedExchangeId; interface ExchangeOrderHandlers { limit(intent: LimitOrderIntent): Promise; @@ -76,17 +78,16 @@ const handlerMap: Record = { trailingStop: standxOrders.createTrailingStopOrder, close: standxOrders.createClosePositionOrder, }, + binance: { + limit: binanceOrders.createLimitOrder, + market: binanceOrders.createMarketOrder, + stop: binanceOrders.createStopOrder, + trailingStop: binanceOrders.createTrailingStopOrder, + close: binanceOrders.createClosePositionOrder, + }, }; -const knownExchanges: ExchangeKey[] = [ - "aster", - "backpack", - "grvt", - "lighter", - "paradex", - "nado", - "standx", -]; +const knownExchanges: ExchangeKey[] = [...SUPPORTED_EXCHANGE_IDS]; function normalizeExchangeId(value: string | undefined | null): string | undefined { if (!value) return undefined; @@ -98,7 +99,7 @@ function resolveExchangeKey(adapter: ExchangeAdapter): ExchangeKey { const candidates = [fromEnv, normalizeExchangeId(adapter.id)]; for (const candidate of candidates) { if (!candidate) continue; - if ((knownExchanges as string[]).includes(candidate)) { + if (knownExchanges.includes(candidate as ExchangeKey)) { return candidate as ExchangeKey; } } diff --git a/src/exchanges/resolve-from-env.ts b/src/exchanges/resolve-from-env.ts index 76c926a..7d88a93 100644 --- a/src/exchanges/resolve-from-env.ts +++ b/src/exchanges/resolve-from-env.ts @@ -6,6 +6,7 @@ import type { BackpackCredentials } from "./backpack/adapter"; import type { ParadexCredentials } from "./paradex/adapter"; import type { NadoCredentials } from "./nado/adapter"; import type { StandxCredentials } from "./standx/adapter"; +import type { BinanceCredentials } from "./binance/adapter"; import { t } from "../i18n"; import type { Address } from "viem"; @@ -18,37 +19,38 @@ export function buildAdapterFromEnv(options: BuildAdapterOptions): ExchangeAdapt const id = resolveExchangeId(options.exchangeId); const symbol = options.symbol; - if (id === "aster") { - const credentials = resolveAsterCredentials(); - return createExchangeAdapter({ exchange: id, symbol, aster: credentials }); + switch (id) { + case "aster": { + const credentials = resolveAsterCredentials(); + return createExchangeAdapter({ exchange: id, symbol, aster: credentials }); + } + case "grvt": + return createExchangeAdapter({ exchange: id, symbol, grvt: { symbol } }); + case "lighter": { + const credentials = resolveLighterCredentials(symbol); + return createExchangeAdapter({ exchange: id, symbol, lighter: credentials }); + } + case "backpack": { + const credentials = resolveBackpackCredentials(symbol); + return createExchangeAdapter({ exchange: id, symbol, backpack: credentials }); + } + case "paradex": { + const credentials = resolveParadexCredentials(); + return createExchangeAdapter({ exchange: id, symbol, paradex: credentials }); + } + case "nado": { + const credentials = resolveNadoCredentials(symbol); + return createExchangeAdapter({ exchange: id, symbol, nado: credentials }); + } + case "standx": { + const credentials = resolveStandxCredentials(symbol); + return createExchangeAdapter({ exchange: id, symbol, standx: credentials }); + } + case "binance": { + const credentials = resolveBinanceCredentials(symbol); + return createExchangeAdapter({ exchange: id, symbol, binance: credentials }); + } } - - if (id === "lighter") { - const credentials = resolveLighterCredentials(symbol); - return createExchangeAdapter({ exchange: id, symbol, lighter: credentials }); - } - - if (id === "backpack") { - const credentials = resolveBackpackCredentials(symbol); - return createExchangeAdapter({ exchange: id, symbol, backpack: credentials }); - } - - if (id === "paradex") { - const credentials = resolveParadexCredentials(); - return createExchangeAdapter({ exchange: id, symbol, paradex: credentials }); - } - - if (id === "nado") { - const credentials = resolveNadoCredentials(symbol); - return createExchangeAdapter({ exchange: id, symbol, nado: credentials }); - } - - if (id === "standx") { - const credentials = resolveStandxCredentials(symbol); - return createExchangeAdapter({ exchange: id, symbol, standx: credentials }); - } - - return createExchangeAdapter({ exchange: id, symbol, grvt: { symbol } }); } function resolveAsterCredentials(): AsterCredentials { @@ -174,6 +176,30 @@ function resolveStandxCredentials(symbol: string): StandxCredentials { }; } +function resolveBinanceCredentials(symbol: string): BinanceCredentials { + const apiKey = process.env.BINANCE_API_KEY; + const apiSecret = process.env.BINANCE_API_SECRET; + if (!apiKey || !apiSecret) { + throw new Error("Missing BINANCE_API_KEY or BINANCE_API_SECRET environment variable"); + } + + const marketTypeRaw = process.env.BINANCE_MARKET_TYPE?.trim().toLowerCase(); + const marketType: BinanceCredentials["marketType"] = + marketTypeRaw === "spot" ? "spot" : marketTypeRaw === "auto" ? "auto" : "perp"; + + return { + apiKey, + apiSecret, + symbol: process.env.BINANCE_SYMBOL ?? symbol, + marketType, + sandbox: parseOptionalBoolean(process.env.BINANCE_SANDBOX), + spotRestUrl: process.env.BINANCE_SPOT_REST_URL ?? undefined, + futuresRestUrl: process.env.BINANCE_FUTURES_REST_URL ?? undefined, + spotWsUrl: process.env.BINANCE_SPOT_WS_URL ?? undefined, + futuresWsUrl: process.env.BINANCE_FUTURES_WS_URL ?? undefined, + }; +} + function isHex32(value: string): boolean { return /^0x[0-9a-fA-F]{64}$/.test(value.trim()); } diff --git a/src/i18n/index.ts b/src/i18n/index.ts index d316996..7c2eb9f 100644 --- a/src/i18n/index.ts +++ b/src/i18n/index.ts @@ -313,8 +313,8 @@ const translations: Record = { "grid.direction.long": { zh: "多", en: "Long" }, "grid.direction.short": { zh: "空", en: "Short" }, "basis.onlyAster": { - zh: "期现套利策略目前仅支持 Aster / Nado / StandX 交易所。请设置 EXCHANGE=aster 或 EXCHANGE=nado 或 EXCHANGE=standx 后重试。", - en: "Basis arbitrage currently supports only Aster, Nado, and StandX. Set EXCHANGE=aster, EXCHANGE=nado, or EXCHANGE=standx and retry.", + zh: "期现套利策略目前仅支持 Aster / Nado / StandX / Binance。请设置 EXCHANGE=aster、EXCHANGE=nado、EXCHANGE=standx 或 EXCHANGE=binance 后重试。", + en: "Basis arbitrage currently supports Aster, Nado, StandX, and Binance. Set EXCHANGE=aster, EXCHANGE=nado, EXCHANGE=standx, or EXCHANGE=binance and retry.", }, "basis.startFailed": { zh: "无法启动期现套利策略: {message}", diff --git a/src/strategy/basis-arb-engine.ts b/src/strategy/basis-arb-engine.ts index 144f0ea..58c8a22 100644 --- a/src/strategy/basis-arb-engine.ts +++ b/src/strategy/basis-arb-engine.ts @@ -167,7 +167,7 @@ export class BasisArbEngine { } ); - if (this.exchange.id === "nado" || this.exchange.id === "standx") { + if (this.exchange.id === "nado" || this.exchange.id === "standx" || this.exchange.id === "binance") { safeSubscribe( this.exchange.watchDepth.bind(this.exchange, this.config.spotSymbol), (depth) => { @@ -409,8 +409,9 @@ export class BasisArbEngine { if (!Number.isFinite(wallet) || !Number.isFinite(available)) continue; if (Math.abs(wallet) === 0 && Math.abs(available) === 0) continue; - if (name === "USDT0") { - futuresBalances.push({ asset: name, wallet, available }); + const isTaggedFuturesAsset = /0$/.test(name); + if (isTaggedFuturesAsset) { + futuresBalances.push({ asset: name.replace(/0$/, ""), wallet, available }); continue; } const locked = Math.max(wallet - available, 0); diff --git a/src/ui/BasisApp.tsx b/src/ui/BasisApp.tsx index 7b98c42..28c253b 100644 --- a/src/ui/BasisApp.tsx +++ b/src/ui/BasisApp.tsx @@ -1,7 +1,7 @@ import React, { useEffect, useMemo, useRef, useState } from "react"; import { Box, Text, useInput } from "ink"; import { basisConfig } from "../config"; -import { getExchangeDisplayName, resolveExchangeId } from "../exchanges/create-adapter"; +import { getExchangeDisplayName, isBasisSupportedExchangeId, resolveExchangeId } from "../exchanges/create-adapter"; import { buildAdapterFromEnv } from "../exchanges/resolve-from-env"; import { BasisArbEngine, type BasisArbSnapshot } from "../strategy/basis-arb-engine"; import { formatNumber } from "../utils/format"; @@ -31,7 +31,7 @@ export function BasisApp({ onExit }: BasisAppProps) { ); useEffect(() => { - if (exchangeId !== "aster" && exchangeId !== "nado" && exchangeId !== "standx") { + if (!isBasisSupportedExchangeId(exchangeId)) { setError(new Error(t("basis.onlyAster"))); return; } diff --git a/tests/basis-arb-engine.test.ts b/tests/basis-arb-engine.test.ts index 2a0951e..6ed279e 100644 --- a/tests/basis-arb-engine.test.ts +++ b/tests/basis-arb-engine.test.ts @@ -71,6 +71,13 @@ describe("BasisArbEngine", () => { time: 2_000, }), }; + const futuresClient = { + getPremiumIndex: vi.fn().mockResolvedValue({ + fundingRate: "0.0001", + nextFundingTime: 3_600_000, + time: 2_000, + }), + }; const engine = new BasisArbEngine( { @@ -79,10 +86,12 @@ describe("BasisArbEngine", () => { refreshIntervalMs: 1_000, maxLogEntries: 10, takerFeeRate: 0.0004, + arbAmount: 1, }, adapter, { spotClient, + futuresClient, now: () => 1_000, } ); @@ -111,7 +120,7 @@ describe("BasisArbEngine", () => { const expectedNet = 1.04 * (1 - effectiveFee) - 1.05 * (1 + effectiveFee); expect(snapshot.netSpread).toBeCloseTo(expectedNet, 6); expect(snapshot.netSpreadBps).toBeCloseTo((expectedNet / 1.05) * 10_000, 6); - expect(snapshot.feedStatus).toEqual({ futures: true, spot: true }); + expect(snapshot.feedStatus).toEqual({ futures: true, spot: true, funding: true }); expect(snapshot.opportunity).toBe(expectedNet >= 0); engine.stop(); diff --git a/tests/config.test.ts b/tests/config.test.ts index fc2cb2c..207a4a3 100644 --- a/tests/config.test.ts +++ b/tests/config.test.ts @@ -49,4 +49,11 @@ describe("resolveSymbolFromEnv", () => { expect(resolveSymbolFromEnv("standx")).toBe("ETH-USD"); }); + + it("supports binance symbol defaults when explicit exchange id is provided", () => { + delete process.env.EXCHANGE; + process.env.BINANCE_SYMBOL = "ETHUSDT"; + + expect(resolveSymbolFromEnv("binance")).toBe("ETHUSDT"); + }); }); diff --git a/tests/exchange-contract-suite.test.ts b/tests/exchange-contract-suite.test.ts new file mode 100644 index 0000000..97ad69a --- /dev/null +++ b/tests/exchange-contract-suite.test.ts @@ -0,0 +1,261 @@ +import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; +import { + BASIS_SUPPORTED_EXCHANGE_IDS, + SUPPORTED_EXCHANGE_IDS, + getExchangeDisplayName, + resolveExchangeId, + type SupportedExchangeId, +} from "../src/exchanges/create-adapter"; +import { parseCliArgs, printCliHelp } from "../src/cli/args"; +import { resolveSymbolFromEnv } from "../src/config"; +import { + routeCloseOrder, + routeLimitOrder, + routeMarketOrder, + routeStopOrder, + routeTrailingStopOrder, +} from "../src/exchanges/order-router"; +import { buildAdapterFromEnv } from "../src/exchanges/resolve-from-env"; +import type { ExchangeAdapter } from "../src/exchanges/adapter"; +import type { + AsterAccountSnapshot, + AsterDepth, + AsterKline, + AsterOrder, + AsterTicker, + CreateOrderParams, +} from "../src/exchanges/types"; + +const ORIGINAL_ENV = { ...process.env }; + +const REQUIRED_ENV_BY_EXCHANGE: Record> = { + aster: { + ASTER_API_KEY: "aster-key", + ASTER_API_SECRET: "aster-secret", + }, + grvt: { + GRVT_API_KEY: "grvt-key", + GRVT_API_SECRET: `0x${"1".repeat(64)}`, + GRVT_SUB_ACCOUNT_ID: "sub-account", + GRVT_INSTRUMENT: "BTC_USDT_Perp", + GRVT_SYMBOL: "BTCUSDT", + }, + lighter: { + LIGHTER_ACCOUNT_INDEX: "1", + LIGHTER_API_PRIVATE_KEY: "lighter-private-key", + LIGHTER_API_KEY_INDEX: "0", + }, + backpack: { + BACKPACK_API_KEY: "backpack-key", + BACKPACK_API_SECRET: "backpack-secret", + }, + paradex: { + PARADEX_PRIVATE_KEY: `0x${"2".repeat(64)}`, + PARADEX_WALLET_ADDRESS: `0x${"3".repeat(40)}`, + }, + nado: { + NADO_SIGNER_PRIVATE_KEY: `0x${"4".repeat(64)}`, + NADO_SUBACCOUNT_OWNER: `0x${"5".repeat(40)}`, + }, + standx: { + STANDX_TOKEN: "standx-token", + }, + binance: { + BINANCE_API_KEY: "binance-key", + BINANCE_API_SECRET: "binance-secret", + }, +}; + +class RecorderAdapter implements ExchangeAdapter { + readonly id: SupportedExchangeId; + public lastCreateOrderParams: CreateOrderParams | null = null; + + constructor(id: SupportedExchangeId) { + this.id = id; + } + + supportsTrailingStops(): boolean { + return false; + } + + watchAccount(_cb: (snapshot: AsterAccountSnapshot) => void): void {} + + watchOrders(_cb: (orders: AsterOrder[]) => void): void {} + + watchDepth(_symbol: string, _cb: (depth: AsterDepth) => void): void {} + + watchTicker(_symbol: string, _cb: (ticker: AsterTicker) => void): void {} + + watchKlines(_symbol: string, _interval: string, _cb: (klines: AsterKline[]) => void): void {} + + async createOrder(params: CreateOrderParams): Promise { + this.lastCreateOrderParams = params; + return { + orderId: 1, + clientOrderId: "test-client-order", + symbol: params.symbol, + side: params.side, + type: params.type, + status: "NEW", + price: String(params.price ?? 0), + origQty: String(params.quantity ?? 0), + executedQty: "0", + stopPrice: String(params.stopPrice ?? 0), + time: Date.now(), + updateTime: Date.now(), + reduceOnly: params.reduceOnly === "true", + closePosition: params.closePosition === "true", + timeInForce: params.timeInForce, + }; + } + + async cancelOrder(_params: { symbol: string; orderId: number | string }): Promise {} + + async cancelOrders(_params: { symbol: string; orderIdList: Array }): Promise {} + + async cancelAllOrders(_params: { symbol: string }): Promise {} +} + +beforeEach(() => { + process.env = { ...ORIGINAL_ENV }; +}); + +afterEach(() => { + process.env = { ...ORIGINAL_ENV }; +}); + +describe("exchange contract suite", () => { + it("keeps exchange registry consistent and case-insensitive", () => { + expect(new Set(SUPPORTED_EXCHANGE_IDS).size).toBe(SUPPORTED_EXCHANGE_IDS.length); + expect(new Set(BASIS_SUPPORTED_EXCHANGE_IDS).size).toBe(BASIS_SUPPORTED_EXCHANGE_IDS.length); + + for (const id of BASIS_SUPPORTED_EXCHANGE_IDS) { + expect(SUPPORTED_EXCHANGE_IDS).toContain(id); + } + + for (const id of SUPPORTED_EXCHANGE_IDS) { + expect(resolveExchangeId(id.toUpperCase())).toBe(id); + expect(getExchangeDisplayName(id)).toBeTruthy(); + } + }); + + it("accepts every supported exchange from CLI and documents them in help output", () => { + for (const id of SUPPORTED_EXCHANGE_IDS) { + expect(parseCliArgs(["--exchange", id]).exchange).toBe(id); + expect(parseCliArgs(["--exchange", id.toUpperCase()]).exchange).toBe(id); + } + + const spy = vi.spyOn(console, "log").mockImplementation(() => undefined); + printCliHelp(); + const output = spy.mock.calls.map((entry) => String(entry[0] ?? "")).join("\n"); + for (const id of SUPPORTED_EXCHANGE_IDS) { + expect(output).toContain(id); + } + spy.mockRestore(); + }); + + it("provides a default symbol fallback for every supported exchange", () => { + for (const id of SUPPORTED_EXCHANGE_IDS) { + const symbol = resolveSymbolFromEnv(id); + expect(typeof symbol).toBe("string"); + expect(symbol.length).toBeGreaterThan(0); + } + }); + + it("builds the requested adapter id for every supported exchange", () => { + for (const id of SUPPORTED_EXCHANGE_IDS) { + process.env = { ...ORIGINAL_ENV, ...REQUIRED_ENV_BY_EXCHANGE[id] }; + const adapter = buildAdapterFromEnv({ exchangeId: id, symbol: "BTCUSDT" }); + expect(adapter.id).toBe(id); + expect(typeof adapter.supportsTrailingStops()).toBe("boolean"); + expect(typeof adapter.watchAccount).toBe("function"); + expect(typeof adapter.watchOrders).toBe("function"); + expect(typeof adapter.watchDepth).toBe("function"); + expect(typeof adapter.watchTicker).toBe("function"); + expect(typeof adapter.watchKlines).toBe("function"); + expect(typeof adapter.createOrder).toBe("function"); + expect(typeof adapter.cancelOrder).toBe("function"); + expect(typeof adapter.cancelOrders).toBe("function"); + expect(typeof adapter.cancelAllOrders).toBe("function"); + } + }); + + it("fails fast when required credentials are missing", () => { + for (const id of SUPPORTED_EXCHANGE_IDS) { + process.env = { ...ORIGINAL_ENV }; + expect(() => buildAdapterFromEnv({ exchangeId: id, symbol: "BTCUSDT" })).toThrow(); + } + }); + + it("routes core order intents for every supported exchange", async () => { + delete process.env.EXCHANGE; + delete process.env.TRADE_EXCHANGE; + + for (const id of SUPPORTED_EXCHANGE_IDS) { + const adapter = new RecorderAdapter(id); + + await routeLimitOrder({ + adapter, + symbol: "BTCUSDT", + side: "BUY", + quantity: 0.01, + price: 100_000, + }); + expect(adapter.lastCreateOrderParams?.type).toBe("LIMIT"); + + await routeMarketOrder({ + adapter, + symbol: "BTCUSDT", + side: "SELL", + quantity: 0.01, + }); + expect(adapter.lastCreateOrderParams?.type).toBe("MARKET"); + + await routeStopOrder({ + adapter, + symbol: "BTCUSDT", + side: "SELL", + quantity: 0.01, + stopPrice: 99_000, + }); + expect(adapter.lastCreateOrderParams?.type).toBe("STOP_MARKET"); + + await routeCloseOrder({ + adapter, + symbol: "BTCUSDT", + side: "SELL", + quantity: 0.01, + reduceOnly: true, + closePosition: true, + }); + expect(adapter.lastCreateOrderParams?.type).toBe("MARKET"); + expect(adapter.lastCreateOrderParams?.reduceOnly).toBe("true"); + } + }); + + it("routes trailing-stop intent by exchange capability (supported or explicit rejection)", async () => { + delete process.env.EXCHANGE; + delete process.env.TRADE_EXCHANGE; + + for (const id of SUPPORTED_EXCHANGE_IDS) { + const adapter = new RecorderAdapter(id); + const intent = { + adapter, + symbol: "BTCUSDT", + side: "SELL" as const, + quantity: 0.01, + activationPrice: 101_000, + callbackRate: 0.2, + }; + + try { + const order = await routeTrailingStopOrder(intent); + expect(order.type).toBe("TRAILING_STOP_MARKET"); + expect(adapter.lastCreateOrderParams?.type).toBe("TRAILING_STOP_MARKET"); + } catch (error) { + const message = error instanceof Error ? error.message : String(error); + expect(message).toMatch(/does not support trailing stop/i); + } + } + }); +}); diff --git a/tests/exchange-factory.test.ts b/tests/exchange-factory.test.ts index 79c434d..8236a9a 100644 --- a/tests/exchange-factory.test.ts +++ b/tests/exchange-factory.test.ts @@ -5,6 +5,7 @@ import { GrvtExchangeAdapter } from "../src/exchanges/grvt/adapter"; import { BackpackExchangeAdapter } from "../src/exchanges/backpack/adapter"; import { ParadexExchangeAdapter } from "../src/exchanges/paradex/adapter"; import { StandxExchangeAdapter } from "../src/exchanges/standx/adapter"; +import { BinanceExchangeAdapter } from "../src/exchanges/binance/adapter"; const ORIGINAL_ENV = { ...process.env }; @@ -32,6 +33,7 @@ describe("exchange factory", () => { expect(resolveExchangeId("BACKPACK")).toBe("backpack"); expect(resolveExchangeId("PaRaDeX")).toBe("paradex"); expect(resolveExchangeId("StandX")).toBe("standx"); + expect(resolveExchangeId("BiNaNcE")).toBe("binance"); }); it("creates grvt adapter when EXCHANGE=grvt", () => { @@ -79,4 +81,15 @@ describe("exchange factory", () => { expect(adapter).toBeInstanceOf(StandxExchangeAdapter); expect(adapter.id).toBe("standx"); }); + + it("creates binance adapter when EXCHANGE=binance", () => { + process.env.EXCHANGE = "binance"; + process.env.BINANCE_API_KEY = "api-key"; + process.env.BINANCE_API_SECRET = "api-secret"; + process.env.BINANCE_SYMBOL = "BTCUSDT"; + + const adapter = createExchangeAdapter({ symbol: "BTCUSDT" }); + expect(adapter).toBeInstanceOf(BinanceExchangeAdapter); + expect(adapter.id).toBe("binance"); + }); });