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",
"amount": "10.00293",
"quantity": "43.7",
"price": "0.11445",
"order_id": "019ecc5b-3649-7e00-9d67-a3c83a97518c",
"status": "CREATED",
"message": "OK"
}
}Response fields
| Field | Description |
|---|---|
order_id | UUID of the order created to reverse the position. |
leverage | Leverage used. |
amount | Margin used, in the position's currency (INR for INR positions). |
quantity | Quantity (base asset). |
price | Execution price (USDT). |
status | Status (e.g. CREATED). |
message | Status message. |
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.
