Structsยง
- Extended
Risk Grid - Extended risk grid with per-instrument breakdown.
- Instrument
Risk Row - P&L for a single instrument under all scenarios.
- Margin
Computation ๐ - Scenario
Pnl - 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