Skip to main content

BondStatic

Struct BondStatic 

pub struct BondStatic {
Show 22 fields pub instrument_id: String, pub currency: String, pub coupon_rate: f64, pub coupon_type: CouponType, pub day_count: DayCountFraction, pub payment_frequency: Frequency, pub face_amount: f64, pub issue: NaiveDate, pub maturity: NaiveDate, pub seniority: Option<Seniority>, pub call_put_schedule: Vec<Callability>, pub credit_entity: Option<CreditCurveId>, pub yield_convention: YieldConvention, pub ex_div: Option<ExDivRule>, pub calc_type: Option<u16>, pub coupon_step_days: Option<u16>, pub repo_group: Option<String>, pub ex_div_dates: Option<Vec<(NaiveDate, NaiveDate)>>, pub settlement_days: u16, pub schedule_override: Option<Vec<NaiveDate>>, pub end_of_month: bool, pub pays_in_kind: bool,
}
Expand description

The quote-less FpML reference definition of a fixed-coupon debt security.

Mirrors FpML Bond / FixedIncomeSecurityContent: the economic fields that define the security, with no market price (the price is the hole, filled by a BondQuote). Pure reference data — no curve, market, or instrument dependency — so it lives in statics beside CouponType/Seniority and is materialised one layer up by FixedRateBond::from_static.

Fields§

§instrument_id: String

Security identifier (FpML instrumentId, ISIN scheme).

§currency: String

ISO 4217 currency.

§coupon_rate: f64

Annual coupon rate (decimal, FpML couponRate). 0 ⇒ zero-coupon.

§coupon_type: CouponType

Coupon type (FpML couponType).

§day_count: DayCountFraction

Accrual day-count (FpML dayCountFraction).

§payment_frequency: Frequency

Coupon payment frequency (FpML paymentFrequency).

§face_amount: f64

Redeemed par (FpML faceAmount).

§issue: NaiveDate

First accrual date.

§maturity: NaiveDate

Maturity / redemption date.

§seniority: Option<Seniority>

Repayment seniority (FpML creditSeniority), if tagged.

§call_put_schedule: Vec<Callability>

Embedded call/put schedule (fixed-price European/Bermudan). Empty ⇒ a plain non-callable bond, behaviourally identical to the pre-embedded-option form.

§credit_entity: Option<CreditCurveId>

The issuer’s credit key into the CreditRegistry (the same namespace CDS survival curves pin under — a credit-curve identifier). None ⇒ default-free pricing; Some opts the bond into survival-weighted (risky) valuation against the entity’s pinned curve and recovery.

§yield_convention: YieldConvention

The street convention the market’s quoted yield compounds in (YieldConvention::Default ⇒ today’s behavior).

§ex_div: Option<ExDivRule>

The ex-dividend rule, when the market trades ex-div (None ⇒ always cum-dividend — today’s behavior).

§calc_type: Option<u16>

The vendor DES calc-type code (VendorCalcMethod registry key), when the security is booked by its market’s convention bundle. Stored raw so it round-trips even for codes the registry learns later; resolution happens (fail-loud) at materialisation.

§coupon_step_days: Option<u16>

Day-based coupon chain: when set, coupon dates step backward from maturity in exact steps of this many calendar days (Turkish government bonds pay every 91/182/364 days) instead of calendar months. The compounding/ICMA frequency stays Self::payment_frequency (a 182-day chain books as 6M). None ⇒ calendar-month schedule.

§repo_group: Option<String>

The financing/repo group the security carries in (a free-form key such as "GC:GBP" or a specialness bucket): the middle tier of the repo resolution cascade (ISIN → group → currency GC → discount fallback). None ⇒ resolution skips straight from the ISIN tier to currency GC.

§ex_div_dates: Option<Vec<(NaiveDate, NaiveDate)>>

Explicit per-period detachment dates (coupon_date, ex_div_date) for exchange-published irregular ex-div calendars. A listed coupon’s detachment overrides the Self::ex_div-rule-derived date; unlisted coupons keep the rule’s. None ⇒ rule-only.

§settlement_days: u16

MarketContext settlement lag in business days on the bond’s calendar (0 ⇒ same-day settlement — the pre-lag behaviour). Copied to the materialised bond, so settlement_date(valuation) — and therefore the settlement any quoted measure is priced at — advances by this lag.

§schedule_override: Option<Vec<NaiveDate>>

Explicit coupon boundary dates, ascending and spanning issue … maturity — for bonds whose published schedule no roll rule reproduces (the South-African R2048 pays on 28 February even in a leap year).

Authoritative when set: it supersedes Self::end_of_month, the Self::coupon_step_days chain and backward generation from maturity, and it is not business-day adjusted — the dates are taken exactly as given. Generate them with hlx.schedule(..) (which adjusts) and patch the exceptions. None ⇒ the generated schedule.

§end_of_month: bool

Whether the coupon schedule rolls on the end of the month rather than preserving the maturity’s day-of-month.

Takes effect only when the maturity anchors a month end — the standard gate on the rule — and is ignored entirely when Self::schedule_override is set. false ⇒ day-of-month preservation.

§pays_in_kind: bool

Whether the coupon capitalises into the principal instead of paying in cash — a payment-in-kind bond. false ⇒ an ordinary cash-paying bond (today’s behaviour).

The declaration is a plain flag because only a contractual accretion is bookable: the rate is Self::coupon_rate and the capitalisation dates are the coupon schedule, so nothing further is needed. A capitalisation rate driven by a floating index, or elected per period by the issuer, has no representation here by design — see Accretion for the closed set of sources, and the calc_methods module docs for the refusals and their stated reasons.

Implementations§

§

impl BondStatic

pub fn new( instrument_id: impl Into<String>, currency: impl Into<String>, coupon_rate: f64, coupon_type: CouponType, day_count: DayCountFraction, payment_frequency: Frequency, face_amount: f64, issue: NaiveDate, maturity: NaiveDate, ) -> Self

Builds a fixed-coupon BondStatic from its FpML reference fields. Optional seniority is set via Self::with_seniority.

pub fn with_settlement_days(self, days: u16) -> Self

Sets the market settlement lag (business days on the bond’s calendar).

pub fn with_schedule(self, dates: Vec<NaiveDate>) -> Self

States the coupon boundary dates explicitly, superseding every generation rule. The vector is taken as given and is not business-day adjusted; see Self::schedule_override.

pub fn with_end_of_month(self, end_of_month: bool) -> Self

Rolls the coupon schedule on the end of the month. Ignored when Self::schedule_override is set.

pub fn with_seniority(self, seniority: Seniority) -> Self

Sets the repayment seniority (FpML creditSeniority).

pub fn with_ex_div(self, rule: ExDivRule) -> Self

Sets the ex-dividend rule.

pub fn with_calc_type(self, code: u16) -> Self

Sets the vendor calc-type code (resolved fail-loud at materialisation).

pub fn with_coupon_step_days(self, days: u16) -> Self

Sets the day-based coupon chain (e.g. 182 for a Turkish 182-day bond).

pub fn with_credit_entity(self, credit: CreditCurveId) -> Self

Tags the issuer’s credit key (the survival-curve name), opting the bond into survival-weighted valuation.

pub fn with_repo_group(self, group: impl Into<String>) -> Self

Tags the financing/repo group (the middle tier of the repo cascade).

Trait Implementations§

§

impl Clone for BondStatic

§

fn clone(&self) -> BondStatic

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 BondStatic

§

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

Formats the value using the given formatter. Read more
§

impl PartialEq for BondStatic

§

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

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.