Status¶
Everything below is generated from the tree and drift-gated — a test compares the committed page against a fresh generation, so it cannot describe a library that no longer exists. The inventory is derived; the readiness tables are judgement, refreshed at each whole-tree re-audit.
pricebook — library status¶
Live status page. The inventory block is generated by
tests/tooling/status.pyfrom the tree and drift-gated in CI — a stale page fails the suite, which is the only reason the numbers here can be trusted (§7's guarded-not-folklore line, applied to a status page). Everything between thecuratedmarkers is judgement — asset-class readiness, the bibliography, the 1.0 scorecard — refreshed by hand at each re-audit (§9's (4) pass). Regenerate withpython tests/tooling/status.py --write.IP note: structure and status only — never a transcribed formula or source line, asserted by the instrument's own test — so the page stays safe to render publicly.
Inventory — derived from the tree, regenerated and drift-gated¶
- Verification: 3645 tests (floored in CI), 13
verify.pygates plusruffandpyright, mutation-swept; 11 whole-tree re-audits - Models: 40
- Engines: 51, dispatching 37
(product, model)pairs - Products: 26
Greeks and book-level risk are DETECTED, not asserted — the columns below are derived from the risk layer, so they cannot drift. A hand-curated greeks cell said "Black MC only" and was wrong on this instrument's first run.
| Asset class | Engines | Greek fns | Book-level risk |
|---|---|---|---|
| commodity | 4 | — | — |
| credit | 8 | — | credit_valuation_adjustment, funding_valuation_adjustment, wrong_way_mc, wrong_way_risk |
| equity | 7 | 4 | equity_cva, sensitivities |
| inflation | 5 | — | — |
| rates | 12 | — | collateral, collateralised_capstone, mc_exposure |
| volatility | 7 | — | — |
Representation (R1) — 4 of 4 built. Detected by presence, so this column fills itself as the structural track proceeds.
| Piece | Built | What it is |
|---|---|---|
Trade |
yes | a holding: product + units + direction (R1.1) |
Position |
yes | the trades held, across any number of products (R1.2) |
PricingRequest |
yes | what to value, as of when, against which market (R1.3) |
MtMReport |
yes | a book's mark, broken down by trade (R1.4) |
Portfolio |
deferred | a hierarchy of positions — deferred, because a flat multi-product Position is the book and nothing needs the hierarchy yet |
Greeks (R2) — 17 of 17 built. The structural track's second column, detected by presence like R1's.
| Piece | Built | What it is |
|---|---|---|
bumped_equity_spot |
yes | the bump primitive: a perturbed factor is a new snapshot (R2.1) |
finite_difference_greek |
yes | the generic FD greek over any priceable (R2.1) |
equity_option_delta |
yes | the first analytic greek, the FD's exact target (R2.1) |
equity_option_gamma |
yes | analytic gamma — the chain rule squared (R2.2) |
equity_option_vega |
yes | analytic vega, per unit of sigma (R2.2) |
volatility_bump |
yes | the model-level bump: vol is not in the snapshot (R2.2) |
equity_option_theta |
yes | analytic theta — the market-fixed decay (R2.2b) |
equity_option_rho |
yes | analytic rho — the total across three rate channels (R2.2b) |
rolled_to |
yes | the date roll: the market unchanged, seen from later (R2.2b) |
paired_mc_spot_greek |
yes | a greek of an MC estimate, banded by its paired paths (R2.3) |
price_european_equity_option_mc |
yes | the MC-priced equity vanilla the greek differences (R2.3) |
book_greek |
yes | a book's risk: one bump of the shared market, every trade repriced (R2.4) |
bucketed_curve_greek |
yes | the key-rate decomposition, one bucket per pillar (R2.4) |
per_path_payoffs |
yes | the engine's per-path protocol, so a book can band from its paths (R2.4) |
spread_cross_gamma |
yes | cross-gamma of the spread, Margrabe-exact (R2.5) |
equity_option_vanna |
yes | vanna and volga — the vol second order (R2.5) |
book_risk |
yes | the risk-a-book report: mark, every greek row, the buckets (R2.5) |
Scenario / P&L (R3) — 3 of 3 built. The third structural column; a scenario is a finite reprice, so its oracle is an identity rather than a convergence rate.
| Piece | Built | What it is |
|---|---|---|
Scenario |
yes | a composable FINITE market shock, not an infinitesimal one (R3.1) |
scenario_value |
yes | the book repriced under a shocked market — an exact identity (R3.1) |
scenario_pnl |
yes | the stress P&L: shocked minus base, the total R3.2 must attribute (R3.1) |
Unclassified risk modules (7): analytic_greeks, book_greeks, book_risk, bumps, finite_difference, mc_greeks, scenario
Unclassified engines (4): equity_vanilla_mc, mtm, position, pricing_request — reported rather than dropped, so the table cannot look complete when it is not.
What this is¶
A pricing-and-risk analytics library where every number is verified against the book or paper that defines
it. Functional core, imperative shell: pricing is a pure price(product, model) → result. The goal (proposed
1.0 purpose): price and risk a position, for the asset classes a desk trades, ingesting any market
provider through the representation contract — to retire the expensive third-party black box.
At a glance¶
- Version: see
CHANGELOG.md(theversiongate keeps them equal) - Spine: L0 foundation · L1 market · L2 products · L3 models + calibration · L4 engines · L5 risk · L6 shell
- Verification: mutation-swept, floored in CI; the live test / gate / re-audit counts are in the generated block above (moved there at T94 so the drift gate keeps them honest — a curated count went stale once)
- Projects built (literature arcs): inflation · Monte-Carlo infrastructure · XVA · equity & hybrids · single/multi-name credit · volatility surface · collateralised discounting · commodities · stochastic rates · volatility derivatives (closing)
Bibliography — where we stand with the literature¶
Every built capability is verified against a held source. worked-from = held and built/oracled against;
in-hand = held, not yet built from. (Source PDFs are gitignored for IP; only this status is tracked.)
| Source | Domain | Status | Delivered / deferred |
|---|---|---|---|
| BERHAN-2012 | Inflation derivatives | worked-from | ch 1–5 built; later ch → to_go_deeper |
| JAECKEL-2002 | Monte-Carlo methods | worked-from | 9 of 14 ch (Sobol, bridge, variance reduction, MC Greeks); rest deferred |
| CREPEY-2026 | XVA | worked-from | elementary XVA spine built; ML/BSDE engine → out_of_method |
| BROCKHAUS-2016 | Equity & hybrids | worked-from | equity/hybrid/CEV built |
| OKANE-2008 | Single/multi-name credit | worked-from | CDS, baskets, CDO, base correlation built |
| GATHERAL-2006 | Volatility surface | worked-from | SVI surface built |
| LICHTERS-2015 | Collateralised discounting | worked-from | OIS/multi-curve, LGM, CSA exposure built |
| CLARK-2014 | Commodities | worked-from | forward, Asian, spread, Schwartz built |
| MCINERNEY-ZASTAWNIAK | Stochastic rates | worked-from | Vasicek→G2++→HJM→Bachelier→CEV; §8.5 SABR → out_of_method |
| KWOK-ZHENG | Volatility derivatives | worked-from (current arc) | variance swaps, options-on-variance, VIX, 3/2, Lévy; timer (T79) to come |
| ZHAO-CUI-FLORESCU-2018 | 3/2 transform (paper) | worked-from | the 3/2 Laplace transform (resolved a book defect) |
| PAGES-2018 | Numerical probability (MC/American/Greeks) | in-hand | shelved; the structural/numerical track's reference |
| KROESE-TAIMRE-2011 · MILLER-EDELMAN-APPLEBY-2007 · OVERHAUS-2002 | MC / numerical / equity | in-hand | shelved; mined when a topic pulls them |
| candidates (not yet held) | Seydel · Savine · C. Alexander | — | trees+PDE, AAD, market risk — for the structural track |
Coverage — asset class × depth (the JUDGEMENT half)¶
●●● deep · ●● solid · ● partial · — absent
Greeks and book-level risk are NOT here — they are detectable, so they live in the generated inventory above and cannot drift. This table carries only what needs a judgement: how deep the pricing and calibration go for each class. A hand-curated greeks cell read "Black MC only" and was wrong within the same re-audit that wrote it; the generator found the fourth function on its first run.
| Asset class | Price | Calibrate |
|---|---|---|
| Rates | ●●● | ●● |
| Credit | ●●● | ●● |
| Volatility / variance | ●●● | ●● |
| Equity | ●● | ●● |
| Inflation | ●● | ●● |
| Commodity | ●● | ● |
| FX | — | — |
| Counterparty / XVA | ●● | — |
Reading: pricing is broad and deep; calibration is broader than it looks (curves, SVI, Heston, HW, CEV, copula, JY). FX is the one untouched asset class — the literature-arc swing, now deferred past R3 (Bernardo ruled the structural track continues first). For greeks and risk, read the generated table: R2 is complete — the full analytic first- and second-order greek set now exists (delta, gamma, vega, theta, rho, vanna, volga, cross-gamma), analytic + finite-difference + MC-estimate, plus book-level and bucketed (key-rate) risk. The "risk a position" line of 1.0 is real at the greek level; scenario/stress and P&L attribution (R3) are what remain of "risk".
The representation layer — the known gap (why it can feel like a catalog)¶
At the pricer level this is a genuine library: one dispatch spine, one price contract, a shared,
actively-de-duplicated foundation. Above the pricers, the representation layer §0 promised was deferred:
| Representation piece | State |
|---|---|
| Product (the economic contract) | ✅ built (frozen dataclasses per asset class) |
MarketSnapshot (market data the model carries) |
✅ built |
| Trade / Position / Portfolio | ❌ absent — cannot represent a book |
| Pricing / Valuation request (§0's other half) | ❌ absent |
| Calendar / holiday / business-day engine | ❌ absent |
| Schedule structure | ◐ half-unified (one foundation + ~15 per-product builders) |
| Mark-to-market procedure (value a position vs market) | ❌ absent |
This layer sits above the 45 engines and reuses them — building it does not rewrite them, and the verified closed-form catalogue becomes its oracle set.
Direction — a two-track rhythm, switched at the re-audit¶
- Literature arcs (book-grounded): add pricing capability for a model/asset class; oracle = the source.
- Structural arcs (library-level, pluggable with any asset/model): representation, greeks, scenario, P&L, lifecycle, XVA-on-position, time-series; oracle = the catalogue + decomposition/convergence identities.
The whole-tree re-audit (every ~arc close) is the switch point: assess the tree, pick the next track.
Where we are: R1 (representation & mark-to-market) done → re-audit #10 → R2 (greeks, first- and second-order, book-level + bucketed) done → re-audit #11 → R3 (scenario / P&L) next (Bernardo ruled the structural track repeats; FX deferred). Then R4 (lifecycle / XVA-on-position) → R5 (time-series / VaR — the statistical-oracle tier) → FX literature arc (the currency-general test). A short presentation break (README + bibliography + Pages) slots before R3.
The 1.0 scorecard (proposed finish line — purpose, not module count)¶
- [ ] Represent a position (trade / portfolio / pricing request)
- [ ] Value a position against any provider's market data (mark-to-market)
- [ ] Risk a position (greeks, scenario/stress, P&L attribution)
- [x] Provider-agnostic by design (§0 — the library owns the representation; providers adapt into it)
- [ ] Desk-complete (price + calibrate + greeks + risk) for the chosen asset classes
- [ ] Statistical-oracle tier ruled (needed for VaR backtesting / time-series) — §4 extension, open
How this page stays honest¶
Regenerated at each re-audit; mechanical rows tooling-emitted (proposed, so they cannot drift); judgement rows curated. A stale status page is worse than none — the §7 guarded-not-folklore rule applies to it too.