Futures Account & Trading
Overview¶
Change Position Mode(TRADE)¶
Response:
{
"code": 200,
"msg": "success"
}
POST /fapi/v3/positionSide/dual
Change user's position mode (Hedge Mode or One-way Mode ) on EVERY symbol
Weight: 1
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
| dualSidePosition | STRING | YES | "true": Hedge Mode; "false": One-way Mode |
Get Current Position Mode(USER_DATA)¶
Response:
{
"dualSidePosition": true // "true": Hedge Mode; "false": One-way Mode
}
GET /fapi/v3/positionSide/dual
Get user's position mode (Hedge Mode or One-way Mode ) on EVERY symbol
Weight: 30
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
Change STP Mode (TRADE)¶
Response:
{
"code": 200,
"msg": "success"
}
POST /fapi/v3/stpMode
Change user's Self-Trade Prevention (STP) mode on EVERY symbol
Weight: 1
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
| stpMode | ENUM | YES | EXPIRE_TAKER: expire taker order; EXPIRE_MAKER: expire maker order; EXPIRE_BOTH: expire both maker and taker orders |
| nonce | LONG | YES | Microsecond-level timestamp |
| signer | STRING | YES | API wallet address |
| signature | STRING | YES | Signature |
Get Current STP Mode (USER_DATA)¶
Response:
{
"stpMode": "EXPIRE_TAKER" // Current STP mode
}
GET /fapi/v3/stpMode
Get user's current Self-Trade Prevention (STP) mode on EVERY symbol
Weight: 30
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
| nonce | LONG | YES | Microsecond-level timestamp |
| signer | STRING | YES | API wallet address |
| signature | STRING | YES | Signature |
Change Multi-Assets Mode (TRADE)¶
Response:
{
"code": 200,
"msg": "success"
}
POST /fapi/v3/multiAssetsMargin
Change user's Multi-Assets mode (Multi-Assets Mode or Single-Asset Mode) on Every symbol
Weight: 1
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
| multiAssetsMargin | STRING | YES | "true": Multi-Assets Mode; "false": Single-Asset Mode |
Get Current Multi-Assets Mode (USER_DATA)¶
Response:
{
"multiAssetsMargin": true // "true": Multi-Assets Mode; "false": Single-Asset Mode
}
GET /fapi/v3/multiAssetsMargin
Get user's Multi-Assets mode (Multi-Assets Mode or Single-Asset Mode) on Every symbol
Weight: 30
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
Asset Exchange (TRADE)¶
Response:
{
"accountId": 123456,
"asset": "USDT", // Asset whose balance was updated by the exchange
"balance": "100.50", // Wallet balance of the asset after the exchange
"updateTime": 1774077572319
}
POST /fapi/v3/assetExchange
Manually trigger an asset exchange for the account in Multi-Assets Mode (equivalent to an auto asset exchange with a threshold of 0).
Weight: 1
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
| signer | STRING | YES | API wallet address |
| nonce | LONG | YES | Microsecond-level timestamp |
| signature | STRING | YES | Signature |
- No business parameters are required; only the common authentication parameters above are needed.
- Only available in Multi-Assets Mode; otherwise
-4212"User can not asset exchange while not in joint margin mode" is returned. - If no exchange takes place, the response body is empty.
New Order (TRADE)¶
Response:
{
"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": "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
"pegPriceType": "", // BBO peg mode, only present for pegged orders
"stpMode": "" // Self-Trade Prevention mode, only present when set on the order
}
POST /fapi/v3/order
Send in a new order.
Weight: 0
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
| symbol | STRING | YES | |
| side | ENUM | YES | |
| positionSide | ENUM | NO | DefaultBOTH for One-way Mode ; LONG or SHORT for Hedge Mode. It must be sent in Hedge Mode. |
| type | ENUM | YES | |
| timeInForce | ENUM | NO | See ENUM definitions: Time in force |
| quantity | DECIMAL | NO | Cannot be sent withclosePosition=true(Close-All) |
| reduceOnly | STRING | NO | "true" or "false". default "false". Cannot be sent in Hedge Mode; cannot be sent withclosePosition=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 withSTOP/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 withTRAILING_STOP_MARKET orders, default as the latest price(supporting different workingType) |
| callbackRate | DECIMAL | NO | Used withTRAILING_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 withSTOP/STOP_MARKET or TAKE_PROFIT/TAKE_PROFIT_MARKET orders. |
| newOrderRespType | ENUM | NO | "ACK", "RESULT", default "ACK" |
| pegPriceType | ENUM | NO | BBO peg mode: COUNTERPARTY_1 or QUEUE_1. When set on a LIMIT order, the engine resolves the actual price from the order book at trigger time using the BBO + pegOffset. Defaults to no peg. |
| pegOffset | DECIMAL | NO | Signed offset from BBO when pegPriceType is set. BUY orders should use a non-positive value (e.g. -0.5); SELL non-negative. Units: same scale as price (must be a tickSize multiple). |
| stpMode | ENUM | NO | Self-Trade Prevention mode for this order. Overrides the account-level default. EXPIRE_TAKER: cancel the taker side; EXPIRE_MAKER: cancel the maker side; EXPIRE_BOTH: cancel both sides. |
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, parametertimeInForcecan be sent ( defaultGTC). - Order with type
TAKE_PROFIT, parametertimeInForcecan be sent ( defaultGTC). - For
STOP_MARKET,TAKE_PROFIT_MARKET,TRAILING_STOP_MARKET: iftimeInForceis sent, onlyGTCis accepted; any other value is rejected. - Sending a parameter that does not apply to the selected
type(e.g.stopPricewithLIMIT;timeInForce,price, orstopPricewithMARKET;pricewithSTOP_MARKET/TAKE_PROFIT_MARKET) returns an error (PARAM_NOT_REQUIRED) rather than being silently ignored. -
Condition orders will be triggered when:
-
If parameter
priceProtectis 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/v3/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:
- when price reaches the
-
BUY:
activationPriceshould be smaller than latest price. - SELL:
activationPriceshould be larger than latest price. -
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.-
STOP_MARKET,TAKE_PROFIT_MARKETwithclosePosition=true: -
Follow the same rules for condition orders.
- If triggered,close all current long position( if
SELL) or current short position( ifBUY). - Cannot be used with
quantityparemeter - Cannot be used with
reduceOnlyparameter - In Hedge Mode,cannot be used with
BUYorders inLONGposition side. and cannot be used withSELLorders inSHORTposition side
Modify Order (TRADE)¶
Response:
{
'orderId': 405, // Order ID
'symbol': 'GOOGLUSDT', // Trading pair
'status': 'NEW', // Order status
'clientOrderId': 'uOLCC3aiCou3z2YL0sxWIX', // User-defined order ID
'price': '295.50', // Order price
'avgPrice': '0.00000', // Average fill price
'origQty': '0.150', // Original order quantity
'executedQty': '0', // Filled quantity
'cumQty': '0',
'cumQuote': '0', // Filled amount
'timeInForce': 'GTC', // Time in force
'type': 'LIMIT', // Order type
'reduceOnly': False, // Reduce only
'closePosition': False, // Close all positions on trigger
'side': 'BUY', // Order side
'positionSide': 'BOTH', // Position side
'stopPrice': '0', // Trigger price, invalid for `TRAILING_STOP_MARKET`
'workingType': 'CONTRACT_PRICE', // Condition price trigger type
'priceProtect': False, // Conditional order trigger protection enabled
'origType': 'LIMIT', // Original order type before trigger
'updateTime': 1776311274450 // Update time
}
PUT /fapi/v3/order
Weight: 1
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
| orderId | LONG | NO | Order ID |
| origClientOrderId | STRING | NO | User-defined order ID |
| symbol | STRING | YES | Trading pair |
| side | ENUM | NO | Optional order side; if provided it is validated against the order's actual side. |
| quantity | DECIMAL | YES | Order quantity |
| price | DECIMAL | YES | Order price |
- Either
orderIdororigClientOrderIdmust be sent. If both are sent,orderIdtakes precedence. - Both
quantityandpricemust be sent. - If the new
quantityorpricedoes not meetPRICE_FILTER/PERCENT_FILTER/LOT_SIZErestrictions, the modification will be rejected and the original order will remain. - Only
LIMITorder type is supported. - Maximum 10000 modifications per order.
- BBO-pegged orders (those placed with
pegPriceType=COUNTERPARTY_1/QUEUE_1): the engine resolves the actual price from the order book at trigger time. To auto-track the BBO with a continuously re-pegged limit order, use a Chase order (seePOST /fapi/v3/chasebelow) which the strategy service polls every second and amends when the BBO moves.
Place Chase Order (TRADE)¶
Response:
{
"strategyId": 12345,
"clientStrategyId": "my_chase_1",
"symbol": "BTCUSDT",
"side": "BUY",
"positionSide": "BOTH",
"quantity": "0.1",
"quantityUnit": "BASE",
"reduceOnly": false,
"chaseOffset": "0.5",
"chaseOffsetType": "ABSOLUTE",
"maxChaseOffset": "10.0",
"maxChaseOffsetType": "ABSOLUTE",
"timeInForce": "GTX",
"strategyStatus": "NEW",
"bookTime": 1747728000000,
"updateTime": 1747728000000
}
POST /fapi/v3/chase
Place a Chase strategy order — a BBO-pegged GTX limit order that automatically re-pegs to the best bid/ask as the market moves. The Chase Order strategy polls the order book once per second; if the relevant BBO price has changed, the strategy amends the order price accordingly to keep the order near the top of the book until it fills or until the market moves beyond maxChaseOffset from the original BBO.
Weight: 1
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
| symbol | STRING | YES | Trading pair. |
| side | ENUM | YES | BUY or SELL. Missing/blank returns "Mandatory parameter 'side' was not sent, was empty/null, or malformed." |
| positionSide | ENUM | NO | Default BOTH for One-way Mode; LONG or SHORT for Hedge Mode. |
| quantityUnit | STRING | YES | BASE (qty in base asset, e.g. BTC) or QUOTE (qty in quote asset, e.g. USDT). For QUOTE orders the system converts to BASE using mark price. |
| quantity | DECIMAL | YES | Order quantity in the unit specified by quantityUnit. |
| reduceOnly | STRING | NO | "true" or "false" (case-insensitive). Any other value is rejected. Default "false". |
| chaseOffset | DECIMAL | NO | Distance from BBO to peg the order. Default "0" (exact BBO peg). Must be ≥ 0 and a multiple of tickSize. BUY price = bid1 − chaseOffset; SELL price = ask1 + chaseOffset. |
| chaseOffsetType | STRING | NO | ABSOLUTE (default). only supports ABSOLUTE for now. Will support PERCENTAGE later. |
| maxChaseOffset | DECIMAL | NO | Maximum tolerated distance from the original BBO before the chase auto-cancels. Must be > 0. If omitted, no distance-based auto-cancel is applied and any maxChaseOffsetType sent is ignored. |
| maxChaseOffsetType | STRING | NO | ABSOLUTE or PERCENTAGE (default ABSOLUTE when maxChaseOffset is sent). ABSOLUTE: same unit as price, must be a multiple of tickSize. PERCENTAGE: ≤ 2 decimal places. |
| timeInForce | ENUM | NO | Default GTX (post-only). NO_FILL is not allowed and is rejected with INVALID_TIF. See ENUM definitions: Time in force. |
| clientStrategyId | STRING | NO | User-defined strategy id. Auto-generated if not sent. Length ≤ 28 characters (DB column is varchar(28)). Must match ^[\.A-Z\:/a-z0-9_-]{1,28}$. |
Validation rules:
sideis mandatory.reduceOnlyaccepts only"true"/"false"(case-insensitive). Any other string returnsINVALID_PARAMETERwithreduceOnlyas the offending param name.chaseOffsetmust be ≥ 0 and a multiple oftickSize.chaseOffsetType/maxChaseOffsetTypemust beABSOLUTEorPERCENTAGE; an invalid value returnsINVALID_PARAMETER(notINVALID_CHASE_OFFSET).chaseOffsetTypecurrently supports onlyABSOLUTE.PERCENTAGEis a valid value but is not yet implemented forchaseOffsetand returnsUNSUPPORTED_OPERATION. (maxChaseOffsetTypesupports both.)- Quantity / notional floor (entry orders only;
reduceOnlyorders are exempt from the notional minimum): forquantityUnit = BASE,quantitymust be ≥ the symbol'smarketMinQty(elseQTY_LESS_THAN_MIN_QTY) andquantity × markPricemust be ≥ the symbol'sminNotional(elseMIN_NOTIONAL); forquantityUnit = QUOTE, the quote amount must be ≥minNotional(elseMIN_NOTIONAL) andquoteQty / markPricemust be ≥marketMinQty(elseQTY_LESS_THAN_MIN_QTY). - When
maxChaseOffsetType = PERCENTAGE, the input value must have ≤ 2 decimal places (it is stored at scale 2 on the wire, e.g."1"→ 1.00%,"100"→ 100.00%). - When
maxChaseOffsetType = ABSOLUTE,maxChaseOffsetmust be a multiple oftickSize. timeInForcecannot beNO_FILL.clientStrategyIdlength must be ≤ 28 characters.- OI cap check: for
quantityUnit = QUOTE, the gateway converts to BASE quantity for the symbol-leverage OI bracket check usingqtyBase = qtyQuote × 10^quantityDecimal / markPrice.
Behavior:
- The initial order is placed as a GTX (post-only) limit with
pegPriceType = QUEUE_1and signedpegOffset(negative for BUY, positive for SELL). - The strategy service polls the order book every second and amends the order price when the BBO moves, keeping the order at
bid1 − chaseOffset(BUY) orask1 + chaseOffset(SELL). - If the market moves beyond
maxChaseOffsetfrom the original BBO, the chase auto-cancels with reasonOFFSET_CANCELLED. - The chase terminates on FILL, user cancel (via standard
DELETE /fapi/v3/order), ormaxChaseOffsetbreach.
Place Multiple Orders (TRADE)¶
Response:
[
{
"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
"symbol": "BTCUSDT",
"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
},
{
"code": -2022,
"msg": "ReduceOnly Order is rejected."
}
]
POST /fapi/v3/batchOrders
Weight: 5
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
| batchOrders | LIST | YES | order list. Max 5 orders |
Where batchOrders is the list of order parameters in JSON
| Name | Type | Mandatory | Description |
|---|---|---|---|
| symbol | STRING | YES | |
| side | ENUM | YES | |
| positionSide | ENUM | NO | DefaultBOTH for One-way Mode ; LONG or SHORT for Hedge Mode. It must be sent with Hedge Mode. |
| type | ENUM | YES | |
| timeInForce | ENUM | NO | See ENUM definitions: Time in force |
| 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 withSTOP/STOP_MARKET or TAKE_PROFIT/TAKE_PROFIT_MARKET orders. |
| activationPrice | DECIMAL | NO | Used withTRAILING_STOP_MARKET orders, default as the latest price(supporting different workingType) |
| callbackRate | DECIMAL | NO | Used withTRAILING_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 withSTOP/STOP_MARKET or TAKE_PROFIT/TAKE_PROFIT_MARKET orders. |
| newOrderRespType | ENUM | NO | "ACK", "RESULT", default "ACK" |
- 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.
Transfer Between Futures And Spot (TRANSFER)¶
Response:
{
"tranId": 21841, //transaction id
"status": "SUCCESS" //status
}
POST /fapi/v3/asset/wallet/transfer (TRANSFER)
Weight: 50
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
| amount | DECIMAL | YES | amount |
| asset | STRING | YES | asset |
| clientTranId | STRING | YES | transaction id |
| kindType | STRING | YES | kindType |
Notes:
- kindType can take the following values: FUTURE_SPOT (futures converted to spot) SPOT_FUTURE (spot converted to futures)
Query Order (USER_DATA)¶
Response:
{
"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
}
GET /fapi/v3/order
Check an order's status.
Weight: 1
- These orders will not be found:
- order status is
CANCELEDorEXPIRED, AND - order has NO filled trade, AND
- created time + 7 days < current time
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
| symbol | STRING | YES | |
| orderId | LONG | NO | |
| origClientOrderId | STRING | NO |
Notes:
- Either
orderIdororigClientOrderIdmust be sent.
Cancel Order (TRADE)¶
Response:
{
"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
}
DELETE /fapi/v3/order
Cancel an active order.
Weight: 1
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
| symbol | STRING | YES | |
| orderId | LONG | NO | |
| origClientOrderId | STRING | NO |
Either orderId or origClientOrderId must be sent.
Cancel Order (Guarded) (TRADE)¶
Response:
{
"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
}
DELETE /fapi/v3/guardedCancelOrder
Cancel an active order. Guarded variant of DELETE /fapi/v3/order, intended for orders placed/authorized on-chain: the on-chain nonce associated with the order is used to guard against duplicate or out-of-order cancellation. signer, nonce, and signature are required. Other request parameters and the response are identical to DELETE /fapi/v3/order.
Weight: 1
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
| symbol | STRING | YES | |
| orderId | LONG | NO | |
| origClientOrderId | STRING | NO | |
| signer | STRING | YES | API wallet address |
| nonce | LONG | YES | The nonce that was used to place this order (i.e. the nonce submitted with POST /fapi/v3/order), not a new/current timestamp |
| signature | STRING | YES | EIP-712 signature signed with the signer wallet private key |
Either orderId or origClientOrderId must be sent.
Cancel All Open Orders (TRADE)¶
Response:
{
"code": "200",
"msg": "The operation of cancel all open order is done."
}
DELETE /fapi/v3/allOpenOrders
Weight: 1
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
| symbol | STRING | YES |
Cancel Multiple Orders (TRADE)¶
Response:
[
{
"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
},
{
"code": -2011,
"msg": "Unknown order sent."
}
]
DELETE /fapi/v3/batchOrders
Weight: 1
Parameters:
| 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. |
Either orderIdList or origClientOrderIdList must be sent.
Batch Modify Orders (TRADE)¶
Response:
[
{
"orderId": 20072994001,
"symbol": "BTCUSDT",
"status": "NEW",
"clientOrderId": "myBuyOrder001",
"price": "65000.0",
"avgPrice": "0.00000",
"origQty": "0.010",
"executedQty": "0",
"cumQty": "0",
"cumQuote": "0",
"timeInForce": "GTC",
"type": "LIMIT",
"reduceOnly": false,
"closePosition": false,
"side": "BUY",
"positionSide": "BOTH",
"stopPrice": "0",
"workingType": "CONTRACT_PRICE",
"priceProtect": false,
"origType": "LIMIT",
"updateTime": 1700000001100
},
{
"code": -2013,
"msg": "Order does not exist."
},
{
"orderId": 20072994099,
"symbol": "ETHUSDT",
"status": "NEW",
"clientOrderId": "autoGenerated_xyz",
"price": "3500.0",
"avgPrice": "0.00000",
"origQty": "0.200",
"executedQty": "0",
"cumQty": "0",
"cumQuote": "0",
"timeInForce": "GTC",
"type": "LIMIT",
"reduceOnly": false,
"closePosition": false,
"side": "SELL",
"positionSide": "BOTH",
"stopPrice": "0",
"workingType": "CONTRACT_PRICE",
"priceProtect": false,
"origType": "LIMIT",
"updateTime": 1700000001234
}
]
PUT /fapi/v3/batchOrders
Weight: 5
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
| batchOrders | LIST | YES | order list. Max 5 orders (max 10 for MM-whitelisted accounts) |
Where batchOrders is the list of order parameters in JSON
| Name | Type | Mandatory | Description |
|---|---|---|---|
| symbol | STRING | YES | Trading pair |
| orderId | STRING | NO | Order ID |
| origClientOrderId | STRING | NO | User-defined order ID |
| quantity | STRING | YES | Order quantity |
| price | STRING | YES | Order price |
- Either
orderIdororigClientOrderIdmust be sent for each order. If both are sent,orderIdtakes precedence. - Both
quantityandpricemust be sent for each order. - Parameter rules for each element are the same as
Modify Orderabove —LIMITorders only, subject toPRICE_FILTER/PERCENT_FILTER/LOT_SIZErestrictions, and a maximum of 10000 modifications per order. - Batch orders are processed concurrently; the processing order is not guaranteed, but the response order always matches the request order.
- Not atomic — each order in the batch succeeds or fails independently. A failed modification leaves the original order untouched and does not affect the other orders in the batch.
- Exceeding the batch size limit returns:
"Illegal characters found in parameter 'batchOrders'; legal range is '1 to 5'."(or'1 to 10'for MM-whitelisted accounts).
Cancel Multiple Orders (Guarded) (TRADE)¶
Response:
[
{
"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
},
{
"code": -2011,
"msg": "Unknown order sent."
}
]
DELETE /fapi/v3/guardedBatchOrders
Cancel multiple active orders. Guarded variant of DELETE /fapi/v3/batchOrders, intended for orders placed/authorized on-chain: the on-chain nonce associated with each order is used to guard against duplicate or out-of-order cancellation. signer, nonce, and signature are required. Other request parameters and the response are identical to DELETE /fapi/v3/batchOrders.
Weight: 1
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
| symbol | STRING | YES | |
| orderIdList | LIST\<LONG> | NO | max length 10 e.g. [1234567,2345678] |
| origClientOrderIdList | LIST\<STRING> | NO | max length 10 e.g. ["my_id_1","my_id_2"], encode the double quotes. No space after comma. |
| signer | STRING | YES | API wallet address |
| nonce | LONG | YES | The nonce that was used to place these orders (i.e. the nonce submitted with POST /fapi/v3/batchOrders), not a new/current timestamp |
| signature | STRING | YES | EIP-712 signature signed with the signer wallet private key |
Either orderIdList or origClientOrderIdList must be sent.
Auto-Cancel All Open Orders (TRADE)¶
Response:
{
"symbol": "BTCUSDT",
"countdownTime": "100000"
}
Cancel all open orders of the specified symbol at the end of the specified countdown.
POST /fapi/v3/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 |
- 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.
Query Current Open Order (USER_DATA)¶
Response:
{
"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
}
GET /fapi/v3/openOrder
Weight: 1
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
| symbol | STRING | YES | |
| orderId | LONG | NO | |
| origClientOrderId | STRING | NO |
- Either
orderIdororigClientOrderIdmust be sent - If the queried order has been filled or cancelled, the error message "Order does not exist" will be returned.
Current All Open Orders (USER_DATA)¶
Response:
[
{
"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
}
]
GET /fapi/v3/openOrders
Get all open orders on a symbol. Careful when accessing this with no symbol.
Weight: 1 for a single symbol; 40 when the symbol parameter is omitted
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
| symbol | STRING | NO |
- If the symbol is not sent, orders for all symbols will be returned in an array.
All Orders (USER_DATA)¶
Response:
[
{
"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
}
]
GET /fapi/v3/allOrders
Get all account orders; active, canceled, or filled.
- These orders will not be found:
- order status is
CANCELEDorEXPIRED, AND - order has NO filled trade, AND
- created time + 7 days < current time
Weight: 5
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
| symbol | STRING | NO | If omitted, orders across all symbols are returned. |
| orderId | LONG | NO | |
| startTime | LONG | NO | |
| endTime | LONG | NO | |
| limit | INT | NO | Default 500; max 1000. |
Notes:
- If
orderIdis set, it will get orders >= thatorderId. Otherwise most recent orders are returned. - The query time period must be less then 7 days( default as the recent 7 days).
Futures Account Balance v3 (USER_DATA)¶
Response:
[
{
"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
}
]
GET /fapi/v3/balance
Weight: 5
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
Account Information v3 (USER_DATA)¶
Response:
{
"feeTier": 0, // account commisssion tier
"canTrade": true, // if can trade
"canDeposit": true, // if can transfer in asset
"canWithdraw": true, // if can transfer out asset
"updateTime": 0,
"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
"positionSide": "BOTH", // position side
"positionAmt": "0", // position amount
"notional": "0", // position notional value
"isolatedWallet": "0", // isolated wallet balance
"updateTime": 0 // last update time
}
]
}
GET /fapi/v3/accountWithJoinMargin
Get current account information.
- A separate, non-join-margin endpoint
GET /fapi/v3/accountalso exists (same response shape and weight, joinMargin=false); useaccountWithJoinMarginfor the join-margin view described here.
Weight: 5
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
Change Initial Leverage (TRADE)¶
Response:
{
"leverage": 21,
"maxNotionalValue": "1000000",
"symbol": "BTCUSDT"
}
POST /fapi/v3/leverage
Change user's initial leverage of specific symbol market.
Weight: 1
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
| symbol | STRING | YES | |
| leverage | INT | YES | target initial leverage: int from 1 to 125 |
Change Margin Type (TRADE)¶
Response:
{
"code": 200,
"msg": "success"
}
POST /fapi/v3/marginType
Weight: 1
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
| symbol | STRING | YES | |
| marginType | ENUM | YES | ISOLATED, CROSSED |
Modify Isolated Position Margin (TRADE)¶
Response:
{
"amount": 100.0,
"code": 200,
"msg": "Successfully modify position margin.",
"type": 1
}
POST /fapi/v3/positionMargin
Weight: 1
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
| symbol | STRING | YES | |
| positionSide | ENUM | NO | DefaultBOTH 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 |
| clientTranId | STRING | NO | Idempotency key, max length 64 chars; requests with the same clientTranId within 7 days for the same account/symbol are rejected as duplicates |
- Only for isolated symbol
Get Position Margin Change History (TRADE)¶
Response:
[
{
"amount": "23.36332311",
"asset": "USDT",
"symbol": "BTCUSDT",
"time": 1578047897183,
"type": 1,
"positionSide": "BOTH",
"deltaType": "TRADE",
"clientTranId": ""
},
{
"amount": "100",
"asset": "USDT",
"symbol": "BTCUSDT",
"time": 1578047900425,
"type": 1,
"positionSide": "LONG"
}
]
GET /fapi/v3/positionMargin/history
Weight: 1
Parameters:
| 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: 500 |
Position Information v3 (USER_DATA)¶
Response:
For One-way position mode:
[
{
"entryPrice": "0.00000",
"marginType": "isolated",
"isAutoAddMargin": "false",
"isolatedMargin": "0.00000000",
"leverage": "10",
"liquidationPrice": "0",
"markPrice": "6679.50671178",
"maxNotionalValue": "20000000",
"positionAmt": "0.000",
"symbol": "BTCUSDT",
"unRealizedProfit": "0.00000000",
"positionSide": "BOTH",
"notional": "0.00000000",
"isolatedWallet": "0.00000000",
"updateTime": 0
}
]
For Hedge position mode:
[
{
"entryPrice": "6563.66500",
"marginType": "isolated",
"isAutoAddMargin": "false",
"isolatedMargin": "15517.54150468",
"leverage": "10",
"liquidationPrice": "5930.78",
"markPrice": "6679.50671178",
"maxNotionalValue": "20000000",
"positionAmt": "20.000",
"symbol": "BTCUSDT",
"unRealizedProfit": "2316.83423560"
"positionSide": "LONG",
"notional": "133590.13423560",
"isolatedWallet": "15517.54150468",
"updateTime": 1625474304765
},
{
"entryPrice": "0.00000",
"marginType": "isolated",
"isAutoAddMargin": "false",
"isolatedMargin": "5413.95799991",
"leverage": "10",
"liquidationPrice": "7189.95",
"markPrice": "6679.50671178",
"maxNotionalValue": "20000000",
"positionAmt": "-10.000",
"symbol": "BTCUSDT",
"unRealizedProfit": "-1156.46711780"
"positionSide": "SHORT",
"notional": "-66795.0671178",
"isolatedWallet": "5413.95799991",
"updateTime": 0
}
]
GET /fapi/v3/positionRisk
Get current position information.
Weight: 5
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
| symbol | STRING | NO |
Note
Please use with user data stream ACCOUNT_UPDATE to meet your timeliness and accuracy needs.
Account Trade List (USER_DATA)¶
Response:
[
{
"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
}
]
GET /fapi/v3/userTrades
Get trades for a specific account and symbol.
Weight: 5
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
| symbol | STRING | YES | |
| orderId | LONG | NO | Filter trades belonging to this order id. |
| 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. |
- If
startTimeandendTimeare both not sent, then the last 7 days' data will be returned. - The time between
startTimeandendTimecannot be longer than 7 days. - The parameter
fromIdcannot be sent withstartTimeorendTime. orderIdis an additional optional filter and takes precedence over the other search modes when sent.
Get Income History(USER_DATA)¶
Response:
[
{
"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"
}
]
GET /fapi/v3/income
Weight: 30
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
| symbol | STRING | NO | |
| incomeType | STRING | NO | "TRANSFER","WELCOME_BONUS", "REALIZED_PNL","FUNDING_FEE", "COMMISSION", "INSURANCE_CLEAR", "MARKET_MERCHANT_RETURN_REWARD", "REFERRAL_KICKBACK", "COMMISSION_REBATE", "MARKET_MAKER_REBATE", "API_REBATE", "CONTEST_REWARD", "CROSS_COLLATERAL_TRANSFER", "INTERNAL_TRANSFER", and "AUTO_EXCHANGE" |
| startTime | LONG | NO | Timestamp in ms to get funding from INCLUSIVE. |
| endTime | LONG | NO | Timestamp in ms to get funding until INCLUSIVE. |
| limit | INT | NO | Default 100; max 1000 |
- If neither
startTimenorendTimeis sent, the recent 7-day data will be returned. - If
incomeTypeis not sent, all kinds of flow will be returned - "trandId" is unique in the same incomeType for a user
Notional and Leverage Brackets (USER_DATA)¶
Response:
[
{
"symbol": "ETHUSDT",
"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
},
]
}
]
OR (if symbol sent)
{
"symbol": "ETHUSDT",
"brackets": [
{
"bracket": 1,
"initialLeverage": 75,
"notionalCap": 10000,
"notionalFloor": 0,
"maintMarginRatio": 0.0065,
"cum":0
},
]
}
GET /fapi/v3/leverageBrackets
Note: GET /fapi/v3/leverageBracket (singular) is deprecated but still functions identically; GET /fapi/v3/leverageBrackets (plural) is the recommended, actively maintained path.
Weight: 1
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
| symbol | STRING | NO |
Position ADL Quantile Estimation (USER_DATA)¶
Response:
[
{
"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
}
}
]
GET /fapi/v3/adlQuantile
Weight: 5
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
| symbol | STRING | NO |
- 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.
User's Force Orders (USER_DATA)¶
Response:
[
{
"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
}
]
GET /fapi/v3/forceOrders
Weight: 20 with symbol, 50 without symbol
Parameters:
| 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. |
- 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
User Commission Rate (USER_DATA)¶
Response:
{
"symbol": "BTCUSDT",
"makerCommissionRate": "0.0002", // 0.02%
"takerCommissionRate": "0.0004" // 0.04%
}
GET /fapi/v3/commissionRate
Weight: 20
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
| symbol | STRING | YES |
Update User MMP (USER_DATA)¶
Response:
true
POST /fapi/v3/mmp
Weight: 1
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
| symbol | STRING | YES | |
| windowTimeInMilliseconds | LONG | YES | Time window (in ms) for calculating qtyLimit, valueLimit, and deltaLimit |
| frozenTimeInMilliseconds | LONG | YES | Duration (in ms) during which MMP orders are prohibited after a limit is triggered |
| qtyLimit | LONG | FALSE | Maximum cumulative filled quantity (both buy and sell) within the window. If reached, triggers the frozen period |
| valueLimit | LONG | FALSE | Maximum cumulative notional value within the window. If reached, triggers the frozen period |
| deltaLimit | LONG | FALSE | Maximum cumulative net position change (buys minus sells) within the window. If reached, triggers the frozen period |
Get User MMP (USER_DATA)¶
Response:
[
{
"symbol":"BTCUSDT",
"windowTimeInMilliseconds":5000,
"frozenTimeInMilliseconds":10000,
"qtyLimit":10,
"valueLimit":200000000,
"deltaLimit":100000000
}
]
GET /fapi/v3/mmp
Weight: 1
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
| symbol | STRING | FALSE |
Delete User MMP (USER_DATA)¶
Response:
true
DELETE /fapi/v3/mmp
Weight: 1
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
| symbol | STRING | YES |
Reset User MMP (USER_DATA)¶
Response:
true
POST /fapi/v3/mmpReset
Weight: 1
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
| symbol | STRING | YES |
Place Strategy Order (TRADE)¶
Response:
{
"strategyId": 123456789,
"clientStrategyId": "myStrategy1",
"strategyType": "OTO",
"strategyStatus": "WORKING",
"updateTime": 1699900000000,
"failureCode": 0,
"failureReason": ""
}
POST /fapi/v3/placeStrategyOrder
Place a new strategy order. Supports OTO (One-Triggers-the-Other), OCO (One-Cancels-the-Other), and OTOCO (One-Triggers-One-Cancels-the-Other) strategy types.
Weight: 50
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
| clientStrategyId | STRING | NO | Client-assigned unique strategy ID |
| strategyType | ENUM | YES | Strategy type: OTO, OCO, OTOCO |
| subOrderList | JSON Array | YES | List of sub-orders. OTO and OCO require exactly 2; OTOCO requires exactly 3 |
| builder | STRING | NO | Builder address |
| feeRate | DECIMAL | NO | Custom fee rate |
Sub-order fields (each element in subOrderList):
| Name | Type | Mandatory | Description |
|---|---|---|---|
| strategySubId | STRING | YES | Sub-order sequence number starting from 1, must be sequential and match position in array |
| securityType | STRING | YES | Security type of the order: USDT_FUTURES, COIN_FUTURES, OPTIONS |
| symbol | STRING | YES | Trading pair |
| side | STRING | YES | BUY or SELL |
| positionSide | STRING | NO | BOTH, LONG, SHORT. Default BOTH in one-way mode |
| type | STRING | YES | LIMIT, MARKET, STOP, STOP_MARKET, TAKE_PROFIT, TAKE_PROFIT_MARKET, TRAILING_STOP_MARKET |
| quantity | STRING | YES* | Order quantity. Not required when closePosition=true |
| price | STRING | YES* | Required for LIMIT, STOP, TAKE_PROFIT |
| stopPrice | STRING | YES* | Required for STOP, STOP_MARKET, TAKE_PROFIT, TAKE_PROFIT_MARKET |
| timeInForce | STRING | YES* | Required for LIMIT; optional for stop orders (default GTC). IOC and FOK are not supported. See ENUM definitions: Time in force |
| workingType | STRING | NO | CONTRACT_PRICE or MARK_PRICE. Default CONTRACT_PRICE |
| reduceOnly | STRING | NO | Reduce-only flag |
| closePosition | STRING | NO | Close-position flag |
| priceProtect | STRING | NO | Price protection flag |
| clientOrderId | STRING | NO | Client-assigned order ID |
| activationPrice | STRING | NO | Activation price for TRAILING_STOP_MARKET |
| callbackRate | STRING | NO | Callback rate for TRAILING_STOP_MARKET |
| firstDrivenId | STRING | NO | strategySubId of the driving sub-order for the first trigger condition |
| firstDrivenOn | STRING | NO | Event type that activates the first trigger: NEW, PARTIALLY_FILLED_OR_FILLED, FILLED, CANCELED, REPLACED, STOPPED, REJECTED, EXPIRED |
| firstTrigger | STRING | NO | First trigger action: PLACE_ORDER, CANCEL_ORDER |
| secondDrivenId | STRING | NO | strategySubId of the driving sub-order for the second trigger condition |
| secondDrivenOn | STRING | NO | Event type that activates the second trigger: NEW, PARTIALLY_FILLED_OR_FILLED, FILLED, CANCELED, REPLACED, STOPPED, REJECTED, EXPIRED |
| secondTrigger | STRING | NO | Second trigger action: PLACE_ORDER, CANCEL_ORDER |
Update Strategy Order (TRADE)¶
Response:
[
{
"strategyId": 123456789,
"clientStrategyId": "myStrategy1",
"strategyType": "OTO",
"strategyStatus": "WORKING",
"updatedSubOrder": 1,
"updateStatus": "SUCCESS",
"updateTime": 1699900000000,
"failureCode": 0,
"failureReason": ""
}
]
POST /fapi/v3/updateStrategyOrder
Update one or more sub-orders of an existing strategy order. Returns an array with one result per updated sub-order.
Weight: 50
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
| strategyId | LONG | YES | Strategy order ID to update |
| strategyType | ENUM | YES | Strategy type: OTO, OCO, OTOCO |
| subOrderList | JSON Array | YES | Sub-orders to update. Max 2 items for OTO/OCO, max 3 for OTOCO |
Sub-order fields (each element in subOrderList):
| Name | Type | Mandatory | Description |
|---|---|---|---|
| strategySubId | STRING | YES | Sequence number of the sub-order to update |
| securityType | STRING | YES | Security type |
| symbol | STRING | YES | Trading pair |
| side | STRING | YES | BUY or SELL |
| positionSide | STRING | NO | BOTH, LONG, SHORT |
| type | STRING | YES | Order type |
| quantity | STRING | NO | New order quantity |
| price | STRING | NO | New price (applicable for LIMIT, STOP, TAKE_PROFIT) |
| stopPrice | STRING | NO | New stop price |
| timeInForce | STRING | NO | New time in force |
| workingType | STRING | NO | New working type |
| reduceOnly | STRING | NO | |
| closePosition | STRING | NO | |
| priceProtect | STRING | NO | |
| activationPrice | STRING | NO | For TRAILING_STOP_MARKET only |
| callbackRate | STRING | NO | For TRAILING_STOP_MARKET only |
Query Strategy Open Order (USER_DATA)¶
Response:
{
"strategyId": 123456789,
"clientStrategyId": "myStrategy1",
"strategyType": "OTO",
"strategyStatus": "WORKING",
"bookTime": 1699900000000,
"updateTime": 1699900001000,
"subOrders": [
{
"strategyId": 123456789,
"orderId": 987654321,
"clientOrderId": "myOrder1",
"status": "NEW",
"strategySubId": 1,
"firstDrivenId": 0,
"firstDrivenOn": "",
"firstTrigger": "",
"secondDrivenId": 0,
"secondDrivenOn": "",
"secondTrigger": "",
"securityType": "FUTURE",
"symbol": "BTCUSDT",
"side": "BUY",
"positionSide": "LONG",
"type": "LIMIT",
"timeInForce": "GTC",
"quantity": "0.001",
"reduceOnly": false,
"closePosition": false,
"price": "50000",
"avgPrice": "0",
"priceProtect": false,
"stopPrice": "0",
"activatePrice": null,
"callbackRate": null,
"workingType": "CONTRACT_PRICE",
"triggerTime": 0
}
]
}
GET /fapi/v3/strategyOpenOrder
Query a current open strategy order. Either strategyId or clientStrategyId must be provided, but not both.
Weight: 5
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
| strategyId | LONG | NO* | Strategy order ID |
| clientStrategyId | STRING | NO* | Client-assigned strategy ID |
| strategyType | STRING | YES | Strategy type: OTO, OCO, OTOCO |
*Either strategyId or clientStrategyId must be provided (mutually exclusive).
Query Strategy History Order (USER_DATA)¶
Response:
{
"strategyId": 123456789,
"clientStrategyId": "myStrategy1",
"strategyType": "OTO",
"strategyStatus": "EXPIRED",
"bookTime": 1699800000000,
"updateTime": 1699800060000,
"subOrders": [
{
"strategyId": 123456789,
"orderId": 987654321,
"clientOrderId": "myOrder1",
"status": "FILLED",
"strategySubId": 1,
"firstDrivenId": 0,
"firstDrivenOn": "",
"firstTrigger": "",
"secondDrivenId": 0,
"secondDrivenOn": "",
"secondTrigger": "",
"securityType": "FUTURE",
"symbol": "BTCUSDT",
"side": "BUY",
"positionSide": "LONG",
"type": "LIMIT",
"timeInForce": "GTC",
"quantity": "0.001",
"reduceOnly": false,
"closePosition": false,
"price": "50000",
"avgPrice": "50000",
"priceProtect": false,
"stopPrice": "0",
"activatePrice": null,
"callbackRate": null,
"workingType": "CONTRACT_PRICE",
"triggerTime": 1699800030000
}
]
}
GET /fapi/v3/strategyHistoryOrder
Query historical strategy orders. Either strategyId or clientStrategyId must be provided, but not both. Maximum lookback window is 90 days.
Weight: 5
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
| strategyId | LONG | NO* | Strategy order ID |
| clientStrategyId | STRING | NO* | Client-assigned strategy ID |
| strategyType | STRING | YES | Strategy type: OTO, OCO, OTOCO |
| startTime | LONG | NO | Start time in milliseconds. Data older than 90 days cannot be queried |
| endTime | LONG | NO | End time in milliseconds |
| limit | INT | NO | Number of results returned. Default 500; max 1000 |
*Either strategyId or clientStrategyId must be provided (mutually exclusive).
Bind Sub-Account (USER_DATA)¶
Response:
{
"code": 200,
"msg": "success"
}
POST /fapi/v3/sub-accounts/bind
Weight: 5
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
| childAddress | STRING | YES | Sub-account wallet address |
| name | STRING | YES | Sub-account name |
| nonce | LONG | YES | Microsecond-level timestamp, used for replay attack prevention |
| user | STRING | YES | Master account wallet address |
| childSignature | STRING | YES | Sub-account's signature over the message body (see Signature Instructions below) |
| signature | STRING | YES | Master account's signature over the message body, must be signed using the master account's wallet private key (see Signature Instructions below) |
Signature Instructions¶
This endpoint requires two independent signatures. The message body differs between the two:
Step 1: Sub-Account Signature (childSignature)¶
The sub-account signs the following message body using its own wallet private key:
childAddress={childAddress}&name={name}&nonce={nonce}&user={user}
Step 2: Master Account Signature (signature)¶
The master account signs the following message body using its own wallet private key (not the API Key). The message body appends childSignature to the one used in Step 1:
childAddress={childAddress}&name={name}&nonce={nonce}&user={user}&childSignature={childSignature}
The key difference between the two message bodies: the master account's message body includes
childSignature, while the sub-account's does not.
Supported Signing Algorithms¶
| Account Type | Signing Algorithm | Encoding Format |
|---|---|---|
| EVM Address | EIP-712 Typed Data (chainId=1666, message.msg=message body) | Hex |
| Solana Address | Ed25519 | Base58 |
The address types of the master account and sub-account must match (EVM with EVM, Solana with Solana).
Important Notes¶
signaturemust be signed using the master account's wallet private key — the signer private key must not be used as a substitutechildSignatureandsignatureare not interchangeable- The
userfield must match the authenticated master account address and cannot be forged - Only whitelisted addresses are supported for creation. Please contact the project team for configuration.
Create Sub-Account (TRADE)¶
Response:
{
"code": 200,
"msg": "success"
}
POST /fapi/v3/createSubAccount
Weight: 5
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
| subSourceAddr | STRING | YES | Sub-account wallet address |
| subAccountName | STRING | YES | Sub-account name |
| nonce | LONG | YES | Microsecond-level timestamp, used for replay attack prevention |
| user | STRING | YES | Master account wallet address |
| signer | STRING | YES | Signer address associated with the master account |
| childSignature | STRING | YES | Sub-account's signature over the message body (see Signature Instructions below) |
| signature | STRING | YES | Master account's signature over the message body, must be signed using the master account's wallet private key (see Signature Instructions below) |
Signature Instructions¶
This endpoint requires two independent signatures. The message body differs between the two:
Step 1: Sub-Account Signature (childSignature)¶
The sub-account signs the following message body using its own wallet private key:
subAccountName={subAccountName}&subSourceAddr={subSourceAddr}&nonce={nonce}&user={user}&signer={signer}
Step 2: Master Account Signature (signature)¶
The master account signs the following message body using its own wallet private key (not the signer private key). The message body appends childSignature to the one used in Step 1:
subAccountName={subAccountName}&subSourceAddr={subSourceAddr}&nonce={nonce}&user={user}&signer={signer}&childSignature={childSignature}
The key difference between the two message bodies: the master account's message body includes
childSignature, while the sub-account's does not.
Supported Signing Algorithms¶
| Account Type | Signing Algorithm | Encoding Format |
|---|---|---|
| EVM Address | EIP-712 Typed Data (chainId=1666, message.msg=message body) | Hex |
| Solana Address | Ed25519 | Base58 |
The address types of the master account and sub-account must match (EVM with EVM, Solana with Solana).
Important Notes¶
signaturemust be signed using the master account's wallet private key — the signer private key must not be used as a substitute.childSignatureandsignatureare not interchangeable.- The
userfield must match the authenticated master account address and cannot be forged.
Get Sub-Account List (USER_DATA)¶
Response:
[
{
"accountId": 123456,
"subAccountName": "trading-desk-1",
"parentAccount": false
},
{
"accountId": 100000,
"subAccountName": "",
"parentAccount": true
}
]
GET /fapi/v3/getSubAccountList
Weight: 5
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
| nonce | LONG | YES | Microsecond-level timestamp, used for replay attack prevention |
| user | STRING | YES | Master account wallet address |
| signer | STRING | YES | Signer address associated with the master account |
| signature | STRING | YES | Signature over the message body (see Signature Instructions below) |
Response fields:
| Name | Type | Description |
|---|---|---|
| accountId | LONG | Account ID |
| subAccountName | STRING | Sub-account name |
| parentAccount | BOOLEAN | Whether this entry is the master account (true) or a sub-account (false) |
Signature Instructions¶
Sign the following message body using the signer's private key (EIP-712, always used regardless of whether the parent account is EVM or Solana):
nonce={nonce}&user={user}&signer={signer}
Signing Algorithm¶
| Algorithm | Encoding Format |
|---|---|
| EIP-712 Typed Data (chainId=1666, message.msg=message body) | Hex |
Unlike other sub-account endpoints,
getSubAccountListalways uses the signer private key (EIP-712) for signing, even when the master account is a Solana address.
Update Sub-Account (TRADE)¶
Response:
{
"code": 200,
"msg": "success"
}
POST /fapi/v3/updateSubAccount
Weight: 5
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
| subSourceAddr | STRING | YES | Sub-account wallet address to update |
| nonce | LONG | YES | Microsecond-level timestamp, used for replay attack prevention |
| user | STRING | YES | Master account wallet address |
| signer | STRING | YES | Signer address associated with the master account |
| subAccountName | STRING | NO | New sub-account name (at least one of subAccountName or status must be provided) |
| status | STRING | NO | Sub-account status: NORMAL (active) or FROZEN (frozen) |
| signature | STRING | YES | Master account's signature over the message body, must be signed using the master account's wallet private key (see Signature Instructions below) |
Signature Instructions¶
The master account signs the following message body using its own wallet private key (not the signer private key):
subSourceAddr={subSourceAddr}&nonce={nonce}&user={user}&signer={signer}[&subAccountName={subAccountName}][&status={status}]
Only include optional fields (
subAccountName,status) in the message body if they are included in the request.
Supported Signing Algorithms¶
| Account Type | Signing Algorithm | Encoding Format |
|---|---|---|
| EVM Address | EIP-712 Typed Data (chainId=1666, message.msg=message body) | Hex |
| Solana Address | Ed25519 | Base58 |
Important Notes¶
signaturemust be signed using the master account's wallet private key — the signer private key must not be used as a substitute.- At least one of
subAccountNameorstatusmust be provided. statusaccepted values:NORMAL(unfreeze / active),FROZEN(freeze).- A frozen sub-account cannot initiate transfers.
Sub-Account Transfer (TRADE)¶
Response:
{
"code": 200,
"msg": "success"
}
POST /fapi/v3/subAccountTransfer
Weight: 5
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
| toAccountAddress | STRING | YES | Destination wallet address |
| asset | STRING | YES | Asset name (e.g., USDT) |
| amount | STRING | YES | Transfer amount |
| kindType | ENUM | YES | Transfer direction (see table below) |
| nonce | LONG | YES | Microsecond-level timestamp, used for replay attack prevention |
| user | STRING | NO | Signing account wallet address (master account address in most cases; sub-account address when the sub-account initiates a transfer to the master account). Optional — pass either user or signer |
| signer | STRING | NO | Agent wallet address associated with user, registered and approved via registerAndApproveAgent/approveAgent. Optional — pass either user or signer |
| fromAccountAddress | STRING | NO | Source wallet address. Required when the source account differs from user (e.g., sub→sub transfers or master→sub transfers initiated by a third party) |
| signature | STRING | YES | Signature over the message body, signed with the private key of whichever account is passed: user's private key if user is passed, or the agent's private key if signer is passed (see Signature Instructions below) |
Parameter Values:
| Transfer | user | signer | fromAccountAddress | toAccountAddress | signature |
|---|---|---|---|---|---|
| Master → Sub | (optional — master account address) | (optional — master account's agent) | Master account address | Sub-account address | Signed with master account (or agent) private key |
| Sub → Master | (optional — master account address) | (optional — master account's agent) | Sub-account address | Master account address | Signed with master account (or agent) private key |
| Sub → Sub | (optional — master account address) | (optional — master account's agent) | Sub A address | Sub B address | Signed with master account (or agent) private key |
| Sub → Master | (optional — sub-account address) | (optional — sub-account's agent) | Sub-account address | Master account address | Signed with sub-account (or agent) private key |
| Sub → Sub | (optional — Sub A address) | (optional — Sub A's agent) | Sub A address | Sub B address | Signed with sub-account (or agent) private key |
userandsignerare both optional — pass either one to identify the signing account (signermust be an agent wallet approved for thatuser). The signature must be signed with the private key of whichever one is passed:user's private key ifuseris passed, or the agent's private key ifsigneris passed.
kindType values:
| Value | Description |
|---|---|
FUTURE_FUTURE |
Perpetual account → Perpetual account |
FUTURE_SPOT |
Perpetual account → Spot account |
SPOT_FUTURE |
Spot account → Perpetual account |
SPOT_SPOT |
Spot account → Spot account |
Signature Instructions¶
Sign the following message body using the private key of whichever account you pass — the user account's wallet private key if user is passed, or the agent's wallet private key if signer is passed instead:
Without fromAccountAddress:
toAccountAddress={toAccountAddress}&asset={asset}&amount={amount}&kindType={kindType}&nonce={nonce}&user={user}&signer={signer}
With fromAccountAddress:
toAccountAddress={toAccountAddress}&asset={asset}&amount={amount}&kindType={kindType}&nonce={nonce}&user={user}&signer={signer}&fromAccountAddress={fromAccountAddress}
Supported Signing Algorithms¶
| Account Type | Signing Algorithm | Encoding Format |
|---|---|---|
| EVM Address | EIP-712 Typed Data (chainId=1666, message.msg=message body) | Hex |
| Solana Address | Ed25519 | Base58 |
Transfer Scenarios¶
| Scenario | user |
fromAccountAddress |
Signing Key |
|---|---|---|---|
| Master → Sub | Master account address | (not required) | Master account wallet private key |
| Sub → Master | Sub-account address | (not required) | Sub-account wallet private key |
| Sub A → Sub B | Master account address | Sub A address | Master account wallet private key |
| Sub A → Sub B | Sub-account address | (not required) | Sub-account wallet private key |
Important Notes¶
userandsignerare both optional — pass either one; only one is needed to identify the signing account.signaturemust be signed with the private key of whichever account is passed —user's wallet private key ifuseris passed, or the agent's wallet private key ifsigneris passed.signermust be an agent wallet address associated withuser, registered and approved viaPOST /fapi/v3/registerAndApproveAgentorapproveAgentwithcanSpotTradeorcanPerpTradepermission.- When signing with a sub-account's private key, transfers to the master account are supported. Sub→Sub transfers are also supported, with the source address being the signing sub-account.
- Transfers to or from a frozen sub-account will fail.
- Transfers to external addresses (addresses not within the sub-account relationship) are not supported.
Migrate User Assets (WITHDRAW)¶
Response:
{
"batchId": "a1B2c3D4e5F6g7H8i9J0k1" // batch ID for querying migration history
}
POST /fapi/v3/asset/migrateUser
Weight: 50
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
| user | STRING | YES | Source account wallet address — the account from which assets will be migrated |
| nonce | LONG | YES | Microsecond-level timestamp, used for replay attack prevention |
| signature | STRING | YES | Signature over the request body, signed using the user account's wallet private key (EIP-712 for EVM addresses, Ed25519 for Solana addresses) |
Notes:
- The source account must have no open positions before migration can proceed; the request will be rejected otherwise.
- The source account must have no open orders before migration can proceed; the request will be rejected otherwise.
- All assets with a positive available balance are automatically included. Assets with zero balance are skipped.
- Up to 300 assets are processed per migration batch.
- Assets are transferred to the authenticated user's account (the destination).
- If the source account has no assets with a positive balance, an empty response is returned and no transfer is initiated.
- Record the returned
batchIdto query migration status via the Migrate User Assets History endpoint below.
Migrate User Assets History (USER_DATA)¶
Response:
{
"batchId": "a1B2c3D4e5F6g7H8i9J0k1",
"totalCount": 2, // total number of records
"successCount": 1, // number of successful records (status=S)
"processingCount": 0, // number of processing records (status=P)
"failCount": 0, // number of failed records (status=F)
"initCount": 1, // number of pending records (status=I)
"details": [
{
"id": 1001,
"asset": "USDT",
"amount": "500.00000000",
"tranId": 9876543210,
"status": "S", // I=pending, S=success, F=failed
"fromStatus": "S", // S=success, F=failed, P=processing
"fromErrorCode": null,
"fromResponse": null,
"toStatus": "S", // S=success, F=failed, P=processing
"toErrorCode": null,
"toResponse": null
},
{
"id": 1002,
"asset": "BTC",
"amount": "0.05000000",
"tranId": null, // null if not yet processed
"status": "I", // I=pending, S=success, F=failed
"fromStatus": null,
"fromErrorCode": null,
"fromResponse": null,
"toStatus": null,
"toErrorCode": null,
"toResponse": null
}
]
}
GET /fapi/v3/asset/migrateUser/history
Weight: 50
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
| batchId | STRING | YES | Batch ID returned from the Migrate User Assets endpoint |
| nonce | LONG | YES | Microsecond-level timestamp, used for replay attack prevention |
| user | STRING | YES | Authenticated user's wallet address |
| signer | STRING | YES | Signer address associated with the user account |
| signature | STRING | YES | Signature over the request body |
Notes:
batchIdis mandatory. EachbatchIdcorresponds to a single migration batch.- The query is scoped to the authenticated user — only migrations initiated by or associated with the authenticated account are returned.
Register and Approve Agent (PUBLIC)¶
Response:
{
"code": 200,
"msg": "success"
}
POST /fapi/v3/registerAndApproveAgent
Registers a new API agent account and grants it trading/withdrawal permissions in a single call. Once approved, the agent can use API Keys to act on behalf of the user within the specified permission scope.
Weight: 50
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
| user | STRING | YES | User's wallet address |
| nonce | LONG | YES | Microsecond-level timestamp, used for replay attack prevention |
| agentName | STRING | YES | Display name for the agent |
| agentAddress | STRING | YES | Agent's wallet address |
| expired | LONG | YES | Agent expiration timestamp (milliseconds) |
| signatureChainId | LONG | YES | Chain ID used when generating the signature (56 for EVM addresses, 101 for Solana addresses) |
| signature | STRING | YES | Signature over the message body, signed using the user's wallet private key (see Signature Instructions below) |
| canSpotTrade | BOOLEAN | YES | Whether the agent is permitted to place spot orders |
| canPerpTrade | BOOLEAN | YES | Whether the agent is permitted to place perpetual futures orders |
| canWithdraw | BOOLEAN | YES | Whether the agent is permitted to initiate withdrawals |
| ipWhitelist | STRING | NO | Space-separated list of permitted IP addresses or CIDR ranges (e.g. 192.168.1.1 10.0.0.0/24). Required when canWithdraw is true. |
| agentCode | STRING | NO | Referral/invitation code for agent registration |
Signature Instructions¶
Sign the following message body using the user's wallet private key:
msg: user={user}&nonce={nonce}&agentName={agentName}&agentAddress={agentAddress}&expired={expired}&signatureChainId={signatureChainId}&canSpotTrade={canSpotTrade}&canPerpTrade={canPerpTrade}&canWithdraw={canWithdraw}&ipWhitelist={ipWhitelist}
EVM addresses only: wrap the
msgstring above asmessage.msgin the following EIP-712 typed data structure before signing:⚠️ Note:
domain.chainIdmust be set to the value of the request parametersignatureChainId(56for EVM addresses,101for Solana addresses) — do not use the fixed value1666.
typed_data = {
"types": {
"EIP712Domain": [
{"name": "name", "type": "string"},
{"name": "version", "type": "string"},
{"name": "chainId", "type": "uint256"},
{"name": "verifyingContract", "type": "address"}
],
"Message": [
{ "name": "msg", "type": "string" }
]
},
"primaryType": "Message",
"domain": {
"name": "AsterSignTransaction",
"version": "1",
"chainId": signatureChainId,
"verifyingContract": "0x0000000000000000000000000000000000000000"
},
"message": {
"msg": "$msg"
}
}
Supported Signing Algorithms¶
| Account Type | Signing Algorithm | Encoding |
|---|---|---|
| EVM Address | EIP-712 Typed Data (chainId=signatureChainId, message.msg=message body) | Hex |
| Solana Address | Ed25519 | Base58 |
Important Notes¶
noncemust be a microsecond-precision timestamp. The difference from server time must not exceed 10 seconds, and the same nonce cannot be reused.expiredis the agent's validity deadline in milliseconds. The agent will automatically expire after this timestamp.ipWhitelistuses spaces as the delimiter and supports CIDR notation (e.g.192.168.1.1 10.0.0.0/24).ipWhitelistis required and must not be empty whencanWithdrawistrue.- This endpoint is unauthenticated — no API Key or HMAC header is required. All authorization is verified through the on-chain
signature. - This endpoint combines agent registration and permission granting into a single call, equivalent to the standalone registration step followed by
approveAgent.
Get Direct Announcements (USER_DATA)¶
Response:
{
"total": 2,
"rows": [
{
"id": 1001,
"contents": [
{
"language": "en",
"title": "Platform Maintenance Notice",
"subtitle": "Scheduled downtime",
"content": "The platform will undergo scheduled maintenance on 2026-06-20 from 02:00 to 04:00 UTC."
},
{
"language": "zh",
"title": "平台维护公告",
"subtitle": "定期停机",
"content": "平台将于2026年6月20日UTC时间02:00至04:00进行定期维护。"
}
],
"category": "MAINTENANCE",
"publishTime": 1750000000000,
"jumpLink": "https://www.asterdex.com/en/announcement/1001"
}
]
}
GET /fapi/v3/announcement/direct
Retrieves the list of direct announcements for the authenticated user, with pagination support.
Weight: 1
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
| page | INT | NO | Page number, starting from 1. Default: 1 |
| size | INT | NO | Number of results per page. Default: 20 |
Response Fields:
| Field | Type | Description |
|---|---|---|
| total | LONG | Total number of announcements |
| rows | ARRAY | List of announcement objects |
| rows[].id | LONG | Announcement ID |
| rows[].contents | ARRAY | Multi-language content list |
| rows[].contents[].language | STRING | Language code (e.g. en, zh) |
| rows[].contents[].title | STRING | Announcement title |
| rows[].contents[].subtitle | STRING | Announcement subtitle |
| rows[].contents[].content | STRING | Announcement body text |
| rows[].category | STRING | Announcement category |
| rows[].publishTime | LONG | Publish timestamp (milliseconds) |
| rows[].jumpLink | STRING | Link to the full announcement page |
Get Direct Announcement By ID (USER_DATA)¶
Response:
{
"id": 1001,
"contents": [
{
"language": "en",
"title": "Platform Maintenance Notice",
"subtitle": "Scheduled downtime",
"content": "The platform will undergo scheduled maintenance on 2026-06-20 from 02:00 to 04:00 UTC."
},
{
"language": "zh",
"title": "平台维护公告",
"subtitle": "定期停机",
"content": "平台将于2026年6月20日UTC时间02:00至04:00进行定期维护。"
}
],
"category": "MAINTENANCE",
"publishTime": 1750000000000,
"jumpLink": "https://www.asterdex.com/en/announcement/1001"
}
GET /fapi/v3/announcement/directById
Retrieves a single direct announcement by its ID for the authenticated user.
Weight: 1
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
| id | LONG | YES | Announcement ID |
Response Fields:
| Field | Type | Description |
|---|---|---|
| id | LONG | Announcement ID |
| contents | ARRAY | Multi-language content list |
| contents[].language | STRING | Language code (e.g. en, zh) |
| contents[].title | STRING | Announcement title |
| contents[].subtitle | STRING | Announcement subtitle |
| contents[].content | STRING | Announcement body text |
| category | STRING | Announcement category |
| publishTime | LONG | Publish timestamp (milliseconds) |
| jumpLink | STRING | Link to the full announcement page |
Get Builder User Accounts (USER_DATA)¶
Response:
{
"total": 1,
"currentPage": 1,
"totalPages": 1,
"pageSize": 50,
"hasMore": false,
"rows": [
{
"address": "0x1234...abcd",
"feeTier": 0,
"canTrade": true,
"canDeposit": true,
"canWithdraw": true,
"updateTime": 1751500000000,
"accountType": 0,
"dualSidePosition": false,
"jointMargin": false,
"feeBurn": false,
"feeBurnAssetId": 0,
"symbolConfig": [
{
"symbol": "BTCUSDT",
"leverage": 20,
"notionalLimitCoef": "10"
}
]
}
]
}
GET /fapi/v3/builder/userAccounts
Query account information for the users trading under the caller's builder code, with pagination. The authenticated account is used as the builder identity — there is no separate builder address parameter.
Weight: 5
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
| userAddresses | STRING | NO | Comma-separated list of up to 50 user wallet addresses to query |
| symbol | STRING | NO | When sent, only this symbol's entry is returned in symbolConfig |
| page | INT | NO | Page number, starting from 1. Default: 1 |
| limit | INT | NO | Number of results per page. Default 50; max 1000 |
| nonce | LONG | YES | Microsecond-level timestamp, used for replay attack prevention |
| signer | STRING | YES | Signer address associated with the authenticated account |
| signature | STRING | YES | Signature over the request body |
- If
userAddressesis sent, only those addresses are returned; each address must have already approved the caller's address as its builder, otherwise it is left out ofrowsand reported inerrorsinstead. - If
userAddressesis omitted, every user currently bound to this builder is paginated through instead, ordered by the time the binding was created. userAddressesaccepts at most 50 addresses per request; sending more is rejected.- The caller's own account must already have a generated on-chain address (i.e. have completed at least one deposit), or the request is rejected.
Response Fields:
| Field | Type | Description |
|---|---|---|
| total | LONG | Total number of matching users |
| currentPage | INT | Current page number |
| totalPages | INT | Total number of pages |
| pageSize | INT | Number of records per page |
| hasMore | BOOLEAN | Whether more pages are available |
| rows | ARRAY | List of account records |
| rows[].address | STRING | Wallet address of the user |
| rows[].feeTier | INT | Account commission tier |
| rows[].canTrade | BOOLEAN | Whether the account can trade |
| rows[].canDeposit | BOOLEAN | Whether the account can deposit |
| rows[].canWithdraw | BOOLEAN | Whether the account can withdraw |
| rows[].updateTime | LONG | Last update time (milliseconds) |
| rows[].accountType | INT | Account type |
| rows[].dualSidePosition | BOOLEAN | Whether Hedge Mode is enabled |
| rows[].jointMargin | BOOLEAN | Whether Multi-Assets Mode is enabled |
| rows[].feeBurn | BOOLEAN | Whether fee burn is enabled |
| rows[].feeBurnAssetId | INT | Fee burn asset ID |
| rows[].symbolConfig | ARRAY | Per-symbol configuration |
| rows[].symbolConfig[].symbol | STRING | Symbol |
| rows[].symbolConfig[].leverage | INT | Current initial leverage |
| rows[].symbolConfig[].notionalLimitCoef | STRING | Notional limit coefficient |
| errors | ARRAY | Present only when one or more requested addresses could not be returned |
| errors[].address | STRING | The address that was left out of rows |
| errors[].errorMsg | STRING | Reason the address was left out of rows: This function can only be used after deposit, User privacy mode is enabled, this operation is not allowed., Failed to check privacy switch status for this address., or This user address is not bound to this builder. (only possible when userAddresses is explicitly supplied) |
Get Builder User Open Orders (USER_DATA)¶
Response:
{
"total": 1,
"currentPage": 1,
"totalPages": 1,
"pageSize": 50,
"hasMore": false,
"rows": [
{
"address": "0x1234...abcd",
"symbol": "BTCUSDT",
"orderId": 1917641,
"clientOrderId": "abc",
"price": "0",
"origQty": "0.40",
"executedQty": "0",
"avgPrice": "0.00000",
"stopPrice": "9300",
"status": "NEW",
"side": "BUY",
"positionSide": "SHORT",
"type": "TRAILING_STOP_MARKET",
"timeInForce": "GTC",
"time": 1579276756075,
"workingType": "CONTRACT_PRICE"
}
]
}
GET /fapi/v3/builder/userOpenOrders
Query current open orders for the users trading under the caller's builder code, with pagination. The authenticated account is used as the builder identity — there is no separate builder address parameter.
Weight: 5
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
| userAddresses | STRING | NO | Comma-separated list of up to 50 user wallet addresses to query |
| symbol | STRING | NO | When sent, only open orders on this symbol are returned |
| page | INT | NO | Page number, starting from 1. Default: 1 |
| limit | INT | NO | Number of results per page. Default 50; max 1000 |
| nonce | LONG | YES | Microsecond-level timestamp, used for replay attack prevention |
| signer | STRING | YES | Signer address associated with the authenticated account |
| signature | STRING | YES | Signature over the request body |
- If
userAddressesis sent, only those addresses are returned; each address must have already approved the caller's address as its builder, otherwise it is left out ofrowsand reported inerrorsinstead. - If
userAddressesis omitted, every user currently bound to this builder is paginated through instead, ordered by the time the binding was created.page/limitpage through the bound users, not the individual orders — each returned user may contribute zero or more rows. userAddressesaccepts at most 50 addresses per request; sending more is rejected.- The caller's own account must already have a generated on-chain address (i.e. have completed at least one deposit), or the request is rejected.
Response Fields:
| Field | Type | Description |
|---|---|---|
| total | LONG | Total number of matching users on this page's underlying query |
| currentPage | INT | Current page number |
| totalPages | INT | Total number of pages |
| pageSize | INT | Number of records per page |
| hasMore | BOOLEAN | Whether more pages are available |
| rows | ARRAY | List of open orders across the returned users |
| rows[].address | STRING | Wallet address of the order owner |
| rows[].symbol | STRING | Symbol |
| rows[].orderId | LONG | Order ID |
| rows[].clientOrderId | STRING | Client order ID |
| rows[].price | STRING | Order price |
| rows[].origQty | STRING | Original order quantity |
| rows[].executedQty | STRING | Executed quantity |
| rows[].avgPrice | STRING | Average filled price |
| rows[].stopPrice | STRING | Stop price |
| rows[].status | STRING | Order status |
| rows[].side | STRING | Order side |
| rows[].positionSide | STRING | Position side: BOTH, LONG, SHORT |
| rows[].type | STRING | Order type |
| rows[].timeInForce | STRING | Time in force |
| rows[].time | LONG | Order time (milliseconds) |
| rows[].workingType | STRING | Working type |
| errors | ARRAY | Present only when one or more requested addresses could not be returned |
| errors[].address | STRING | The address that was left out of rows |
| errors[].errorMsg | STRING | Reason the address was left out of rows: This function can only be used after deposit, User privacy mode is enabled, this operation is not allowed., Failed to check privacy switch status for this address., or This user address is not bound to this builder. (only possible when userAddresses is explicitly supplied) |
Get Builder User Balances (USER_DATA)¶
Response:
{
"total": 1,
"currentPage": 1,
"totalPages": 1,
"pageSize": 50,
"hasMore": false,
"rows": [
{
"address": "0x1234...abcd",
"asset": "USDT",
"walletBalance": "23.72469206",
"price": "1",
"balanceInUsd": "23.72469206"
}
]
}
GET /fapi/v3/builder/userBalances
Query wallet balances for the users trading under the caller's builder code, with pagination. The authenticated account is used as the builder identity — there is no separate builder address parameter.
Weight: 5
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
| userAddresses | STRING | NO | Comma-separated list of up to 50 user wallet addresses to query |
| page | INT | NO | Page number, starting from 1. Default: 1 |
| limit | INT | NO | Number of results per page. Default 50; max 1000 |
| nonce | LONG | YES | Microsecond-level timestamp, used for replay attack prevention |
| signer | STRING | YES | Signer address associated with the authenticated account |
| signature | STRING | YES | Signature over the request body |
- If
userAddressesis sent, only those addresses are returned; each address must have already approved the caller's address as its builder, otherwise it is left out ofrowsand reported inerrorsinstead. - If
userAddressesis omitted, every user currently bound to this builder is paginated through instead, ordered by the time the binding was created. userAddressesaccepts at most 50 addresses per request; sending more is rejected.- The caller's own account must already have a generated on-chain address (i.e. have completed at least one deposit), or the request is rejected.
Response Fields:
| Field | Type | Description |
|---|---|---|
| total | LONG | Total number of matching users |
| currentPage | INT | Current page number |
| totalPages | INT | Total number of pages |
| pageSize | INT | Number of records per page |
| hasMore | BOOLEAN | Whether more pages are available |
| rows | ARRAY | List of balance records across the returned users |
| rows[].address | STRING | Wallet address of the balance owner |
| rows[].asset | STRING | Asset name |
| rows[].walletBalance | STRING | Wallet balance |
| rows[].price | STRING | Asset price used to compute balanceInUsd |
| rows[].balanceInUsd | STRING | Wallet balance converted to USD |
| errors | ARRAY | Present only when one or more requested addresses could not be returned |
| errors[].address | STRING | The address that was left out of rows |
| errors[].errorMsg | STRING | Reason the address was left out of rows: This function can only be used after deposit, User privacy mode is enabled, this operation is not allowed., Failed to check privacy switch status for this address., or This user address is not bound to this builder. (only possible when userAddresses is explicitly supplied) |
Get Builder User Position Risk (USER_DATA)¶
Response:
{
"total": 1,
"currentPage": 1,
"totalPages": 1,
"pageSize": 50,
"hasMore": false,
"rows": [
{
"address": "0x1234...abcd",
"symbol": "BTCUSDT",
"positionAmt": "20.000",
"entryPrice": "6563.66500",
"markPrice": "6679.50671178",
"unRealizedProfit": "2316.83423560",
"liquidationPrice": "5930.78",
"leverage": "10",
"maxNotionalValue": "20000000",
"marginType": "isolated",
"isolatedMargin": "15517.54150468",
"isAutoAddMargin": "false",
"positionSide": "LONG",
"notional": "133593.13423560",
"isolatedWallet": "13200.70726908",
"updateTime": 1625474304765
}
]
}
GET /fapi/v3/builder/userPositionRisk
Query current position information for the users trading under the caller's builder code, with pagination. The authenticated account is used as the builder identity — there is no separate builder address parameter.
Weight: 5
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
| userAddresses | STRING | NO | Comma-separated list of up to 50 user wallet addresses to query |
| symbol | STRING | NO | When sent, only positions on this symbol are returned |
| page | INT | NO | Page number, starting from 1. Default: 1 |
| limit | INT | NO | Number of results per page. Default 50; max 1000 |
| nonce | LONG | YES | Microsecond-level timestamp, used for replay attack prevention |
| signer | STRING | YES | Signer address associated with the authenticated account |
| signature | STRING | YES | Signature over the request body |
- If
userAddressesis sent, only those addresses are returned; each address must have already approved the caller's address as its builder, otherwise it is left out ofrowsand reported inerrorsinstead. - If
userAddressesis omitted, every user currently bound to this builder is paginated through instead, ordered by the time the binding was created.page/limitpage through the bound users, not the individual positions — each returned user may contribute zero or more rows. userAddressesaccepts at most 50 addresses per request; sending more is rejected.- The caller's own account must already have a generated on-chain address (i.e. have completed at least one deposit), or the request is rejected.
- For a user in One-way Mode, only the
BOTH-side position is returned; for a user in Hedge Mode, theLONG/SHORT-side positions are returned. liquidationPriceis reported as0whenever the underlying value would be negative.- This batch endpoint only returns positions with a non-zero
positionAmt. This differs from the single-accountGET /fapi/v3/positionRisk, which returns every symbol's position including ones withpositionAmt = 0.
Response Fields:
| Field | Type | Description |
|---|---|---|
| total | LONG | Total number of matching users on this page's underlying query |
| currentPage | INT | Current page number |
| totalPages | INT | Total number of pages |
| pageSize | INT | Number of records per page |
| hasMore | BOOLEAN | Whether more pages are available |
| rows | ARRAY | List of position records across the returned users |
| rows[].address | STRING | Wallet address of the position owner |
| rows[].symbol | STRING | Symbol |
| rows[].positionAmt | STRING | Position amount |
| rows[].entryPrice | STRING | Average entry price |
| rows[].markPrice | STRING | Mark price |
| rows[].unRealizedProfit | STRING | Unrealized profit |
| rows[].liquidationPrice | STRING | Liquidation price |
| rows[].leverage | STRING | Current initial leverage |
| rows[].maxNotionalValue | STRING | Maximum available notional with current leverage |
| rows[].marginType | STRING | Margin type: isolated or cross |
| rows[].isolatedMargin | STRING | Isolated margin |
| rows[].isAutoAddMargin | STRING | Whether auto-add-margin is enabled for the position |
| rows[].positionSide | STRING | Position side: BOTH, LONG, SHORT |
| rows[].notional | STRING | Position notional value |
| rows[].isolatedWallet | STRING | Isolated wallet balance |
| rows[].updateTime | LONG | Last update time (milliseconds) |
| errors | ARRAY | Present only when one or more requested addresses could not be returned |
| errors[].address | STRING | The address that was left out of rows |
| errors[].errorMsg | STRING | Reason the address was left out of rows: This function can only be used after deposit, User privacy mode is enabled, this operation is not allowed., Failed to check privacy switch status for this address., or This user address is not bound to this builder. (only possible when userAddresses is explicitly supplied) |
Get Builder User Commission Rates (USER_DATA)¶
Response:
{
"total": 1,
"currentPage": 1,
"totalPages": 1,
"pageSize": 50,
"hasMore": false,
"rows": [
{
"address": "0x1234...abcd",
"symbol": "BTCUSDT",
"makerCommissionRate": "0.0002",
"takerCommissionRate": "0.0004"
}
]
}
GET /fapi/v3/builder/userCommissionRates
Query commission rates on a symbol for the users trading under the caller's builder code, with pagination. The authenticated account is used as the builder identity — there is no separate builder address parameter.
Weight: 5
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
| userAddresses | STRING | NO | Comma-separated list of up to 50 user wallet addresses to query |
| symbol | STRING | YES | Symbol to look up commission rates for |
| page | INT | NO | Page number, starting from 1. Default: 1 |
| limit | INT | NO | Number of results per page. Default 50; max 1000 |
| nonce | LONG | YES | Microsecond-level timestamp, used for replay attack prevention |
| signer | STRING | YES | Signer address associated with the authenticated account |
| signature | STRING | YES | Signature over the request body |
- If
userAddressesis sent, only those addresses are returned; each address must have already approved the caller's address as its builder, otherwise it is left out ofrowsand reported inerrorsinstead. - If
userAddressesis omitted, every user currently bound to this builder is paginated through instead, ordered by the time the binding was created. userAddressesaccepts at most 50 addresses per request; sending more is rejected.- The caller's own account must already have a generated on-chain address (i.e. have completed at least one deposit), or the request is rejected.
- Each user's
makerCommissionRate/takerCommissionRateis derived from their own fee tier plus any per-symbol fee adjustment on their account, the same computation used byGET /fapi/v3/commissionRate.
Response Fields:
| Field | Type | Description |
|---|---|---|
| total | LONG | Total number of matching users |
| currentPage | INT | Current page number |
| totalPages | INT | Total number of pages |
| pageSize | INT | Number of records per page |
| hasMore | BOOLEAN | Whether more pages are available |
| rows | ARRAY | List of commission-rate records |
| rows[].address | STRING | Wallet address of the user |
| rows[].symbol | STRING | Symbol |
| rows[].makerCommissionRate | STRING | Maker commission rate |
| rows[].takerCommissionRate | STRING | Taker commission rate |
| errors | ARRAY | Present only when one or more requested addresses could not be returned |
| errors[].address | STRING | The address that was left out of rows |
| errors[].errorMsg | STRING | Reason the address was left out of rows: This function can only be used after deposit, User privacy mode is enabled, this operation is not allowed., Failed to check privacy switch status for this address., or This user address is not bound to this builder. (only possible when userAddresses is explicitly supplied) |
Get Builder Trades (USER_DATA)¶
Response:
{
"total": 42,
"currentPage": 1,
"totalPages": 1,
"pageSize": 50,
"hasMore": false,
"rows": [
{
"tradeId": 698759,
"insertTime": 1751500000000,
"symbol": "BTCUSDT",
"positionSide": "SHORT",
"price": "7819.01",
"qty": "0.002",
"baseAsset": "BTC",
"baseType": "CRYPTO",
"quoteAsset": "USDT",
"side": "SELL",
"activeBuy": false,
"feeAsset": "USDT",
"totalQuota": "15.63802",
"fee": "-0.07819010",
"orderId": 25851813,
"realizedProfit": "-0.91539999",
"marginAsset": "USDT",
"userAddress": "0x1234...abcd",
"builderFee": "0.00050000"
}
]
}
GET /fapi/v3/builder/userTrades
Query the paginated trade history of users trading under the caller's builder code. The authenticated account is used as the builder identity — there is no separate builder address parameter.
Weight: 5
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
| userAddresses | STRING | NO | Comma-separated list of up to 50 user wallet addresses to query |
| startTime | LONG | NO | Timestamp in ms |
| endTime | LONG | NO | Timestamp in ms |
| page | INT | NO | Page number, starting from 1. Default: 1 |
| limit | INT | NO | Number of results per page. Default 50; max 1000 |
| nonce | LONG | YES | Microsecond-level timestamp, used for replay attack prevention |
| signer | STRING | YES | Signer address associated with the authenticated account |
| signature | STRING | YES | Signature over the request body |
- If neither
startTimenorendTimeis sent, the recent 7 days' data is returned. - The resolved
startTimemust not be earlier than 90 days before the current time, or the request is rejected. endTimecannot be more than 1 day ahead of the current server time.- Results are ordered by trade time descending.
- If
userAddressesis sent, only trades of those addresses are returned; each address must have already approved the caller's address as its builder, otherwise it is left out ofrowsand reported inerrorsinstead. - If
userAddressesis omitted, trades of every user currently bound to this builder are returned instead. userAddressesaccepts at most 50 addresses per request; sending more is rejected.
Response Fields:
| Field | Type | Description |
|---|---|---|
| total | LONG | Total number of matching trades |
| currentPage | INT | Current page number |
| totalPages | INT | Total number of pages |
| pageSize | INT | Number of records per page |
| hasMore | BOOLEAN | Whether more pages are available |
| rows | ARRAY | List of trade records |
| rows[].tradeId | LONG | Trade ID |
| rows[].insertTime | LONG | Trade time (milliseconds) |
| rows[].symbol | STRING | Symbol |
| rows[].positionSide | STRING | Position side: BOTH, LONG, SHORT |
| rows[].price | STRING | Trade price |
| rows[].qty | STRING | Trade quantity |
| rows[].baseAsset | STRING | Base asset |
| rows[].baseType | STRING | Symbol type: CRYPTO or STOCK |
| rows[].quoteAsset | STRING | Quote asset |
| rows[].side | STRING | Trade side |
| rows[].activeBuy | BOOLEAN | Whether the trade was an active buy |
| rows[].feeAsset | STRING | Commission asset |
| rows[].totalQuota | STRING | Notional value of the trade (price × qty) |
| rows[].fee | STRING | Fee for the trade, from the trading user's perspective: negative when a fee is charged, positive when a rebate is applied. Unlike most other decimal fields in this response, fee is not stripped of trailing zeros |
| rows[].orderId | LONG | Order ID |
| rows[].realizedProfit | STRING | Realized profit |
| rows[].marginAsset | STRING | Margin (settlement) asset |
| rows[].userAddress | STRING | Wallet address of the trading user |
| rows[].builderFee | STRING | Builder fee charged on the trade |
| errors | ARRAY | Present only when one or more requested addresses could not be returned |
| errors[].address | STRING | The address that was left out of rows |
| errors[].errorMsg | STRING | Reason the address was left out of rows: This function can only be used after deposit, User privacy mode is enabled, this operation is not allowed., Failed to check privacy switch status for this address., or This user address is not bound to this builder. (only possible when userAddresses is explicitly supplied) |
Get Builder All Orders (USER_DATA)¶
Response:
{
"total": 1,
"currentPage": 1,
"totalPages": 1,
"pageSize": 50,
"hasMore": false,
"rows": [
{
"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",
"closePosition": false,
"symbol": "BTCUSDT",
"time": 1579276756075,
"timeInForce": "GTC",
"type": "TRAILING_STOP_MARKET",
"activatePrice": "9020",
"priceRate": "0.3",
"updateTime": 1579276756075,
"workingType": "CONTRACT_PRICE",
"priceProtect": false,
"address": "0x1234...abcd"
}
]
}
GET /fapi/v3/builder/userAllOrders
Query the paginated historical order records (active, canceled, or filled) of users trading under the caller's builder code. The authenticated account is used as the builder identity — there is no separate builder address parameter.
Weight: 5
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
| userAddresses | STRING | NO | Comma-separated list of up to 50 user wallet addresses to query |
| symbol | STRING | NO | When sent, only orders on this symbol are returned |
| startTime | LONG | NO | Timestamp in ms |
| endTime | LONG | NO | Timestamp in ms |
| page | INT | NO | Page number, starting from 1. Default: 1 |
| limit | INT | NO | Number of results per page. Default 50; max 1000 |
| nonce | LONG | YES | Microsecond-level timestamp, used for replay attack prevention |
| signer | STRING | YES | Signer address associated with the authenticated account |
| signature | STRING | YES | Signature over the request body |
- If neither
startTimenorendTimeis sent, the recent 7 days' data is returned. - The resolved
startTimemust not be earlier than 90 days before the current time, or the request is rejected. endTimecannot be more than 1 day ahead of the current server time.- If
userAddressesis sent, only orders of those addresses are returned; each address must have already approved the caller's address as its builder, otherwise it is left out ofrowsand reported inerrorsinstead. - If
userAddressesis omitted, orders of every user currently bound to this builder are returned instead. userAddressesaccepts at most 50 addresses per request; sending more is rejected.
Response Fields:
| Field | Type | Description |
|---|---|---|
| total | LONG | Total number of matching orders |
| currentPage | INT | Current page number |
| totalPages | INT | Total number of pages |
| pageSize | INT | Number of records per page |
| hasMore | BOOLEAN | Whether more pages are available |
| rows | ARRAY | List of order records |
| rows[].orderId | LONG | Order ID |
| rows[].symbol | STRING | Symbol |
| rows[].status | STRING | Order status |
| rows[].clientOrderId | STRING | Client order ID |
| rows[].price | STRING | Order price |
| rows[].avgPrice | STRING | Average filled price |
| rows[].origQty | STRING | Original order quantity |
| rows[].executedQty | STRING | Executed quantity |
| rows[].cumQuote | STRING | Cumulative quote quantity |
| rows[].timeInForce | STRING | Time in force |
| rows[].type | STRING | Order type |
| rows[].reduceOnly | BOOLEAN | Whether reduce-only |
| rows[].side | STRING | Order side |
| rows[].stopPrice | STRING | Stop price. Please ignore when order type is TRAILING_STOP_MARKET |
| rows[].workingType | STRING | Working type |
| rows[].origType | STRING | Original order type |
| rows[].time | LONG | Order time (milliseconds) |
| rows[].updateTime | LONG | Update time (milliseconds) |
| rows[].priceRate | STRING | Callback rate, only returned with TRAILING_STOP_MARKET orders |
| rows[].activatePrice | STRING | Activation price, only returned with TRAILING_STOP_MARKET orders |
| rows[].positionSide | STRING | Position side: BOTH, LONG, SHORT |
| rows[].closePosition | BOOLEAN | Whether Close-All |
| rows[].priceProtect | BOOLEAN | Whether the conditional order trigger is protected |
| rows[].address | STRING | Wallet address of the order owner |
| errors | ARRAY | Present only when one or more requested addresses could not be returned |
| errors[].address | STRING | The address that was left out of rows |
| errors[].errorMsg | STRING | Reason the address was left out of rows: This function can only be used after deposit, User privacy mode is enabled, this operation is not allowed., Failed to check privacy switch status for this address., or This user address is not bound to this builder. (only possible when userAddresses is explicitly supplied) |
Get Builder Approved User List (USER_DATA)¶
Response:
{
"rows": [
{
"userAddress": "0x1234...abcd",
"builderAddress": "0x5678...efgh",
"maxFeeRate": 0.0001,
"builderName": "MyBuilder",
"approveTime": 1768903037082
}
],
"total": 1,
"currentPage": 1,
"totalPages": 1,
"pageSize": 100,
"hasMore": false
}
GET /fapi/v3/builder/approvedUserList
Query the list of users who have approved the caller's address as their builder.
Weight: 5
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
| startTime | LONG | NO | Only return users approved after this timestamp (ms). If omitted, defaults to 0, meaning no time filter is applied and all approved users are returned. |
| endTime | LONG | NO | Only return users approved on or before this timestamp (ms). If omitted, defaults to the current server time. |
| page | INT | NO | Page number, starting from 1. Defaults to 1. |
| limit | INT | NO | Page size. Defaults to 100, maximum 1000. |
| nonce | LONG | YES | Microsecond-level timestamp, used for replay attack prevention |
| signer | STRING | YES | Signer address associated with the authenticated account |
| signature | STRING | YES | Signature over the request body |
- The authenticated account is used as the builder identity — there is no separate
builderaddress parameter. - Results are paginated; use
pageandlimitto page through the full result set.
Response Fields:
| Field | Type | Description |
|---|---|---|
| rows | ARRAY | List of approved-user records for the current page |
| rows[].userAddress | STRING | Wallet address of the approved user |
| rows[].builderAddress | STRING | Builder's wallet address |
| rows[].maxFeeRate | DECIMAL | Maximum fee rate the user granted this builder |
| rows[].builderName | STRING | Builder name set by the user when approving |
| rows[].approveTime | LONG | Timestamp (ms) when the user approved the builder |
| total | LONG | Total number of matching records across all pages |
| currentPage | INT | Current page number |
| totalPages | INT | Total number of pages |
| pageSize | INT | Effective page size used |
| hasMore | BOOLEAN | Whether more pages exist after this one |
Get All Asset Logos¶
Response:
[
{
"assetCode": "BTC",
"logoUrl": "https://example.com/logo/btc.png"
},
{
"assetCode": "ETH",
"logoUrl": "https://example.com/logo/eth.png"
}
]
GET /fapi/v3/common/asset/all-asset-logo
Query the logo URL of every active asset. This is a public endpoint — no authentication is required.
Weight: 1
Parameters:
None
Response Fields:
| Field | Type | Description |
|---|---|---|
| assetCode | STRING | Asset name |
| logoUrl | STRING | URL of the asset's logo image |