Skip to main content

Set Leverage

info

According to the risk limit, leverage affects the maximum position value that can be opened, that is, the greater the leverage, the smaller the maximum position value that can be opened, and vice versa. Learn more

HTTP Request

POST /v5/position/set-leverage

Request Parameters

ParameterRequiredTypeComments
categorytruestringProduct type
  • UTA2.0, UTA1.0: linear, inverse
  • Classic account: linear, inverse
symboltruestringSymbol name, like BTCUSDT, uppercase only
buyLeveragetruestring[1, max leverage]
  • one-way mode: buyLeverage must be the same as sellLeverage
  • Hedge mode:
    Classic account & UTA (isolated margin): buyLeverage and sellLeverage can be different;
    UTA (cross margin): buyLeverage must be the same as sellLeverage
sellLeveragetruestring[1, max leverage]

Response Parameters

None

Request Example

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

{
"category": "linear",
"symbol": "BTCUSDT",
"buyLeverage": "6",
"sellLeverage": "6"

}

Response Example

{
"retCode": 0,
"retMsg": "OK",
"result": {},
"retExtInfo": {},
"time": 1672281607343
}