Module risk
Expand description
The risk vocabulary: the keys a risk vector is reported under, the axis each key belongs to, and the ways a read-back refuses.
This module holds keys only. It carries no scalar, no tape, and no
reference to a mode — a MarketInputId is the same value whether it was
produced by a reverse sweep or written down by hand. The read-back that
produces one lives on the lift (MarketView),
not on the evaluation trait each curve family implements: what a curve
answers is what it is worth, and how a ladder labels its parameters is the
lift’s business.
Two properties are load-bearing and are asserted rather than intended.
Every key names its curve. A meeting or turn pillar carries the
CurveId it belongs to, so two curves knotted at the same policy decision
report two rows rather than silently summing into one.
Every arm is classified explicitly. axis_of has no catch-all, so a
new axis cannot fall through into someone else’s measure — the compiler makes
whoever adds one decide where it belongs.
Structs§
- AxisSet
- A set of risk axes: what a product’s value can depend on.
- Curve
IdParse Error - A spelling that names no curve: the spelling, and — where a role’s own key refused it — that key’s reason.
- Mark
IdParse 🔒Error - A spelling that names no mark.
- Risk
Entry - One entry of a risk vector: an input, and the derivative of the valuation with respect to it.
- Risk
Vector - The risk vector one pass produced.
- VolSurface
IdParse Error - A spelling that names no vol surface: the spelling, and — where a registry’s own key refused it — that key’s reason.
Enums§
- Asset
Class - The desk a risk axis belongs to — the grouping a caller looks for a measure under.
- CurveId
- Identifies a stored curve by the role it was pinned under.
- MarkId 🔒
- The identity a model mark is stored under — a parameter someone chose rather than a curve calibrated from instruments or a fact already printed: a correlation, a tranche’s recovery floor or copula degrees of freedom, a watched exogenous scalar. Variants in the order the lift walks the marks, which is this declaration’s.
- Market
Input Id - The typed key for one entry of a risk vector.
- Quantity
Kind - The kind of quote an axis moves — what a default scale is keyed by.
- Risk
Axis - The class of market input a measure reads.
- Risk
Error - A risk pass that cannot report what it was asked for.
- VolSurface
Id - A volatility surface, by the store it is pinned in and its key.
Functions§
- axis_of
- The axis
idbelongs to, orNonewhere it belongs to none. - on_axis
- Whether
idbelongs toaxis— the filter every delta measure applies. - write_
cap_ 🔒vol - A cap vol node’s label:
"cap vol CCY 1y x 0.25y", with@ 3%where the surface carries a strike column. - write_
cms_ 🔒spread_ correlation - A CMS spread correlation’s label: the pair, and the pillar’s expiry in years where the mark is a term structure.
- write_
credit_ 🔒vol - One inflation vol node’s label:
"<kind> inflation vol INDEX 5y", with@ 2%where the surface carries a strike column. - write_
future_ 🔒option_ vol - A futures option vol node’s label:
"future option vol CONTRACT", then the listed expiry and@ STRIKEwhere the surface carries them. - write_
inflation_ 🔒vol - write_
listed_ 🔒vol - A listed-option vol node: its surface’s label, then the expiry and strike where the surface is not flat.
- write_
rate_ 🔒vol - A swaption vol node’s label:
"rate vol CCY 1y x 5y", with@ +25bpwhere the surface carries a smile column.