Skip to main content

BondOption

Struct BondOption 

pub struct BondOption {
    pub bond: CallableBond,
    pub expiry: NaiveDate,
    pub settlement: NaiveDate,
    pub strike: BondStrike,
    pub kind: OptionKind,
    pub engine: BondOptionEngine,
    pub repo_key: Option<String>,
    pub yield_vol_key: Option<String>,
}
Expand description

A European option on a fixed-coupon bullet bond, physically settled.

Fields§

§bond: CallableBond

The deliverable bond, with its collateral and any security spread. A bullet: the call schedule is empty and the bond is not credit-tagged.

§expiry: NaiveDate

The expiry — the exercise decision date the premium discounts from.

§settlement: NaiveDate

The exercise settlement date the forward price is struck at: physical delivery settles like a cash trade done at expiry. A stored contract term, on or after the expiry.

§strike: BondStrike

The strike, in one of the market’s quoting forms.

§kind: OptionKind

Call (the right to buy the bond) or put.

§engine: BondOptionEngine

The model the option prices under.

§repo_key: Option<String>

The repo curve the forward carries on, by key; None carries on the discount curve.

§yield_vol_key: Option<String>

The key of the bond yield vol surface the option reads, one surface per security if wanted; None reads the bond’s currency.

Implementations§

§

impl BondOption

pub fn new( bond: CallableBond, expiry: NaiveDate, strike: BondStrike, kind: OptionKind, ) -> Result<Self, BondOptionError>

A bond option settling on its expiry, priced off the yield vol surface, carried on the discount curve.

§Errors

BondOptionError for a callable or credit-tagged underlying, a non-finite strike, or an expiry on or after maturity.

pub fn with_yield_vol_key(self, key: impl Into<String>) -> Self

This option reading the bond yield vol surface pinned under key rather than its currency’s.

pub fn yield_vol_key(&self) -> &str

The key of the surface the option reads: its own, or the currency.

pub fn settling_on(self, settlement: NaiveDate) -> Result<Self, BondOptionError>

This option with exercise settling on settlement.

§Errors

BondOptionError::SettlementBeforeExpiry if it precedes the expiry.

pub fn with_engine(self, engine: BondOptionEngine) -> Self

This option priced under engine.

pub fn financed_on(self, key: impl Into<String>) -> Self

This option with the forward carried on the repo curve under key.

pub fn accrued_at_exercise(&self) -> f64

Accrued per 100 at exercise settlement.

pub fn dirty_strike(&self) -> f64

The dirty cash strike at exercise settlement per 100 of the original face — the basis every price the crate reports is on — from whichever quoting form the strike carries.

A clean or dirty strike is quoted per 100 of the face alive at exercise settlement, so on an amortiser it is scaled by the fraction alive; the accrued already accrues on that fraction and is added as it is. A yield strike’s implied dirty price is on the original face already. A bullet’s fraction is exactly one.

§

impl BondOption

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

The forward dirty price per 100 at exercise settlement: the spot carried on the repo curve when the option declares one, on the discount curve otherwise — bit-identical to the discount-only price rebased to settlement in that case.

pub fn npv_with_diagnostics<R: Scalar>( &self, view: &PricingView<'_, R>, ) -> Result<(R, BondOptionDiagnostics), PricingError>

The yield-vol engine’s premium with the quantities it was built from.

The forward yield and duration are solved passively on the forward and reattached in the mode by the implicit-function slopes ∂y/∂F = 1/P′ and ∂D/∂F = (−P″/P + (P′/P)²)/P′ from one second-order pricing pass — so the surface is read at a duration that carries the curve’s adjoints, and the price vol carries them through both factors. Freezing either would drop its slope from the sensitivities.

§Errors

PricingError::UnsupportedForProduct under the Hull-White engine or for an expired option, a missing surface, or the solver’s failures.

Trait Implementations§

§

impl Clone for BondOption

§

fn clone(&self) -> BondOption

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 BondOption

§

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

Formats the value using the given formatter. Read more
§

impl PartialEq for BondOption

§

fn eq(&self, other: &BondOption) -> 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 BondOption

§

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

Under the yield-vol engine, npv_with_diagnostics’s premium; under Hull-White, the Jamshidian kernel on the deliverable flows after exercise settlement against the dirty strike, per unit face, scaled by the face. An expired option is worth nothing.

§

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

The par rate — the fixed rate at which the product is worth nothing. Read more
§

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 BondOption

§

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

Discounts on the bond’s collateral with its security spread, carries on the declared repo curve, and declares only what the engine reads: the currency’s bond yield vols, or its Hull-White parameters.

§

impl Product for BondOption

§

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_rate(&self, _rate: f64) -> Option<AnyInstrument>

This product re-struck at the par rate 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>

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

impl StructuralPartialEq for BondOption

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.