Function par_rungs
pub fn par_rungs<'a>(
template: impl SwapTemplateArg<'a>,
valuation: NaiveDate,
tenors: &[Period],
quotes: &[f64],
notional: f64,
) -> Result<Vec<Rung>, RungBuildError>Expand description
The par rungs of a single-currency swap ladder, built from a swap template
— the sibling of cross_currency_rungs for the commonest curve there is.
Each rung is the template’s swap from its spot date to tenor, at the
quoted fixed rate on notional, dated by the template’s own conventions
as swap_builder_on_tenor dates it; the pillar is the swap’s final
payment date, as for a cross-currency rung, because an overnight swap’s
last cashflow pays after its termination and that payment is the node the
quote determines. The rungs come back in pillar order whatever order the
tenors were given in, so a mapping of quotes needs no ordering of its own.
The result feeds calibrate directly.
§Errors
RungBuildError for an unknown code, a template that is not a swap
template, a tenor and quote count mismatch, or a swap the template refuses
to build.