Skip to main content

RateFuture

Struct RateFuture 

pub struct RateFuture {
Show 14 fields pub currency: Currency, pub collateral: CollateralSpec, pub index: String, pub accrual_start: NaiveDate, pub accrual_end: NaiveDate, pub day_count: DayCountFraction, pub contracts: f64, pub contract_notional: f64, pub contract_accrual: f64, pub traded_price: f64, pub convexity_adjustment: f64, pub hull_white_convexity: bool, pub side: f64, pub overnight: Option<AnyCoupon>,
}
Expand description

A short-term interest-rate futures position.

Two conventions are easy to get wrong in ways that look right. The payoff is undiscounted: a daily-margined future settles variation margin in immediate money, so the declared discount curve does not enter its value, and its risk carries no discount row. The payoff scale comes from the contract specification, never from the accrual day count: the exchange fixes a contract’s basis-point value, so day_count prices the rate and contract_accrual scales the payoff.

Fields§

§currency: Currency

The contract’s currency.

§collateral: CollateralSpec

The declared collateral — carried for booking uniformity; unused by the payoff.

§index: String

The projection index the contract’s rate is read from, by registry code.

§accrual_start: NaiveDate

Contract accrual start.

§accrual_end: NaiveDate

Contract accrual end.

§day_count: DayCountFraction

The day count the rate is computed under. Not the payoff scale.

§contracts: f64

Contracts held.

§contract_notional: f64

The published contract notional. Sizes the position for reporting; it does not scale the payoff on its own.

§contract_accrual: f64

The contract’s fixed period fraction (exactly 0.25 for a quarterly contract). With contract_notional this fixes the payoff scale.

§traded_price: f64

The traded price, 100 − traded rate.

§convexity_adjustment: f64

The exogenous convexity adjustment, applied as futures rate = forward + adjustment — the orientation a futures quote calibrates under, so a position marks against the curve its quote built.

§hull_white_convexity: bool

Whether the convexity is modelled under Hull–White rather than stated: the futures rate follows from the forward by 1 + τF_fut = (1 + τF_fwd)·e^Λ on the currency’s Hull–White parameters — for an overnight contract, from the strip, compounded in arrears or print by print — and convexity_adjustment is unread.

§side: f64

+1 long — receives the rate implied by the price, gains when rates fall; −1 short.

§overnight: Option<AnyCoupon>

The daily strip the contract settles on, for a future on an overnight index, carried as a unit-notional coupon so the future’s rate is the coupon’s rate: realised days from the fixings, today’s if it has printed, the rest projected. An OvernightCoupon for a compounded contract, a MultiResetCoupon of daily prints for an averaged one; None for a contract on a term rate, which settles on one forward over the accrual.

Implementations§

§

impl RateFuture

pub fn new( index: impl Into<String>, currency: Currency, accrual_start: NaiveDate, accrual_end: NaiveDate, day_count: DayCountFraction, contracts: f64, contract_notional: f64, contract_accrual: f64, traded_price: f64, ) -> Self

A long position, collateralised in its own currency.

pub fn with_hull_white_convexity(self) -> Self

This contract with its convexity modelled under Hull–White on the currency’s market parameters, rather than stated. A stated adjustment is set aside.

  • Term contract: the Hull-White convexity bias, read from the forward.
  • Compounded overnight (SR3, SONIA, €STR): 1 + τF_fut = (1 + τF_strip)·e^Λ, Λ by hull_white_compounded_convexity_exponent from the first day whose print is not held — inside the period only the remaining days carry convexity.
  • Averaged overnight (SR1, Fed Funds): each print still to fix carries the term contract’s convexity over its own window, at the weight the strip gives it.

pub fn with_overnight_accumulation( self, accumulation: AccrualCompounding, ) -> Self

This contract settling on its index’s daily overnight rates over the accrual, combined under accumulation — compounded (SR3, SONIA, €STR) or averaged (SR1, Fed Funds) — on the index’s registered fixing calendar. See with_overnight_accumulation_on.

pub fn with_overnight_accumulation_on( self, accumulation: AccrualCompounding, calendar: &dyn Calendar, ) -> Self

This contract settling on its index’s daily prints on calendar’s business days over the accrual, combined under accumulation.

Compounded (SR3, SONIA, €STR): one observation per business day, each spanning to the next and capped at the accrual end, carried as a unit-notional OvernightCoupon.

