Add Margin
Top up margin on an open position. Pushes the liquidation price further away from the mark price. See Margin & Leverage.
HTTP
| Method | POST |
| Endpoint | /trade/api/v2/futures/add_margin |
| Rate limit | 10 requests per 60 seconds |
Request Parameters
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
symbol | string | Yes | Symbol with the open position, e.g. DOGEUSDT. |
exchange | string | Yes | EXCHANGE_2. |
margin | integer | Yes | USDT amount to add. Must be ≤ available wallet balance. |
Example
- Python
- Java
- Go
- Node.js
import requests
body = {"exchange": "EXCHANGE_2", "symbol": "dogeusdt", "margin": 16}
headers, path = sign_request("POST", "/trade/api/v2/futures/add_margin")
response = requests.post(BASE_URL + path, headers=headers, json=body)
print(response.json())
HashMap<String, Object> body = new HashMap<>();
body.put("exchange", "EXCHANGE_2");
body.put("symbol", "dogeusdt");
body.put("margin", 16);
HttpResponse<String> resp = client.send(
"POST", "/trade/api/v2/futures/add_margin", null, body);
System.out.println(resp.body());
body := map[string]any{
"exchange": "EXCHANGE_2",
"symbol": "dogeusdt",
"margin": 16,
}
bodyJSON, _ := json.Marshal(body)
headers, p, err := SignRequest("POST", "/trade/api/v2/futures/add_margin", nil)
if err != nil { panic(err) }
req, _ := http.NewRequest("POST", BaseURL+p, bytes.NewReader(bodyJSON))
for k, v := range headers { req.Header.Set(k, v) }
resp, err := http.DefaultClient.Do(req)
if err != nil { panic(err) }
defer resp.Body.Close()
out, _ := io.ReadAll(resp.Body)
fmt.Println(string(out))
const {signRequest, BASE_URL} = require('./reference-client');
const body = {"exchange": "EXCHANGE_2", "symbol": "dogeusdt", "margin": 16};
const {headers, path} = signRequest('POST', '/trade/api/v2/futures/add_margin');
const r = await fetch(BASE_URL + path, {
method: 'POST',
headers,
body: JSON.stringify(body),
});
console.log(await r.json());
Response
{
"data": {
"exchange": "EXCHANGE_2",
"position_id": "8b81b763-df36-4c93-9bc8-9a93d65b8546",
"symbol": "DOGEUSDT",
"position_side": "LONG",
"leverage": "25",
"position_size": "65",
"position_value": "25.09455",
"position_margin": "50.052117186199",
"maint_margin": "37.641825",
"avg_entry_price": "0.38607",
"mark_price": "0.38694",
"last_price": "0.38677",
"unrealised_pnl": "-0.0455",
"liquidation_price": "-0.3752759970953692",
"status": "OPEN",
"created_at": 1732617093684,
"updated_at": 1732636761825
}
}
The response is the updated position object. Same shape as Get Positions. Note position_margin reflects the new (higher) value and liquidation_price has moved.