Function swap_builder_on_index
pub fn swap_builder_on_index(
effective: NaiveDate,
termination: NaiveDate,
index: &str,
) -> Result<ProductBuilder, CurveError>Expand description
A ProductBuilder pre-loaded with the registered conventions for
index’s standard single-currency swap — calendar, frequency, roll,
business-day convention, day counts, and payment lag all come from the
template registry, restated nowhere.
An overnight index resolves to its OIS template and builds the overnight
family, accumulating the way that template says; a term (IBOR) index
resolves to its vanilla swap template. Where two templates share an index
and differ in the accumulation, this reaches the index’s registered one —
swap_builder_on_overnight_template names the other. The trade’s currency is the
index’s own.
§Errors
CurveError::UnknownIndex naming the code and listing the registered
rate indices, if index resolves to no rate index or no swap template
covers it; CurveError::Malformed if the index’s currency code is not a
currency.