FinancePy

FinancePy API Reference

bond perpetual

financepy.products.bonds.bond_perpetual

Class

BondPerpetual

BondPerpetual( issue_dt: Date, coupon: float, freq_type: FrequencyTypes, accrual_dc_type: DayCountTypes = <DayCountTypes.ACT_ACT_ICMA: 6>, first_coupon_dt: Date | None = None, ex_div_days: int = 0, cal_type: CalendarTypes = <CalendarTypes.WEEKEND: 2>, bd_type: BusDayAdjustTypes = <BusDayAdjustTypes.FOLLOWING: 2>, ) -> None
Inherits from: Product
Class for perpetual bonds (Consols / undated debt). These instruments have regular periodic coupon payments of a known rate and have no maturity date (T = infinity). The principal is never repaid.

Methods

accrued_interest

accrued_interest( self, settle_dt: Date, face: float = 100.0, ) -> float
Calculate the amount of coupon accrued between the previous coupon date and the settlement date.

dirty_price_from_ytm

dirty_price_from_ytm( self, settle_dt: Date, ytm: float | list[float] | numpy.ndarray, convention: YTMCalcType = <YTMCalcType.UK_DMO: 1>, ) -> float | numpy.ndarray
Calculate the dirty price of a perpetual bond from its yield to maturity. Supports vectorization with respect to yield inputs.

clean_price_from_ytm

clean_price_from_ytm( self, settle_dt: Date, ytm: float | list[float] | numpy.ndarray, convention: YTMCalcType = <YTMCalcType.UK_DMO: 1>, ) -> float | numpy.ndarray
Calculate the clean price of a perpetual bond from its yield to maturity.

yield_to_maturity

yield_to_maturity( self, settle_dt: Date, clean_price: float | list[float] | numpy.ndarray, convention: YTMCalcType = <YTMCalcType.UK_DMO: 1>, ) -> float | numpy.ndarray
Calculate the yield to maturity (yield to perpetuity) from clean price.

current_yield

current_yield( self, settle_dt: Date, clean_price: float | list[float] | numpy.ndarray, ) -> float | numpy.ndarray
Calculate the bond's current yield: coupon / clean_price.

dv01

dv01( self, settle_dt: Date, ytm: float, convention: YTMCalcType = <YTMCalcType.UK_DMO: 1>, ) -> float
Calculate the DV01 (dollar value of 1 basis point increase in yield).

dollar_duration

dollar_duration( self, settle_dt: Date, ytm: float, convention: YTMCalcType = <YTMCalcType.UK_DMO: 1>, ) -> float
Calculate dollar duration: 10,000 * DV01.

modified_duration

modified_duration( self, settle_dt: Date, ytm: float, convention: YTMCalcType = <YTMCalcType.UK_DMO: 1>, ) -> float
Calculate modified duration: dollar_duration / dirty_price.

macaulay_duration

macaulay_duration( self, settle_dt: Date, ytm: float, convention: YTMCalcType = <YTMCalcType.UK_DMO: 1>, ) -> float
Calculate Macaulay duration: modified_duration * (1 + ytm / freq).

convexity_from_ytm

convexity_from_ytm( self, settle_dt: Date, ytm: float, convention: YTMCalcType = <YTMCalcType.UK_DMO: 1>, ) -> float
Calculate convexity from yield to maturity: (1 / P) * (d^2 P / dy^2).

dirty_price_from_discount_curve

dirty_price_from_discount_curve( self, settle_dt: Date, discount_curve: DiscountCurve, horizon_years: float = 100.0, ) -> float
Calculate the dirty price of the perpetual bond from an arbitrary discount curve. Coupons falling within horizon_years of settlement are discounted off the curve one by one. The perpetuity beyond the horizon is valued as a tail that continues the curve's forward rate over the final coupon period, so a sloped curve is not truncated at a spot rate.

clean_price_from_discount_curve

clean_price_from_discount_curve( self, settle_dt: Date, discount_curve: DiscountCurve, horizon_years: float = 100.0, ) -> float
Calculate the clean price of the perpetual bond from a discount curve.

value

value( self, value_dt: Date, discount_curve: DiscountCurve, *args, **kwargs, ) -> float
Evaluate the clean price of the perpetual bond on value_dt using the provided discount curve, adhering to the Product interface.
Generated automatically from the FinancePy source code. Do not edit this file manually.