bybit/models/set_risk_limit.rs
1use crate::prelude::*;
2
3/// Parameters for setting risk limits for a position.
4///
5/// Used to construct a request to the `/v5/position/set-risk-limit` endpoint to adjust risk limits for a specific symbol. Bots use this to control maximum exposure and manage liquidation risk in perpetual futures.
6#[derive(Clone, Default)]
7pub struct SetRiskLimit<'a> {
8 /// The product category (e.g., Linear, Inverse).
9 ///
10 /// Specifies the instrument type. Bots must set this to target the correct contract type.
11 pub category: Category,
12
13 /// The trading pair symbol (e.g., "BTCUSDT").
14 ///
15 /// Identifies the perpetual futures contract for which risk limits are being set. Bots must specify a valid symbol.
16 pub symbol: Cow<'a, str>,
17
18 /// The risk ID to apply.
19 ///
20 /// Identifies the risk limit tier to use, corresponding to specific margin and exposure limits. Bots should select a risk ID that aligns with their risk management strategy.
21 pub risk_id: i8,
22
23 /// The position index (optional).
24 ///
25 /// Specifies the position type (e.g., 0 for one-way mode, 1 or 2 for hedge mode). Bots should set this for hedge mode positions to target the correct side.
26 pub position_idx: Option<i32>,
27}