Skip to main content

swap_from_builder

Function swap_from_builder 

pub(crate) fn swap_from_builder(
    builder: ProductBuilder,
    index: &str,
    notional: f64,
    fixed_rate: f64,
    pays_fixed: bool,
    accrual_compounding: Option<Named<AccrualCompounding>>,
) -> PyResult<PyInstrument>
Expand description

The swap tail both the code-keyed vanilla_swap and Template.vanilla_swap forward to: the terms, the accrual-compounding override and its two refusals, the side, and the build.

Extracted rather than duplicated so the two constructor paths cannot compute different products — which is the obligation python-product-surface puts on a family reachable two ways.