Struct BondForward
pub struct BondForward {
pub bond: FixedRateBond,
pub notional: f64,
pub strike: f64,
pub strike_quote: StrikeQuote,
pub forward_date: NaiveDate,
pub settlement_date: NaiveDate,
pub side: f64,
pub knockout_issuer: Option<CreditCurveId>,
pub repo_key: String,
pub collateral: CollateralSpec,
}Expand description
A linear bond forward: the reference bond’s dirty price at the forward date, carried on the repo curve, against a locked strike.
Fields§
§bond: FixedRateBondThe reference bond.
notional: f64Package notional in bond face.
strike: f64The locked strike per 100 face.
strike_quote: StrikeQuoteWhether the strike is quoted clean or dirty.
forward_date: NaiveDateThe forward (price-determination) date.
settlement_date: NaiveDateThe settlement date the payoff discounts to.
side: f64+1 long, −1 short.
knockout_issuer: Option<CreditCurveId>The issuer whose survival to the forward date scales the payoff, if the forward knocks out on default.
repo_key: StringThe repo curve the bond is financed on.
collateral: CollateralSpecThe collateral key the payoff discounts under.
Implementations§
§impl BondForward
impl BondForward
pub fn new(
bond: FixedRateBond,
notional: f64,
strike: f64,
forward_date: NaiveDate,
settlement_date: NaiveDate,
repo_key: impl Into<String>,
) -> Result<Self, FinancingError>
pub fn new( bond: FixedRateBond, notional: f64, strike: f64, forward_date: NaiveDate, settlement_date: NaiveDate, repo_key: impl Into<String>, ) -> Result<Self, FinancingError>
A long forward with a clean strike, no knockout, financed on
repo_key, discounting on the bond currency’s cash collateral.
§Errors
FinancingError::SettlementBeforeForward if the dates are inverted.
pub fn short(self) -> Self
pub fn short(self) -> Self
The short side.
pub fn dirty_strike(self) -> Self
pub fn dirty_strike(self) -> Self
A dirty (accrued-inclusive) strike.
pub fn with_knockout(self, issuer: CreditCurveId) -> Self
pub fn with_knockout(self, issuer: CreditCurveId) -> Self
Knocks out on issuer’s default before the forward date.
pub fn strike_amount(&self) -> f64
pub fn strike_amount(&self) -> f64
The notional-scaled strike amount: strike·N/100, plus the accrued at
the forward date when the strike is quoted clean, so that the forward
dirty price and the strike net accrued exactly once.
Trait Implementations§
§impl Clone for BondForward
impl Clone for BondForward
§fn clone(&self) -> BondForward
fn clone(&self) -> BondForward
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 BondForward
impl Debug for BondForward
§impl PartialEq for BondForward
impl PartialEq for BondForward
§impl<R: Scalar> Priceable<R> for BondForward
impl<R: Scalar> Priceable<R> for BondForward
§fn npv(&self, view: &PricingView<'_, R>) -> Result<R, PricingError>
fn npv(&self, view: &PricingView<'_, R>) -> Result<R, PricingError>
sign · (F_dirty·N/100 − strike_amount) · DF_disc(settle), scaled by
the issuer’s survival to the forward date when the forward knocks out.
§fn par_rate(&self, _view: &PricingView<'_, R>) -> Result<R, PricingError>
fn par_rate(&self, _view: &PricingView<'_, R>) -> Result<R, PricingError>
§fn par_spread(&self, _view: &PricingView<'_, R>) -> Result<R, PricingError>
fn par_spread(&self, _view: &PricingView<'_, R>) -> Result<R, PricingError>
§impl PricingRiskFactors for BondForward
impl PricingRiskFactors for BondForward
§fn risk_factors(&self) -> Result<RiskFactors<'_>, PricingError>
fn risk_factors(&self) -> Result<RiskFactors<'_>, PricingError>
Discounts on the declared collateral, carries on the repo curve, and — only when the forward knocks out — references the issuer.
§impl Product for BondForward
impl Product for BondForward
§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.