Skip to content

Description

TP/SL Order

After private WebSocket login succeeds, this channel is pushed automatically. Channel name is tpsl. data is always an object, not an array.

CLOSE alone is not a final state. Always read event together with status. Partial fill / full fill of the child order is pushed on the order channel or queried via REST, not on tpsl.

FILLED means the TP/SL trigger succeeded and the child order was placed. It does not mean the child order is fully filled.

Statuses that are not pushed: INIT, PENDING_CANCEL, TRIGGER_WAIT_PLACE. Do not document PART_FILLED on this channel.

Push Parameters

ParameterTypeDescription
chStringChannel name: tpsl
tsInt64Gateway send time, Unix milliseconds. Do not use this field to order business events.
data<Object>Always an object (not an array)
> eventStringCREATE / UPDATE / CLOSE
> positionIdStringposition Id
> orderIdStringorder Id
> symbolStringSymbol
> leverageStringLeverage
> sideStringBUY/SELL
> positionModeStringPosition mode, ONE_WAY/HEDGE
> statusStringNEW / CANCELED / SYSTEM_CANCELED / FILLED / FAILED. See event-status table below.
> ctimeStringCreate time, ISO-8601 nanosecond string, e.g. 2024-05-16T08:13:09.123456789Z. REST history APIs use millisecond integers instead.
> typeStringLIMIT/MARKET
> tpQtyStringTake-profit order quantity (base coin). Omitted if unused.
> slQtyStringStop-loss order quantity (base coin). Omitted if unused. Never Boolean. Never JSON null. "0" is sent as "0".
> tpStopTypeStringtake profit trigger type. MARK_PRICE/LAST_PRICE
> tpPriceStringtake profit trigger price
> tpOrderTypeStringtake profit trigger place order type. LIMIT/MARKET
> tpOrderPriceStringtake profit trigger place order price
> slStopTypeStringstop loss trigger type. MARK_PRICE/LAST_PRICE
> slPriceStringstop loss trigger price
> slOrderTypeStringstop loss trigger place order type. LIMIT/MARKET
> slOrderPriceStringstop loss trigger place order price

Event and status

eventstatusMeaning
CREATENEWTP/SL order became effective
UPDATENEWTP/SL order was modified
CLOSECANCELEDCanceled by the user
CLOSESYSTEM_CANCELEDCanceled by the system
CLOSEFILLEDTrigger succeeded and the child order was placed (not child-order full fill)
CLOSEFAILEDTrigger failed