Expand description
§Convex Bonds
Bond pricing and analytics for the Convex fixed income analytics library.
This crate provides:
- Instruments: Fixed coupon bonds, zero coupon bonds, floating rate notes
- Pricing: Present value, clean/dirty price, yield-to-maturity
- Cash Flows: Coupon schedule generation with business day adjustments
- Risk: Duration, convexity, DV01, key rate durations
§Example
ⓘ
use convex_bonds::prelude::*;
use convex_core::types::{Date, Currency, Frequency};
use rust_decimal_macros::dec;
// Create a fixed coupon bond
let bond = FixedBondBuilder::new()
.isin("US912828Z229")
.coupon_rate(dec!(2.5))
.maturity(Date::from_ymd(2030, 5, 15).unwrap())
.frequency(Frequency::SemiAnnual)
.currency(Currency::USD)
.build()
.unwrap();
// Calculate yield-to-maturity
let settlement = Date::from_ymd(2025, 1, 15).unwrap();
let price = Price::new(dec!(98.50), Currency::USD);
let ytm = bond.yield_to_maturity(price, settlement).unwrap();Re-exports§
pub use error::BondError;pub use error::BondResult;pub use indices::ArrearConvention;pub use indices::IndexConventions;pub use indices::IndexFixing;pub use indices::IndexFixingStore;pub use indices::IndexSource;pub use indices::OvernightCompounding;pub use indices::PublicationTime;pub use indices::ShiftType;pub use instruments::AccelerationOption;pub use instruments::CallableBond;pub use instruments::CallableBondBuilder;pub use instruments::FixedBond;pub use instruments::FixedBondBuilder;pub use instruments::FixedRateBond;pub use instruments::FixedRateBondBuilder;pub use instruments::FloatingRateNote;pub use instruments::FloatingRateNoteBuilder;pub use instruments::SinkingFundBond;pub use instruments::SinkingFundBondBuilder;pub use instruments::SinkingFundPayment;pub use instruments::SinkingFundSchedule;
Modules§
- cashflows
- Cash flow generation for bonds.
- conventions
- Market conventions for bond analytics.
- curve_
instruments - Curve instrument wrappers for yield curve bootstrapping.
- error
- Error types for bond operations.
- indices
- Rate index infrastructure for floating rate bonds.
- instruments
- Bond instrument types.
- options
- Option pricing models for callable and puttable bonds.
- prelude
- Prelude module for convenient imports.
- pricing
- Bond pricing calculations.
- risk
- Risk metrics for bonds.
- traits
- Core bond traits and extensions.
- types
- Domain types for bond analytics.