Skip to main content
Atoti Market Risk relies on the date conversion services from the Common Library to convert pillar values into durations. The business day calendar factory supplies the calendar that the DAY, EOM, EOQ, EOY and WDA members use to pick a date: the comparison date of day-to-day measures, or the market shift date of Taylor VaR.

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: Here are the parameters needed to make a 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:

Day count convention

The IDayCountConvention converts a pair of dates into a duration expressed in days or years. Several implementations are provided:

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: an IBusinessDayCalendar, despite its name, based on the TARGET2 settlement system calendar. It treats weekends and TARGET2 holidays, including Good Friday and Easter Monday, as closed. Its nested TargetBusinessDayConvention.Factory implements IBusinessDayCalendarFactory and is a ready-made alternative to the default factory.
  • NextBusinessDayConvention: returns the first open day on or after the date.

What is the business day calendar factory?

The IBusinessDayCalendarFactory interface builds the IBusinessDayCalendar consumed by day-to-day shift calculations. IBusinessDayCalendar exposes a single method, isBusinessDay(LocalDate date), which reports whether that date is open. These calculations pick the comparison date for day-to-day measures in the VaR-ES, VaR-ES Summary and Sensitivity cubes. Examples include VaR DtD and Taylor VaR DtD. The shift moves along the DayToDay analysis hierarchy relative to AsOfDate. A day-to-day measure subtracts the value at the shifted date from the value at AsOfDate. UnfilteredDateShiftPostProcessor resolves the shifted value with the DayToDay and date filters removed. A shift to a date with no loaded data therefore returns an empty result instead of an error. UnfilteredDateShiftPostProcessor and the IBusinessDayCalendar/IBusinessDayCalendarFactory interfaces come from the Common Library. The default factory and its qualifier belong to Atoti Market Risk. The factory bean is qualified with SP_QUALIFIER__BUSINESS_DAY_CALENDAR_FACTORY and defined in MaturityConverterConfig. This factory does not affect maturity or tenor conversion: the maturity converter is built without a calendar factory.

Why does the default factory treat every day as a business day?

The default implementation, PassThroughBusinessDayCalendarFactory, categorizes every day as a business day. Business day and holiday conventions differ by region and by client. Atoti Market Risk therefore ships no holiday calendar by default (see How to override the business day calendar factory for alternatives). To migrate from a version that used TargetBusinessDayConvention.Factory by default, see Updated business calendar logic.

How do day-to-day measures find the previous date?

Day-to-day measures compare the selected AsOfDate with the date picked by the DayToDay member. Members are set in mr.cubes.levels.day-to-day-members, each in the format Label=<KEY><offset>. The offset is an integer, signed when non-zero, for example Yesterday=DAY-1. DAY and the other calendar-based rules count business days through the business day calendar. CUB instead steps through the dates loaded in the cube and ignores the calendar. DAY-1 and CUB+1 both point to an earlier date. CUB moves through the AsOfDate members in hierarchy order, and AsOfDate is sorted newest first. CUB+1 is therefore the previous loaded date, and CUB-1 is the next one. If the selected AsOfDate is not loaded in the cube, the shift returns no result. CUB+1 skips dates with no data anywhere in the cube. A partial load, such as one missing book, is not skipped. With the default calendar every day is a business day. Yesterday=DAY-1 on a Monday points to Sunday. End Of Month=EOM-1 can equally point to a weekend day, for example 31 August 2025. If no data is loaded that day, the result is empty. The Previous member (CUB+1) fixes the Monday case but not the end-of-period members. Only a custom factory makes EOM-1 skip weekends. Taylor VaR’s default YESTERDAY=DAY-1 has the same Monday issue. To compare Monday with Friday, either:
Setting mr.cubes.levels.day-to-day-members replaces the whole default list. A configuration that lists only Previous loses Yesterday, Day-2, Tomorrow, and the end-of-period members.
The following configuration keeps every default member and makes Previous the default:

How to override the business day calendar factory

The Previous member (CUB+1) avoids most weekend and holiday gaps. End-of-period members, such as EOM-1, can still land on a day with no data. Replace the default factory when day-to-day shifts must follow a strict business day calendar. With a strict calendar, a business day with missing data shows an empty result instead of falling back to an earlier date.
The business day calendar factory also resolves the MarketShiftDate members used by Taylor VaR (mr.taylor.market-shift-date-specific). A custom factory changes the dates picked by both day-to-day measures and Taylor VaR.
Publish a @Primary bean under the SP_QUALIFIER__BUSINESS_DAY_CALENDAR_FACTORY qualifier, in a @Configuration class the application loads. Name the bean method differently from businessDayCalendarFactory, the default bean’s name in MaturityConverterConfig, or startup fails with BeanDefinitionOverrideException. CustomBusinessDayCalendarFactory below is a placeholder name for the custom IBusinessDayCalendarFactory implementation.
Replace it with an implementation of IBusinessDayCalendarFactory. Its only abstract method is:
databaseVersion is null on a query cube, such as MRCombinedCube or the query node of a distributed deployment, so a custom factory that reads it must handle that case. leafCoordinates can be empty. Taylor VaR always passes an empty list when it resolves MarketShiftDate, since it never calls the factory’s leaf-coordinates hook. A factory that picks a calendar per book or location can fill leafCoordinates for day-to-day measures. It does so through updateLeafCoordinatesFunction, a default method of ILeafCoordinatesService that IBusinessDayCalendarFactory extends. UnfilteredDateShiftPostProcessor calls it once, when the post-processor initializes. For each location it expands, it applies the returned function and passes the result to getBusinessDayCalendar as leafCoordinates. A factory used for both must still return a sensible calendar when leafCoordinates is empty. The following minimal factory treats weekends as closed and every other day as open. It follows the same shape as PassThroughBusinessDayCalendarFactory:
The Common Library’s TargetBusinessDayConvention.Factory is a ready-made alternative that skips weekends and TARGET2 holidays. It replaces the bean method in CustomBusinessDayCalendarFactoryConfig: