Skip to main content

OvernightIndex

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: String

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

§currency: String

ISO 4217 currency code.

§day_count: DayCountFraction

Accrual day-count.

§fixing_calendar: Arc<dyn Calendar>

Calendar on which fixings are published.

§publication_lag_days: u16

Publication (payment) lag, in business days.

§business_day_convention: BusinessDayConvention

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

§end_of_month: bool

Conventional end-of-month rule (off for the standard overnight indices).

Implementations§

§

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

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

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

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

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>, 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

§

fn clone(&self) -> OvernightIndex

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 OvernightIndex

§

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

Formats the value using the given formatter. Read more
§

impl From<&OvernightIndex> for ProjectionKey

§

fn from(i: &OvernightIndex) -> Self

Converts to this type from the input type.
§

impl From<&OvernightIndex> for FixingKey

§

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