Struct TriPartyRepo
pub struct TriPartyRepo {
pub cash_leg: Repo,
pub allocation: Vec<TriPartyAllocation>,
}Expand description
A tri-party repo: cash against a basket an agent allocates under a collateral schedule. The cash leg is a repo’s, financed on the schedule’s repo curve then the currency’s general collateral; the agent manages the basket’s coupons and substitutions, so the leg carries none, and the allocation is margined at market net of its haircuts.
Fields§
§cash_leg: RepoThe cash leg, as a repo with no coupons of its own.
allocation: Vec<TriPartyAllocation>The basket the agent has allocated.
Implementations§
§impl TriPartyRepo
impl TriPartyRepo
pub fn new(
terms: RepoTerms,
cash: f64,
schedule: &str,
allocation: Vec<TriPartyAllocation>,
) -> Result<Self, RepoError>
pub fn new( terms: RepoTerms, cash: f64, schedule: &str, allocation: Vec<TriPartyAllocation>, ) -> Result<Self, RepoError>
cash lent or borrowed on terms under the collateral schedule
(its repo curve key), against allocation.
§Errors
RepoError::Malformed for an empty allocation, a bond in another
currency or maturing within the term, a nominal that is not positive,
or a haircut outside [0, 1); otherwise as Repo::from_cash.
§impl TriPartyRepo
impl TriPartyRepo
pub fn margin(&self, market: &MarketContext) -> Result<RepoMargin, PricingError>
pub fn margin(&self, market: &MarketContext) -> Result<RepoMargin, PricingError>
The margin position on market: the exposure the cash leg carries,
against the allocation at its dirty value on its discount curve, each
bond counted net of its haircut. required is the exposure plus the
haircuts, so excess is the haircut value less the exposure, and
haircut the basket’s value-weighted one.
§Errors
As Priceable::npv.
Trait Implementations§
§impl Clone for TriPartyRepo
impl Clone for TriPartyRepo
§fn clone(&self) -> TriPartyRepo
fn clone(&self) -> TriPartyRepo
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 TriPartyRepo
impl Debug for TriPartyRepo
§impl PartialEq for TriPartyRepo
impl PartialEq for TriPartyRepo
§impl<R: Scalar> Priceable<R> for TriPartyRepo
impl<R: Scalar> Priceable<R> for TriPartyRepo
§fn npv(&self, view: &PricingView<'_, R>) -> Result<R, PricingError>
fn npv(&self, view: &PricingView<'_, R>) -> Result<R, PricingError>
The cash leg on the schedule’s repo curve.
§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 TriPartyRepo
impl PricingRiskFactors for TriPartyRepo
§fn risk_factors(&self) -> Result<RiskFactors<'_>, PricingError>
fn risk_factors(&self) -> Result<RiskFactors<'_>, PricingError>
The cash leg’s: the schedule’s repo curve, then general collateral.
§impl Product for TriPartyRepo
impl Product for TriPartyRepo
§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.