Set Margin
Add or reduce margin for an existing position in isolated margin mode.
HTTP Request
POST /api/v1/future/account/set-margin
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | Trading pair symbol (e.g., BTCUSDT) |
| holdSide | string | Yes | Position side: "LONG" or "SHORT" |
| amount | number | Yes | Margin amount to add (positive) or reduce (negative) |
Request Example
Add Margin
curl -X POST "https://open-api.bydoxe.com/api/v1/future/account/set-margin" \
-H "ACCESS-KEY: your-api-key" \
-H "ACCESS-SIGN: your-signature" \
-H "ACCESS-PASSPHRASE: your-passphrase" \
-H "ACCESS-TIMESTAMP: 1659076670000" \
-H "Content-Type: application/json" \
-d '{
"symbol": "BTCUSDT",
"holdSide": "LONG",
"amount": 1000
}'
Reduce Margin
curl -X POST "https://open-api.bydoxe.com/api/v1/future/account/set-margin" \
-H "ACCESS-KEY: your-api-key" \
-H "ACCESS-SIGN: your-signature" \
-H "ACCESS-PASSPHRASE: your-passphrase" \
-H "ACCESS-TIMESTAMP: 1659076670000" \
-H "Content-Type: application/json" \
-d '{
"symbol": "BTCUSDT",
"holdSide": "LONG",
"amount": -500
}'
Response Parameters
| Parameter | Type | Description |
|---|---|---|
| code | string | Response code |
| msg | string | Response message |
| requestTime | number | Request timestamp in milliseconds |
| data | null | No data returned |
Response Example
Success Response
{
"code": "00000",
"msg": "success",
"requestTime": 1732000000000,
"data": null
}
Error Codes
| Code | Message |
|---|---|
| 40034 | symbol does not exist |
| 40001 | Position not found |
| 40001 | Cross margin is not supported |
| 40001 | Amount is not a number |
| 40001 | Insufficient balance |
| 40001 | Insufficient position margin |