Set Margin Mode
Default is the regular margin mode. This mode is valid for USDT Perp, USDC Perp and Option.
HTTP Request
POST /unified/v3/private/account/setMarginMode
Request Parameters
Parameter | Required | Type | Comments |
---|---|---|---|
setMarginMode | true | string | REGULAR_MARGIN , PORTFOLIO_MARGIN |
Response Parameters
Parameter | Type | Comments |
---|---|---|
reasons | array | Empty array if the request is submitted successfully. Otherwise, there are failure Object |
> reasonCode | string | Fail reason code |
> reasonMsg | string | Fail reason msg |
Request Example
POST /unified/v3/private/account/setMarginMode HTTP/1.1
Host: api-testnet.bybit.com
X-BAPI-SIGN: XXXXX
X-BAPI-API-KEY: XXXXX
X-BAPI-TIMESTAMP: 1672023475526
X-BAPI-RECV-WINDOW: 5000
Content-Type: application/json
{
"setMarginMode": "REGULAR_MARGIN"
}
Response Example
{
"retCode": 3400045,
"retMsg": "Set margin mode failed",
"result": {
"reasons": [
{
"reasonCode": "3400102",
"reasonMsg": "Please ensure that there are no active orders in your USDC account, including Limit, Market and Conditional orders"
},
{
"reasonCode": "3400101",
"reasonMsg": "Please ensure that there are no positions in your USDC account, including USDC perpetual and options"
}
]
}
}