Skip to main content

swap_builder_on_template

Function swap_builder_on_template 

pub fn swap_builder_on_template(
    effective: NaiveDate,
    termination: NaiveDate,
    template: &AnyTemplate,
    index_code: &str,
) -> Result<ProductBuilder, CurveError>
Expand description

The currency and the floating day count come from the template’s own index, not from a second registry lookup. template_index_matches_the_registry_index pins that this is the same index the code-keyed path resolved, so routing through here changes no number.

§Errors

CurveError::UnknownIndex if template is not a swap family; CurveError::Malformed if the index’s currency code is not a currency.