Skip to main content

Set Margin Mode

Switch between isolated and crossed margin modes for a specific trading symbol.

HTTP Request

POST /api/v1/future/account/set-margin-mode

Request Parameters

ParameterTypeRequiredDescription
symbolstringYesTrading pair symbol (e.g., BTCUSDT)
marginModestringYesMargin mode: "CROSS" or "ISOLATED"

Request Example

Set to Crossed Margin

curl -X POST "https://open-api.bydoxe.com/api/v1/future/account/set-margin-mode" \
-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",
"marginMode": "CROSS"
}'

Set to Isolated Margin

curl -X POST "https://open-api.bydoxe.com/api/v1/future/account/set-margin-mode" \
-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",
"marginMode": "ISOLATED"
}'

Response Parameters

ParameterTypeDescription
codestringResponse code
msgstringResponse message
requestTimenumberRequest timestamp in milliseconds
dataobjectMargin mode change data
> symbolstringTrading pair symbol
> marginCoinstringMargin coin (e.g., USDT)
> longLeveragestringCurrent leverage for long positions
> shortLeveragestringCurrent leverage for short positions
> marginModestringUpdated margin mode: "CROSS" or "ISOLATED"

Response Example

Success Response

{
"code": "00000",
"msg": "success",
"requestTime": 1732000000000,
"data": {
"symbol": "BTCUSDT",
"marginCoin": "USDT",
"longLeverage": "10",
"shortLeverage": "10",
"marginMode": "CROSS"
}
}

Error Codes

CodeMessage
40034symbol does not exist
40001marginMode mode is not supported
40001A different margin mode is not available than the position currently opened.

Notes

  • Cross Margin Mode: All available balance in your futures account is used as margin. Positions share the same margin pool, which can help prevent liquidation but risks the entire account balance.
  • Isolated Margin Mode: Only the margin allocated to a specific position is at risk. If liquidated, you only lose the margin allocated to that position, not your entire account balance.
  • You cannot change margin mode if you have open positions for the symbol. Close all positions first before switching margin modes.