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
FxForwardrule):DF_S(T) / fixing; - otherwise at the parity forward for the fixing’s value date
V:DF_S(T) / F(V)withF(V) = X · DF_S(V) / DF_ref|S(V)— which isDF_ref|S(T) / Xwhen 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.