This service is now deprecated for customizations. Taylor VaR measures implemented in Atoti Market Risk still use this implementation, but will be migrated in the future.Any newly created custom measures should use Atoti Market Data, wherever possible.
Spring
The market data retrieval service provides thecom.activeviam.accelerator.common.services.IMarketDataRetrievalService
interface as a Spring Bean. The Bean is instantiated on the
com.activeviam.mr.common.measures.MarketDataRetrievalServiceConfig
Spring configuration file. It has several implementations depending on
the Spring configuration.
Services
- getMarketData: returns a list of market data.
- getPnlVector: returns a list of PnL vectors used for the Taylor VaR.
- getCorporateAction: returns any corporate action related to the market data, such as dividend, coupon, or split.
Multi-dimension handling
The services are able to handle multi-dimension market data. The size of theIPillarSet[] requestedPillars on the services input parameters provides the number of requested dimensions. The returned array will contain the values for all the requested coordinates.
For instance, for a 3 dimensions request, the values for (x, y, z) will be at the location:
(x * requestedPillars[1].getSize() + y) * requestedPillars[2].getSize() + z
The request provides a pillar set of size 1 and then get back a single value.
Customization
Most of the customization should be performed on theIInterpolationConfiguration Bean that is injected to the service.
If you need to rely on additional parameters (extra levels for
instance), the property List<Object> ServiceContext.leafCoordinates;
can be used. It is filled by the custom user service Bean
com.activeviam.accelerator.common.services.ICustomParameters, instantiated in
com.activeviam.mr.common.measures.CustomParametersConfig.
If the input data need to be retrieved elsewhere or in a different way
than the standard one, you can override or replace
com.activeviam.mr.common.services.impl.MarketDataRetrievalService or
com.activeviam.mr.common.services.impl.ScalarMarketDataRetrievalService
for the service implementation.
If the non-interpolated way of matching pillars needs to be changed, the
class com.activeviam.accelerator.common.utils.ModifiedPillarSetOfPillar should
be used to encapsulate the requested pillar set. It overrides the
equality between pillars by a custom lambda function. This has to be
done on the InterpolationConfiguration.fixPillarSet(…) method.
The default double value for empty slots can be set on the constructor
of the service Bean.
Interpolation
We can choose to interpolate or not a dataset on the configuration Bean. We can set the following options:- Enable or disable the interpolation.
- Set the interpolation order.
- Specify a transformation to apply to a specific axis before the interpolation: and have to be provided.
com.activeviam.accelerator.common.services.impl.marketdataretrieval.InterpolationDoublefor double interpolation.com.activeviam.accelerator.common.services.impl.marketdataretrieval.InterpolationVectorfor IVector interpolation.
Nominal, absolute or relative price
The service can handle absolute or relative price. Take the following example of a bond:
We can see that the MtM of the Bond is Price * Nominal / 100 = 16116.00
EUR. For PnL computation we need to use the MtM, absolute price. To
achieve this, the following must be configured in the
InterpolationConfiguration class:
Retrieving the market price
The service and, by extension, the MarketDataPostProcessor can retrieve the market data as an absolute or relative price. This is done with theMarketType typeOfMarketData parameter.
For PnL explain and VaR, the market data must be expressed in absolute
price.
Corporate Action
The corporate action can be stored in the CorporateAction store or via any customization. Atoti Market Risk handles two corporate actions: dividend and split. Use the getCorporateAction function to retrieve these input data.Split
The market data retrieval service provides an option to integrate corporate splits into the market price to calculate PnL. This integration is defined by the function corporateActionOperator in theInterpolationConfiguration class.