Modify Stop-Loss Order
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/modify-position-stop-loss
Request parameters
| Parameter Name | Required | Type | Notes |
|---|---|---|---|
| market | true | string | Market name |
| market_type | true | string | Market type. Note: In spot related functions, only SPOT or MARGIN can be used. In futures related functions, only FUTURES can be used. |
| stop_loss_id | true | int | Stop-loss order ID |
| stop_loss_type | false | string | Stop-loss trigger price type. On CoinEx, you can choose different trigger price types when setting “TP/SL” (Take Profit and Stop Loss), including “Latest Transaction Price,” “Mark Price,” or “Index Price.” |
| stop_loss_price | false | string | Stop-loss price |
| stop_loss_amount | false | string | Stop-loss amount |
Note
At least one of the three parameters, stop_loss_type, stop_loss_price, and stop_loss_amount, must be provided.
Return parameters
| Parameter Name | Type | Notes |
|---|---|---|
| position_id | int | Position ID |
| market | string | Market name |
| market_type | string | Market Type |
| side | string | Position side |
| margin_mode | string | Position type |
| open_interest | string | Position |
| close_avbl | string | Amount that's available for position closing. Remaining amount that's available for position closing. |
| ath_position_amount | string | ATH position amount |
| unrealized_pnl | string | Unrealized profit. The current PNL of open positions, estimated at the Mark Price or the Latest Price. |
| realized_pnl | string | Realized PNL |
| avg_entry_price | string | Average entry price |
| cml_position_value | string | Cumulative open position value (calculated based on average open price, not changing with mark price) |
| max_position_value | string | Historical maximum open position value (calculated based on open price, not changing with mark price) |
| take_profit_price | string | Take-profit price |
| stop_loss_price | string | Stop-loss price |
| take_profit_type | string | Take-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_type | string | Stop-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. |
| leverage | int | Leverage |
| margin_avbl | string | Allocated margin. Cross margin: USDⓈ-margined contract = open position amount * mark price / leverage; Coin-margined contract = open position amount / mark price / leverage. Isolated margin: Initial margin + added margin - reduced margin. Upon partial closing, the allocated margin decreases proportionally based on the closing ratio; adding/reducing margin in isolated margin includes manual transfers and funding fee settlements. |
| ath_margin_size | string | ATH margin amount |
| position_margin_rate | string | Position margin rate |
| maintenance_margin_rate | string | Maintenance 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_value | string | Maintenance margin amount. Maintenance margin: The minimum amount of margin required to keep your position open. (USDⓈ-margined contract) Maintenance margin = mark price * position amount * maintenance margin rate (Coin-margined contract) Maintenance margin = position amount / mark price * maintenance margin rate |
| liq_price | string | Liquidation price.The estimated trigger price calculated by the system in real time based on the current mark price.The calculation takes into account factors such as position mode (One-way/Hedge Mode), contract type (USDⓈ-margined/Coin-margined), position size, settlement price, margin, maintenance margin, unrealized PNL, and potential risks of unfilled orders.In cross margin mode, positions under the same settlement asset jointly affect the liquidation price; in isolated margin mode, it is calculated independently for that position. The liquidation price may change accordingly when the market price, order status, or account funds change. When no valid liquidation price exists, the interface return value is subject to the actual response. |
| bkr_price | string | Bankruptcy price. The bankruptcy price in cross margin is no longer calculated. The bankruptcy price in isolated margin can be calculated using the liquidation price formula, where the maintenance margin rate is 0. |
| adl_level | int | ADL (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_price | string | Settlement price, calculated as mark price |
| settle_value | string | Settlement value, calculated as mark price |
| risk_rate | string | Position risk rate. The calculation considers position margin, unrealized PNL, maintenance margin, and the potential risks of unexecuted orders; the value will be adjusted in real time with changes in mark price, orders, and funds. |
| created_at | int | Order creation time |
| updated_at | int | Order update time |
| stop_loss_list | array | Stop-loss order list |
| stop_loss_list[].id | int | Stop-loss order ID |
| stop_loss_list[].price | string | Stop-loss price |
| stop_loss_list[].type | string | Stop-loss trigger price type |
| stop_loss_list[].amount | string | Stop-loss amount |
| stop_loss_list[].is_all | bool | Whether this is a full‑position stop‑loss order |
| stop_loss_list[].created_at | int | Stop-loss order creation time |
| take_profit_list | array | Take-profit order list |
| take_profit_list[].id | int | Take-profit order ID |
| take_profit_list[].price | string | Take-profit price |
| take_profit_list[].type | string | Take-profit trigger price type |
| take_profit_list[].amount | string | Take-profit amount |
| take_profit_list[].is_all | bool | Whether this is a full‑position take-profit order |
| take_profit_list[].created_at | int | Take-profit order creation time |
Request example
{
"market": "CETUSDT",
"market_type": "FUTURES",
"stop_loss_id": 123457,
"stop_loss_price": "0.055"
}
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.055",
"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",
"risk_rate": "0.1234",
"created_at": 1691482451000,
"updated_at": 1691482451000,
"stop_loss_list": [
{
"id": 123457,
"price": "0.055",
"type": "mark_price",
"amount": "500000",
"is_all": false,
"created_at": 1691482451000
}
],
"take_profit_list": []
},
"message": "OK"
}