Skip to main content

IborIndex

Struct IborIndex 

pub struct IborIndex {
    pub name: String,
    pub currency: String,
    pub tenor: Period,
    pub day_count: DayCountFraction,
    pub fixing_calendar: Arc<dyn Calendar>,
    pub fixing_lag_days: u16,
    pub business_day_convention: BusinessDayConvention,
    pub end_of_month: bool,
    pub value_calendar: Option<Arc<dyn Calendar>>,
}
Expand description

A term (IBOR-style) interest-rate index definition.

A value type carrying only conventions and metadata (it binds no curve; pricing supplies the curve separately). See IborIndex::fixing_date.

Fields§

§name: String

Index name (e.g. "EURIBOR").

§currency: String

ISO 4217 currency code.

§tenor: Period

Index tenor.

§day_count: DayCountFraction

Accrual day-count.

§fixing_calendar: Arc<dyn Calendar>

Calendar on which fixings are published.

§fixing_lag_days: u16

Fixing lag, in business days (magnitude; the fixing precedes the accrual anchor by this many good business days — the conventional −2 IBOR lag).

§business_day_convention: BusinessDayConvention

Conventional business-day convention (drives value-/maturity-date rolling).

§end_of_month: bool

Conventional end-of-month rule (true for the standard month/year IBOR tenors).

§value_calendar: Option<Arc<dyn Calendar>>

The calendar value and maturity dates settle on, where it is not the fixing calendar: USD LIBOR fixed in London and settled on London and New York jointly. None settles on the fixing calendar.

Implementations§

§

impl IborIndex

pub fn new( name: impl Into<String>, currency: impl Into<String>, tenor: Period, day_count: DayCountFraction, fixing_calendar: Arc<dyn Calendar>, fixing_lag_days: u16, business_day_convention: BusinessDayConvention, end_of_month: bool, ) -> Self

Builds a term index from its conventions, for a market the registry does not carry.

Registers nothing. The result is a value the caller passes explicitly; what any other index or calendar resolves to is unchanged. The resolved form is registry::lookup, and process-global registration is deliberately not reachable this way.

pub fn with_value_calendar(self, calendar: Arc<dyn Calendar>) -> Self

This index settling its value and maturity dates on calendar — fixing on its fixing calendar still.

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

The period’s fixing date: the accrual anchor advanced back by the fixing lag on the fixing calendar (a fixing_lag_days of 2 reads as −2 good business days). The handle binds no curve.

pub fn value_date(&self, accrual_start: NaiveDate) -> NaiveDate

The value date of the fixing a period starting at accrual_start reads: the fixing date rolled forward by the fixing lag on the fixing calendar — the date the quoted rate’s own window starts.

On a business-day accrual start the round trip is exact and this is accrual_start itself. On an unadjusted boundary that falls on a weekend or holiday the two part: a Saturday start with a two-day lag fixes on Thursday for value Monday, and the index window runs from the Monday — a rate for a window starting on a Saturday is not a rate anyone publishes. A zero-lag index fixes for same-day value, so its value date is the start adjusted to the next business day. The handle binds no curve.

pub fn code(&self) -> String

The registry code ("EUR-EURIBOR-3M"): the key a market stores the index’s projection curve and fixings under, and the one a coupon names.

pub fn maturity_date(&self, value_date: NaiveDate) -> NaiveDate

The maturity of the index’s own fixing window for a rate valued on value_date: the value date advanced by the index’s tenor, rolled by the index’s conventional business-day convention and end-of-month rule on its fixing calendar.

This is the window the quoted rate spans, which is not the coupon’s accrual period whenever a schedule’s business-day convention has moved an accrual boundary: a 3M EURIBOR coupon accruing over 94 adjusted days still fixes on the 3M rate, not on the 94-day forward. The handle binds no curve.

pub fn business_day_convention(&self) -> BusinessDayConvention

The index’s conventional business-day convention. Exposed metadata; the handle binds no curve.

pub fn end_of_month(&self) -> bool

The index’s end-of-month rule. Exposed metadata; the handle binds no curve.

pub fn forecast<R: Scalar>( &self, curve: &dyn YieldCurve<R>, value_date: NaiveDate, ) -> Result<R, CurveError>

The rate this index quotes for a period valued on value_date, projected off curve.

The simple forward over the index’s own window: (DF(value_date) / DF(maturity) − 1) / τ, where maturity is maturity_date — the index’s tenor window, not a coupon’s accrual period — and τ is measured on the index’s own day count. This is the same expression, over the same two dates, that the pricing engine applies to an unfixed IborCoupon, so the two agree by construction rather than by coincidence.

value_date is where the quoted period starts, not where the rate is published. The lag runs the other way: fixing_date maps an accrual anchor back to its publication date. A floating leg builds its coupon’s window from the accrual start directly, and reports that same date in the fixing_date column of its cashflow records — so that column is what to pass here, and advancing it by the lag first would land a window too late.

Not YieldCurve::forward_rate. That query is continuously compounded on the crate’s ACT/365 anchor and is a property of the curve; this one is simple on the index’s day count over a rolled window. For an ACT/360 index the two differ, and a test asserts that they do.

§Errors

Any CurveError the two discount queries raise, and CurveError::Malformed if the window has no length.

Trait Implementations§

§

impl Clone for IborIndex

§

fn clone(&self) -> IborIndex

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 Debug for IborIndex

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
§

impl From<&IborIndex> for ProjectionKey

§

fn from(i: &IborIndex) -> Self

Converts to this type from the input type.
§

impl From<&IborIndex> for FixingKey

§

fn from(i: &IborIndex) -> 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.