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: AssetSwapThe 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: CreditCurveIdThe collateral’s issuer: its default is the SPV’s.
notional: f64The note notional — the swap’s.
waterfall: WaterfallThe payout order on termination.
trigger: Option<ValuationTrigger>A valuation trigger, if the note has one. Collateral default always terminates the note.
role: RepackRoleThe side the note is booked from.
engine: RepackEngineHow 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
impl RepackNote
pub fn new(
swap: AssetSwap,
issuer: CreditCurveId,
notional: f64,
) -> Result<Self, RepackError>
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>
pub fn cross_currency( swap: CrossCurrencyAssetSwap, issuer: CreditCurveId, notional: f64, ) -> Result<Self, RepackError>
pub fn with_role(self, role: RepackRole) -> Self
pub fn with_role(self, role: RepackRole) -> Self
This note booked from role.
pub fn with_engine(self, engine: RepackEngine) -> Self
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>
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.
§impl RepackNote
impl RepackNote
pub fn collateral_value<R: Scalar>(
&self,
view: &PricingView<'_, R>,
) -> Result<R, PricingError>
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>
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
impl RepackNote
pub fn simulation_factors(&self) -> Result<RiskFactors<'_>, PricingError>
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
impl Clone for RepackNote
§fn clone(&self) -> RepackNote
fn clone(&self) -> RepackNote
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 RepackNote
impl Debug for RepackNote
§impl PartialEq for RepackNote
impl PartialEq for RepackNote
§impl<R: Scalar> Priceable<R> for RepackNote
impl<R: Scalar> Priceable<R> for RepackNote
§fn npv(&self, view: &PricingView<'_, R>) -> Result<R, PricingError>
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>
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 RepackNote
impl PricingRiskFactors for RepackNote
§fn risk_factors(&self) -> Result<RiskFactors<'_>, PricingError>
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
impl Product for RepackNote
§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.