Skip to main content

Set Position Stop Loss

Info
  • This endpoint requires signature. For specific signature rules, please refer to Authentication
  • This endpoint will trigger rate limit. For specific rules, please refer to Rate Limit.

HTTP request

POST /futures/set-position-stop-loss

Request parameters

Parameter NameRequiredTypeNotes
markettruestringMarket name
market_typetruestringMarket type.
Note: In spot related functions, only SPOT or MARGIN can be used.
In futures related functions, only FUTURES can be used.
stop_loss_typetruestringStop loss trigger price type.On CoinEx, you can choose different trigger price types when setting "TP/SL" (Take Profit and Stop Loss), using "Latest Price" or "Mark Price" as the trigger price.
stop_loss_pricetruestringStop-loss price

Return parameters

Parameter NameTypeNotes
position_idintPosition ID
marketstringMarket name
market_typestringMarket Type
sidestringPosition side
margin_modestringPosition type
open_intereststringPosition
close_avblstringAmount that's available for position closing.Remaining amount that's available for position closing.
ath_position_amountstringATH position amount
unrealized_pnlstringUnrealized profit.The current PNL of open positions, estimated at the Mark Price or the Latest Price.
realized_pnlstringRealized PNL
avg_entry_pricestringAverage entry price
cml_position_valuestringCumulative position value
max_position_valuestringMax. position value
take_profit_pricestringTake-profit price
stop_loss_pricestringStop-loss price
take_profit_typestringTake profit trigger price type.On CoinEx, you can choose different trigger price types when setting "TP/SL" (Take Profit and Stop Loss), using "Latest Price" or "Mark Price" as the trigger price.
stop_loss_typestringStop loss trigger price type.On CoinEx, you can choose different trigger price types when setting "TP/SL" (Take Profit and Stop Loss), using "Latest Price" or "Mark Price" as the trigger price.
leverageintLeverage
margin_avblstringMargin available.Current margin amount = Initial margin + added margin - reduced margin
ath_margin_sizestringATH margin amount
position_margin_ratestringPosition margin rate
maintenance_margin_ratestringMaintenance margin rate.CoinEx adopts a Maintenance Margin Level System.
The more positions you hold, the higher the maintenance margin rate, and the lower the leverage available.
The fewer positions, the lower the maintenance margin rate, and the higher the leverage available.
maintenance_margin_valuestringMaintenance margin amount.Maintenance margin: The minimum amount of margin required to keep your position open.
(Linear contract) Maintenance margin = Opening mark price * position amount * maintenance margin rate
(Inverse contract) Maintenance margin = (Contract value * contract count / opening mark price) * maintenance margin rate
liq_pricestringLiquidation price.
(Long position) Forced liquidation price = Settlement price* (1 - forced liquidation margin rate)/(1 - maintenance margin rate)
(Short position) Forced liquidation price = Settlement price*(1 + forced liquidation margin rate)/(1 + maintenance margin rate)
bkr_pricestringBankruptcy price.
(Long position) Bankruptcy price = Settlement price* (1 - forced liquidation margin rate)
(Short position) Bankruptcy price = Settlement price* (1 + liquidation margin rate)
adl_levelintADL (Auto-deleveraging) risk level, a number in the range of [1, 5]. The smaller the number, the lower the risk level, and vice versa.
settle_pricestringSettlement price, calculated as mark price
settle_valuestringSettlement value, calculated as mark price
created_atintOrder creation time
updated_atintOrder update time

Request example

{
"market": "CETUSDT",
"market_type": "FUTURES",
"stop_loss_type": "mark_price",
"stop_loss_price": "0.059"
}

Response example

{
"code": 0,
"data": {
"position_id": 927266133,
"market": " CETUSDT",
"market_type": "FUTURES",
"side": "long",
"margin_mode": "cross",
"open_interest": "1000000",
"close_avbl": "1000000",
"ath_position_amount": "1000000",
"unrealized_pnl": "8391.123989502",
"realized_pnl": "110396.83471965",
"avg_entry_price": "0.0631",
"cml_position_value": "1118787.958709152",
"max_position_value": "1302421.11392201",
"take_profit_price": "",
"stop_loss_price": "0.059",
"take_profit_type": "",
"stop_loss_type": "mark_price",
"leverage": "10",
"margin_avbl": "210396.83471965",
"ath_margin_size": "210396.83471965",
"position_margin_rate": "0.050",
"maintenance_margin_rate": "0.005",
"maintenance_margin_value": "5000",
"liq_price": "0.05679",
"bkr_price": "0.053635",
"adl_level": 5,
"settle_price": "0.06817",
"settle_value": "1291322.83913829",
"created_at": 1691482451000,
"updated_at": 1691482451000
},
"message": "OK"
}