Skip to main content

CallableLoan

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: Loan

The loan, its credit tag included.

§schedule: Vec<Callability>

The exercise entries.

§american: bool

Whether each entry’s right runs from its date to the next entry’s.

Implementations§

§

impl CallableLoan

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

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

Whether an entry can still exercise after cut, before maturity.

pub fn strike(&self, entry: &Callability, on: NaiveDate) -> f64

The redemption on on under entry, in currency.

§

impl CallableLoan

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>

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

§

fn clone(&self) -> CallableLoan

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 CallableLoan

§

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

Formats the value using the given formatter. Read more
§

impl PartialEq for CallableLoan

§

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

§

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>

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 CallableLoan

§

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

§

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 CallableLoan

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.