Skip to main content

FutureTemplate

Struct FutureTemplate 

pub struct FutureTemplate {
Show 15 fields pub name: String, pub index_name: String, pub index_code: String, pub currency: String, pub period: Period, pub day_count: DayCountFraction, pub contract_notional: f64, pub contract_accrual: f64, pub calendar: Arc<dyn Calendar>, pub exchange_calendar: Option<Arc<dyn Calendar>>, pub business_day_convention: BusinessDayConvention, pub reference: FutureReference, pub accumulation: Option<AccrualCompounding>, pub last_trading: LastTrading, pub tick: TickRule,
}
Expand description

The conventions of a rate future (a type = "RateFuture" pillar): a forward accrual over a fixed period (the contract’s reference length, e.g. 3M) starting at the pillar’s locator. The quoted value is the futures price (100·(1 − rate)); RateFutureConvexity is deferred (an adjustment on the segment, not a pillar quote). It carries the schedule conventions needed to turn the pillar locator into the accrual [start, end].

Fields§

§name: String

Template name (doubles as the registry code).

§index_name: String

The underlying index name (recorded for provenance; the helper pins discount).

§index_code: String

The underlying index’s registry code ("USD-SOFR") — the key a market stores the projection curve under, and the one a position declares.

§currency: String

ISO 4217 currency of the contract. Carried rather than parsed out of index_name: the name is a projection-curve key ("SOFR"), which does not contain a currency.

§period: Period

The contract accrual length (e.g. 3M).

§day_count: DayCountFraction

Accrual day-count. Prices the underlying rate — it is the convention the contract’s forward is computed under, and the one the calibration helper uses. It does not scale the payoff; see Self::contract_accrual.

§contract_notional: f64

The published contract notional (e.g. 1,000,000 USD for the 3M SOFR contract). The reportable size of one contract.

§contract_accrual: f64

The contract’s fixed period fraction (e.g. exactly 0.25 for a 3M contract). Scales the payoff, and is deliberately not derived from Self::day_count: the exchange fixes a contract’s basis-point value regardless of how many days its period actually spans, but an IMM quarter is 91 or 92 actual days, so an Act/360 fraction (0.2528 / 0.2556) would overstate the bp value by 1.1%–2.2% and would vary by contract month.

The two fractions are never interchangeable: day_count prices the rate, contract_accrual scales the payoff.

§calendar: Arc<dyn Calendar>

Calendar advancing the locator to the accrual end.

§exchange_calendar: Option<Arc<dyn Calendar>>

The exchange’s business-day calendar where its contract rules define one; None where they do not, and the fixing calendar stands in. The last trading day and the tick window roll on it (Self::trading_calendar).

§business_day_convention: BusinessDayConvention

Business-day convention applied to that advance.

§reference: FutureReference

How a listed contract’s reference period follows from its delivery month.

§accumulation: Option<AccrualCompounding>

How the contract’s daily overnight rates combine into its settlement rate — compounded (SR3, SONIA, €STR) or averaged (SR1, Fed Funds) — or None for a contract on a term rate, which settles on one fixing.

§last_trading: LastTrading

When a listed contract stops trading.

§tick: TickRule

Its minimum price fluctuation.

Implementations§

§

impl FutureTemplate

pub fn reference_period( &self, year: i32, month: u32, ) -> Result<(NaiveDate, NaiveDate), RateFutureError>

The reference period of the listed contract for a delivery month — the IMM quarter starting on the delivery month’s third Wednesday, or the calendar month itself — the period RateFuture::for_contract settles over.

§Errors

RateFutureError for a month off a quarterly template’s cycle, or a year and month that name no date.

pub fn last_trading_day( &self, year: i32, month: u32, ) -> Result<Option<NaiveDate>, RateFutureError>

The day the listed contract for a delivery month stops trading, under the exchange’s rule on the template’s trading calendar — the exchange’s own where its contract rules define one, else the fixing calendar — or None where the rule is not sourced.

§Errors

As reference_period.

pub fn tick_size( &self, year: i32, month: u32, as_of: NaiveDate, ) -> Result<Option<f64>, RateFutureError>

The listed contract’s minimum price fluctuation on as_of, in index points, or None where the exchange’s rule is not sourced.

§Errors

As reference_period.

§

impl FutureTemplate

pub fn price_point_value(&self) -> f64

Money per 1.00 of price movement on one contract (e.g. 2,500 USD for the 3M SOFR contract, whose bp value is therefore 25 USD).

Derived rather than stored: it is fixed by the contract notional and the contract accrual, and a third editable field encoding the same fact is how the three drift apart.

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

The calendar the listing dates roll on: the exchange’s own where the contract rules define one, else the fixing calendar (the stand-in is explicit in exchange_calendar).

Trait Implementations§

§

impl Clone for FutureTemplate

§

fn clone(&self) -> FutureTemplate

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<FutureTemplate> for AnyTemplate

§

fn from(t: FutureTemplate) -> 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.