Skip to main content

EquityTotalReturnSwap

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: Currency

The 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: DayCountFraction

The funding leg’s accrual day count.

§funding_margin: f64

The margin over the funding index, as a decimal.

§funding_gearing: f64

Gearing on the index fixing; 0.0 makes the funding fixed at the margin.

§funding_collateral: CollateralSpec

The 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: bool

true 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

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>

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

The funding leg’s notional: stated, or Σ quantity · initial_price.

Trait Implementations§

§

impl Clone for EquityTotalReturnSwap

§

fn clone(&self) -> EquityTotalReturnSwap

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for EquityTotalReturnSwap

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
§

impl PartialEq for EquityTotalReturnSwap

§

fn eq(&self, other: &EquityTotalReturnSwap) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl<R: Scalar> Priceable<R> for EquityTotalReturnSwap

§

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>

The par rate — the fixed rate at which the product is worth nothing. Read more
§

fn par_spread(&self, _view: &PricingView<'_, R>) -> Result<R, PricingError>

The par (breakeven) floating-leg spread. Zero for a product with no floating leg. Read more
§

impl PricingRiskFactors for EquityTotalReturnSwap

§

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

§

fn currency(&self) -> Currency

The currency the product pays in. An FX product values in its quote currency; a book converts.
§

fn contract_dates(&self) -> Vec<(&'static str, NaiveDate)>

The contract dates the product resolved to, as (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>>

The legs the product itself holds, in a declared order, or 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>

The date of the product’s final payment, where a calibration rung can be built on it; None for a product no ladder is built from.
§

fn restruck_at_rate(&self, _rate: f64) -> Option<AnyInstrument>

This product re-struck at the par rate 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>

This product re-struck at the basis spread spread on its spread leg, or None for a product that quotes none.
§

impl StructuralPartialEq for EquityTotalReturnSwap

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.