Struct OvernightIndex
pub struct OvernightIndex {
pub name: String,
pub currency: String,
pub day_count: DayCountFraction,
pub fixing_calendar: Arc<dyn Calendar>,
pub publication_lag_days: u16,
pub business_day_convention: BusinessDayConvention,
pub end_of_month: bool,
}Expand description
An overnight (RFR) interest-rate index definition.
A value type carrying only conventions and metadata; it binds no curve.
Fields§
§name: StringIndex name (e.g. "SOFR").
currency: StringISO 4217 currency code.
day_count: DayCountFractionAccrual day-count.
fixing_calendar: Arc<dyn Calendar>Calendar on which fixings are published.
publication_lag_days: u16Publication (payment) lag, in business days.
business_day_convention: BusinessDayConventionConventional business-day convention (drives value-/maturity-date rolling).
end_of_month: boolConventional end-of-month rule (off for the standard overnight indices).
Implementations§
§impl OvernightIndex
impl OvernightIndex
pub fn new(
name: impl Into<String>,
currency: impl Into<String>,
day_count: DayCountFraction,
fixing_calendar: Arc<dyn Calendar>,
publication_lag_days: u16,
business_day_convention: BusinessDayConvention,
end_of_month: bool,
) -> Self
pub fn new( name: impl Into<String>, currency: impl Into<String>, day_count: DayCountFraction, fixing_calendar: Arc<dyn Calendar>, publication_lag_days: u16, business_day_convention: BusinessDayConvention, end_of_month: bool, ) -> Self
Builds an overnight index from its conventions, for a market the registry does not carry.
Registers nothing, on the same terms as IborIndex::new.
pub fn code(&self) -> String
pub fn code(&self) -> String
The registry code ("USD-SOFR"): the key a market stores the index’s
projection curve and fixings under, and the one a coupon names.
The counterpart of IborIndex::code, and built the same way — from the
index’s own parts rather than by matching the registry, so an index a
caller built has a code too. That is the whole point: an unregistered
index has nothing to match against, and its curve still has to be
pinnable.
Rebuilding a code from parts is only safe while the rule holds for every
registered index, so it is swept rather than assumed —
every_overnight_index_code_is_its_registry_code fails if a future index
is registered under a spelling this does not produce.
pub fn fixing_date(&self, observation_date: NaiveDate) -> NaiveDate
pub fn fixing_date(&self, observation_date: NaiveDate) -> NaiveDate
The fixing date for an overnight observation date: the date itself (an
overnight rate fixes on its own observation day). 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>,
date: NaiveDate,
) -> Result<R, CurveError>
pub fn forecast<R: Scalar>( &self, curve: &dyn YieldCurve<R>, date: NaiveDate, ) -> Result<R, CurveError>
The rate this index quotes for an observation on date, projected off
curve.
The one-day simple forward over [date, next_business_day(date)] on the
index’s own day count — the same per-day projection the overnight coupon
walk applies, so a strip built from this agrees with the engine’s.
Not YieldCurve::forward_rate, on the same terms as
IborIndex::forecast.
§Errors
Any CurveError the two discount queries raise, and
CurveError::Malformed if the day has no length.
Trait Implementations§
§impl Clone for OvernightIndex
impl Clone for OvernightIndex
§fn clone(&self) -> OvernightIndex
fn clone(&self) -> OvernightIndex
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more