Skip to main content

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

ParameterTypeRequiredDescription
symbolstringYesTrading pair symbol (e.g., BTCUSDT)
holdSidestringYesPosition side: "LONG" or "SHORT"
amountnumberYesMargin 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

ParameterTypeDescription
codestringResponse code
msgstringResponse message
requestTimenumberRequest timestamp in milliseconds
datanullNo data returned

Response Example

Success Response

{
"code": "00000",
"msg": "success",
"requestTime": 1732000000000,
"data": null
}

Error Codes

CodeMessage
40034symbol does not exist
40001Position not found
40001Cross margin is not supported
40001Amount is not a number
40001Insufficient balance
40001Insufficient position margin