SA ETL for SBM Vega
This topic covers the ETL specifics for the Vega files. It provides an overview of ETL for SBM Vega, ting with a dataflow diagram. A table shows you the fields included in each row of a Vega Sensitivity CSV Input Data file, indicating which stores these fields are copied to during the ETL process.
Additionally, it shows the key fields for vector creation and the fields that have the potential to be populated with vectors, as opposed to always containing scalar values.
Dataflow diagram
Vectorization
The following table provides information about the vectors employed within the Vega CSV Input files for each risk class:
Risk Class | Vector Information |
---|---|
- GIRR - CSR non-Sec - CSR Sec CTP - CSR Sec non-CTP - Equity - Commodity - FX |
Vega sensitivities (note for GIRR Vega it is two dimensional vector). The indices of the vectors are the option maturities (and for GIRR also the residual underlying maturities). |
PublisherUtils vectorization methods
This table describes The PublisherUtils methods used for vectorization:
Method | Parameters | Description |
---|---|---|
PublisherUtils.buildMatrixSensitivityAndCurrencyMaps | - tuples - publisherDataStructures - indexes - context |
|
PublisherUtils.buildVectorSensitivityAndCurrencyMaps | - tuples - publisherDataStructures - indexes - context |
This PublisherUtils method is used for Vector-based Vega. Once all rows are parsed, for an individual key, the lowest level map built in the call to the method above become the [dates] and [sensitivities] vectors. The map and interpolation required by Vector-based Vega will not be performed, as sensitivities are always a single value for a single tenor. |
Interpolation
All input vectors are interpolated onto FRTB vertices loaded from the following file:
frtb-starter/src/test/resources/data/configuration/Vertices.csv
All vertices in the FRTB project can be found within this file. Default vertices are based on the BCBS specification.
PublisherUtils interpolation methods
The Interpolation methods are shown within the following table:
Method | Parameters | Description |
---|---|---|
PublisherUtils.buildMatrixInterpolatedAndBaseTupleMaps | publisherDataStructures context parameterRetriever |
Interpolation happens on the flattened matrix, which consists of the flattened dates vector and the flattened Vega sensitivities vector. Based on these two vectors and the defined FRTB vertices, we employ linear interpolation to map input sensitivities onto FRTB-defined dates. |
PublisherUtils.buildVectorInterpolatedAndBaseTupleMaps | - publisherDataStructures - contextparameter - Retriever |
Once the interpolated sensitivities vector is created, we can build the Sensitivity and Base store tuples, using the appropriate variables. |
Normalization
Vega-relevant stores
The stores that are relevant for Vega are:
Stores |
---|
TradeBase Store |
Vega Store |
RiskFactorDescription Store |
UnderlyingDescription Store |
FX Buckets Store |
GIRR Buckets Store |
Mapping of SBM Vega CSV file fields onto the stores that they populate
Field from CSV file OR ColumnCalculator (if the CSV file field is null) |
TradeBase Store |
Vega Store |
RiskFactor Description Store |
Underlying Description Store | FXBuckets Store |
GIRRBuckets Store |
Key Fields for Vector Creation |
---|---|---|---|---|---|---|---|
AsOfDate | (AsOfDate) | (AsOfDate) | (AsOfDate) | (AsOfDate) | (AsOfDate) | (AsOfDate) | |
TradeId | (TradeId) | (TradeId) | |||||
RiskClass | (RiskClass) | (RiskClass) | (RiskClass) | (RiskClass) | |||
RiskMeasure | (Risk Measure) | (Risk Measure) | (Risk Measure) | ||||
OptionMaturity | (Option Maturity) | ||||||
UnderlyingMaturity | (Underlying Maturity) | ||||||
VegaSensitivities (vector-valued field) |
(VegaSensitivities) | ||||||
VegaCcy | (Ccy) | ||||||
RiskFactor OR RiskFactor ColumnCalculator |
(RiskFactor) | (RiskFactor) | (RiskFactor) | (RiskFactor) | |||
Type | (RiskFactorType) | (GIRR Curve Type) | |||||
RiskFactorCcy | (GIRR Ccy) | (Bucket) | |||||
Underlying | (Underlying) | (Underlying) | (Bucket) | (Curve) | |||
CSRQuality | (CSRQuality) | ||||||
CSRSector | (CSRSector) | ||||||
EquityEconomy | (EquityEconomy) | ||||||
EquityMarketCap | (EquityMarketCap) | ||||||
EquitySector | (EquitySector) | ||||||
CmtyLocation | (CmtyLocation) | ||||||
FXCounterCurrency | (FXCounterCurrency) | ||||||
ALWAYS UnderlyingFxCcy ColumnCalculator | (UnderlyingFxCcy) |
Column Calculators and Tuple Publishers
RiskFactorColumnCalculator
Risk Class | Creation Method for RiskFactor |
---|---|
Commodity | Risk Factor field value is created by concatenating Underlying CmtyGrade and CmtyLocation, using ‘space’ as a delimiter. |
GIRR | Risk Factor field value is created by concatenating Underlying and RiskFactorType, using ‘space’ as a delimiter. |
Equity | Risk Factor field value is created by concatenating Underlying and RiskFactorType, using ‘space’ as a delimiter. |
CSR non-Sec | Risk Factor field value is created by concatenating Underlying and RiskFactorType, using ‘space’ as a delimiter. |
CSR Sec CTP | Risk Factor field value is created by concatenating Underlying and RiskFactorType, using ‘space’ as a delimiter. |
CSR Sec non-CTP | Risk Factor field value is created by concatenating Underlying and RiskFactorType, using ‘space’ as a delimiter. |
FX | Risk Factor field value is created by using Underlying. |
The Tuple Publisher and Publisher Classes
The function of the TuplePublisher and its associated Publisher classes is to separate data in the incoming file row according to its relevance to particular stores and applying ETL logic to the incoming rows:
Tuple Publisher Class | Publisher Class | Function |
---|---|---|
RiskClassTuplePublisher | Splits fields according to the following criteria: - fields relevant to ADeltaPublisher OR AVegaPublisher OR ACurvaturePublisher - fields relevant to MarketDataPublisher (same one for all risk classes) - fields relevant to StaticDataPublisher classes for GIRR Buckets and FX Buckets |
|
AVegaPublisher (with risk-class-specific implementations defining the context) | AVegaPublisher applies vectorization/interpolation according to rules described in the specific sections on vectorization/interpolation. AVegaPublisher also publishes to TradeBase store |
|
RiskFactorDescriptionPublisher | RiskFactorDescriptionPublisher publishes to RiskFactorDescription store | |
UnderlyingPublisher | UnderlyingPublisher publishes to UnderlyingDescription store | |
StaticDataPublisher | StaticDataPublisher is a type that allows publishing of non-duplicated rows to a given store. Specific instances define the store (fxBucketsPublisher, girrBucketsPublisher). |