Day-Count Conventions
Day-count conventions determine the fraction of a year () between two dates and , governing interest accrual and discount factors:
Supported Conventions
1. Actual/Actual ICMA (Bond Standard)
Used for sovereign and corporate bonds. Calculates accrual relative to the actual number of days in the current coupon period:
where is the payment frequency and is the reference coupon period.
2. Actual/Actual ISDA (Swap Standard)
Splits calculation across calendar years:
3. Actual/360 & Actual/365 Fixed
- Actual/360: Standard in money markets (US Treasury bills, commercial paper, SOFR/Euribor loans):
- Actual/365 Fixed: Standard in UK, Commonwealth, and JPY markets:
4. 30/360 Family (US & Eurobond)
Treats all full months as 30 days and a year as 360 days:
- 30/360 US (Bond Basis): Adjusts and based on end-of-month and February rules.
- 30E/360 (Eurobond Basis): If ; if .
5. Business/252
Used primarily in Brazilian and Latin American fixed income:
Rust Code Example
use sabiquant::core::Date;use sabiquant::core::daycount::{ DayCounter, ActualActualICMA, ActualActualISDA, Actual360, Actual365Fixed, Thirty360US};
fn main() -> Result<(), Box<dyn std::error::Error>> { let d1 = Date::from_ymd(2024, 2, 1)?; // Leap year let d2 = Date::from_ymd(2024, 8, 1)?;
let act_360 = Actual360::default(); let act_365 = Actual365Fixed::default(); let thirty_360 = Thirty360US::default(); let isda = ActualActualISDA::default();
println!("Actual/360: {:.6}", act_360.year_fraction(d1, d2)?); println!("Actual/365: {:.6}", act_365.year_fraction(d1, d2)?); println!("30/360 US: {:.6}", thirty_360.year_fraction(d1, d2)?); println!("Act/Act ISDA: {:.6}", isda.year_fraction(d1, d2)?);
Ok(())}