Skip to main content

Module span

Module span 

Source

Structsยง

ExtendedRiskGrid
Extended risk grid with per-instrument breakdown.
InstrumentRiskRow
P&L for a single instrument under all scenarios.
MarginComputation ๐Ÿ”’
ScenarioPnl
Scenario PnL entry for risk grid introspection.

Functionsยง

assemble_margin_details ๐Ÿ”’
civil_from_days ๐Ÿ”’
compute_extended_risk_grid_from_snapshot
Compute per-instrument and aggregate scenario PnL rows for a snapshot.
compute_risk_grid_from_snapshot
Compute per-scenario total PnL for a normalized portfolio margin snapshot.
compute_span_margin_at
Compute SPAN margin from a fully-populated snapshot and market state.
empty_portfolio_margin_details
Build zero-margin details for a legacy account with no portfolio exposure.
f64_to_decimal ๐Ÿ”’
format_expiry_from_ts ๐Ÿ”’
format_option_symbol ๐Ÿ”’
generate_scenarios
has_portfolio_positions
Detect whether a legacy account has portfolio exposure requiring PM math.
perp_current_value ๐Ÿ”’
single_option_snapshot ๐Ÿ”’