Skip to main content

compute_risk_grid_from_snapshot

Function compute_risk_grid_from_snapshot 

Source
pub fn compute_risk_grid_from_snapshot(
    snapshot: &PortfolioMarginSnapshot,
    market_state: &PortfolioMarginMarketState,
) -> Result<Vec<ScenarioPnl>, MarginError>
Expand description

Compute per-scenario total PnL for a normalized portfolio margin snapshot.

The snapshot is treated as an immutable weighted view of executed positions plus hypothetical open-order exposure. Missing or non-representable market inputs are returned as MarginError.