pub struct RiskContext {Show 14 fields
pub symbol: Symbol,
pub exchange: ExchangeId,
pub signed_position_qty: Quantity,
pub portfolio_equity: Price,
pub exchange_equity: Price,
pub last_price: Price,
pub liquidate_only: bool,
pub instrument_kind: Option<InstrumentKind>,
pub base_asset: AssetId,
pub quote_asset: AssetId,
pub settlement_asset: AssetId,
pub base_available: Quantity,
pub quote_available: Quantity,
pub settlement_available: Quantity,
}Expand description
Context passed to risk checks describing current exposure state.
Fields§
§symbol: SymbolSymbol used to construct risk metadata.
exchange: ExchangeIdVenue that will carry the exposure.
signed_position_qty: QuantitySigned quantity of the current open position (long positive, short negative).
portfolio_equity: PriceTotal current portfolio equity.
exchange_equity: PriceEquity scoped to the symbol’s exchange.
last_price: PriceLast known price for the signal’s symbol.
liquidate_only: boolWhen true, only exposure-reducing orders are allowed.
instrument_kind: Option<InstrumentKind>Instrument kind, if metadata is available.
base_asset: AssetIdBase asset tracked for solvency checks.
quote_asset: AssetIdQuote asset tracked for solvency checks.
settlement_asset: AssetIdSettlement asset for derivatives.
base_available: QuantityAvailable base asset quantity on the venue.
quote_available: QuantityAvailable quote asset quantity on the venue.
settlement_available: QuantityAvailable settlement asset quantity on the venue.
Trait Implementations§
Source§impl Clone for RiskContext
impl Clone for RiskContext
Source§fn clone(&self) -> RiskContext
fn clone(&self) -> RiskContext
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RiskContext
impl Debug for RiskContext
Source§impl Default for RiskContext
impl Default for RiskContext
Source§fn default() -> RiskContext
fn default() -> RiskContext
Returns the “default value” for a type. Read more
impl Copy for RiskContext
Auto Trait Implementations§
impl Freeze for RiskContext
impl RefUnwindSafe for RiskContext
impl Send for RiskContext
impl Sync for RiskContext
impl Unpin for RiskContext
impl UnwindSafe for RiskContext
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more