Skip to main content

NdsTemplate

Struct NdsTemplate 

pub struct NdsTemplate {
    pub name: String,
    pub swap: Box<AnyTemplate>,
    pub fx: FxSource,
    pub fixing_lag: Option<u32>,
    pub fixing_centers: Option<&'static str>,
    pub zero_coupon_up_to: Option<Period>,
    pub fixed_compounds: bool,
    pub template_date: NaiveDate,
    pub settlement_override: Option<String>,
}
Expand description

A non-deliverable swap market’s terms: the local swap, the FX fixing that converts its payments, and the short-end rule.

Fields§

§name: String

Template name (doubles as registry code), e.g. KRW-CD-NDS.

§swap: Box<AnyTemplate>

The local swap’s conventions — an OIS or a vanilla template, built here and not registered: the onshore deliverable market differs.

§fx: FxSource

The FX fixing’s source.

§fixing_lag: Option<u32>

The fixing lag, overriding the source’s.

§fixing_centers: Option<&'static str>

The fixing calendar, overriding the source’s.

§zero_coupon_up_to: Option<Period>

Tenors up to and including this pay once at maturity on both legs.

§fixed_compounds: bool

Whether the fixed leg compounds its rate into its single payment, (1 + K)^τ — BRL’s — rather than accruing it simply.

§template_date: NaiveDate

The date of the latest trade template the row follows.

§settlement_override: Option<String>

The currency the swap settles in, overriding the source’s — an ISO code the caller states, checked when the swap is drafted. Settling in a currency other than the source’s crosses the source’s fixing with the settlement currency’s against USD (EMTA’s Cross Currency Settlement Rate). ISDA’s NDS standard terms allow USD, EUR, GBP, JPY, AUD, HKD or SGD; the supplement’s non-USD settlement-rate mechanism is licence-gated, so this cross is the EMTA cross templates’ and is UNVERIFIED against the supplement.

Implementations§

§

impl NdsTemplate

pub fn with_settlement_currency(self, code: &str) -> Self

This template settling in code: the swap reports and pays in it, each fixing crossed through USD where code is not the source’s settlement currency, the fixing lag and calendar the source’s.

pub fn reference_ccy(&self) -> Currency

The local currency the swap accrues in.

§Panics

If the row’s swap names no ISO currency — a wiring error the registry test catches.

pub fn fx_terms(&self) -> NdsFxTerms

The FX fixing’s terms: the source’s, with the row’s overrides applied.

§Panics

If the row names an unregistered NDF template or a malformed currency — a wiring error the registry test catches.

pub fn fixing_calendar(&self) -> Arc<dyn Calendar>

The calendar the FX fixing is a business day of.

pub fn fx_index(&self) -> String

The FX fixing series: the pair’s canonical key, settlement currency as base (FX-USDKRW).

pub fn fixing_date(&self, payment: NaiveDate) -> NaiveDate

The FX fixing date for a payment on payment: adjusted Preceding onto the fixing calendar, then stepped back the lag in its business days.

pub fn fixing_for_payment(&self, payment: NaiveDate) -> (NaiveDate, NaiveDate)

The (fixing, value) dates a payment on payment converts at: the FX fixing fixing_date dates, for value the lag later on the same calendar — the payment date itself, unless the payment falls on a day the fixing calendar is closed.

pub fn swap_for(&self, tenor: Period) -> AnyTemplate

The local swap a tenor trade draws on: the row’s, paying once at maturity on both legs when the tenor is within the zero-coupon limit.

pub fn with_spot_lag(self, days: i32) -> Self

This template with its local swap’s spot lag overridden, in business days.

pub fn spot_rule(&self) -> (Arc<dyn Calendar>, Period, BusinessDayConvention)

The local swap’s calendar, spot lag and business-day convention — the spot rule a drafted NDS starts from.

§Panics

If the row’s swap is neither an OIS nor a vanilla template, which no registered row is.

pub fn with_fixing_lag(self, days: u32) -> Self

This template with its FX fixing lag overridden, in business days.

Trait Implementations§

§

impl Clone for NdsTemplate

§

fn clone(&self) -> NdsTemplate

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl From<NdsTemplate> for AnyTemplate

§

fn from(t: NdsTemplate) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.