Struct SwapIndex
pub struct SwapIndex {
template: SwapTemplate,
tenor: Period,
collateral: CollateralSpec,
}Expand description
The swap a CMS rate observes: a registered fixed-versus-IBOR swap template and a tenor.
Fields§
§template: SwapTemplate§tenor: Period§collateral: CollateralSpecImplementations§
§impl SwapIndex
impl SwapIndex
pub fn new(template: &str, tenor: Period) -> Result<Self, SwapIndexError>
pub fn new(template: &str, tenor: Period) -> Result<Self, SwapIndexError>
The swap index on template (a registered fixed-versus-IBOR swap
template code) at tenor.
§Errors
SwapIndexError::NotAFixedIborTemplate for any other code.
§Panics
If a registered template’s floating index carries a currency code that is not ISO 4217, which the registry does not hold.
pub fn code(&self) -> String
pub fn code(&self) -> String
The key the index’s published rates are stored and read under: the
template’s code and the tenor in its largest exact unit, so a 12M and a
1Y index read the same prints — "EUR-EURIBOR-6M-IRS-10Y".
pub fn projection(&self) -> String
pub fn projection(&self) -> String
The index the swap’s floating leg projects.
pub fn risk_factors<'a>(&'a self, projection: &'a str) -> RiskFactors<'a>
pub fn risk_factors<'a>(&'a self, projection: &'a str) -> RiskFactors<'a>
What a CMS rate on this index is priced against: the currency’s cash discount curve, the floating index’s projection and the currency’s swaption vols.
pub fn underlying(&self, fixing: NaiveDate) -> Result<VanillaSwap, PricingError>
pub fn underlying(&self, fixing: NaiveDate) -> Result<VanillaSwap, PricingError>
The swap the index observes at fixing: from the fixing’s spot date to
that date plus the tenor, built from the template as its own swaps are.
§Errors
PricingError if the template cannot build the swap.
Trait Implementations§
§impl From<&SwapIndex> for FixingKey
impl From<&SwapIndex> for FixingKey
§fn from(index: &SwapIndex) -> Self
fn from(index: &SwapIndex) -> Self
The index in hand: its prints are stored under SwapIndex::code.