Guides
Guides

Add/Reduce Margin

Add or reduce margin for an existing position to adjust liquidation price.

Add or reduce margin for an existing position to adjust the liquidation price. The margin amount is in the position's currency (INR for INR positions) — it inherits the currency from the position UUID. The response echoes trade_currency.

Request

# Add margin
curl -X POST "https://trade.mudrex.com/fapi/v1/futures/positions/{position_id}/add-margin" \
  -H "Content-Type: application/json" \
  -H "X-Authentication: your-secret-key" \
  -d '{"margin": 1}'
# Reduce margin
curl -X POST "https://trade.mudrex.com/fapi/v1/futures/positions/{position_id}/add-margin" \
  -H "Content-Type: application/json" \
  -H "X-Authentication: your-secret-key" \
  -d '{"margin": -0.5}'

Parameters

ParameterTypeRequiredDescription
position_idstringYesThe unique identifier of the position (path parameter).
marginfloatYesAmount to add (positive) or reduce (negative), in the position currency.

Response

Status: 200 OK

Add (margin: 1):

{
    "success": true,
    "data": {
        "message": "OK",
        "initial_margin": "97.44",
        "liquidation_price": "0.09269",
        "trade_currency": "INR"
    }
}

Reduce (margin: -0.5):

{
    "success": true,
    "data": {
        "message": "OK",
        "initial_margin": "96.72",
        "liquidation_price": "0.09281",
        "trade_currency": "INR"
    }
}

Response fields

FieldDescription
messageStatus message.
initial_marginUpdated initial margin of the position, in trade_currency.
liquidation_priceUpdated liquidation price of the position (USDT).
trade_currencyCurrency of the position: USDT or INR.

Errors

Common errors

Position not found

{
    "success": false,
    "errors": [
        { "code": 404, "text": "Position not found" }
    ]
}

Status: 404 Not Found

Insufficient funds

{
    "success": false,
    "errors": [
        { "code": 400, "text": "Insufficient funds" }
    ]
}

Status: 400 Bad Request