Skip to main content

Module risk

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.
CurveIdParseError
A spelling that names no curve: the spelling, and — where a role’s own key refused it — that key’s reason.
MarkIdParseError 🔒
A spelling that names no mark.
RiskEntry
One entry of a risk vector: an input, and the derivative of the valuation with respect to it.
RiskVector
The risk vector one pass produced.
VolSurfaceIdParseError
A spelling that names no vol surface: the spelling, and — where a registry’s own key refused it — that key’s reason.

Enums§

AssetClass
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.
MarketInputId
The typed key for one entry of a risk vector.
QuantityKind
The kind of quote an axis moves — what a default scale is keyed by.
RiskAxis
The class of market input a measure reads.
RiskError
A risk pass that cannot report what it was asked for.
VolSurfaceId
A volatility surface, by the store it is pinned in and its key.

Functions§

axis_of
The axis id belongs to, or None where it belongs to none.
on_axis
Whether id belongs to axis — 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 @ STRIKE where 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 @ +25bp where the surface carries a smile column.