Struct CurvePin
pub struct CurvePin {
pub currency: Currency,
pub date: NaiveDate,
pub reading: CurveReading,
}Expand description
A curve’s reading at a date, as an instrument: its value is the reading
on the discount curve pinned under currency’s cash collateral.
Fields§
§currency: CurrencyThe currency whose cash-collateral discount curve is read.
date: NaiveDateThe date the reading is taken at.
reading: CurveReadingWhich reading.
Implementations§
§impl CurvePin
impl CurvePin
pub fn new(currency: Currency, date: NaiveDate, reading: CurveReading) -> Self
pub fn new(currency: Currency, date: NaiveDate, reading: CurveReading) -> Self
The reading of currency’s discount curve at date.
§impl CurvePin
impl CurvePin
fn collateral_spec(&self) -> &'static CollateralSpec
fn collateral_spec(&self) -> &'static CollateralSpec
The cash collateral the reading is taken from. Owned here because the declaration borrows it, and the instrument stores the currency.
Trait Implementations§
§impl<R: Scalar> Priceable<R> for CurvePin
impl<R: Scalar> Priceable<R> for CurvePin
§fn npv(&self, view: &PricingView<'_, R>) -> Result<R, PricingError>
fn npv(&self, view: &PricingView<'_, R>) -> Result<R, PricingError>
The reading itself: the discount factor to the date, or the continuously compounded zero rate to it — so a priced rung with money per quote of one pins the curve to the quote.
§fn par_rate(&self, view: &PricingView<'_, R>) -> Result<R, PricingError>
fn par_rate(&self, view: &PricingView<'_, R>) -> Result<R, PricingError>
The same reading: a curve pin has no rate apart from what it reads.
§fn par_spread(&self, _view: &PricingView<'_, R>) -> Result<R, PricingError>
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 CurvePin
impl PricingRiskFactors for CurvePin
§fn risk_factors(&self) -> Result<RiskFactors<'_>, PricingError>
fn risk_factors(&self) -> Result<RiskFactors<'_>, PricingError>
The market data this product is priced against. Read more
§impl Product for CurvePin
impl Product for CurvePin
§fn currency(&self) -> Currency
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)>
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>>
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>
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>
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>
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 CurvePin
Auto Trait Implementations§
impl Freeze for CurvePin
impl RefUnwindSafe for CurvePin
impl Send for CurvePin
impl Sync for CurvePin
impl Unpin for CurvePin
impl UnsafeUnpin for CurvePin
impl UnwindSafe for CurvePin
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more