Struct EquityTotalReturnSwap
pub struct EquityTotalReturnSwap {
pub names: Vec<String>,
pub currency: Currency,
pub quantities: Vec<f64>,
pub initial_prices: Vec<f64>,
pub reset_schedule: Vec<NaiveDate>,
pub funding_day_count: DayCountFraction,
pub funding_margin: f64,
pub funding_gearing: f64,
pub funding_collateral: CollateralSpec,
pub funding_index: Option<String>,
pub pay_total_return: bool,
pub funding_notional: Option<f64>,
}Expand description
An equity total return swap: the total return on a basket of one or more equities against a funding leg, single-currency, valued on the period under way as accrued to date.
Fields§
§names: Vec<String>The constituents’ names, as the market quotes their spots.
currency: CurrencyThe return and funding currency.
quantities: Vec<f64>Shares of each constituent, aligned with names.
initial_prices: Vec<f64>The contractual price per share each constituent’s first period
starts from, aligned with names.
reset_schedule: Vec<NaiveDate>Reset boundaries, ascending: the return and funding periods.
funding_day_count: DayCountFractionThe funding leg’s accrual day count.
funding_margin: f64The margin over the funding index, as a decimal.
funding_gearing: f64Gearing on the index fixing; 0.0 makes the funding fixed at the
margin.
funding_collateral: CollateralSpecThe funding leg’s discounting collateral.
funding_index: Option<String>The funding index whose fixing at a period’s start sets its rate.
pay_total_return: booltrue pays the total return and receives funding.
funding_notional: Option<f64>The funding notional where the contract states one; None is
Σ quantity · initial_price.
Implementations§
§impl EquityTotalReturnSwap
impl EquityTotalReturnSwap
pub fn new(
name: impl Into<String>,
currency: Currency,
quantity: f64,
initial_price: f64,
reset_schedule: Vec<NaiveDate>,
) -> Result<Self, FinancingError>
pub fn new( name: impl Into<String>, currency: Currency, quantity: f64, initial_price: f64, reset_schedule: Vec<NaiveDate>, ) -> Result<Self, FinancingError>
A total-return receiver with Act/360 funding on the currency’s cash collateral, zero margin and unit gearing.
§Errors
FinancingError::MalformedResets for fewer than two or non-ascending
boundaries; FinancingError::NonPositiveEquityTerms for a quantity
or initial price that is not finite and positive.
pub fn basket(
constituents: Vec<(String, f64, f64)>,
currency: Currency,
reset_schedule: Vec<NaiveDate>,
) -> Result<Self, FinancingError>
pub fn basket( constituents: Vec<(String, f64, f64)>, currency: Currency, reset_schedule: Vec<NaiveDate>, ) -> Result<Self, FinancingError>
new on a basket of (name, quantity, initial_price)
constituents.
§Errors
As new, for any constituent;
FinancingError::MalformedEquityBasket for an empty basket or a
repeated name.
pub fn funded_notional(&self) -> f64
pub fn funded_notional(&self) -> f64
The funding leg’s notional: stated, or Σ quantity · initial_price.
Trait Implementations§
§impl Clone for EquityTotalReturnSwap
impl Clone for EquityTotalReturnSwap
§fn clone(&self) -> EquityTotalReturnSwap
fn clone(&self) -> EquityTotalReturnSwap
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 EquityTotalReturnSwap
impl Debug for EquityTotalReturnSwap
§impl PartialEq for EquityTotalReturnSwap
impl PartialEq for EquityTotalReturnSwap
§fn eq(&self, other: &EquityTotalReturnSwap) -> bool
fn eq(&self, other: &EquityTotalReturnSwap) -> bool
self and other values to be equal, and is used by ==.§impl<R: Scalar> Priceable<R> for EquityTotalReturnSwap
impl<R: Scalar> Priceable<R> for EquityTotalReturnSwap
§fn npv(&self, view: &PricingView<'_, R>) -> Result<R, PricingError>
fn npv(&self, view: &PricingView<'_, R>) -> Result<R, PricingError>
The accrued value of the period under way: each constituent’s shares at spot against the period’s start price, plus its dividends, less the funding accrued in the period under way, undiscounted; nothing from the last reset on.
§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 EquityTotalReturnSwap
impl PricingRiskFactors for EquityTotalReturnSwap
§fn risk_factors(&self) -> Result<RiskFactors<'_>, PricingError>
fn risk_factors(&self) -> Result<RiskFactors<'_>, PricingError>
The funding collateral’s discount curve and each constituent’s spot. The funding index is read only for its past fixing, so no projection.
§impl Product for EquityTotalReturnSwap
impl Product for EquityTotalReturnSwap
§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_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 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.