Struct BondFutureOption
pub struct BondFutureOption {
pub contract: ListedFutureId,
pub expiry: NaiveDate,
pub strike: f64,
pub kind: OptionKind,
pub exercise: ExerciseStyle,
pub premium_style: PremiumStyle,
pub contracts: f64,
pub point_value: f64,
pub side: f64,
pub traded_premium: f64,
pub currency: Currency,
pub collateral: CollateralSpec,
}Expand description
An option on a listed bond future: the right to a futures position at the strike, priced off the quoted futures price and the contract’s option vol surface.
Two contract axes decide the model (see
npv): the
PremiumStyle — futures-style is margined and undiscounted, paid is
discounted to expiry — and the ExerciseStyle, which matters only when
the premium is paid.
The value is per position: side · contracts · point value · (model − traded premium) for a futures-style option, whose margin settles against
the price it was traded at, and side · contracts · point value · model
for a paid one, whose premium is a past exchange rather than a claim.
Fields§
§contract: ListedFutureIdThe future the option exercises into.
expiry: NaiveDateThe last day the option can be exercised.
strike: f64The strike, per 100 face of the future.
kind: OptionKindCall (the right to go long the future) or put.
exercise: ExerciseStyleEuropean or American.
Futures-style or paid.
contracts: f64The number of contracts held.
point_value: f64What one price point is worth per contract — 1,000 for most bond futures, 2,000 for the CBOT 2-year.
side: f64+1 long, −1 short.
The premium the option was traded at, per 100 face.
currency: CurrencyThe currency the option settles in.
collateral: CollateralSpecThe collateral a paid premium’s option value is discounted under.
Implementations§
§impl BondFutureOption
impl BondFutureOption
pub fn new(
contract: ListedFutureId,
expiry: NaiveDate,
strike: f64,
kind: OptionKind,
premium_style: PremiumStyle,
exercise: ExerciseStyle,
currency: Currency,
) -> Result<Self, BondFutureOptionError>
pub fn new( contract: ListedFutureId, expiry: NaiveDate, strike: f64, kind: OptionKind, premium_style: PremiumStyle, exercise: ExerciseStyle, currency: Currency, ) -> Result<Self, BondFutureOptionError>
One long contract on contract, struck at strike per 100, expiring
on expiry, with a point value of 1,000, traded at a premium of zero
and discounted on currency’s cash collateral.
§Errors
BondFutureOptionError::Strike for a strike that is not finite.
pub fn with_contracts(
self,
contracts: f64,
) -> Result<Self, BondFutureOptionError>
pub fn with_contracts( self, contracts: f64, ) -> Result<Self, BondFutureOptionError>
This option on contracts contracts.
§Errors
BondFutureOptionError::Contracts unless finite and positive.
pub fn with_point_value(
self,
point_value: f64,
) -> Result<Self, BondFutureOptionError>
pub fn with_point_value( self, point_value: f64, ) -> Result<Self, BondFutureOptionError>
This option with one price point worth point_value per contract.
§Errors
BondFutureOptionError::PointValue unless finite and positive.
This option traded at premium per 100.
§Errors
BondFutureOptionError::Premium for a negative or non-finite one.
pub fn with_collateral(self, collateral: CollateralSpec) -> Self
pub fn with_collateral(self, collateral: CollateralSpec) -> Self
This option discounted under collateral.
pub fn short(self) -> Self
pub fn short(self) -> Self
The short side.
pub fn price_point_value(&self) -> f64
pub fn price_point_value(&self) -> f64
What one price point is worth to this position.
§impl BondFutureOption
impl BondFutureOption
fn model_parts<R: Scalar>(
&self,
view: &PricingView<'_, R>,
) -> Result<FutureOptionParts<R>, PricingError>
fn model_parts<R: Scalar>( &self, view: &PricingView<'_, R>, ) -> Result<FutureOptionParts<R>, PricingError>
The per-100 model value and its parts.
On or after expiry, the intrinsic value against the quoted price. Before it: Black-76 (lognormal surface) or Bachelier (normal) on the quoted price at the surface’s vol for the expiry and strike — undiscounted for a futures-style premium, where American exercise adds nothing; multiplied by the discount factor to expiry for a paid one, and for a paid American, Barone-Adesi–Whaley with zero carry.
pub fn npv_with_diagnostics(
&self,
view: &PricingView<'_, f64>,
) -> Result<(f64, BondFutureOptionDiagnostics), PricingError>
pub fn npv_with_diagnostics( &self, view: &PricingView<'_, f64>, ) -> Result<(f64, BondFutureOptionDiagnostics), PricingError>
Trait Implementations§
§impl Clone for BondFutureOption
impl Clone for BondFutureOption
§fn clone(&self) -> BondFutureOption
fn clone(&self) -> BondFutureOption
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 BondFutureOption
impl Debug for BondFutureOption
§impl PartialEq for BondFutureOption
impl PartialEq for BondFutureOption
§fn eq(&self, other: &BondFutureOption) -> bool
fn eq(&self, other: &BondFutureOption) -> bool
self and other values to be equal, and is used by ==.§impl<R: Scalar> Priceable<R> for BondFutureOption
impl<R: Scalar> Priceable<R> for BondFutureOption
§fn npv(&self, view: &PricingView<'_, R>) -> Result<R, PricingError>
fn npv(&self, view: &PricingView<'_, R>) -> Result<R, PricingError>
side · contracts · point value · (model − traded premium) for a
futures-style option — margined, so undiscounted and netting the price
it was traded at — and side · contracts · point value · model for a
paid one. The model is per 100: see model_parts.
§fn par_rate(&self, _view: &PricingView<'_, R>) -> Result<R, PricingError>
fn par_rate(&self, _view: &PricingView<'_, R>) -> Result<R, PricingError>
Unsupported: an option is quoted as a price or a vol, not a rate.
§fn par_spread(&self, _view: &PricingView<'_, R>) -> Result<R, PricingError>
fn par_spread(&self, _view: &PricingView<'_, R>) -> Result<R, PricingError>
Unsupported: an option carries no margin.
§impl PricingRiskFactors for BondFutureOption
impl PricingRiskFactors for BondFutureOption
§fn risk_factors(&self) -> Result<RiskFactors<'_>, PricingError>
fn risk_factors(&self) -> Result<RiskFactors<'_>, PricingError>
Reads the contract’s quoted price and its option vol surface, and discounts on the option’s collateral — which only a paid premium reads, so a futures-style option’s risk carries no rate row.
§impl Product for BondFutureOption
impl Product for BondFutureOption
§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_rate(&self, _rate: f64) -> Option<AnyInstrument>
fn restruck_at_rate(&self, _rate: f64) -> Option<AnyInstrument>
rate — the scalar a par
calibration rung on it is quoted in — or None for a product that
carries no such scalar. What a quote scenario moves a rung to.§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.