Struct PaymentInKindBond
pub struct PaymentInKindBond {
pub bond: FixedRateBond,
pub accretion: Accretion,
pub collateral: CollateralSpec,
pub security_spread: Option<String>,
}Expand description
A fixed-rate payment-in-kind bond.
Fields§
§bond: FixedRateBondThe par bullet: its coupon is the capitalisation rate, its schedule the capitalisation dates, its face the par face. It pays nothing in cash; it states the terms.
accretion: AccretionThe accretion rule the par flows scale by.
collateral: CollateralSpecThe discounting key.
security_spread: Option<String>A security-spread key composed onto the discounting.
Implementations§
§impl PaymentInKindBond
impl PaymentInKindBond
pub fn new(
currency: Currency,
issue: NaiveDate,
maturity: NaiveDate,
rate: f64,
frequency: Frequency,
day_count: DayCountFraction,
face: f64,
) -> Result<Self, PikError>
pub fn new( currency: Currency, issue: NaiveDate, maturity: NaiveDate, rate: f64, frequency: Frequency, day_count: DayCountFraction, face: f64, ) -> Result<Self, PikError>
A PIK capitalising rate at frequency from issue to maturity on
face of par, collateralised in its own currency.
§Errors
PikError::NonPositiveRate for a rate that is not finite and
strictly positive; PikError::Bond if the bullet cannot be built.
pub fn spread_by(self, key: impl Into<String>) -> Self
pub fn spread_by(self, key: impl Into<String>) -> Self
Composes the security spread under key onto the discounting.
pub fn with_accrual_adjustment(
self,
calendar: Arc<dyn Calendar>,
convention: BusinessDayConvention,
) -> Self
pub fn with_accrual_adjustment( self, calendar: Arc<dyn Calendar>, convention: BusinessDayConvention, ) -> Self
This bond capitalising over boundaries rolled on calendar under
convention, as
FixedRateBond::with_accrual_adjustment rolls them. The contractual accretion is rebuilt
on the rolled periods.
pub fn with_settlement_lag(self, days: i32, calendar: Arc<dyn Calendar>) -> Self
pub fn with_settlement_lag(self, days: i32, calendar: Arc<dyn Calendar>) -> Self
This bond settling days business days on calendar after it trades,
by forwarding to its par bullet’s
with_settlement_lag.
pub fn settlement_date(&self, trade_date: NaiveDate) -> NaiveDate
pub fn settlement_date(&self, trade_date: NaiveDate) -> NaiveDate
The date a trade on trade_date settles on: the settlement lag walked
from it, never before issue.
pub fn capitalisations(&self) -> Vec<Capitalisation>
pub fn capitalisations(&self) -> Vec<Capitalisation>
Every capitalisation on the bond’s life, growing the par face.
pub fn accretion_factor(&self, date: NaiveDate) -> f64
pub fn accretion_factor(&self, date: NaiveDate) -> f64
The accretion factor at date — current_face / par face, and the
conversion factor between the two quote bases.
pub fn current_face(&self, date: NaiveDate) -> f64
pub fn current_face(&self, date: NaiveDate) -> f64
The accreted face at date. A face, not a trade notional: reaching
for it as one reintroduces the per-100 ambiguity the ratio avoids.
pub fn redemption_per_100(&self) -> f64
pub fn redemption_per_100(&self) -> f64
The single cash flow per 100 of par face: the accreted redemption at maturity.
pub fn to_par_basis(&self, on_accreted_face: f64, settlement: NaiveDate) -> f64
pub fn to_par_basis(&self, on_accreted_face: f64, settlement: NaiveDate) -> f64
Converts a quantity per 100 accreted face to per 100 par face
at settlement.
pub fn to_accreted_basis(&self, on_par_face: f64, settlement: NaiveDate) -> f64
pub fn to_accreted_basis(&self, on_par_face: f64, settlement: NaiveDate) -> f64
Converts a quantity per 100 par face to per 100 accreted face
at settlement.
pub fn accrued_on_accreted_face(&self, settlement: NaiveDate) -> f64
pub fn accrued_on_accreted_face(&self, settlement: NaiveDate) -> f64
Accrued per 100 of accreted face: the interest capitalising in the current period. Between capitalisations the face is constant, so on its own basis this is the plain coupon accrual.
pub fn accrued_on_par_face(&self, settlement: NaiveDate) -> f64
pub fn accrued_on_par_face(&self, settlement: NaiveDate) -> f64
Accrued per 100 of par face — the accreted basis grown by the accretion in force.
fn time_to_maturity(&self, settlement: NaiveDate) -> f64
fn time_to_maturity(&self, settlement: NaiveDate) -> f64
The year fraction from settlement to maturity on the bond’s basis.
pub fn dirty_price_on_par_face(
&self,
y: f64,
settlement: NaiveDate,
basis: YieldBasis,
) -> f64
pub fn dirty_price_on_par_face( &self, y: f64, settlement: NaiveDate, basis: YieldBasis, ) -> f64
Dirty price per 100 of par face at yield y: the accreted
redemption discounted at y under compounding.
pub fn dirty_price_on_accreted_face(
&self,
y: f64,
settlement: NaiveDate,
basis: YieldBasis,
) -> f64
pub fn dirty_price_on_accreted_face( &self, y: f64, settlement: NaiveDate, basis: YieldBasis, ) -> f64
Dirty price per 100 of accreted face — the market convention.
pub fn clean_price_on_par_face(
&self,
y: f64,
settlement: NaiveDate,
basis: YieldBasis,
) -> f64
pub fn clean_price_on_par_face( &self, y: f64, settlement: NaiveDate, basis: YieldBasis, ) -> f64
Clean price per 100 of par face — dirty less accrued on the same basis.
pub fn clean_price_on_accreted_face(
&self,
y: f64,
settlement: NaiveDate,
basis: YieldBasis,
) -> f64
pub fn clean_price_on_accreted_face( &self, y: f64, settlement: NaiveDate, basis: YieldBasis, ) -> f64
Clean price per 100 of accreted face.
pub fn yield_from_par_face(
&self,
dirty: f64,
settlement: NaiveDate,
basis: YieldBasis,
) -> f64
pub fn yield_from_par_face( &self, dirty: f64, settlement: NaiveDate, basis: YieldBasis, ) -> f64
The yield repricing a dirty price per 100 of par face — exact, since the bond is one flow: the discount factor is inverted in closed form. Zero at or past maturity.
pub fn yield_from_accreted_face(
&self,
dirty: f64,
settlement: NaiveDate,
basis: YieldBasis,
) -> f64
pub fn yield_from_accreted_face( &self, dirty: f64, settlement: NaiveDate, basis: YieldBasis, ) -> f64
The yield repricing a dirty price per 100 of accreted face.
Trait Implementations§
§impl Clone for PaymentInKindBond
impl Clone for PaymentInKindBond
§fn clone(&self) -> PaymentInKindBond
fn clone(&self) -> PaymentInKindBond
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 PaymentInKindBond
impl Debug for PaymentInKindBond
§impl PartialEq for PaymentInKindBond
impl PartialEq for PaymentInKindBond
§fn eq(&self, other: &PaymentInKindBond) -> bool
fn eq(&self, other: &PaymentInKindBond) -> bool
self and other values to be equal, and is used by ==.§impl<R: Scalar> Priceable<R> for PaymentInKindBond
impl<R: Scalar> Priceable<R> for PaymentInKindBond
§fn npv(&self, view: &PricingView<'_, R>) -> Result<R, PricingError>
fn npv(&self, view: &PricingView<'_, R>) -> Result<R, PricingError>
The one cash event: the accreted redemption at maturity, discounted on the collateral curve (with any composed security spread). The accretion factor is contract data and enters as a constant.
§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 PaymentInKindBond
impl PricingRiskFactors for PaymentInKindBond
§fn risk_factors(&self) -> Result<RiskFactors<'_>, PricingError>
fn risk_factors(&self) -> Result<RiskFactors<'_>, PricingError>
§impl Product for PaymentInKindBond
impl Product for PaymentInKindBond
§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.