Struct CallableLoan
pub struct CallableLoan {
pub loan: Loan,
pub schedule: Vec<Callability>,
pub american: bool,
}Expand description
A loan with exercise rights: the borrower may prepay it
(a Call) or the lender
demand it back (a Put) on
each entry’s date, at the entry’s price per 100 of the principal then
outstanding — plus the interest accrued, for a clean price. Booked from
the depositor’s side it is a callable or puttable term deposit. A
floating loan exercises on its interest dates alone, where nothing has
accrued.
Fields§
§loan: LoanThe loan, its credit tag included.
schedule: Vec<Callability>The exercise entries.
american: boolWhether each entry’s right runs from its date to the next entry’s.
Implementations§
§impl CallableLoan
impl CallableLoan
pub fn new(loan: Loan, schedule: Vec<Callability>) -> Result<Self, String>
pub fn new(loan: Loan, schedule: Vec<Callability>) -> Result<Self, String>
loan with schedule’s rights, exercised on their dates alone.
§Errors
A make-whole entry, an entry not after the drawdown or after maturity, or on a floating loan an entry inside an interest period.
pub fn with_american_exercise(self) -> Self
pub fn with_american_exercise(self) -> Self
Each entry’s right runs from its date to the slice before the next
entry’s (a floating loan’s is then refused at valuation), as CallableBond::with_american_exercise.
pub fn has_exercisable(&self, cut: NaiveDate) -> bool
pub fn has_exercisable(&self, cut: NaiveDate) -> bool
Whether an entry can still exercise after cut, before maturity.
pub fn strike(&self, entry: &Callability, on: NaiveDate) -> f64
pub fn strike(&self, entry: &Callability, on: NaiveDate) -> f64
The redemption on on under entry, in currency.
§impl CallableLoan
impl CallableLoan
fn on_lattice<R: Scalar>(
&self,
view: &PricingView<'_, R>,
) -> Result<LoanOnLattice<R>, PricingError>
fn on_lattice<R: Scalar>( &self, view: &PricingView<'_, R>, ) -> Result<LoanOnLattice<R>, PricingError>
The servicing after the valuation on the currency’s Hull-White lattice: each fixed flow, each floating coupon still to fix less its replicated lattice rate, and each right still live.
§Errors
American exercise on a floating loan, missing Hull-White parameters or credit, and the lattice’s own errors.
fn quote_scale(&self, valuation: NaiveDate) -> Result<(f64, f64), PricingError>
fn quote_scale(&self, valuation: NaiveDate) -> Result<(f64, f64), PricingError>
The loan’s quote per 100 of the principal outstanding at the valuation, clean of the interest accrued, from its servicing’s value: a loan not yet drawn has no quote.
Trait Implementations§
§impl Clone for CallableLoan
impl Clone for CallableLoan
§fn clone(&self) -> CallableLoan
fn clone(&self) -> CallableLoan
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 CallableLoan
impl Debug for CallableLoan
§impl PartialEq for CallableLoan
impl PartialEq for CallableLoan
§impl<R: Scalar> Priceable<R> for CallableLoan
impl<R: Scalar> Priceable<R> for CallableLoan
§fn npv(&self, view: &PricingView<'_, R>) -> Result<R, PricingError>
fn npv(&self, view: &PricingView<'_, R>) -> Result<R, PricingError>
The drawdown off the curve, and the servicing rolled back on the Hull-White lattice from the lender’s side — risky on the borrower’s credit when tagged — with each right exercised against its strike: the borrower calls below the continuation, the lender puts above it. With nothing left to exercise, the loan itself.
A floating coupon not yet fixed is the lattice’s own rate plus a
deterministic remainder: N lent at its accrual start, survival-
weighted to its payment, and its projected amount less
N·P(start)/P(payment) paid on the payment date. Both are fixed
amounts, so the rollback stays exact on one discount curve; the basis
to a projection curve is held at today’s forward. The N sits in the
continuation on the boundary it lands on, so an exercise there is
struck that much lower.
§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 CallableLoan
impl PricingRiskFactors for CallableLoan
§fn risk_factors(&self) -> Result<RiskFactors<'_>, PricingError>
fn risk_factors(&self) -> Result<RiskFactors<'_>, PricingError>
The loan’s factors, and the currency’s Hull-White parameters while a right can still exercise.
§impl Product for CallableLoan
impl Product for CallableLoan
§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.