Request parameters.
Promise<WebsocketApiResponse
Get current account information. User in single-asset/ multi-assets mode will see different value, see comments in response section for detail.
Weight(IP): 5
Security Type: USER_DATA
Request parameters.
Promise<WebsocketApiResponse
Cancel an active algo order.
Weight(IP): 1
Security Type: TRADE
Notes:
algoId or clientAlgoId must be sent.Request parameters.
Promise<WebsocketApiResponse
Cancel an active order.
Weight(IP): 1
Security Type: TRADE
Notes:
orderId or origClientOrderId must be sent.Request parameters.
Promise<WebsocketApiResponse
Close out a user data stream.
Weight(IP): 1
Security Type: USER_STREAM
Request parameters.
Promise<WebsocketApiResponse
Disconnects from the WebSocket server. If there is no active connection, a warning is logged. Otherwise, all connections in the connection pool are closed gracefully, and a message is logged indicating that the connection has been disconnected.
A Promise that resolves when all connections have been closed.
Futures Account Balance
Weight(IP): 5
Security Type: USER_DATA
Request parameters.
Promise<WebsocketApiResponse
Futures Account Balance V2
Weight(IP): 5
Security Type: USER_DATA
Request parameters.
Promise<WebsocketApiResponse
Checks if the WebSocket connection is currently open.
true if the connection is open, false otherwise.
Keepalive a user data stream to prevent a time out. User data streams will close after 60 minutes. It's recommended to send a ping about every 60 minutes.
Weight(IP): 1
Security Type: USER_STREAM
Request parameters.
Promise<WebsocketApiResponse
Order modify function, currently only LIMIT order modification is supported, modified orders will be reordered in the match queue
Weight: 1 on 10s order rate limit(X-MBX-ORDER-COUNT-10S); 1 on 1min order rate limit(X-MBX-ORDER-COUNT-1M); 0 on IP rate limit(x-mbx-used-weight-1m)
Security Type: TRADE
Notes:
Either orderId or origClientOrderId must be sent, and the
orderId will prevail if both are sent.
Both quantity and price must be sent. (After CM migration, the dapi modify order endpoint follows the same rule.)
When the new quantity or price doesn't satisfy PRICE_FILTER /
PERCENT_FILTER / LOT_SIZE, amendment will be rejected and the order will
stay as it is.
However the order will be cancelled by the amendment in the following situations:
when the order is in partially filled status and the new quantity <=
executedQty
When the order is GTX and the new price will cause it to be executed
immediately
One order can only be modfied for less than 10000 times
Request parameters.
Promise<WebsocketApiResponse
Send in a new algo order.
Weight(IP): 0
Security Type: TRADE
Notes:
If parameterpriceProtectis sent as true:
when price reaches the triggerPrice ,the difference rate between
"MARK_PRICE" and "CONTRACT_PRICE" cannot be larger than the
"triggerProtect" of the symbol
"triggerProtect" of a symbol can be got from GET /fapi/v1/exchangeInfo
STOP, STOP_MARKET:
BUY: latest price ("MARK_PRICE" or "CONTRACT_PRICE") >= triggerPrice
SELL: latest price ("MARK_PRICE" or "CONTRACT_PRICE") <=
triggerPrice
TAKE_PROFIT, TAKE_PROFIT_MARKET:
BUY: latest price ("MARK_PRICE" or "CONTRACT_PRICE") <= triggerPrice
SELL: latest price ("MARK_PRICE" or "CONTRACT_PRICE") >=
triggerPrice
TRAILING_STOP_MARKET:
BUY: the lowest price after order placed <= activatePrice, and the
latest price >= the lowest price * (1 + callbackRate)
SELL: the highest price after order placed >= activatePrice, and the
latest price <= the highest price * (1 - callbackRate)
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.
Request parameters.
Promise<WebsocketApiResponse
Send in a new order.
Weight(IP): 0
Security Type: TRADE
Notes:
Additional mandatory parameters based on type:
LIMIT: timeInForce, quantity, priceMARKET: quantity
If
newOrderRespTypeis sent asRESULT:
MARKETorder: the final FILLED result of the order will be return directly.LIMITorder with specialtimeInForce: the final status result of the order(FILLED or EXPIRED) will be returned directly.
selfTradePreventionModeis only effective whentimeInForceset toIOCorGTCorGTD.In extreme market conditions, timeInForce
GTDorder auto cancel time might be delayed comparing togoodTillDate
Request parameters.
Promise<WebsocketApiResponse
Get current order book. Note that this request returns limited market depth.
If you need to continuously monitor order book updates, please consider
using Websocket Market Streams:
<symbol>@depth<levels>
<symbol>@depth
You can use depth request together with <symbol>@depth streams to
maintain a local order book.
Note:*
Weight: Adjusted based on the limit:
| Limit | Weight |
|---|---|
| 5, 10, 20, 50 | 2 |
| 100 | 5 |
| 500 | 10 |
| 1000 | 20 |
Request parameters.
Promise<WebsocketApiResponse
Get current position information.
Weight(IP): 5
Security Type: USER_DATA
Notes:
ACCOUNT_UPDATE to meet your
timeliness and accuracy needs.Request parameters.
Promise<WebsocketApiResponse
Get current position information(only symbol that has position or open orders will be returned).
Weight(IP): 5
Security Type: USER_DATA
Notes:
ACCOUNT_UPDATE to meet your
timeliness and accuracy needs.Request parameters.
Promise<WebsocketApiResponse
Check an order's status.
These orders will not be found:
order status is CANCELED or EXPIRED AND order has NO filled trade AND created time + 3 days < current time
order create time + 90 days < current time
Weight(IP): 1
Security Type: USER_DATA
Notes: Notes:
orderId or origClientOrderId must be sent.orderId is self-increment for each specific symbolRequest parameters.
Promise<WebsocketApiResponse
Sends a signed message to the WebSocket server with authentication
The API method to call
Message parameters and options
Promise that resolves with the server response
Start a new user data stream. The stream will close after 60 minutes unless a keepalive is sent. If the account has an active listenKey, that listenKey will be returned and its validity will be extended for 60 minutes.
Weight(IP): 1
Security Type: USER_STREAM
Request parameters.
Promise<WebsocketApiResponse
Best price/qty on the order book for a symbol or symbols.
Note:*
Weight: 2 for a single symbol; 5* when the symbol parameter is omitted
Notes:
If the symbol is not sent, bookTickers for all symbols will be returned in an array.
The field X-MBX-USED-WEIGHT-1M in response header is not accurate
from this endpoint, please ignore.
Request parameters.
Promise<WebsocketApiResponse
Latest price for a symbol or symbols.
Weight: 1 for a single symbol; 2* when the symbol parameter is omitted
Notes:
Request parameters.
Promise<WebsocketApiResponse
Get current account information. User in single-asset/ multi-assets mode will see different value, see comments in response section for detail.
Weight(IP): 5
Security Type: USER_DATA