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: CurrencyThe contract’s currency.
collateral: CollateralSpecThe declared collateral — carried for booking uniformity; unused by the payoff.
index: StringThe projection index the contract’s rate is read from, by registry code.
accrual_start: NaiveDateContract accrual start.
accrual_end: NaiveDateContract accrual end.
day_count: DayCountFractionThe day count the rate is computed under. Not the payoff scale.
contracts: f64Contracts held.
contract_notional: f64The published contract notional. Sizes the position for reporting; it does not scale the payoff on its own.
contract_accrual: f64The contract’s fixed period fraction (exactly 0.25 for a quarterly
contract). With contract_notional this fixes the payoff scale.
traded_price: f64The traded price, 100 − traded rate.
convexity_adjustment: f64The 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: boolWhether 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
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
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
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^Λ,Λbyhull_white_compounded_convexity_exponentfrom 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
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
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
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>
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
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
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
pub fn short(self) -> Self
The short side.
pub fn with_convexity_adjustment(self, adjustment: f64) -> Self
pub fn with_convexity_adjustment(self, adjustment: f64) -> Self
Sets the convexity adjustment, as a decimal rate.
pub fn price_point_value(&self) -> f64
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
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.
Trait Implementations§
§impl Clone for RateFuture
impl Clone for RateFuture
§fn clone(&self) -> RateFuture
fn clone(&self) -> RateFuture
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for RateFuture
impl Debug for RateFuture
§impl PartialEq for RateFuture
impl PartialEq for RateFuture
§impl<R: Scalar> Priceable<R> for RateFuture
impl<R: Scalar> Priceable<R> for RateFuture
§fn npv(&self, view: &PricingView<'_, R>) -> Result<R, PricingError>
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>
fn par_rate(&self, view: &PricingView<'_, R>) -> Result<R, PricingError>
The futures rate.
§fn par_spread(&self, _view: &PricingView<'_, R>) -> Result<R, PricingError>
fn par_spread(&self, _view: &PricingView<'_, R>) -> Result<R, PricingError>
§impl PricingRiskFactors for RateFuture
impl PricingRiskFactors for RateFuture
§fn risk_factors(&self) -> Result<RiskFactors<'_>, PricingError>
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
impl Product for RateFuture
§fn restruck_at_rate(&self, rate: f64) -> Option<AnyInstrument>
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
fn currency(&self) -> Currency
§fn contract_dates(&self) -> Vec<(&'static str, NaiveDate)>
fn contract_dates(&self) -> Vec<(&'static str, NaiveDate)>
(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>>
fn legs(&self) -> Option<Vec<&Leg>>
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>
fn final_payment_date(&self) -> Option<NaiveDate>
None for a product no ladder is built from.§fn restruck_at_spread(&self, _spread: f64) -> Option<AnyInstrument>
fn restruck_at_spread(&self, _spread: f64) -> Option<AnyInstrument>
spread on its spread
leg, or None for a product that quotes none.