Skip to main content

cross_currency_rungs

Function cross_currency_rungs 

pub fn cross_currency_rungs<'a>(
    template: impl XccyTemplateArg<'a>,
    valuation: NaiveDate,
    tenors: &[Period],
    quotes: &[f64],
    notional: f64,
    fx_rate: f64,
) -> Result<Vec<Rung>, RungBuildError>
Expand description

The spread rungs of a collateral ladder, built from a basis-swap template — what a recipe’s Basis segment declares, given its quotes.

Each rung is the template’s swap at one tenor, receiving the quoted leg at notional with the basis quote on it, dated by the template’s own conventions: effective from valuation by the template’s spot lag on the quoted leg’s calendar, termination by advancing the tenor on that calendar under the leg’s business-day convention and end-of-month flag; the pillar is the swap’s final payment date, as for an OIS rung. fx_rate is units of the other leg’s currency per one unit of the quoted leg’s, as CrossCurrencySwap::from_template takes it. The result feeds calibrate_cross_currency directly.

§Errors

RungBuildError for an unknown or non-cross-currency template, a tenor and quote count mismatch, or a shape the template does not build.

§Panics

If the template’s swap has no paying leg, which a registered template’s never does.