Skip to main content

Set Margin Mode

Default is regular margin mode

info

HTTP Request

POST /v5/account/set-margin-mode

Request Parameters

ParameterRequiredTypeComments
setMarginModetruestringISOLATED_MARGIN, REGULAR_MARGIN(i.e. Cross margin), PORTFOLIO_MARGIN

Response Parameters

ParameterTypeComments
reasonsarrayObject. If requested successfully, it is an empty array
> reasonCodestringFail reason code
> reasonMsgstringFail reason msg

Request Example

POST /v5/account/set-margin-mode HTTP/1.1
Host: api-testnet.bybit.com
X-BAPI-SIGN: XXXXX
X-BAPI-API-KEY: XXXXX
X-BAPI-TIMESTAMP: 1672134396332
X-BAPI-RECV-WINDOW: 5000
Content-Type: application/json

{
"setMarginMode": "PORTFOLIO_MARGIN"
}

Response Example

{
"retCode": 3400045,
"retMsg": "Set margin mode failed",
"result": {
"reasons": [
{
"reasonCode": "3400000",
"reasonMsg": "Equity needs to be equal to or greater than 1000 USDC"
}
]
}
}