Skip to main content

conversion

Function conversion 

pub(crate) fn conversion<R: Scalar>(
    leg: &Leg,
    view: &PricingView<'_, R>,
    currency: Currency,
    pays: NaiveDate,
    how: Conversion,
) -> Result<R, PricingError>
Expand description

What one unit of a non-deliverable leg’s currency paid on pays is worth today in the settlement currency, converted as how says:

  • at an agreed rate A: DF_S(T) / A;
  • at an FX fixing once it is published (the FxForward rule): DF_S(T) / fixing;
  • otherwise at the parity forward for the fixing’s value date V: DF_S(T) / F(V) with F(V) = X · DF_S(V) / DF_ref|S(V) — which is DF_ref|S(T) / X when the value date is the payment date, the form taken then.

An agreed rate and a printed fixing are both reference units per settlement unit — a fixing on a key quoted the other way round turned first — and divide at this one place.