Reverse position
Switch an existing position from long to short or vice versa.
The currency is inherited from the position. The liquidation price (USDT) is recalculated for the reversed direction.
Request
curl -X POST "https://trade.mudrex.com/fapi/v1/futures/positions/{position_id}/reverse" \
-H "Content-Type: application/json" \
-H "X-Authentication: your-secret-key"Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
position_id | string | Yes | The unique identifier of the position (path parameter). |
Response
Status: 202 Accepted
{
"success": true,
"data": {
"leverage": "5",
"quantity": "8",
"price": "1.5093",
"order_id": "01a0f1ca-fc9d-7c56-bfcf-04de44af7ff1",
"status": "CREATED",
"message": "OK",
"client_order_id": null,
"position_id": "01a0f1ca-8e83-7c9f-b3e6-d51b34cba2e3"
}
}Response fields
| Field | Description |
|---|---|
order_id | UUID of the reverse order. |
position_id | Position UUID (same as the path parameter). |
client_order_id | null. |
leverage | Leverage used. |
quantity | Reverse order quantity (base asset): twice the open quantity. |
price | Execution price (USDT). |
status | Status (e.g. CREATED). |
message | Status message. |
Notes
- The reverse order is a
LONGorSHORTorder, opposite to the position side, for twice the open quantity. - The position keeps its
position_id. Position history returns aCLOSEDrow for the closed side. - Open stop-loss and take-profit orders on the position are cancelled (
SYSTEM_CANCELLED). - See Order and position IDs.
Errors
Common errors
Position not in sync with exchange
{
"success": false,
"errors": [
{
"code": null,
"text": "position not in sync with exchange"
}
]
}Status: 400 Bad Request — the position state on the exchange differs from the local state, preventing the reversal.
Updated about 1 month ago
Did this page help you?
