Struct FxSwap
pub struct FxSwap {
near: FxForward,
far: FxForward,
}Expand description
An FX swap: a near forward and a far forward on the same pair in opposite directions.
Fields§
§near: FxForward§far: FxForwardImplementations§
§impl FxSwap
impl FxSwap
pub fn fair_far_rate<R: Scalar>(
&self,
view: &PricingView<'_, R>,
) -> Result<R, PricingError>
pub fn fair_far_rate<R: Scalar>( &self, view: &PricingView<'_, R>, ) -> Result<R, PricingError>
The far outright that zeroes the swap given its near leg: the far
leg’s value is affine in its quote amount −B·F however it settles,
so this is one division through the reading the pricer uses — the
parity forward, or a cash settlement’s printed fixing once it has
printed.
§Errors
The pricer’s own: a missing foreign discount curve or spot.
Trait Implementations§
§impl<R: Scalar> Priceable<R> for FxSwap
impl<R: Scalar> Priceable<R> for FxSwap
§fn npv(&self, view: &PricingView<'_, R>) -> Result<R, PricingError>
fn npv(&self, view: &PricingView<'_, R>) -> Result<R, PricingError>
The near leg plus the far leg, in the near leg’s quote currency: a leg cash-settled in the other currency converts at spot.
§fn par_rate(&self, view: &PricingView<'_, R>) -> Result<R, PricingError>
fn par_rate(&self, view: &PricingView<'_, R>) -> Result<R, PricingError>
The fair far outright — what an FX-swap rung’s quote is verified against.
§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 FxSwap
impl PricingRiskFactors for FxSwap
§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 FxSwap
impl Product for FxSwap
§fn restruck_at_rate(&self, rate: f64) -> Option<AnyInstrument>
fn restruck_at_rate(&self, rate: f64) -> Option<AnyInstrument>
The swap with its far leg at the outright rate — the quote an
FX-swap rung carries, which its fair far rate verifies.
§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_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 FxSwap
Auto Trait Implementations§
impl Freeze for FxSwap
impl RefUnwindSafe for FxSwap
impl Send for FxSwap
impl Sync for FxSwap
impl Unpin for FxSwap
impl UnsafeUnpin for FxSwap
impl UnwindSafe for FxSwap
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