Class ScalarMarketDataRetrievalService
- java.lang.Object
-
- com.activeviam.risk.ref.services.impl.AMarketDataRetrievalService
-
- com.activeviam.risk.ref.services.impl.ScalarMarketDataRetrievalService
-
- All Implemented Interfaces:
IMarketDataRetrievalService
public class ScalarMarketDataRetrievalService extends AMarketDataRetrievalService
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.activeviam.risk.core.services.IMarketDataRetrievalService
IMarketDataRetrievalService.IPillar, IMarketDataRetrievalService.IPillarSet, IMarketDataRetrievalService.MarketType
-
-
Field Summary
-
Fields inherited from class com.activeviam.risk.ref.services.impl.AMarketDataRetrievalService
defaultValue, doubleInterpolation, interpolationConfiguration, vectorInterpolation
-
-
Constructor Summary
Constructors Constructor Description ScalarMarketDataRetrievalService(IMaturityConverter maturityConverter, IInterpolationConfiguration interpolationConfiguration, double defaultValue, String tenorAndMaturityDefaultValue, String moneynessDefaultValue)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected com.qfs.store.record.IRecordReader
fetchMarketData(IServiceContext context, LocalDate date, String marketDataSet, String riskFactor, IntFunction<Object> labels, IntFunction<Object> dates)
Attempts to fetch a market data record by its key.double[]
getMarketData(IServiceContext context, LocalDate date, String marketDataSet, String sensitivityKind, String sensitivityName, String riskClass, String riskFactor, IMarketDataRetrievalService.IPillarSet[] requestedPillars, boolean interpolate, IMarketDataRetrievalService.MarketType type, String debugKey)
This function is overridden in order to add an optimisation in case of single non interpolated data retrievalprotected com.qfs.store.record.IRecordReader
getMarketDataRecord(IServiceContext context, LocalDate date, String marketDataSet, String riskFactor, IMarketDataRetrievalService.IPillarSet[] requestedPillars)
Method that retrieves the market data for the current dayprotected Double
getNominal(IServiceContext context, LocalDate date, String marketDataSet, String sensitivityKind, String sensitivityName, String riskClass, String riskFactor)
Retrieve the nominal of a risk factorprotected IMarketDataset<double[],Double>
getRawMarketData(IServiceContext context, LocalDate date, String marketDataSet, String sensitivityKind, String sensitivityName, String riskClass, String riskFactor, int nrDim)
This function retrieves the data before any manipulationprotected IMarketDataset<com.qfs.vector.IVector[],com.qfs.vector.IVector>
getRawPnlVector(IServiceContext context, LocalDate date, String scenario, String marketDataSet, String sensitivityKind, String sensitivityName, String riskClass, String riskFactor, int nrDim)
This function retrieves the data before any manipulationboolean
isSingleValue(IMarketDataRetrievalService.IPillarSet[] requestedPillars)
Return the number of elements corresponding to the requested pillars-
Methods inherited from class com.activeviam.risk.ref.services.impl.AMarketDataRetrievalService
computeShift, extractData, fillResult, findMapping, getMarketDataForShiftNormalization, getMarketDataInterpolationFlag, getMarketDataNoInterpolate, getPillarSets, getPillarVectorMap, getPnlVector, getShiftDataInterpolationFlag, handleAbsoluteRelativeResult, handleAbsoluteRelativeResult, recToPillar, runAsCompiledQuery
-
-
-
-
Constructor Detail
-
ScalarMarketDataRetrievalService
public ScalarMarketDataRetrievalService(IMaturityConverter maturityConverter, IInterpolationConfiguration interpolationConfiguration, double defaultValue, String tenorAndMaturityDefaultValue, String moneynessDefaultValue)
-
-
Method Detail
-
getRawMarketData
protected IMarketDataset<double[],Double> getRawMarketData(IServiceContext context, LocalDate date, String marketDataSet, String sensitivityKind, String sensitivityName, String riskClass, String riskFactor, int nrDim)
Description copied from class:AMarketDataRetrievalService
This function retrieves the data before any manipulation- Specified by:
getRawMarketData
in classAMarketDataRetrievalService
- Parameters:
context
- The caller contextdate
- The requested datemarketDataSet
- The requested datasetsensitivityKind
- The type of sensitivity delta / gamma /vega / ....sensitivityName
- Th underlying nameriskClass
- the risk classriskFactor
- The requested namenrDim
- The number of dimension of the result- Returns:
- A list of MD and its axis description
-
getRawPnlVector
protected IMarketDataset<com.qfs.vector.IVector[],com.qfs.vector.IVector> getRawPnlVector(IServiceContext context, LocalDate date, String scenario, String marketDataSet, String sensitivityKind, String sensitivityName, String riskClass, String riskFactor, int nrDim)
Description copied from class:AMarketDataRetrievalService
This function retrieves the data before any manipulation- Specified by:
getRawPnlVector
in classAMarketDataRetrievalService
- Parameters:
context
- The caller contextdate
- The requested datescenario
- The requested datasetmarketDataSet
- The requested market data setsensitivityKind
- The type of sensitivity delta / gamma /vega / ....sensitivityName
- The underlyingriskClass
- The risk classriskFactor
- The requested namenrDim
- The number of dimension of the result- Returns:
- A list of pnl vector and its axis description
-
getNominal
protected Double getNominal(IServiceContext context, LocalDate date, String marketDataSet, String sensitivityKind, String sensitivityName, String riskClass, String riskFactor)
Description copied from class:AMarketDataRetrievalService
Retrieve the nominal of a risk factor- Specified by:
getNominal
in classAMarketDataRetrievalService
- Parameters:
context
- The caller contextdate
- The requested datemarketDataSet
- The requested datasetsensitivityKind
- The type of sensitivity delta / gamma /vega / ....sensitivityName
- The underlyingriskClass
- The risk classriskFactor
- The requested name- Returns:
- The value of the Nominal
-
getMarketData
public double[] getMarketData(IServiceContext context, LocalDate date, String marketDataSet, String sensitivityKind, String sensitivityName, String riskClass, String riskFactor, IMarketDataRetrievalService.IPillarSet[] requestedPillars, boolean interpolate, IMarketDataRetrievalService.MarketType type, String debugKey)
This function is overridden in order to add an optimisation in case of single non interpolated data retrieval- Specified by:
getMarketData
in interfaceIMarketDataRetrievalService
- Overrides:
getMarketData
in classAMarketDataRetrievalService
- Parameters:
context
- The caller contextdate
- The as of date of the market datamarketDataSet
- The set of data to look forsensitivityKind
- the type of sensitivity delta / gamma /vega / ....sensitivityName
- The kind of sensiriskClass
- The risk class of the requested market datariskFactor
- The name of the market datarequestedPillars
- The list of the requested pillar. For instance IPillarSets[0] for tenor, IPillarSets[1] for maturity, IPillarSets[2] for moneynessinterpolate
- Is the interpolation allowedtype
- The type of the returned market data : absolute means the market price in currency (for bonds price x nominal), relative to the nominal, raw aka as it is normally used / storedebugKey
- If not null will store debug info in the cache at the ket location- Returns:
- A list of values describing a vector / map / cube depending of the requested dimensions, coordinates are (i * size(j) + j) * size(k) + k
-
isSingleValue
public boolean isSingleValue(IMarketDataRetrievalService.IPillarSet[] requestedPillars)
Return the number of elements corresponding to the requested pillars- Returns:
- The size of the vector / map / cube / ...
-
getMarketDataRecord
protected com.qfs.store.record.IRecordReader getMarketDataRecord(IServiceContext context, LocalDate date, String marketDataSet, String riskFactor, IMarketDataRetrievalService.IPillarSet[] requestedPillars)
Method that retrieves the market data for the current day- Parameters:
context
- The caller contextdate
- as of datemarketDataSet
- market data set context valueriskFactor
- risk factorrequestedPillars
- The list of the requested pillar. For instance IPillarSets[0] for tenor, IPillarSets[1] for maturity, IPillarSets[2] for moneyness- Returns:
- market data for current day and tenor/maturity
-
fetchMarketData
protected com.qfs.store.record.IRecordReader fetchMarketData(IServiceContext context, LocalDate date, String marketDataSet, String riskFactor, IntFunction<Object> labels, IntFunction<Object> dates)
Attempts to fetch a market data record by its key.- Parameters:
context
- The caller contextdate
- The as of date.marketDataSet
- The market data set.riskFactor
- The risk factor.labels
- The array of label values.dates
- The array of date values.- Returns:
- An optional containing a market data record, if found.
-
-