Module collateral
Expand description
The discount-curve key — a collateral specification (pure reference data).
CollateralSpec names which discount curve a cashflow is collateralised
against. It is a pure value type over Currency with no state and no
market dependency, so it lives in statics — letting both the curve-recipe
registry (which keys recipes by it) and the
MarketContext discount registry (which resolves
curves by it) share one key without an upward layer edge.
§One key, not two
There were two types spelled CollateralSpec: this one, and a
{cashflow_ccy, collateral_ccy} pair of currency codes that only the recipe
registry used. They were not interchangeable, so a recipe could not be looked
up by the key a trade declares — which was the whole point of keying recipes
by a collateral spec. The pair is gone and this is the survivor, because it
is the one that can represent what callers actually pin curves under:
FromStr here is total, and keys like CSA-ACME-2026 or TRY-implied
decompose into no currency pair at all.
The two-code question a recipe asks is therefore answered fallibly, by
parts. A key that names no currency pair has no
recipe, which is an answer rather than a lost case.
Not to be confused with the xccy template
CsaSpec, which is the CSA
definition (collateral currency + its overnight index); CollateralSpec is
the discount key.
Structs§
- NotA
Collateral Currency - A
collateralargument that is not a currency code: collateral is always the currency posted, never an index or a discount key.
Enums§
- Collateral
Spec - Which discount curve a product is collateralised against.
Constants§
- CSA_
INFIX 🔒 - The infix separating the cashflow currency from its collateral currency in a
named cross-collateral key:
"EUR-CSA-USD"is EUR flows under a USD CSA.
Functions§
- collateral_
currency - The currency a
collateralargument names.