Module recipes
Expand description
Curve recipes: how a currency’s curves are built, as topology.
A recipe names, per role, the template that builds the curve — a deposit at the front, a policy path on the meeting template, a futures strip, a par-swap strip, or for a cross-collateral key FX swaps and then basis swaps — and, per projection index, whether it telescopes onto the discount curve or has its own strip. It carries no tenor and no pillar: the grid is whatever the quote sheet quotes, bound to the templates by the shape of each quote’s locator. The one dated thing a recipe may carry is an explicit window, for an author who fixes a window whatever the sheet says.
Recipes are reference data. The shipped base (recipe_for) is immutable
and carried by every market; a CurveRecipes overlays it per book. A
recipe is never executed at pricing time: the sheet binder in the
calibration module reads it, and resolution never does.
Modules§
- eur 🔒
- EUR default curve recipe: the ESTR sheet’s topology.
- gbp 🔒
- GBP default curve recipe: the SONIA sheet’s topology.
- offshore 🔒
- The offshore (NDF-implied) curves under USD collateral: each local currency’s discount under USD collateral, marked from NDF outrights, for the ten NDS currencies with an EMTA NDF template (THB has none).
- ois 🔒
- Own-currency recipes that are a par OIS strip and nothing else: one per currency with a registered OIS template and no richer recipe of its own.
- spec 🔒
- A curve recipe stated as data.
- try_
in_ 🔒usd - TRY-under-USD-collateral cross recipe (
{TRY, USD}). - usd 🔒
- USD default curve recipe: the SOFR sheet’s topology.
- usd_
in_ 🔒eur - USD-under-EUR-collateral cross recipe (
{USD, EUR}).
Structs§
- Cross
Recipe Projection Error - A cross-collateral-keyed recipe carried a projection entry — rejected at
CurveRecipes::insert. The projection namespace is flat and index-keyed: an index projects off its own-currency curves, so a cross recipe’s projection entry would silently overwrite the own-currency projection pin for every trade in a context. Only discounting varies by collateral. - Cross
Recipe Step Error - A cross-collateral-keyed recipe carried a policy path or an explicit
window — rejected at
CurveRecipes::insert. Policy steps shape an index’s own-currency short end; under a cross key only discounting varies by collateral. - Curve
Recipe - A quote-less, per-currency topology: the discount segments in order, per projection index its source, and any windows the recipe fixes. Keyed by currency code (ISO 4217).
- Curve
Recipes - A resolver layering user overrides over the immutable default base.
- Explicit
Window - A window the recipe fixes whatever the sheet says: the template it is quoted on and its dates.
- Projection
Topology Entry - One projection index paired with how it is sourced — an entry of a recipe’s
projection_topology. - Recipe
Spec - A curve recipe stated as data: the collateral key it builds under, the currency, the discount segments in order, a source per projection index, the windows, and an optional triangulation hub.
- Segment
- One discount segment: a role and the template that builds it.
- Window
Spec - A window the recipe fixes, as data.
Enums§
- Cross
Recipe Error - Why a
CurveRecipes::insertrejected a cross-collateral-keyed recipe. - Projection
- How a projection index’s forward curve is sourced.
- Projection
Kind - Whether a projection index resolves to its own forward curve or telescopes onto the discount curve — the recipe’s authority on projection topology.
- Projection
Spec - How a projection index is sourced, as data.
- Recipe
Error - Why a template could not take the place a recipe builder gave it.
- Recipe
Spec Error - Why a
RecipeSpeccould not become a recipe — always naming its key. - Role
- What a discount segment contributes to the curve, in the order a desk reads its sheet.
- Triangulated
Recipe Error - Why a triangulated declaration was rejected at
CurveRecipes::insert.
Constants§
- TURN
- The tagged-quote family of a turn-of-period one-period swap.
- XCCY
- The tagged-quote family of a floating-floating cross-currency basis swap: the quote is the basis spread on the template’s quoted leg.
Statics§
- REGISTRY 🔒
- The registered default recipes, keyed by
(cashflow_ccy, collateral_ccy), each single-sourced: a richer recipe in its own file, a par-OIS-only one as a row ofois::OIS_ONLY.(X, X)is a currency’s own recipe;(X, Y)(X ≠ Y) is a cross-collateral recipe. This is the immutable base: never mutated at runtime, and a recipe added here appears to callers without restating.
Functions§
- canonical
- The registered spelling of
code, which the registry matches without regard to case;codeas given where it is not registered. - collaterals
- The registered base collateral keys.
- is_
degenerate_ hub - Whether
viais one ofkey’s own currencies, which collapses the triangle onto the key itself: the one rule a recipe and a market pin share. - keyed 🔒
- A registry key from two currency codes, or
Nonewhere either names no currency. - own_
recipe_ 🔒of - The
{cashflow}-ownrecipe a cross key’s misplaced entry belongs in, named for a message. A key that decomposes into no currency pair has no own recipe to name, and says so rather than inventing a currency. - recipe_
for - The default recipe for
key, orNoneif unregistered. Reads the immutable base; for the effective recipe under user overrides, useCurveRecipes. - shipped 🔒
- A shipped recipe’s segment, which names a registered template of the role’s family: a wrong code in a shipped file is a defect the unit test over the registry catches, not a runtime condition.
- triangulated_
sources - The three source keys of a triangulated cross discount
{cashflow, collateral}derived throughvia, in ratio order: base{collateral, collateral}, numerator{cashflow, via}, denominator{collateral, via}. - try_
usd_ basis_ recipe - The earlier TRY-under-USD basis recipe (FX swaps and a cross-currency
swap over a TRY-own curve), no longer the
{TRY, USD}default — overlay it on aCurveRecipeswhen a TRY-own curve is available. The shipped default is the directly-observable fixed-vs-float cross-currency curve. The earlier basis model: FX swaps onTRY-USD-FXSWAPthen basis swaps onTRY-USD-CCS, both pinning one FX-basis curve over a TRY-own peer curve. Not the shipped default — overlay it when a TRY-own curve is available.
Type Aliases§
- Recipe
Key - The recipe-registry key: a
CollateralSpec({cashflow_ccy, collateral_ccy}). - Recipe
Make 🔒 - A recipe constructor, registered against a
(cashflow_ccy, collateral_ccy)key.