Day-Count Convention

Debt instruments use a day-count convention to calculate the amount of accrued interest when the next coupon payment is less than a full coupon period away.

The D-ASA MUST specify one day-count convention.

The day-count convention MUST be identified with one of the following enumerate IDs (uint8):

IDNameDaily interest calculation description
1030/360Using a 360-day year and 30-day months
3030/365Using a 365-day year and 30-day months
50Actual/360Using a 360-day year and the actual number of days in each time period
70Actual/365Using a 365-day year and the actual number of days in each time period
100Actual/ActualUsing the actual number of days in each time period
255ContinuousUsing the actual number of time units in each time period

The day-count convention defines the day-count factor as a fraction of:

  • Numerator: elapsed time of the accrual period to date;
  • Denominator: time of the full accrual period defined by the D-ASA time schedule.

The day-count convention MUST be set using the asset_config method.

đź“Ž EXAMPLE

Let’s have a D-ASA with time events defined as block’s timestamps (UNIX time). The D-ASA has the following coupon dates:

  • date1: starting date for the current coupon’s interest accrual, defined by the D-ASA time schedule;
  • date2: date through which the interest is being accrued (“to” date), equals to the current block timestamp;
  • date3: next coupon due date, defined by the D-ASA time schedule.

The day-count factor is calculated as:

Continuous convention (ID=255):

(date2 - date1) / (date3 - date1)

Actual/Actual convention (ID=100):

days_in(date2 - date1) / days_in(date3 - date1)

Where days_in returns the actual number of days (equal to 86400 seconds) in the time interval.