Skip to main content

Set Risk Limit

Since bybit has launched auto risk limit on 12 March 2024, please click here to learn more, so it will not take effect even you set it successfully.

HTTP Request

POST /v5/position/set-risk-limit

Request Parameters

ParameterRequiredTypeComments
categorytruestringProduct type
  • Unified account: linear, inverse
  • Classic account: linear, inverse. Please note that category is not involved with business logic
symboltruestringSymbol name, like BTCUSDT, uppercase only
riskIdtrueintegerRisk limit ID
positionIdxfalseintegerUsed to identify positions in different position modes. For hedge mode, it is required
  • 0: one-way mode
  • 1: hedge-mode Buy side
  • 2: hedge-mode Sell side

Response Parameters

ParameterTypeComments
categorystringProduct type
riskIdintegerRisk limit ID
riskLimitValuestringThe position limit value corresponding to this risk ID

Request Example

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

{
"category": "linear",
"symbol": "BTCUSDT",
"riskId": 4,
"positionIdx": null
}

Response Example

{
"retCode": 0,
"retMsg": "OK",
"result": {
"riskId": 4,
"riskLimitValue": "8000000",
"category": "linear"
},
"retExtInfo": {},
"time": 1672282270571
}