Guides
Guides

Add/Reduce Margin

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

Add or reduce isolated margin on an open position. margin is in the position's currency, taken from the position. The response returns 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": 50}'
# 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": -20}'

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: 50, INR position):

{
    "success": true,
    "data": {
        "message": "OK",
        "initial_margin": "166.57",
        "liquidation_price": "0.12114",
        "trade_currency": "INR"
    }
}

Reduce (margin: -20, INR position):

{
    "success": true,
    "data": {
        "message": "OK",
        "initial_margin": "146.57",
        "liquidation_price": "0.1179",
        "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

HTTPError textMeaning
400margin is requiredmargin is 0.
400margin less than required marginReduction takes the margin below the initial margin required at the position's leverage.
400margin cannot be greater than max marginmargin exceeds the margin that can be added.

Reduction below required margin

{
    "success": false,
    "errors": [
        { "code": 400, "text": "margin less than required margin" }
    ]
}

Status: 400 Bad Request

Notes

  • Margin cannot be reduced below the initial margin required at the position's leverage. A position with no added margin rejects any negative margin.
  • liquidation_price is rounded to the asset's price step. Preview a change without applying it with Liquidation price and ext_margin.

Did this page help you?