pricebook

A pricing-and-risk analytics library where every number is verified against the book or paper that
defines it — not by a test that re-runs the code, but by an oracle that proves it against a known value.
The goal. Represent, value, and risk a position — price, greeks, calibration, scenario and P&L —
for the asset classes a desk trades, ingesting any market provider through one representation contract. The
point is to retire the expensive third-party black box, not to wrap it.
→ pricebook.github.io — the status page, the
bibliography, and how every number is verified. The status half is generated from the tree and
drift-gated, so it cannot describe a library that no longer exists.
What it is
A functional core with an imperative shell: pricing is a pure price(product, model) → result; everything
stateful is a thin shell around it. In scope: products, models, calibration, engines, risk, the market-data
value types, and the representation of a position and a pricing request. Out of scope — and built in other
projects that consume the representation — GUI, database, broker and data feeds. The library is pluggable,
not plugged in.
How every number is verified
Nothing lands without a named, green oracle, in order of preference: a closed form, then an external
cross-check, then self-consistency, then a trusted mark. “Runs and looks right” is not an oracle.
The method is two-track. Literature arcs add pricing capability verified against a held book;
structural arcs add library-wide capability — representation, greeks, scenario — verified against the
catalogue the literature arcs built. The whole tree is then re-audited for silent oracle decay at every arc
close, because an oracle that was strong when written can be quietly weakened by a later refactor, and a
green suite will not say so. The full discipline is in CLAUDE.md; the re-audit record is in
docs/audit_log.md.
Where it stands
Ten asset-class and model arcs built — rates, credit, equity and hybrids, inflation, commodities,
volatility and variance, XVA, collateralised discounting — and the structural layer that represents and
risks a position: representation, mark-to-market, and the full first- and second-order greek set, both
book-level and bucketed.
This section deliberately states no counts, so it cannot go stale. The live numbers — tests, gates,
re-audits, coverage by asset class — are on the status page, and the three on the badges
above are generated from the tree rather than typed, for the same reason.
Lineage
A clean restart of an earlier migration library. The architecture, the verification standard and the
conventions are kept; the obligation to port every legacy module is not — the library grows by interest
toward the goal above, under the oracle discipline.
License
MIT — see LICENSE.
评论