Skip to main content

RepackNote

Struct RepackNote 

pub struct RepackNote {
    pub swap: AssetSwap,
    pub issuer: CreditCurveId,
    pub notional: f64,
    pub waterfall: Waterfall,
    pub trigger: Option<ValuationTrigger>,
    pub role: RepackRole,
    pub engine: RepackEngine,
    pub cross_currency: Option<CrossCurrencyTerms>,
}
Expand description

A single-asset repack note: the SPV’s asset swap with the bank, the issuer whose default is the SPV’s, the notional, the waterfall, the termination events, the role it is booked from and the engine its gap is priced by.

Fields§

§swap: AssetSwap

The SPV’s asset swap with the bank. The SPV is its buyer; its bond is the collateral, valued risk-free inside the swap as the swap’s own convention requires.

§issuer: CreditCurveId

The collateral’s issuer: its default is the SPV’s.

§notional: f64

The note notional — the swap’s.

§waterfall: Waterfall

The payout order on termination.

§trigger: Option<ValuationTrigger>

A valuation trigger, if the note has one. Collateral default always terminates the note.

§role: RepackRole

The side the note is booked from.

§engine: RepackEngine

How the gap is priced.

§cross_currency: Option<CrossCurrencyTerms>

For a note in another currency than its collateral, the floating leg’s currency, the contract rate and the two discount keys of the SPV’s cross-currency asset swap. Priced by simulation alone.

Implementations§

§

impl RepackNote

pub fn new( swap: AssetSwap, issuer: CreditCurveId, notional: f64, ) -> Result<Self, RepackError>

A bank-side note on swap, the collateral issued by issuer, of notional — the swap’s — bank-senior, terminating on collateral default, priced independently.

§Errors

RepackError::NotionalMismatch when notional is not the swap’s; RepackError::SwapNotBought for a swap held from the seller’s side.

pub fn cross_currency( swap: CrossCurrencyAssetSwap, issuer: CreditCurveId, notional: f64, ) -> Result<Self, RepackError>

A bank-side note on the SPV’s cross-currency asset swap swap: the collateral in one currency, the notes in the floating leg’s, of notional collateral face. Its gap is priced by simulation alone; the closed forms refuse it.

§Errors

As new.

pub fn with_role(self, role: RepackRole) -> Self

This note booked from role.

pub fn with_engine(self, engine: RepackEngine) -> Self

This note’s gap priced under engine.

pub fn with_trigger( self, trigger: ValuationTrigger, ) -> Result<Self, RepackError>

This note with a valuation trigger.

§Errors

RepackError::TriggerLevel for a level outside (0, 1); RepackError::TriggerMonitoring for empty or unsorted dates.

pub fn maturity(&self) -> NaiveDate

The collateral’s maturity — the note’s.

§

impl RepackNote

pub fn collateral_value<R: Scalar>( &self, view: &PricingView<'_, R>, ) -> Result<R, PricingError>

The collateral’s risky value at the issuer’s survival and market recovery, in currency — what the SPV holds.

§Errors

As the risky bond’s valuation.

pub fn swap_value<R: Scalar>( &self, view: &PricingView<'_, R>, ) -> Result<R, PricingError>

The swap’s value to the bank: the negated value of the asset swap to its buyer, the SPV.

§Errors

As the asset swap’s valuation.

§

impl RepackNote

pub fn simulation_factors(&self) -> Result<RiskFactors<'_>, PricingError>

The market data a gap simulation reads: the note’s own factors, the issuer’s credit intensity, and its crisis parameters.

§Errors

As risk_factors.

Trait Implementations§

§

impl Clone for RepackNote

§

fn clone(&self) -> RepackNote

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 RepackNote

§

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

Formats the value using the given formatter. Read more
§

impl PartialEq for RepackNote

§

fn eq(&self, other: &RepackNote) -> 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 RepackNote

§

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

The bank’s swap less the gap, V − G; or the notes per unit notional, (A − V + G) / N — so the two roles conserve the collateral.

§

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 RepackNote

§

fn risk_factors(&self) -> Result<RiskFactors<'_>, PricingError>

The swap’s collateral discounting and projection, the issuer’s credit with its market recovery, the currency’s Hull-White parameters, and — under the correlated engine — the issuer’s credit intensity.

§

impl Product for RepackNote

§

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 RepackNote

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.