v26

latestOpenAPI 3.0.2raw.githubusercontent.com2024-10-0834042975.6 KB
Trade

New Order List - OTO (TRADE)

Places an OTO.

  • An OTO (One-Triggers-the-Other) is an order list comprised of 2 orders.
  • The first order is called the working order and must be LIMIT or LIMIT_MAKER. Initially, only the working order goes on the order book.
  • The second order is called the pending order. It can be any order type except for MARKET orders using parameter quoteOrderQty. The pending order is only placed on the order book when the working order gets fully filled.
  • If either the working order or the pending order is cancelled individually, the other order in the order list will also be canceled or expired.
  • When the order list is placed, if the working order gets immediately fully filled, the placement response will show the working order as FILLED but the pending order will still appear as PENDING_NEW. You need to query the status of the pending order again to see its updated status.
  • OTOs add 2 orders to the unfilled order count, EXCHANGE_MAX_NUM_ORDERS filter and MAX_NUM_ORDERS filter.

Weight: 1

post/api/v3/orderList/oto

Query parameters

symbolstring required
Example:BNBUSDT

Trading symbol, e.g. BNBUSDT

listClientOrderIdstring

Arbitrary unique ID among open order lists. Automatically generated if not sent. A new order list with the same listClientOrderId is accepted only when the previous one is filled or completely expired. listClientOrderId is distinct from the workingClientOrderId and the pendingClientOrderId.

newOrderRespType'ACK' | 'RESULT' | 'FULL'

Set the response JSON.

selfTradePreventionMode'EXPIRE_TAKER' | 'EXPIRE_MAKER' | 'EXPIRE_BOTH' | 'NONE'
Example:EXPIRE_TAKER

The allowed enums is dependent on what is configured on the symbol. The possible supported values are EXPIRE_TAKER, EXPIRE_MAKER, EXPIRE_BOTH, NONE.

workingType'LIMIT' | 'LIMIT_MAKER' required

Supported values: LIMIT,LIMIT_MAKER

workingSide'BUY' | 'SELL' required

BUY,SELL

workingClientOrderIdstring

Arbitrary unique ID among open orders for the working order. Automatically generated if not sent.

workingPricenumber double required
workingQuantitynumber double required

Sets the quantity for the working order.

workingIcebergQtynumber double required

This can only be used if workingTimeInForce is GTC.

workingTimeInForce'GTC' | 'IOC' | 'FOK'

GTC, IOC, FOK

workingStrategyIdnumber double

Arbitrary numeric value identifying the working order within an order strategy.

workingStrategyTypeinteger

Arbitrary numeric value identifying the working order strategy. Values smaller than 1000000 are reserved and cannot be used.

pendingType'LIMIT' | 'MARKET' | 'STOP_LOSS' | 'STOP_LOSS_LIMIT' | 'TAKE_PROFIT' | 'TAKE_PROFIT_LIMIT' | 'LIMIT_MAKER' required

Supported values: Order Types Note that MARKET orders using quoteOrderQty are not supported.

pendingSide'BUY' | 'SELL' required

BUY,SELL

pendingClientOrderIdstring

Arbitrary unique ID among open orders for the pending order. Automatically generated if not sent.

pendingPricenumber double
pendingStopPricenumber double
pendingTrailingDeltanumber double
pendingQuantitynumber double required

Sets the quantity for the pending order.

pendingIcebergQtynumber double

This can only be used if pendingTimeInForce is GTC.

pendingTimeInForce'GTC' | 'IOC' | 'FOK'

GTC, IOC, FOK

pendingStrategyIdnumber double

Arbitrary numeric value identifying the pending order within an order strategy.

pendingStrategyTypeinteger

Arbitrary numeric value identifying the pending order strategy. Values smaller than 1000000 are reserved and cannot be used.

timestampinteger required

UTC timestamp in ms

signaturestring required

Signature

Response

New OTO details

orderListIdinteger required
contingencyTypestring required
listStatusTypestring required
listOrderStatusstring required
listClientOrderIdstring required
transactionTimeinteger required
symbolstring required

Example response

{
  "contingencyType": "OTO",
  "listStatusType": "EXEC_STARTED",
  "listOrderStatus": "EXECUTING",
  "listClientOrderId": "yl2ERtcar1o25zcWtqVBTC",
  "transactionTime": 1712289389158,
  "symbol": "LTCBTC"
}