Struct OvernightIndexedSwap
pub struct OvernightIndexedSwap {
pub fixed: Leg,
pub floating: Leg,
pub currency: Currency,
pub index: String,
pub collateral: CollateralSpec,
pub stated_dates: Option<StatedDates>,
pub foreign_collateral: Option<CollateralSpec>,
}Expand description
An overnight-indexed swap: fixed against a compounded overnight leg.
Structurally the same pair of legs as VanillaSwap; what differs is the
floating leg’s coupon kind, which is the leg’s business rather than the
swap’s. It is a separate type because the two are separate products with
separate conventions, not because the pricing differs.
Fields§
§fixed: LegThe fixed leg.
floating: LegThe overnight-compounded leg.
currency: CurrencyThe swap’s currency.
index: StringThe overnight index the floating leg observes.
collateral: CollateralSpecWhat the swap is collateralised against.
stated_dates: Option<StatedDates>The unadjusted dates the swap’s schedule was generated from, where it was built from dates rather than assembled from legs. A swap rebuilt from them generates the same schedule, which its adjusted accrual dates would not promise: a rolled termination can generate a stub.
foreign_collateral: Option<CollateralSpec>For a non-deliverable swap, the key of its own currency’s discount
curve under the settlement currency’s collateral — the curve its
payments convert at the parity forward on; None for a swap paid in
its own currency.
Implementations§
§impl OvernightIndexedSwap
impl OvernightIndexedSwap
pub fn new(
fixed: Leg,
floating: Leg,
currency: Currency,
index: impl Into<String>,
collateral: CollateralSpec,
) -> Self
pub fn new( fixed: Leg, floating: Leg, currency: Currency, index: impl Into<String>, collateral: CollateralSpec, ) -> Self
A swap from two compiled legs.
pub fn settled_in(
self,
settlement: Currency,
fx_index: impl Into<FixingSource>,
fixed_fixings: Vec<Conversion>,
floating_fixings: Vec<Conversion>,
) -> Result<Self, NonDeliverableError>
pub fn settled_in( self, settlement: Currency, fx_index: impl Into<FixingSource>, fixed_fixings: Vec<Conversion>, floating_fixings: Vec<Conversion>, ) -> Result<Self, NonDeliverableError>
This swap settling non-deliverably in settlement: each leg’s payments
converted at the fx_index fixing on the matching date — one per
payment, fixed leg then floating — discounted on settlement’s curve,
the conversion’s forward read off this currency’s curve under
settlement collateral.
§Errors
NonDeliverableError as Leg::with_non_deliverable refuses either leg.
pub fn with_stated_dates(
self,
effective: NaiveDate,
termination: NaiveDate,
) -> Self
pub fn with_stated_dates( self, effective: NaiveDate, termination: NaiveDate, ) -> Self
This swap stating the unadjusted dates its schedule was generated from.
§impl OvernightIndexedSwap
impl OvernightIndexedSwap
fn floating_curves<'v, R: Scalar>(
&self,
view: &'v PricingView<'_, R>,
fwd: &'v OneCurve<'v, R>,
) -> &'v dyn CurveByIndex<R>
fn floating_curves<'v, R: Scalar>( &self, view: &'v PricingView<'_, R>, fwd: &'v OneCurve<'v, R>, ) -> &'v dyn CurveByIndex<R>
The source the floating leg reads: the view when its coupons carry options, which read the cap vols; the one curve otherwise.
Trait Implementations§
§impl Clone for OvernightIndexedSwap
impl Clone for OvernightIndexedSwap
§fn clone(&self) -> OvernightIndexedSwap
fn clone(&self) -> OvernightIndexedSwap
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 OvernightIndexedSwap
impl Debug for OvernightIndexedSwap
§impl PartialEq for OvernightIndexedSwap
impl PartialEq for OvernightIndexedSwap
§fn eq(&self, other: &OvernightIndexedSwap) -> bool
fn eq(&self, other: &OvernightIndexedSwap) -> bool
self and other values to be equal, and is used by ==.§impl<R: Scalar> Priceable<R> for OvernightIndexedSwap
impl<R: Scalar> Priceable<R> for OvernightIndexedSwap
§fn npv(&self, view: &PricingView<'_, R>) -> Result<R, PricingError>
fn npv(&self, view: &PricingView<'_, R>) -> Result<R, PricingError>
§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 OvernightIndexedSwap
impl PricingRiskFactors for OvernightIndexedSwap
§fn risk_factors(&self) -> Result<RiskFactors<'_>, PricingError>
fn risk_factors(&self) -> Result<RiskFactors<'_>, PricingError>
Discounting and the index’s projection, and the currency’s cap vols when the floating leg carries options on its rates.
§impl Product for OvernightIndexedSwap
impl Product for OvernightIndexedSwap
§fn currency(&self) -> Currency
fn currency(&self) -> Currency
The currency the swap pays in: its own, or the settlement currency a non-deliverable swap converts every payment into.
§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 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_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.