Struct ForwardRateAgreement
pub struct ForwardRateAgreement {
pub index: String,
pub currency: Currency,
pub collateral: CollateralSpec,
pub accrual_start: NaiveDate,
pub accrual_end: NaiveDate,
pub fixing_date: NaiveDate,
pub day_count: DayCountFraction,
pub notional: f64,
pub struck_rate: f64,
pub side: f64,
}Expand description
A forward-rate agreement: one accrual period, cash-settled at its start.
The fixing date is a stored contract term, as an NDF’s is: computed once
from the index’s lag and calendar by from_template,
and compared with the valuation date at pricing to decide whether the
published fixing or the projected forward is the contract’s rate.
Fields§
§index: StringThe term index the contract fixes on, by registry code.
currency: CurrencyThe contract’s currency.
collateral: CollateralSpecWhat the settlement is discounted against.
accrual_start: NaiveDateAccrual start — also the settlement date.
accrual_end: NaiveDateAccrual end.
fixing_date: NaiveDateThe date the contract’s rate is fixed on.
day_count: DayCountFractionThe accrual day count.
notional: f64The notional.
struck_rate: f64The struck (contract) rate, as a decimal.
side: f64+1 pays the struck rate and receives the index — long the rate, the
same orientation as a payer swap; −1 the reverse.
Implementations§
§impl ForwardRateAgreement
impl ForwardRateAgreement
pub fn new(
index: impl Into<String>,
currency: Currency,
accrual_start: NaiveDate,
accrual_end: NaiveDate,
fixing_date: NaiveDate,
day_count: DayCountFraction,
notional: f64,
struck_rate: f64,
) -> Self
pub fn new( index: impl Into<String>, currency: Currency, accrual_start: NaiveDate, accrual_end: NaiveDate, fixing_date: NaiveDate, day_count: DayCountFraction, notional: f64, struck_rate: f64, ) -> Self
A FRA paying the struck rate, collateralised in its own currency.
pub fn from_template(
template: &FraTemplate,
valuation: NaiveDate,
forward_start: Option<Period>,
notional: f64,
struck_rate: f64,
) -> Self
pub fn from_template( template: &FraTemplate, valuation: NaiveDate, forward_start: Option<Period>, notional: f64, struck_rate: f64, ) -> Self
A FRA from its template: the accrual starts at the spot date (the
valuation advanced by the index’s fixing lag) advanced by
forward_start, and ends one index period later; the fixing date is
the start less the fixing lag. A 6x9 is forward_start = 6M.
pub fn receiver(self) -> Self
pub fn receiver(self) -> Self
The side receiving the struck rate.
pub fn year_fraction(&self) -> f64
pub fn year_fraction(&self) -> f64
The accrual year fraction.
Trait Implementations§
§impl Clone for ForwardRateAgreement
impl Clone for ForwardRateAgreement
§fn clone(&self) -> ForwardRateAgreement
fn clone(&self) -> ForwardRateAgreement
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 ForwardRateAgreement
impl Debug for ForwardRateAgreement
§impl PartialEq for ForwardRateAgreement
impl PartialEq for ForwardRateAgreement
§fn eq(&self, other: &ForwardRateAgreement) -> bool
fn eq(&self, other: &ForwardRateAgreement) -> bool
self and other values to be equal, and is used by ==.§impl<R: Scalar> Priceable<R> for ForwardRateAgreement
impl<R: Scalar> Priceable<R> for ForwardRateAgreement
§fn npv(&self, view: &PricingView<'_, R>) -> Result<R, PricingError>
fn npv(&self, view: &PricingView<'_, R>) -> Result<R, PricingError>
The settlement discounted from the accrual start; a contract whose settlement date has passed has cash-settled and is worth nothing.
§fn par_rate(&self, view: &PricingView<'_, R>) -> Result<R, PricingError>
fn par_rate(&self, view: &PricingView<'_, R>) -> Result<R, PricingError>
The fair rate: the contract rate, at which the settlement is zero.
§fn par_spread(&self, _view: &PricingView<'_, R>) -> Result<R, PricingError>
fn par_spread(&self, _view: &PricingView<'_, R>) -> Result<R, PricingError>
§impl PricingRiskFactors for ForwardRateAgreement
impl PricingRiskFactors for ForwardRateAgreement
§fn risk_factors(&self) -> Result<RiskFactors<'_>, PricingError>
fn risk_factors(&self) -> Result<RiskFactors<'_>, PricingError>
§impl Product for ForwardRateAgreement
impl Product for ForwardRateAgreement
§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 currency(&self) -> Currency
fn currency(&self) -> Currency
§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.