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: StringTemplate name (doubles as the registry code).
index_name: StringThe underlying index name (recorded for provenance; the helper pins discount).
index_code: StringThe underlying index’s registry code ("USD-SOFR") — the key a market
stores the projection curve under, and the one a position declares.
currency: StringISO 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: PeriodThe contract accrual length (e.g. 3M).
day_count: DayCountFractionAccrual 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: f64The published contract notional (e.g. 1,000,000 USD for the 3M SOFR contract). The reportable size of one contract.
contract_accrual: f64The 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: BusinessDayConventionBusiness-day convention applied to that advance.
reference: FutureReferenceHow 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: LastTradingWhen a listed contract stops trading.
tick: TickRuleIts minimum price fluctuation.
Implementations§
§impl FutureTemplate
impl FutureTemplate
pub fn reference_period(
&self,
year: i32,
month: u32,
) -> Result<(NaiveDate, NaiveDate), RateFutureError>
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>
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>
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
impl FutureTemplate
pub fn price_point_value(&self) -> f64
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>
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
impl Clone for FutureTemplate
§fn clone(&self) -> FutureTemplate
fn clone(&self) -> FutureTemplate
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more