Date Conversion
The Atoti Market Risk relies on the date conversion services from the Common Library to convert pillar values into durations.
Maturity converter
The maturity converter service converts any pillar value into a duration, expressed in number of days,
year fraction or a date relative to the current date.
The interface of the bean is IMaturityConverter.
It can be injected into any Atoti plugin that extends the IMaturityConverterAware interface.
The interface provides the following services:
| Method | Description |
|---|---|
toYearFraction |
Converts a pillar into a number of years. |
toFraction |
Converts a pillar into a number of days. |
toDate |
Converts a pillar into a future date relative to the as-of date. |
Here are the parameters needed to make a conversion:
| Parameter | Type | Example | Meaning |
|---|---|---|---|
| pivot | IActivePivot | The current cube | Used to pass the current cube to the service. |
| databaseVersion | IDatabaseVersion | The current database | Used to pass the current database to the service. |
| asOfDate | LocalDate | 2023-02-27 | The current date used to find the right duration. |
| bucketType | BucketType | TENOR_INPUT | The kind of pillar, used to differentiate the tenor for the (underlying) maturity. |
| tenorSet | String | “Simple” | Used to select a specific set of tenors. |
| maturity | Object | 6M | The pillar to convert. |
| leafCoordinates | List<Object> | [] | Additional data to help the conversion. |
The default implementation provided is SimpleMaturityConverter.
Tenor converter
The tenor converter transforms a pillar and an as-of date into the target date.
The default implementation SimpleTenorConverter handles several pillar types:
| Type | Containing | Explanation | Examples |
|---|---|---|---|
| LocalDate | Date | The tenor is a fixed date. | 2035-03-12 |
| String | Overnight | One business day duration. | “ON”, “O/N” |
| String | Two nights | Two business days duration. | “TN”, “T/N” |
| Double | Years | A year fraction. | 1.5 |
| String | A duration | A duration. | “3D”, “6M”, “2W”, “1Y6M” |
| String | IMM date | 3rd Wednesday of the month. | “MAR24”, “SEP-2024” |
| String | ISO date | ISO 8601 date. | “2035-03-12” |
Day count convention
The IDayCountConvention converts a pair of dates into a duration expressed in days or years.
Several implementations are provided:
| Implementation | Rule | Description |
|---|---|---|
DayCount30on360ISDA |
A001 | All months have 30 days, year has 360 days. |
DayCountA360 |
A004 | Exact days, year is 360 days. |
DayCountA365Fixed |
A005 | Exact days, year is 365 days. |
DayCountActualActualISDA |
A008 | Exact days and years (366 or 365 depending on current year). |
DayCountActualActual |
A009 | Exact days and years (366 or 365 depending on last year). |
Business day calendar and convention
The IBusinessDayCalendar tells if a day is open or closed.
The IBusinessDayConvention finds the matching business day from a given date.
The common library provides:
TargetBusinessDayConvention: open days based on the Target2 settlement system calendar.NextBusinessDayConvention: returns the closest next open day.