Function par_rate_of
fn par_rate_of<R: Scalar>(
fixed: &Leg,
floating_npv: R,
view: &PricingView<'_, R>,
product: &'static str,
) -> Result<R, PricingError>Expand description
The par rate of a fixed-against-floating swap.
The swap is worth sign_fixed · K · A + floating, where A is the fixed
leg’s annuity, so the rate that makes it worthless is
−floating / (sign_fixed · A). bpv already reports sign_fixed · A scaled
by a basis point, which is why the annuity is recovered from it rather than
recomputed — two ways of summing the same discount factors would eventually
disagree.
§Errors
PricingError::DegenerateAnnuity if no coupon survives the as-of filter —
a matured trade has no annuity to solve against, and dividing by the zero
would report Ok(NaN).