Market data retrieval in the market data API data model
The market data API allows the retrieval of either:
- a single market data corresponding to a key defining the market data
- all the market data corresponding to a curve, a surface, or a cube
Market data retrieval interfaces
Interfaces for market data retrieval are defined in the package com.activeviam.marketdata.api.retrievers.intf
Interface | Description | Methods |
---|---|---|
IInstrumentMarketDataRetriever |
Interface for a market data retriever that retrieves a single market data value relating to an instrument. | getMarketData(asOfDate, marketDataSet, instrumentId) |
ICurveMarketDataRetriever |
Interface for a market data retriever for curve (1-axis) market data. | getMarketData(asOfDate, marketDataSet, curveId, tenor) , getCurve(asOfDate, marketDataSet, curveId) |
ISurfaceMarketDataRetriever |
Interface for a market data retriever for surface (2-axis) market data. | getMarketData(asOfDate, marketDataSet, surfaceId, tenor, moneyness) , getSurface(asOfDate, marketDataSet, surfaceId) |
ICubeMarketDataRetriever |
Interface for a market data retriever for cube (3-axis) market data. | getMarketData(asOfDate, marketDataSet, cubeId, tenor, moneyness, maturity) , getCube(asOfDate, marketDataSet, cubeId) |
IFxRateMarketDataRetriever |
Interface for a market data retriever that retrieves FX rates. | getMarketData(asOfDate, marketDataSet, baseCcy, counterCcy) |
IContextualInstrumentMarketDataRetriever |
Interface for a market data retriever that retrieves a single market data value relating to an instrument. The retrieval may be modified by a provided MarketDataRetrieverContext . |
getMarketData(asOfDate, marketDataSet, instrumentId, context) |
IContextualCurveMarketDataRetriever |
Interface for a market data retriever for curve (1-axis) market data. The retrieval may be modified by a provided MarketDataRetrieverContext . |
getMarketData(asOfDate, marketDataSet, curveId, tenor, context) , getCurve(asOfDate, marketDataSet, curveId, context) |
IContextualSurfaceMarketDataRetriever |
Interface for a market data retriever for surface (2-axis) market data. The retrieval may be modified by a provided MarketDataRetrieverContext . |
getMarketData(asOfDate, marketDataSet, surfaceId, tenor, moneyness, context) , getSurface(asOfDate, marketDataSet, surfaceId, context) |
IContextualCubeMarketDataRetriever |
Interface for a market data retriever for cube (3-axis) market data. The retrieval may be modified by a provided MarketDataRetrieverContext . |
getMarketData(asOfDate, marketDataSet, cubeId, tenor, moneyness, maturity, contex) , getCube(asOfDate, marketDataSet, cubeId, context) |
IContextualFxRateMarketDataRetriever |
Interface for a market data retriever that retrieves FX rates. The retrieval may be modified by a provided MarketDataRetrieverContext . |
getMarketData(asOfDate, marketDataSet, baseCcy, counterCcy, context) |
Market data retrieval implementations
Implementations for market data retrieval are defined in the package com.activeviam.marketdata.api.retrievers.impl
.
Class | Description | Details |
---|---|---|
TableInstrumentMarketDataRetriever |
Implements ICurveMarketDataRetriever . |
Returns instrument market data values. |
TableCurveMarketDataRetriever |
Implements ICurveMarketDataRetriever . |
Returns single market dates values from a curve, or whole curves. |
TableSurfaceMarkok,etDataRetriever |
Implements ISurfaceMarketDataRetriever . |
Returns single market dates values from a surface, or whole surfaces. |
TableCubeMarketDataRetriever |
Implements ICubeMarketDataRetriever . |
Returns single market dates values from a cube, or whole cubes. |
TableFxRateMarketDataRetriever |
Implements IFxRateMarketDataRetriever . |
Returns FX rates. |
DateShiftingInstrumentMarketDataRetriever |
Implements ICurveMarketDataRetriever . |
Returns instrument market data values after applying a shift to the provided asOfDate. |
DateShiftingCurveMarketDataRetriever |
Implements ICurveMarketDataRetriever . |
Returns single market dates values from a curve, or whole curves after applying a shift to the provided asOfDate. |
DateShiftingSurfaceMarkok,etDataRetriever |
Implements ISurfaceMarketDataRetriever . |
Returns single market dates values from a surface, or whole surfaces after applying a shift to the provided asOfDate. |
DateShiftingCubeMarketDataRetriever |
Implements ICubeMarketDataRetriever . |
Returns single market dates values from a cube, or whole cubes after applying a shift to the provided asOfDate. |
DateShiftingCubeMarketDataRetriever |
Implements IFxRateMarketDataRetriever . |
Returns FX rates after applying a shift to the provided asOfDate. |
MarketDataDateShift
The MarketDataDateShift
defined in the package com.activeviam.marketdata.api.dates.impl
is an enum with the following values:
Value | Details |
---|---|
CURRENT_DAY |
Used to retrieve the current day with regard to a base date. |
NEXT_DAY |
Used to retrieve the next day with regard to a base date. |
PREVIOUS_DAY |
Used to retrieve the previous day with regard to a base date. |
Retrieval context
The market data retrieval context is defined in the class MarketDataRetrieverContext
in the package com.activeviam.marketdata.api.retrievers.intf
.
It is used to define:
- the name of the retrieval
- the query cache that is used
- the
MarketDataDateShift
(see above).
Date retrieval interfaces
Interfaces for date retrieval are defined in the package com.activeviam.marketdata.api.dates.intf
Interface | Description | Details |
---|---|---|
IDateRetriever |
Interface to retrieve all the asOfDates present in market data inputs. | Used for the retrieval of the previous or the next day with regards to a given asOfDate. |
IContextualDateRetriever |
Interface for the retrieval of the current, previous or the next day with regard to a given asOfDate. | Takes an asOfDate and a MarketDataRetrieverContext object as inputs. |
Date retrieval implementations
Implementations for date retrieval are defined in the package com.activeviam.mr.common.services.marketdata.dates.impl
.
Interface | Description | Details |
---|---|---|
TableDateRetriever |
Implementation of IDateRetriever . |
Returns all the dates present in a given table in an IDatabase object. |
DateShiftingDateRetriever |
Implementation of IContextualDateRetriever . |
Returns a shifted date (i.e. the current, next or previous date) with an asOfDate and a MarketDataRetrieverContext object as inputs. |
Coordinate Translator Interface
The interface used to translate market data coordinates used to retrieve market data (i.e. modify the coordinates based on a given MarketDataRetrieverContext
(see above)) is defined in the package
com.activeviam.marketdata.api.translators.intf
.
The translation is meant to modify the asOfDate passed in the coordinates in order to return a key containing the previous or next day with regard to the original asOfDate.
Interface | Description | Details |
---|---|---|
IMarketDataCoordinateTranslator |
Interface for market data coordinates translators | Uses IContextualDateRetriever to translate a key based on a MarketDataRetrieverContext . |
Key Translator Implementation
The implementation used to translate a coordinates used to retrieve market data is defined in the package com.activeviam.marketdata.api.translators.impl
.
Interface | Description | Details |
---|---|---|
DateShiftTranslator |
Implementation of IMarketDataCoordinateTranslator . |
Shifts the provided date by using an underlying IContextualDateRetriever . |
Market data retrieval service
IMarketDataRetrievalService
(in com.activeviam.marketdata.api.services.intf
) provides a higher level interface for retrieving market data. Whereas I...MarketDataRetriever
objects retrieve data only from a specified store, retrieval services are expected to contain business logic relating to the collection of market data for specific uses. This may entail calls to multiple underlying retrievers or interpolation services.
The only current implementation of IMarketDataRetrievalService
is an abstract class: ACachingMArketDataRetrievalService
that handles caching of market data values in an IQueryCache
at runtime.
Spring configuration classes
Several Spring configuration classes are provided in the com.activeviam.marketdata.api.configuration.retrievers
package of the market-data-api-spring-boot-starter
module, providing Datastore Helper (DASH) stores and retrievers as Spring beans. When you add the starter as a dependency in your project, the CubeMarketDataRetrievalConfig
, CurveMarketDataRetrievalConfig
, FxRateMarketDataRetrievalConfig
, InstrumentMarketDataRetrievalConfig
, and SurfaceMarketDataRetrievalConfig
classes will be auto-configured.
Class | Details |
---|---|
CubeMarketDataStoreConfig |
Publishes a cube store bean along with associated date retrievers and translators. This also configures an IContextualCubeMarketDataRetriever bean that can be overridden by providing a bean of the same type. |
CurveMarketDataStoreConfig |
Publishes a curve store bean along with associated date retrievers and translators. This also configures an IContextualCurveMarketDataRetriever bean that can be overridden by providing a bean of the same type. |
FxRateMarketDataStoreConfig |
Publishes an FX rate store bean along with associated date retrievers and translators. This also configures an IContextualFxRateMarketDataRetriever bean that can be overridden by providing a bean of the same type. |
InstrumentMarketDataStoreConfig |
Publishes an instrument store bean along with associated date retrievers and translators. This also configures an IContextualInstrumentMarketDataRetriever bean that can be overridden by providing a bean of the same type. |
SurfaceMarketDataStoreConfig |
Publishes a surface store bean along with associated date retrievers and translators. This also configures an IContextualSurfaceMarketDataRetriever bean that can be overridden by providing a bean of the same type. |