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: StringIndex name (e.g. "EURIBOR").
currency: StringISO 4217 currency code.
tenor: PeriodIndex tenor.
day_count: DayCountFractionAccrual day-count.
fixing_calendar: Arc<dyn Calendar>Calendar on which fixings are published.
fixing_lag_days: u16Fixing 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: BusinessDayConventionConventional business-day convention (drives value-/maturity-date rolling).
end_of_month: boolConventional 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
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
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
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
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
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
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
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
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
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>
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.