Datastore Helper implementation within MR
This page provides implementation details about the usage of the Datastore Helper 3.4.0-AS6.1 library within Atoti Market Risk, focusing on the wiring between different datastore definitions and customizations. For documentation of the library itself, see the Datastore Helper Documentation.
Implementations of the AConfigurableSchema class
All the MR libraries datastores are provided as
extensions of the AConfigurableSchema
and ATenorAwareSchema
classes. These classes are exposed as individual beans or annotated as @Configuration
,
then collected and applied to the IDatastoreConfigurator
object in the DatastoreConfiguratorSetup
class.
The full list of store definitions is as follows:
Class | Datastore contents | Exposed as |
---|---|---|
CubeMarketDataStore |
Cube market data. | A bean in the CubeMarketDataRetrievalConfig class. |
CurveMarketDataStore |
Curve market data. | A bean in the CurveMarketDataRetrievalConfig class. |
FxRateMarketDataStore |
FX rates. | A bean in the FxRateMarketDataRetrievalConfig class. |
SpotMarketDataStore |
Spot market data. | A bean in the SpotMarketDataRetrievalConfig class. |
SurfaceMarketDataStore |
Surface market data. | A bean in the SurfaceMarketDataRetrievalConfig class. |
BookHierarchyStoreConfig |
A multi-level book hierarchy. | @Configuration class wired directly. |
BookParentChildStoreConfig |
A parent-child book hierarchy. | @Configuration class wired directly. |
CounterpartyHierarchyStoreConfig |
A multi-level counterparty hierarchy. | @Configuration class wired directly. |
CounterpartyParentChildStoreConfig |
A parent-child counterparty hierarchy. | @Configuration class wired directly. |
CounterpartyStoreConfig |
Counterparty information. | @Configuration class wired directly. |
CountryStoreConfig |
Country information. | @Configuration class wired directly. |
LegalEntityHierarchyStoreConfig |
A multi-level legal entity hierarchy. | @Configuration class wired directly. |
LegalEntityParentChildStoreConfig |
A parent-child legal entity hierarchy. | @Configuration class wired directly. |
MarketShiftStoreConfig |
Market shifts. | @Configuration class wired directly. |
RiskFactorsCatalogueStoreConfig |
Risk factors information. | @Configuration class wired directly. |
ScenariosStoreConfig |
Scenarios per set. | @Configuration class wired directly. |
TradeAttributesStoreConfig |
Trade attributes. | @Configuration class wired directly. |
CounterpartyToCountryReferenceConfig |
References between the Counterparty and Country stores. | @Configuration class wired directly. |
TradeAttributesToBookHierarchyReferenceConfig |
References between the Trade Attributes and Book Hierarchy stores. | @Configuration class wired directly. |
TradeAttributesToCounterpartyHierarchyReferenceConfig |
References between the Trade Attributes and Counterparty Hierarchy stores. | @Configuration class wired directly. |
TradeAttributesToCounterpartyReferenceConfig |
References between the Trade Attributes and Counterparty stores. | @Configuration class wired directly. |
TradeAttributesToLegalEntityHierarchyReferenceConfig |
References between the Trade Attributes and Legal Entity Hierarchy stores. | @Configuration class wired directly. |
PnLStoreConfig |
Standard PnL store. | @Configuration class wired directly. |
PnLAggregatedStoreConfig |
Denormalized store for PnL aggregated imports. | @Configuration class wired directly. |
CorrelationMarketDataStore |
Correlation market data. | A bean in the CorrelationMarketDataRetrievalConfig class. |
DividendMarketDataStore |
Dividend market data. | A bean in the CorrelationMarketDataRetrievalConfig class. |
DynamicTenorsStoreConfig |
Dynamic tenors for rebucketing. | @Configuration class wired directly. |
SensiLaddersStoreConfig |
Sensitivity ladders. | @Configuration class wired directly. |
SplitRatioMarketDataStore |
Split ratios for equity instruments. | A bean in the CorporateActionMarketDataRetrievalConfig class. |
TradeSensitivitiesStoreConfig |
Standard sensitivity data. | @Configuration class wired directly. |
SensiAggregatedStoreConfig |
Denormalized store for sensitivity aggregated imports. | @Configuration class wired directly. |
SensiFlatStoreConfig |
Denormalized store for sensitivity store-level imports. | @Configuration class wired directly. |
TradeSensitivitiesToRiskFactorsCatalogueReferenceConfig |
References between the Trade Sensitivities and Risk Factors Catalogue stores. | @Configuration class wired directly. |
TradeSensitivitiesToTradeAttributesReferenceConfig |
References between the Trade Sensitivities and Trade Attributes stores. | @Configuration class wired directly. |
VaRStoreConfig |
Standard VaR data. | @Configuration class wired directly. |
VaRAggregatedStoreConfig |
Denormalized store for VaR aggregated imports. | @Configuration class wired directly. |
VaRFlatStoreConfig |
Denormalized store for VaR store-level imports. | @Configuration class wired directly. |
Several additional classes are provided to allow groups of stores and references to be imported together:
Class | Details | Imported classes |
---|---|---|
AllCommonStoresConfig |
Stores used in multiple cubes. | MarketShiftStoreConfig . |
AllStandardStoresConfig |
Stores used regardless of cube. | BookHierarchyStoreConfig , BookParentChildStoreConfig , CounterpartyHierarchyStoreConfig , CounterpartyParentChildStoreConfig , CounterpartyStoreConfig , LegalEntityHierarchyStoreConfig , LegalEntityParentChildStoreConfig , MarketDataSetStoreConfig , RiskFactorsCatalogueStoreConfig , ScenariosStoreConfig , TradeAttributesStoreConfig . |
AllStandardReferencesConfig |
References used regardless of cube. | CounterpartyToCountryReferenceConfig , TradeAttributesToBookHierarchyReferenceConfig , TradeAttributesToCounterpartyReferenceConfig , TradeAttributesToCounterpartyHierarchyReferenceConfig , TradeAttributesToLegalEntityHierarchyReferenceConfig . |
AllSensiStoresConfig |
Stores used for the sensitivity cube. | DynamicTenorsStoreConfig , SensiLaddersStoreConfig , TradeSensitivitiesStoreConfig . |
AllSensiReferencesConfig |
References used for the sensitivity cube. | TradeSensitivitiesToRiskFactorsCatalogueReferenceConfig , TradeSensitivitiesToTradeAttributesReferenceConfig . |
The DatastoreConfiguratorSetup class
All Spring beans are collected in the DatastoreConfiguratorSetup class. The@Configuration
classes are expected to be made
conditional on application properties and thus result in the correct set of datastores for each run mode.
Customizations should be created as DatastoreConfiguratorConsumer
beans, which are then collected by the class constructor:
public DatastoreConfiguratorSetup(
List<IConfigurableSchema> schemas,
@Autowired(required = false) List<DatastoreConfiguratorConsumer> customisations) {
this.schemas = schemas;
this.customisations = customisations;
}
Customizations classes
Atoti Market Risk contains two customization classes that
instantiate DatastoreConfiguratorConsumer
beans.
Class | Usage |
---|---|
DatastoreCustomisations | Empty class intended to provide a place to define simple customizations. |
ProductControlDatastoreCustomisations | Operates on the PnL base store. Makes the Type field a key field and adds Monthly , Yearly and Lifetime value fields. |