pub struct RiskLimit {
pub id: u64,
pub symbol: String,
pub risk_limit_value: f64,
pub maintenance_margin: f64,
pub initial_margin: f64,
pub is_lowest_risk: u8,
pub max_leverage: f64,
}Expand description
Represents a risk limit configuration for a trading symbol. Defines leverage, margin, and position size limits for perpetual futures.
Fields§
§id: u64Unique identifier for the risk limit tier. Used by Bybit to distinguish different risk levels. Bots can use this to track specific configurations.
symbol: StringThe trading symbol (e.g., “BTCUSDT”). Specifies the market to which the risk limit applies. Bots must match this with their trading pairs.
risk_limit_value: f64The maximum position size allowed (in base currency or USD). In perpetual futures, this limits exposure to prevent excessive risk. Bots use this to cap order sizes and avoid rejections.
maintenance_margin: f64The maintenance margin rate (e.g., 0.005 for 0.5%). The minimum margin required to keep a position open. If the margin falls below this, liquidation occurs at the bust price (bankruptcy price). Bots monitor this to manage liquidation risks.
initial_margin: f64The initial margin rate (e.g., 0.01 for 1%). The margin required to open a position. Lower rates allow higher leverage, but increase liquidation risk. Bots use this to calculate capital requirements.
is_lowest_risk: u8Indicates if this is the lowest risk tier (1 for true, 0 for false). Lower risk tiers have stricter limits but safer margin requirements. Bots may prefer these for conservative strategies.
max_leverage: f64The maximum leverage allowed (e.g., “100” for 100x). Leverage amplifies gains and losses in perpetual futures. Bots must ensure orders comply with this limit to avoid rejections.