Futures · Trade
Classic Account — Futures · Trade
Place Order
Rate limit: 10 requests/second/UID
Ignore the tradeSide parameter when position mode is in one-way-mode
In “hedge-mode”, when there is limit close order occupying the position, if the size of next market close order and limit close orders exceeds the position size, it will return an “insufficient position error” instead of cancelling the current limit order and executing the market order
hedge position mode: Open long: "side"=buy, "tradeSide"=open; Close long: "side"=buy, "tradeSide"=close; Open short: "side"=sell, "tradeSide"=open; Close short: "side"=sell, "tradeSide"=close; one-way position mode: "side"=buy and sell, tradeSide: ignore
In one-way-mode position mode, if the total size of the new reduce-only order and the existing reduce-only orders exceeds the position size, the system will cancel the existing reduce-only orders sequentially based on their creation order until the total size of the new and existing reduce-only orders is less than or equal to the position size. Additionally, the response for the latest reduce-only order request will not include an orderId. You can use the clientOid set in the request to query order details or retrieve the orderId from the current pending orders.
When in hedge Mode, if a limit close order is occupying a position, and a subsequent market close order (its quantity plus the limit order's quantity) exceeds the total position size, it will not report an insufficient position error. It also won't cancel the limit order that's occupying the position. Instead, the quantity of the limit close order will be preserved, and the market order will close only the quantity remaining after subtracting the limit order's quantity from the total position size. For example: If you have a position of 100, a limit order occupies 70, and you then place a market close order for 50, it will not report an insufficient position error, nor will it cancel the occupying limit order to execute the market order. Instead, it will directly close a quantity of 30.
When in hedge Mode,if the existing quantity is equal to the limit close position order of the held position, a newly added close position order will automatically cancel the limit order that has occupied the position.
For elite traders, please strictly adhere to the list of trading pairs specified in the Available trading pairs and parameters for elite traders when placing orders using the Copy Trading API Key. Trading pairs outside the announced list are not available for copy trading.
API Broker rebate identifier:
The following code block needs to be added to the HTTP Header of the request.
"X-CHANNEL-API-CODE":"your-channel-api-code"
Place Order › Request Parameters
symbolTrading pair, e.g. ETHUSDT
productTypeProduct type
USDT-FUTURES USDT-M Futures
COIN-FUTURES Coin-M Futures
USDC-FUTURES USDC-M Futures
marginModePosition mode
isolated: isolated margin
crossed: crossed margin
marginCoinMargin coin(capitalized)
sizeAmount (base coin) To get the decimal places of size:Get Contract Config
sideTrade side
buy: Buy(one-way-mode); Long position direction(hedge-mode)
sell: Sell(one-way-mode); Short position direction(hedge-mode)
orderTypeOrder type
limit: limit orders
market: market orders
pricePrice of the order.
Required if the "orderType" is limit
To get the decimal places of size:Get Contract Config
tradeSideTrade type
Only required in hedge-mode
open: Open position
close: Close position
forceOrder expiration date.
Required if the orderType is limit
ioc: Immediate or cancel
fok: Fill or kill
gtc: Good till canceled(default value)
post_only: Post only
clientOidCustomize order ID
reduceOnlyWhether or not to just reduce the position: YES, NO
Default: NO.
Applicable only in one-way-position mode
presetStopSurplusPriceTake-profit value No take-profit is set if the field is empty.
presetStopLossPriceStop-loss value No stop-loss is set if the field is empty.
presetStopSurplusExecutePricePreset stop - profit execution price.
presetStopLossExecutePricePreset stop-loss execution price.
stpModeSTP Mode(Self Trade Prevention)
none: not setting STP(default value)
cancel_taker: cancel taker order
cancel_maker: cancel maker order
cancel_both: cancel both of taker and maker orders
Place Order › Response Parameters
Successful response
codemsgrequestTimeorderIdOrder ID
clientOidCustomize order ID
Reversal
Rate limit: 10 req/sec/UID Rate limit: 1 req/sec/UID for copy trading traders
side and tradeSide:
- In one-way-mode, do NOT add the tradeSide parameter in request
- In hedge-mode, tradeSide is required
- Reversal the current long position and open a short position: side=buy, tradeSide
- Reversal the current short position and open a long position: side=sell, tradeSide
size: represents the reversal size
- In one-way-mode, the whole position will be reversed if no size was set in the request
- In hedge-mode:
- If the size set is less than the current position size, the size of position will be closed and the same size reversal position will be opened
For example, for a ETHUSDT size 20 long position, if the size was set 3 in request, then the current long position size will be reduced to 17, and a new size 3 short position will be opened
- If the size set is equal to or more than the current position size, the whole position will be reversed
For example, for a ETHUSDT size 10 long position, if the size was set 10 or 11 in request, then the current position will be closed and a new 10 size short position will be opened
API Broker rebate identifier:
The following code block needs to be added to the HTTP Header of the request.
"X-CHANNEL-API-CODE":"your-channel-api-code"
Reversal › Request Parameters
symbolTrading pair, e.g. ETHUSDT
marginCoinmarginCoin e.g: USDT
productTypeProduct type
USDT-FUTURES USDT-M Futures
COIN-FUTURES Coin-M Futures
USDC-FUTURES USDC-M Futures
sideOrder direction buy: Buy sell: Sell
sizeAmount
tradeSideDirection Required in open and close (hedge mode) position . For one-way positions, this field will be ignored Open and Close Notes: For open long, fill in"Buy"; tradeSide should be "Open" For open short, fill in "Sell"; tradeSide should be "Open" For close long, fill in "Buy"; tradeSide should be "Close" For close short, fill in "Sell"; tradeSide should be "Close"
clientOidCustomize order ID
Reversal › Response Parameters
Successful response
codemsgrequestTimeorderIdOrder ID
clientOidCustomize order ID
Batch Order
Rate limit: 5 requests/second/UID Rate limit: 1 request/second/UID for copy trading traders
Supports TP/SL feature. If the current underlying asset does not exist in the position, it is intended to preset the TP/SL. If the current underlying exists in the position, it is intended to modify the TP/SL
Ignore the tradeSide parameter when position mode is in one-way-mode
API Broker rebate identifier:
The following code block needs to be added to the HTTP Header of the request.
"X-CHANNEL-API-CODE":"your-channel-api-code"
Batch Order › Request Parameters
symbolTrading pair
productTypeProduct type
USDT-FUTURES USDT-M Futures
COIN-FUTURES Coin-M Futures
USDC-FUTURES USDC-M Futures
marginCoinMargin coin, must be capitalized
marginModePosition mode
isolated: isolated margin
crossed: crossed margin
Order list, maximum length: 50
Batch Order › Response Parameters
Successful response
codemsgrequestTimeSuccessful order list
Failed order list
resultWhether all orders succeeded. true: all succeeded; false: at least one failed
Modify Order
Speed limit is 10 times/s for average users. Frequency limit imposed according to user ID
Interface for order modification, used to modify an pending order, such as its TP/SL and/or price/size.
Modifying size and price will cancel the old order; then create a new order asynchronously, modify the preset TPSL will not cancel the old order. Modifying size and price, please pass in both, not just one of them Modify the order price, size and preset TPSL according to orderId or clientOId It is only allowed to modify the new status limit order. If the size, price and TPSL all is set in the request, then the TPSL will not work Modify the limit order price and size, please be sure to provide newClientOid, because the orderId of the new order cannot be returned synchronously, so you need to use newClientOid to help you query order information Modifying the order size needs to meet the minimum order quantity If you only modify the TPSL, please do not pass price and size. If you only pass one of TP or SL, the other one will be cancelled
Modify Order › Request Parameters
symbolTrading pair, e.g. ETHUSDT
productTypeProduct type
USDT-FUTURES USDT-M Futures
COIN-FUTURES Coin-M Futures
USDC-FUTURES USDC-M Futures
newClientOidNew customized order ID after order modification
orderIdOrder ID Either orderId or clientOid is required. If both are entered, orderId prevails.
clientOidCustomize order ID Either orderId or clientOid is required. If both are entered, orderId prevails.
newSizeAmount of the modified transaction The amount stays unchanged if the field if left blank.
newPriceModified price for placing new orders.
- When the existing order type is Limit, the original price will be maintained if the field is left empty.
- When the existing order type is Limit market, the field should not be set.
newPresetStopSurplusPriceModifying take-profit
- If the original order has take-profit set and the field is empty, the original value will be kept.
- If the original order has take-profit set and the field is filled in with a value, TP will be updated; if the original order has take-profit set and the field is not set, a new take-profit value will be added. If there was a TP value and a 0 is filled in the filled, the existing TP will be deleted.
newPresetStopLossPriceModifying stop-loss
- If the original order has stop-loss set and the field is empty, the original value will be kept.
- If the original order has stop-loss set and the field is filled in with a value, TP will be updated; if the original order has stop-loss set and the field is not set, a new stop-loss value will be added. If there was a SL value and a 0 is filled in the filled, the existing SL will be deleted.
Modify Order › Response Parameters
Successful response
codemsgrequestTimeorderIdOrder ID
clientOidCustomize order ID
Cancel Order
Frequency limit: 10 times/1s
Cancel a pending order
Cancel Order › Request Parameters
symbolTrading pair
productTypeProduct type
USDT-FUTURES USDT-M Futures
COIN-FUTURES Coin-M Futures
USDC-FUTURES USDC-M Futures
marginCoinMargin coin must be capitalized
orderIdOrder ID Either orderId or clientOid is required. If both are present, orderId prevails.
clientOidCustomize order ID Either orderId or clientOid is required. If both are present, orderId prevails.
Cancel Order › Response Parameters
Successful response
codemsgrequestTimeorderIdOrder ID
clientOidClient customized ID
Batch Cancel
Speed limit is 10 times/s for average users. Frequency limit imposed according to user ID
Order cancelling interface, can be used to cancel by product type and trading pair.
Batch Cancel › Request Parameters
productTypeProduct type
USDT-FUTURES USDT-M Futures
COIN-FUTURES Coin-M Futures
USDC-FUTURES USDC-M Futures
Order ID list.maximum length: 50 If filled in, symbol must not be null and must be aligned with symbol/productType.
symbolTrading pair, e.g. ETHUSDT
It's required when orderIdList is set
marginCoinMargin coin must be capitalized
Batch Cancel › Response Parameters
Successful response
codemsgrequestTimeThe collection of successfully cancelled orders.
The collection of unsuccessfully cancelled orders.
Flash Close Position
Frequency limit: 1 time/1s (User ID)
close position at market price
API Broker rebate identifier:
The following code block needs to be added to the HTTP Header of the request.
"X-CHANNEL-API-CODE":"your-channel-api-code"
Flash Close Position › Request Parameters
productTypeProduct type
USDT-FUTURES USDT-M Futures
COIN-FUTURES Coin-M Futures
USDC-FUTURES USDC-M Futures
symbolTrading pair
holdSidePosition direction
- In one-way position mode(buy or sell): This field should be left blank. Will be ignored if filled in.
- In hedge-mode position(open or close): All positions will be closed if the field is left blank; Positions of the specified direction will be closed is the field is filled in.
long: Long position;short: Short position
Flash Close Position › Response Parameters
Successful response
codemsgrequestTimeThe collection of successfully closed orders
The collection of unsuccessfully closed orders The close order may fail when the pair is in delivery or in risk control handling
Get Order Detail
Frequency limit: 10 times/1s (uid)
Get order detail
Request Parameters
symbolProduct ID must be capitalized
productTypeProduct type
USDT-FUTURES USDT-M Futures
COIN-FUTURES Coin-M Futures
USDC-FUTURES USDC-M Futures
orderIdOrder ID Either 'orderId' or 'clientOid' is required.
clientOidCustom order ID Either 'orderId' or 'clientOid' is required.
Get Order Detail › Response Parameters
Successful response
codemsgrequestTimesymbolTrading pair
sizeAmount
orderIdOrder ID
clientOidCustomize order ID
baseVolumeAmount of coins traded
priceAvgAverage price
feeTransaction fee
priceOrder price
stateOrder status
live: New order, waiting for a match in orderbook
partially_filled: Partially filled
filled: All filled
canceled: the order is cancelled
sideDirection
buy
sell
forceOrder expiration date
ioc: Immediate or cancel
fok: Fill or kill
gtc: Good till canceled
post only: post only orders
totalProfitsTotal PnL
posSidePosition direction
long: hedge mode long position
short: hedge mode short position
net: one-way position
marginCoinMargin coin
presetStopSurplusPriceSet TP
presetStopSurplusTypePreset Take Profit Trigger type fill_price: market price; mark_price: mark price
presetStopSurplusExecutePricePreset Take Profit Execution price
presetStopLossPriceSet SL
presetStopLossTypePreset Stop Loss Trigger type fill_price: market price; mark_price: mark price
presetStopLossExecutePricePreset Stop Loss Execution price
quoteVolumeTrading amount in quoting coin
orderTypeOrder type
limit
market
leverageLeverage
marginModeMargin mode
isolated: isolated margin
crossed: cross margin
reduceOnlyWhether or not to just reduce the position.
YES
NO
enterPointSourceOrder source WEB: Orders created on the website API: Orders created on API SYS: System managed orders, usually generated by forced liquidation logic ANDROID: Orders created on the Android app IOS: Orders created on the iOS app
tradeSideDirection
close: Close (open and close mode)
open: Open (open and close mode)
reduce_close_long: Liquidate partial long positions for hedge position mode
reduce_close_short:Liquidate partial short positions for hedge position mode
burst_close_long:Liquidate long positions for hedge position mode
burst_close_short:Liquidate short positions for hedge position mode
offset_close_long:Liquidate partial long positions for netting for hedge position mode
offset_close_short:Liquidate partial short positions for netting for hedge position mode
delivery_close_long:Delivery long positions for hedge position mode
delivery_close_short:Delivery short positions for hedge position mode
dte_sys_adl_close_long:ADL close long position for hedge position mode
dte_sys_adl_close_short:ADL close short position for hedge position mode
buy_single:Buy, one way postion mode
sell_single:Sell, one way postion mode
reduce_buy_single:Liquidate partial positions, buy, one way position mode
reduce_sell_single:Liquidate partial positions, sell, one way position mode
burst_buy_single:Liquidate short positions, buy, one way postion mode
burst_sell_single:Liquidate partial positions, sell, one way position mode
delivery_sell_single:Delivery sell, one way position mode
delivery_buy_single:Delivery buy, one way position mode
dte_sys_adl_buy_in_single_side_mode:ADL close position, buy, one way position mode
dte_sys_adl_sell_in_single_side_mode:ADL close position, sell, one way position mode
newTradeSideTrade direction (new). Returned together with tradeSide for upgraded accounts; may be null for legacy orders
posModePosition mode
one_way_mode: one-way position
hedge_mode: two-way position
orderSourceOrder source normal: Normal order market: market order profit_market: Market TP order loss_market: Market SL order Trader_delegate: Elite trade order trader_profit: Trader takes profit trader_loss: Trader stops loss reverse: Reversed orders trader_reverse: Reversed elite trades profit_limit: Take-profit limit order loss_limit: Stop-loss limit order liquidation: Liquidation order delivery_close_long: close long positions delivery_close_short: close short positions pos_profit_limit: Position take-profit limit order pos_profit_market: Position take-profit market order pos_loss_limit: Position stop-loss limit order pos_loss_market: Position stop-loss market order profit_chase: Take Profit Chase Order loss_chase: Stop Loss Chase Order follower_delegate: Follower Delegate Order reduce_offset: Reduce Position Offset Order market_risk: Best Price Risk Handling plan_limit: Limit Plan Order plan_market: Best Price Plan Order pos_loss_limit: Position Stop Loss Limit strategy_positive: Strategy-Positive Grid strategy_reverse: Strategy-Reverse Grid strategy_unlimited: Unlimited Strategy move_limit: Limit Moving Take Profit and Stop Loss move_market: Best Price Moving Take Profit and Stop Loss tracking_limit: Limit Trailing Order tracking_market: Best Price Trailing Order strategy_dca_positive: DCA Strategy-Positive strategy_dca_reverse: DCA Strategy-Reverse strategy_oco_limit: Strategy-OCO Limit Order strategy_oco_trigger: Strategy-OCO Trigger Order modify_order_limit: Limit Modify Order strategy_regular_buy: Strategy-Regular Buy strategy_grid_middle: Strategy-Neutral Grid
cancelReasonCancel reason
normal_cancel: Normal cancel
stp_cancel: Cancelled by STP
cTimeCreation time, ms
uTimeUpdate time, ms
Get Order Fill Details
Speed limit is 10 times/s for average users. Frequency limit imposed according to user ID
Get order fill details
Request Parameters
productTypeProduct type
USDT-FUTURES USDT-M Futures
COIN-FUTURES Coin-M Futures
USDC-FUTURES USDC-M Futures
orderIdOrder ID
symbolTrading pair, e.g. ETHUSDT
idLessThanRequests the content on the page before the tradeId (older data).
startTimeStart time (time stamp in milliseconds) (The maximum time span supported is three months. The default end time is three months if no value is set for the end time. ) (For Managed Sub-Account, the StartTime cannot be earlier than the binding time)
endTimeEnd time (time stamp in milliseconds) (The maximum time span supported is three months. The default start time is three months ago if no value is set for the start time. )
limitNumber of queries: Default: 100, maximum: 100
Get Order Fill Details › Response Parameters
Successful response
codemsgrequestTimeTransaction details
endIdThe final Transaction ID. This is used when idLessThan/idGreaterThan is set as a range.
Get Historical Transaction Details
Frequency limit: 10 times/1s (uid)
Get order fill history
Request Parameters
productTypeProduct type
USDT-FUTURES USDT-M Futures
COIN-FUTURES Coin-M Futures
USDC-FUTURES USDC-M Futures
It does not support to query the data in demo trading
orderIdOrder ID Either orderId or clientOid is required. If both are entered, orderId prevails.
symbolTrading pair, e.g. ETHUSDT
startTimeStart timestamp Unix timestamp in milliseconds format, e.g. 1597026383085 (The maximum time span supported is a week. The default end time is a week if no value is set for the end time. ) (For Managed Sub-Account, the StartTime cannot be earlier than the binding time)
endTimeEnd timestamp Unix timestamp in milliseconds format, e.g. 1597026383085 (The maximum time span supported is a week. The default start time is a week ago if no value is set for the start time. )
idLessThanRequests the content on the page before this ID (older data), the value input should be the endId of the corresponding interface.
limitNumber of queries: Maximum: 100, default: 100
Get Historical Transaction Details › Response Parameters
Successful response
codemsgrequestTimeendIdLast query ended order ID
Order list
Get Pending Orders
Rate limit: 10 req/sec/UID
To query all existing pending orders.
Request Parameters
productTypeProduct type
USDT-FUTURES USDT-M Futures
COIN-FUTURES Coin-M Futures
USDC-FUTURES USDC-M Futures
orderIdOrder ID; If both orderId and clientOidare entered, orderId prevails.
clientOidCustomize order ID; If both orderId and clientOid are entered, orderId prevails.
symbolTrading pair, e.g. ETHUSDT
statusOrder status
If not specified, all ordered with a status of live (not filled yet) will be returned.
live: pending orders
partially_filled: Partially filled
idLessThanRequests the content on the page before this ID (older data), the value input should be the endId of the corresponding interface.
startTimeStart timestamp Unix timestamp in milliseconds format, e.g. 1597026383085 (The maximum time span supported is three months. The default end time is three months if no value is set for the end time. )
endTimeEnd timestamp Unix timestamp in milliseconds format, e.g. 1597026383085 (The maximum time span supported is three months. The default start time is three months ago if no value is set for the start time. )
limitNumber of queries: Maximum: 100, default: 100
Get Pending Orders › Response Parameters
Successful response
codemsgrequestTimeOrder list
endIdThe final order ID. This is used when idLessThan/idGreaterThan is set as a range.
Get History Order
Rate limit: 10 req/sec/UID
Get history order(It only supports to get the data within 90days. The older data can be downloaded from web)
Request Parameters
productTypeProduct type
USDT-FUTURES USDT-M Futures
COIN-FUTURES Coin-M Futures
USDC-FUTURES USDC-M Futures
orderIdOrder ID If both orderId and clientOid are entered, orderId prevails.
clientOidCustomize order ID If both orderId and clientOid are entered, orderId prevails.
symbolTrading pair, e.g. ETHUSDT
idLessThanRequests the content on the page before this ID (older data), the value input should be the endId of the previous request response
orderSourceOrder sources normal: Normal order market: market order profit_market: Market TP order loss_market: Market SL order Trader_delegate: Elite trade order trader_profit: Trader takes profit trader_loss: Trader stops loss reverse: Reversed orders trader_reverse: Reversed elite trades profit_limit: Take-profit limit order loss_limit: Stop-loss limit order liquidation: Liquidation order delivery_close_long: close long positions delivery_close_short: close short positions pos_profit_limit: Position take-profit limit order pos_profit_market: Position take-profit market order pos_loss_limit: Position stop-loss limit order pos_loss_market: Position stop-loss market order
startTimeStart timestamp Unix timestamp in milliseconds format, e.g. 1597026383085 (For Managed Sub-Account, the StartTime cannot be earlier than the binding time)
endTimeEnd timestamp Unix timestamp in milliseconds format, e.g. 1597026383085
limitNumber of queries: Maximum: 100, default: 100
Get History Order › Response Parameters
Successful response
codemsgrequestTimeendIdLast query ended order ID
Order list
Cancel All Orders
Rate limit: 10 req/sec/UID
Cancel All Orders › Request Parameters
productTypeProduct type
USDT-FUTURES USDT-M Futures
COIN-FUTURES Coin-M Futures
USDC-FUTURES USDC-M Futures
marginCoinMargin coin, must be capitalized
requestTimerequest Time Unix millisecond timestamp
receiveWindowvalid window period Unix millisecond timestamp Unix millisecond timestamp
Cancel All Orders › Response Parameters
Successful response
codemsgrequestTimeThe collection of successfully cancelled orders.
The collection of unsuccessfully cancelled orders.
