Struct SecuritiesLoan
pub struct SecuritiesLoan {
pub loan: Repo,
pub fee: f64,
pub cash_collateral: bool,
}Expand description
A securities loan: a bond lent for a fee on its market value, accrued each day on the day count and paid at the end of each of the loan’s interest periods — monthly where the repo carries monthly interest dates, else once at the end — against collateral. Cash collateral is a repo at the rebate the lender pays on it — the lender of the bond is the borrower of the cash — and other bonds as collateral change hands and come back, worth nothing on the loan.
It is carried by loan, the repo that lends the bond: its
side (Repo for the lender of the bond), dates, interest dates, day
count, bond, nominal and financing keys, at the rebate for cash
collateral, which pays on the same dates as the fee.
Fields§
§loan: RepoThe repo that lends the bond, at the rebate for cash collateral.
fee: f64The lending fee, a simple annual rate on the bond’s dirty value.
cash_collateral: boolWhether the collateral is cash, valued as the repo at the rebate; otherwise it is other securities, which value nothing on the loan.
Implementations§
§impl SecuritiesLoan
impl SecuritiesLoan
pub fn new(
loan: Repo,
fee: f64,
cash_collateral: bool,
) -> Result<Self, RepoError>
pub fn new( loan: Repo, fee: f64, cash_collateral: bool, ) -> Result<Self, RepoError>
loan lending its bond for fee, against cash at the loan’s rate (the
rebate) when cash_collateral, or against other securities.
§Errors
RepoError::Malformed for a fee that is not finite, or a
cross-currency or buy/sell-back loan.
§impl SecuritiesLoan
impl SecuritiesLoan
fn fee_value<R: Scalar>(
&self,
view: &PricingView<'_, R>,
) -> Result<R, PricingError>
fn fee_value<R: Scalar>( &self, view: &PricingView<'_, R>, ) -> Result<R, PricingError>
The fee still to be paid: per interest period, fee · N/100 · Σ τ_d·F(d) over its days, F(d) the bond’s forward dirty price on its
financing curve, discounted from the period’s end. A period paid by
today is gone; a day already past accrues on today’s price.
Trait Implementations§
§impl Clone for SecuritiesLoan
impl Clone for SecuritiesLoan
§fn clone(&self) -> SecuritiesLoan
fn clone(&self) -> SecuritiesLoan
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 SecuritiesLoan
impl Debug for SecuritiesLoan
§impl PartialEq for SecuritiesLoan
impl PartialEq for SecuritiesLoan
§impl<R: Scalar> Priceable<R> for SecuritiesLoan
impl<R: Scalar> Priceable<R> for SecuritiesLoan
§fn npv(&self, view: &PricingView<'_, R>) -> Result<R, PricingError>
fn npv(&self, view: &PricingView<'_, R>) -> Result<R, PricingError>
The fee, and against cash the repo at the rebate.
§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 SecuritiesLoan
impl PricingRiskFactors for SecuritiesLoan
§fn risk_factors(&self) -> Result<RiskFactors<'_>, PricingError>
fn risk_factors(&self) -> Result<RiskFactors<'_>, PricingError>
The loan’s repo’s: its discount curve, and the financing curve the bond’s forward value is carried on.
§impl Product for SecuritiesLoan
impl Product for SecuritiesLoan
§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.