Averaged (SR1, Fed Funds): every calendar day of the accrual takes the print of the business day on or before it, so a month opening on a holiday carries the previous business day’s print for those days. Each print is projected over its own span to the next business day and weighted by the part of that span inside the accrual, carried as a MultiResetCoupon under ResetCompounding::Averaged.

An index the registry does not hold as an overnight index, or an accumulation no overnight rate is quoted under, leaves the contract on its term-rate forward.

fn averaged_prints( &self, calendar: &dyn Calendar, day_count: DayCountFraction, ) -> MultiResetCoupon

The averaged strip: one reset per print, from the print on or before the accrual start to the last before its end.

pub fn for_contract( template: &FutureTemplate, year: i32, month: u32, contracts: f64, traded_price: f64, ) -> Result<Self, RateFutureError>

The listed contract for a delivery month: its reference period is the template’s — the IMM quarter starting on the delivery month’s third Wednesday, or the calendar month itself — and it settles on the template’s accumulation of its index.

§Errors

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

pub fn between( template: &FutureTemplate, accrual_start: NaiveDate, accrual_end: NaiveDate, contracts: f64, traded_price: f64, ) -> Self

A position on template over a stated accrual, settling on the template’s accumulation of its index on the template’s fixing calendar — so a stated one-month SOFR contract averages exactly as its listed twin does.

pub fn from_template( template: &FutureTemplate, valuation: NaiveDate, contracts: f64, traded_price: f64, ) -> Self

A position from its template: the accrual starts on the valuation date (rolled to a business day) and ends one contract period later.

pub fn short(self) -> Self

The short side.

pub fn with_convexity_adjustment(self, adjustment: f64) -> Self

Sets the convexity adjustment, as a decimal rate.

pub fn price_point_value(&self) -> f64

Money per 1.00 of price movement on one contract — contract data.

pub fn basis_point_value(&self) -> f64

The value of one basis point on the whole position — contract data, independent of how many days the period spans.

pub fn notional(&self) -> f64

The position’s reportable notional, contracts · contract notional.

Trait Implementations§

§

impl Clone for RateFuture

§

fn clone(&self) -> RateFuture

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 RateFuture

§

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

Formats the value using the given formatter. Read more
§

impl PartialEq for RateFuture

§

fn eq(&self, other: &RateFuture) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl<R: Scalar> Priceable<R> for RateFuture

§

fn npv(&self, view: &PricingView<'_, R>) -> Result<R, PricingError>

side · contracts · price-point value · (model − traded), in immediate money: a margined position has no deferred cashflow to discount, so the declared discount curve is deliberately unread.

§

fn par_rate(&self, view: &PricingView<'_, R>) -> Result<R, PricingError>

The futures rate.

§

fn par_spread(&self, _view: &PricingView<'_, R>) -> Result<R, PricingError>

The par (breakeven) floating-leg spread. Zero for a product with no floating leg. Read more
§

impl PricingRiskFactors for RateFuture

§

fn risk_factors(&self) -> Result<RiskFactors<'_>, PricingError>

Declares its collateral like every product, though the payoff does not read it: the seam wants a discount key, and a book wants the currency. With Hull–White convexity, the currency’s Hull–White parameters too, on a term or an overnight contract alike.

§

impl Product for RateFuture

§

fn restruck_at_rate(&self, rate: f64) -> Option<AnyInstrument>

Re-struck at the futures rate rate: the traded price 100 − 100·rate.

§

fn currency(&self) -> Currency

The currency the product pays in. An FX product values in its quote currency; a book converts.
§

fn contract_dates(&self) -> Vec<(&'static str, NaiveDate)>

The contract dates the product resolved to, as (name, date) pairs — exactly the dates its stated constructor takes, so a product built through a derived form can be read back and rebuilt through the stated one. Empty for a product with no stated form. No default: every product states which it is — see AnyInstrument::contract_dates.
§

fn legs(&self) -> Option<Vec<&Leg>>

The legs the product itself holds, in a declared order, or None for a product that holds none — see AnyInstrument::legs. No default: every product states which it is.
§

fn final_payment_date(&self) -> Option<NaiveDate>

The date of the product’s final payment, where a calibration rung can be built on it; None for a product no ladder is built from.
§

fn restruck_at_spread(&self, _spread: f64) -> Option<AnyInstrument>

This product re-struck at the basis spread spread on its spread leg, or None for a product that quotes none.
§

impl StructuralPartialEq for RateFuture

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.