Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Principle:Avhz RustQuant Day Count Conventions

From Leeroopedia


Knowledge Sources
Domains Fixed_Income, Financial_Infrastructure
Last Updated 2026-02-07 21:00 GMT

Overview

Day count conventions define how the fraction of a year between two dates is computed, which directly affects interest accrual, coupon payments, and discount factor calculations across all fixed-income instruments.

Description

Day count conventions (also known as day count fractions or day count bases) determine how interest accrues over time for bonds, loans, swaps, and other financial instruments. RustQuant implements 19 distinct conventions through the DayCountConvention enum.

The supported conventions are organized into three families:

Actual-based conventions compute the numerator as the actual number of calendar days between two dates:

  • Actual/360 (money market convention): divides actual days by 360
  • Actual/364: divides actual days by 364
  • Actual/365 Fixed: divides actual days by 365 regardless of leap years
  • Actual/365.25: divides actual days by 365.25 to approximate leap years
  • Actual/365 Actual: divides by 366 if the period spans a leap year, 365 otherwise
  • Actual/365 Leap: similar to Actual/365 Actual
  • Actual/366: divides actual days by 366
  • Actual/Actual ISDA: splits the period at year boundaries, dividing each portion by 365 or 366 depending on whether that year is a leap year
  • Actual/Actual AFB: French bond market convention with special handling for periods over one year
  • Actual/Actual ICMA: divides actual days by the actual coupon period length times frequency

30/360-based conventions assume each month has 30 days and each year has 360 (or 365) days:

  • 30/360 ISDA: adjusts day 31 to 30 with specific rules
  • 30E/360: European convention, both day-31s become 30
  • 30E/360 ISDA: like 30E/360 but also adjusts end-of-February
  • 30E+/360: if end day is 31, roll to the first of the next month
  • 30U/360: US convention with end-of-February adjustments
  • 30E/365: like 30E/360 ISDA but divides by 365

Special conventions:

  • 1/1: always returns 1.0
  • NL/360 and NL/365: no-leap conventions that subtract leap days before dividing

Additionally, RustQuant provides supporting infrastructure:

  • DateGenerationConvention: Forward, Backward, or Zero generation from issue/maturity dates
  • Schedule: stores a sequence of dates with their day count factors, rolling convention, and counting convention
  • Frequency: an enum for coupon frequencies from Daily (252/year) through Annually (1/year)
  • DateRollingConvention: Actual, Following, Modified Following, Preceding, Modified Preceding, and Modified Rolling conventions for adjusting non-business dates

Usage

Use day count conventions whenever computing accrued interest, discount factors, coupon amounts, or year fractions between dates. The choice of convention is specified in the instrument's terms and affects pricing. For example, US Treasury bonds use Actual/Actual, while LIBOR-based instruments typically use Actual/360.

Theoretical Basis

The day count factor (DCF) represents the fraction of a year between two dates:

DCF(d1,d2)=DayCount(d1,d2)Basis

For Actual/360: DCF=d2d1360

For 30/360 ISDA: DCF=360(Y2Y1)+30(M2M1)+(D2D1)360

where D1 and D2 are adjusted according to the specific 30/360 variant rules.

For Actual/Actual ISDA:

DCF=days in non-leap year portion365+days in leap year portion366

The day count factor is used in the fundamental interest calculation:

Interest=Principal×Rate×DCF(d1,d2)

Related Pages

Implemented By

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment