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:| Instrument | Price | Nominal |
|---|---|---|
| CREDIT AGRICOLE 2% 02/05/27 EUR | 107.44 % | 15000.00 EUR |
InterpolationConfiguration class:
| Method | Expected return for the bond price | Explanation |
|---|---|---|
| isRelativeMarketData | true | Must return true for risk factor with relative price, so the formula is applied correctly |
| relativeToAbsoluteMarketDataOperator | (nominal, md) -> md * nominal / 100 | Transforms relative price to absolute price |
| absoluteToRelativeMarketDataOperator | (nominal, md) -> md / nominal * 100 | Transforms absolute price to relative price |
| relativeToAbsoluteShiftOperator | (md, shift) -> shift * md / 100 | Transforms the market shift used for VaR from relative to absolute |
| absoluteToRelativeShiftOperator | (md, shift) -> shift / md * 100 | Transforms the market shift used for VaR from absolute to relative |
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.
| MarketType | How Market Data is expressed |
|---|---|
| ABSOLUTE | An absolute price in currency. |
| RELATIVE | A price relative to the nominal price. |
| RAW | An absolute or relative price, depending on the way it is stored. The nominal is not used. |
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.
| Method | Expected return | Explanation |
|---|---|---|
| normalizationShiftOperator | (md, shift) -> normalized shift | Transforms the input shift into a shift fitted for the sensitivity stored in the Sensitivity Cube |