Function ndf_rung
pub fn ndf_rung(
code: &str,
template: &AnyTemplate,
valuation: NaiveDate,
tenor: Period,
quote: FxSwapQuote,
notional: f64,
spot: f64,
) -> Result<Rung, RungBuildError>Expand description
The par rung of an NDF on an NDF template value: an FX swap whose far leg
is the cash-settled forward AnyTemplate::ndf drafts at the quoted
outright — spot, value and fixing dates from the template’s own calendars
and lag — turned to quote the reference currency as base, and whose near
leg is the physical opposite on the valuation date at spot, where both
discount factors are one, as fx_swap_rung’s is. The rung’s quote is
the swap’s own far rate, settlement units per reference unit: the
reciprocal of the sheet’s outright. The reference currency’s leg discounts under the
settlement currency’s collateral, so the rung solves
discount(<ref>-CSA-<settle>): the NDF-implied curve. Before its fixing a
cash-settled forward values as the physical one, so the residual is
covered interest parity at the value date, and the swap’s fair far rate
verifies the quote. Quoted, as the template is, in reference units per
settlement unit (KRW per USD).
§Errors
RungBuildError::NotFamily for a template of another family;
RungBuildError::Build where the NDF does not draft or the swap is
refused.