Skip to main content

Module market

Module market 

Expand description

The pricing seam: what a product declares it needs, and what it is handed.

Two halves that deliberately do not mix.

Declaration is mode-free. RiskFactors is identifiers only — a discount key, a projection index, a credit entity, a security-spread key, two flags. No scalar, no type parameter, no numeric market value. A product says what it is priced against without touching how the answer will be differentiated, so the trait reporting it is the same trait in every mode.

Resolution is parameterized by the mode. PricingView<R> holds the data those identifiers resolved to, lifted into one mode, and Priceable<R> returns that mode’s scalar. A later market input is a new field on the view, never a wider signature — widening the seam must not change the arity of its verbs.

The view also knows how to make a derivative-free copy of itself, which is what replaces suspending the tape at runtime: an iterative kernel whose answer is a passive quantity — a yield solve, a lattice rollback, a model calibration — runs through a projection that borrows the very same storage, and records nothing because there is nothing active in it to record.

Modules§

bond_readings
The bond readings a desk takes over an instrument and a market, spelled and ordered as the Python bonds module spells them.
cms
Constant-maturity swap rates: a swap index observed on a fixing date and paid on another, adjusted for convexity by the linear terminal swap rate model.
context
The resolved pricing view, the priceable trait, and the mode-free vocabulary a product declares its market data in.
frame
The risk frame: a risk vector paired with the market that explains it.
pricers
The pricers: one generic implementation per product.
records
An instrument’s cashflow table, resolved against a market.
risk
The risk vocabulary: the keys a risk vector is reported under, the axis each key belongs to, and the ways a read-back refuses.
source
Fetching a market through a source: the port an external system implements.
store
The stored market, the lift that turns it into a mode view, and the risk read-back that comes off the lift.