pub struct RiskConfig {
pub session_pnl: SessionPnlConfig,
pub circuit_breaker: CircuitBreakerConfig,
pub sizing: SizingConfig,
}Expand description
Risk-layer config for a symbol: session-PnL cap, circuit breaker, and
position sizing. Used both as the bot-wide default
(BotConfig::risk) and as a per-symbol override
(BotConfig::per_symbol_risk, set via
BotConfigBuilder::symbol_risk).
Fields§
§session_pnl: SessionPnlConfigSession PnL config applied to every configured symbol.
circuit_breaker: CircuitBreakerConfigCircuit-breaker config applied to every configured symbol.
sizing: SizingConfigPosition-sizing config used by the execution service.
Implementations§
Source§impl RiskConfig
impl RiskConfig
Sourcepub fn crypto_perp() -> Self
pub fn crypto_perp() -> Self
Per-AssetClass starting presets. These are sensible defaults to
tune, not prescriptions — they mainly differ in leverage (the most
class-defining knob) and per-trade size; tighten or loosen for your
venue and risk appetite. Apply one per class via
BotConfigBuilder::class_risk, or per symbol via
BotConfigBuilder::symbol_risk.
Crypto perpetuals: moderate 5× leverage (the framework default shape).
Sourcepub fn crypto_spot() -> Self
pub fn crypto_spot() -> Self
Crypto spot: no leverage (1×) — one unit traded is one base unit.
Sourcepub fn futures() -> Self
pub fn futures() -> Self
Dated futures: bigger contracts, moderate leverage, a wider daily cap.
Sourcepub fn preset_for(class: AssetClass) -> Self
pub fn preset_for(class: AssetClass) -> Self
The starting preset for an AssetClass: CryptoSpot →
Self::crypto_spot, Fx → Self::fx, Future → Self::futures,
Equity → Self::equity; CryptoPerp and any other class fall back
to Self::crypto_perp.
Trait Implementations§
Source§impl Clone for RiskConfig
impl Clone for RiskConfig
Source§fn clone(&self) -> RiskConfig
fn clone(&self) -> RiskConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more