Struct CmsCoupon
pub struct CmsCoupon {Show 18 fields
pub accrual_start: NaiveDate,
pub accrual_end: NaiveDate,
pub payment_date: NaiveDate,
pub payment_ordinal: i32,
pub fixing_date: NaiveDate,
pub notional: f64,
pub gearing: f64,
pub spread: f64,
pub day_count: DayCountFraction,
pub accrual: f64,
pub currency: Currency,
pub template: String,
pub tenor: Period,
pub projection: String,
pub fixing_key: String,
pub mean_reversion: f64,
pub payoff: Option<RatePayoff>,
pub spread_against: Option<Box<CmsSpreadLeg>>,
}Expand description
A CMS coupon: notional · τ · (g · CMS + s), the CMS rate the swap
index template at tenor fixes on fixing_date — in advance, by the
index’s fixing lag — convexity-adjusted by linear TSR at
mean_reversion and paid on payment_date.
A payoff caps, floors or digitises the rate as on an IBOR coupon.
It holds the swap index by its codes, resolved when priced: the index is
a market-layer type. Its rate needs the discount curve and the swaption
smile as well as a projection, so only a source that answers
CurveByIndex::cms_rate
can project it; a print under fixing_key settles it anywhere.
Fields§
§accrual_start: NaiveDateAccrual start.
accrual_end: NaiveDateAccrual end.
payment_date: NaiveDateThe payment date.
payment_ordinal: i32The payment date as a proleptic-Gregorian day number.
fixing_date: NaiveDateThe CMS rate’s fixing date.
notional: f64The notional.
gearing: f64Multiplier on the CMS rate.
spread: f64Added to the geared rate, as a decimal.
day_count: DayCountFractionThe accrual day count.
accrual: f64The accrual year fraction.
currency: CurrencyThe coupon’s currency.
template: StringThe fixed-versus-IBOR swap template the index is quoted on.
tenor: PeriodThe swap tenor.
projection: StringThe projection key of the swap’s floating index — the curve the CMS rate’s forward reads.
fixing_key: StringThe key the swap index’s prints are stored under.
mean_reversion: f64The mean reversion the linear TSR slope is taken at.
payoff: Option<RatePayoff>An option on the rate g · CMS + s, or None for a plain coupon.
spread_against: Option<Box<CmsSpreadLeg>>A second swap index whose rate is subtracted, making the observation
a spread of two, or None.
Implementations§
§impl CmsCoupon
impl CmsCoupon
pub fn settled<R: Scalar>(
&self,
fixings: &FixingsView<'_, R>,
as_of: NaiveDate,
) -> Result<Option<R>, CashflowError>
pub fn settled<R: Scalar>( &self, fixings: &FixingsView<'_, R>, as_of: NaiveDate, ) -> Result<Option<R>, CashflowError>
What the coupon pays when its fixing is published — the rate geared,
spread and settled through its payoff — or None while it is still
to fix. A fixing before today must be published: see
FixingsView::observe.
§Errors
A missing historical print; a malformed payoff.
§impl CmsCoupon
impl CmsCoupon
pub fn on_index(
index: &SwapIndex,
start: NaiveDate,
end: NaiveDate,
payment: NaiveDate,
notional: f64,
gearing: f64,
spread: f64,
day_count: DayCountFraction,
mean_reversion: f64,
) -> Self
pub fn on_index( index: &SwapIndex, start: NaiveDate, end: NaiveDate, payment: NaiveDate, notional: f64, gearing: f64, spread: f64, day_count: DayCountFraction, mean_reversion: f64, ) -> Self
A CMS coupon on index accruing from start to end on day_count,
paid on payment: its rate fixes the index’s fixing lag before
start, as a CmsSwap’s periods do, and is gearing · CMS + spread, convexity-adjusted at mean_reversion.
pub fn on_spread(
index: &SwapIndex,
minus: &SwapIndex,
correlation: impl Into<CmsSpreadCorrelation>,
start: NaiveDate,
end: NaiveDate,
payment: NaiveDate,
notional: f64,
gearing: f64,
spread: f64,
day_count: DayCountFraction,
mean_reversion: f64,
) -> Self
pub fn on_spread( index: &SwapIndex, minus: &SwapIndex, correlation: impl Into<CmsSpreadCorrelation>, start: NaiveDate, end: NaiveDate, payment: NaiveDate, notional: f64, gearing: f64, spread: f64, day_count: DayCountFraction, mean_reversion: f64, ) -> Self
A CMS spread coupon: gearing · (CMS(index) − CMS(minus)) + spread,
both rates fixing on index’s lag before start, their correlation
correlation — a contract number, or the market’s mark for the pair.