Guides
Guides

Add/Reduce Margin

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

Request

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": 10.2
  }'

Parameters

ParameterTypeRequiredDescription
position_idstringYesThe unique identifier of the position (path parameter)
marginfloatYesMargin amount to add (positive value) or reduce (negative value)

Response

{
    "success": true,
    "data": {
        "message": "OK",
        "initial_margin": "3.01011155",
        "liquidation_price": "2.5847"
    }
}

Parameters

ParameterDescription
messageStatus message
initial_marginUpdated initial margin of the position
liquidation_priceUpdated liquidation price of the position

Common errors

Position not found

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

Status: 404 Not Found

This error occurs when the position ID is incorrect or the position does not exist.

Insufficient funds

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

Status: 400 Bad Request

This error occurs when attempting to add margin but there are insufficient funds available.