Skip to main content

New UM Algo Order (TRADE)

API Description

Place new UM conditional order

HTTP Request

POST /papi/v1/um/algo/order

Request Weight

1

Request Parameters

NameTypeMandatoryDescription
algoTypeENUMYESOnly support CONDITIONAL
symbolSTRINGYES
sideENUMYES
positionSideENUMNODefault BOTH for One-way Mode ; LONG or SHORT for Hedge Mode. It must be sent in Hedge Mode.
typeENUMYESFor CONDITIONAL algoType, STOP_MARKET/TAKE_PROFIT_MARKET/STOP/TAKE_PROFIT/TRAILING_STOP_MARKET as order type
timeInForceENUMNOIOC or GTC or FOK or GTX , default GTC
quantityDECIMALYESOrder quantity
priceDECIMALNO
triggerPriceDECIMALNO
workingTypeENUMNOtriggerPrice triggered by: MARK_PRICE, CONTRACT_PRICE. Default CONTRACT_PRICE
priceMatchENUMNOonly avaliable for LIMIT/STOP/TAKE_PROFIT order; can be set to OPPONENT/ OPPONENT_5/ OPPONENT_10/ OPPONENT_20: /QUEUE/ QUEUE_5/ QUEUE_10/ QUEUE_20; Can't be passed together with price
priceProtectSTRINGNO"true" or "false", default "false". Used with STOP_MARKET or TAKE_PROFIT_MARKET order. when price reaches the triggerPrice, the difference rate between "MARK_PRICE" and "CONTRACT_PRICE" cannot be larger than the Price Protection Threshold of the symbol.
reduceOnlySTRINGNO"true" or "false". default "false". Cannot be sent in Hedge Mode.
activatePriceDECIMALNOUsed with TRAILING_STOP_MARKET orders, default as the latest price(supporting different workingType)
callbackRateDECIMALNOUsed with TRAILING_STOP_MARKET orders, min 0.1, max 10 where 1 for 1%
clientAlgoIdSTRINGNOA unique id among open orders. Automatically generated if not sent. Can only be string following the rule: ^[\.A-Z\:/a-z0-9_-]{1,36}$
newOrderRespTypeENUMNO"ACK", "RESULT", default "ACK"
selfTradePreventionModeENUMNOEXPIRE_TAKER:expire taker order when STP triggers/ EXPIRE_MAKER:expire maker order when STP triggers/ EXPIRE_BOTH:expire both orders when STP triggers; default NONE
goodTillDateLONGNOorder cancel time for timeInForce GTD, mandatory when timeInforce set to GTD; order the timestamp only retains second-level precision, ms part will be ignored; The goodTillDate timestamp must be greater than the current time plus 600 seconds and smaller than 253402300799000
recvWindowLONGNO
timestampLONGYES
  • Algo order with type STOP, parameter timeInForce can be sent ( default GTC).
  • Algo order with type TAKE_PROFIT, parameter timeInForce can be sent ( default GTC).
  • Condition orders will be triggered when:

    • If parameterpriceProtectis sent as true:
      • when price reaches the triggerPrice , the difference rate between "MARK_PRICE" and "CONTRACT_PRICE" cannot be larger than the "triggerProtect" of the symbol
      • "triggerProtect" of a symbol can be got from GET /fapi/v1/exchangeInfo
    • STOP, STOP_MARKET:
      • BUY: latest price ("MARK_PRICE" or "CONTRACT_PRICE") >= triggerPrice
      • SELL: latest price ("MARK_PRICE" or "CONTRACT_PRICE") <= triggerPrice
    • TAKE_PROFIT, TAKE_PROFIT_MARKET:
      • BUY: latest price ("MARK_PRICE" or "CONTRACT_PRICE") <= triggerPrice
      • SELL: latest price ("MARK_PRICE" or "CONTRACT_PRICE") >= triggerPrice
    • TRAILING_STOP_MARKET:
      • BUY: the lowest price after order placed <= activatePrice, and the latest price >= the lowest price * (1 + callbackRate)
      • SELL: the highest price after order placed >= activatePrice, and the latest price <= the highest price * (1 - callbackRate)
  • For TRAILING_STOP_MARKET, if you got such error code.
    {"code": -2021, "msg": "Order would immediately trigger."}
    means that the parameters you send do not meet the following requirements:

    • BUY: activatePrice should be smaller than latest price.
    • SELL: activatePrice should be larger than latest price.
  • selfTradePreventionMode is only effective when timeInForce set to IOC or GTC or GTD.

Response Example

{
"algoId": 2146760,
"clientAlgoId": "6B2I9XVcJpCjqPAJ4YoFX7",
"algoType": "CONDITIONAL",
"orderType": "TAKE_PROFIT",
"symbol": "BNBUSDT",
"side": "SELL",
"positionSide": "BOTH",
"timeInForce": "GTC",
"quantity": "0.01",
"algoStatus": "NEW",
"triggerPrice": "750.000",
"price": "750.000",
"icebergQuantity": null,
"selfTradePreventionMode": "EXPIRE_MAKER",
"workingType": "CONTRACT_PRICE",
"priceMatch": "NONE",
"priceProtect": false,
"reduceOnly": false,
"activatePrice": "", //TRAILING_STOP_MARKET order
"callbackRate": "", //TRAILING_STOP_MARKET order
"createTime": 1750485492076,
"updateTime": 1750485492076,
"triggerTime": 0,
"goodTillDate": 0
}