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: 5
Request parameters.
Promise<WebsocketApiResponse
Cancel an active order.
Either orderId or origClientOrderId must be sent.
Weight: 1
Request parameters.
Promise<WebsocketApiResponse
Close out a user data stream.
Weight: 1
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.
Query account balance info
Weight: 5
Request parameters.
Promise<WebsocketApiResponse
Query account balance info
Weight: 5
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: 1
Request parameters.
Promise<WebsocketApiResponse
Order modify function, currently only LIMIT order modification is supported, modified orders will be reordered in the match queue
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
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)
Request parameters.
Promise<WebsocketApiResponse
Send in a new order.
Order with type STOP, parameter timeInForce can be sent ( default GTC).
Order with type TAKE_PROFIT, parameter timeInForce can be sent ( default GTC).
Condition orders will be triggered when:
If parameterpriceProtectis sent as true:
when price reaches the stopPrice ,the difference rate between "MARK_PRICE" and "CONTRACT_PRICE" cannot be larger than the "triggerProtect" of the symbol
"triggerProtect" of a symbol can be got from GET /fapi/v1/exchangeInfo
STOP, STOP_MARKET:
BUY: latest price ("MARK_PRICE" or "CONTRACT_PRICE") >= stopPrice
SELL: latest price ("MARK_PRICE" or "CONTRACT_PRICE") <= stopPrice
TAKE_PROFIT, TAKE_PROFIT_MARKET:
BUY: latest price ("MARK_PRICE" or "CONTRACT_PRICE") <= stopPrice
SELL: latest price ("MARK_PRICE" or "CONTRACT_PRICE") >= stopPrice
TRAILING_STOP_MARKET:
BUY: the lowest price after order placed <= activationPrice, and the latest price >= the lowest price * (1 + callbackRate)
SELL: the highest price after order placed >= activationPrice, and the latest price <= the highest price * (1 - callbackRate)
For TRAILING_STOP_MARKET, if you got such error code.
{"code": -2021, "msg": "Order would immediately trigger."}
means that the parameters you send do not meet the following requirements:
BUY: activationPrice should be smaller than latest price.
SELL: activationPrice should be larger than latest price.
If newOrderRespType is sent as RESULT :
MARKET order: the final FILLED result of the order will be return directly.
LIMIT order with special timeInForce: the final status result of the order(FILLED or EXPIRED) will be returned directly.
STOP_MARKET, TAKE_PROFIT_MARKET with closePosition=true:
Follow the same rules for condition orders.
If triggered,close all current long position( if SELL) or current short position( if BUY).
Cannot be used with quantity paremeter
Cannot be used with reduceOnly parameter
In Hedge Mode,cannot be used with BUY orders in LONG position side. and cannot be used with SELL orders in SHORT position side
Weight: 0
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.
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.
Please use with user data stream ACCOUNT_UPDATE to meet your timeliness and accuracy needs.
Weight: 5
Request parameters.
Promise<WebsocketApiResponse
Get current position information(only symbol that has position or open orders will be returned).
Please use with user data stream ACCOUNT_UPDATE to meet your timeliness and accuracy needs.
Weight: 5
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
Either orderId or origClientOrderId must be sent.
orderId is self-increment for each specific symbol
Weight: 1
Request 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: 1
Request parameters.
Promise<WebsocketApiResponse
Best price/qty on the order book for a symbol or symbols.
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.
Weight: 2 for a single symbol; 5 when the symbol parameter is omitted
Request parameters.
Promise<WebsocketApiResponse
Latest price for a symbol or symbols.
If the symbol is not sent, prices for all symbols will be returned in an array.
Weight: 1 for a single symbol; 2 when the symbol parameter is omitted
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: 5