Guides
Guides

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

ParameterTypeRequiredDescription
position_idstringYesThe 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

FieldDescription
order_idUUID of the reverse order.
position_idPosition UUID (same as the path parameter).
client_order_idnull.
leverageLeverage used.
quantityReverse order quantity (base asset): twice the open quantity.
priceExecution price (USDT).
statusStatus (e.g. CREATED).
messageStatus message.

Notes

  • The reverse order is a LONG or SHORT order, opposite to the position side, for twice the open quantity.
  • The position keeps its position_id. Position history returns a CLOSED row 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.


Did this page help you?