Exchange Rate and Market Data API

Relation between RiskFactor and currency pair

The IRiskFactorFXPairTranslator interface converts a risk factor into a currency pair and back.

It provides the following functions:

  • riskFactorToFxPair: Conversion of a risk factor into a currency pair.
  • fxPairToRiskFactor: Conversion of a currency pair into a risk factor.
  • isFxRiskFactor: Specifies whether a risk factor is an FX risk factor and can be converted into a currency pair.

This interface has two implementations:

  • RiskFactorFXPairTranslator: This translator assumes that RiskFactor=ccy1/ccy2.
  • LegacyRiskFactorFXPairTranslator: This translator makes the same transformation as RiskFactorFXPairTranslator and also makes [ccy]_FX Equivalent=EUR/ccy according to the sample dataset.

This service can be injected into any plugin with the interface IRiskFactorFXPairTranslatorAware. It is used by the Delta FX market data post-processor, the RiskFactor hierarchy, and the FX Shift service.

The LegacyRiskFactorFXPairTranslator bean is created on the configuration class RiskFactorFXPairTranslatorConfig.

Use of the market data API exchange rate

The Common Library FX post-processors are wired back to the Market Data API by a specific wrapper class that calls back the native Market Data API. This implementation is FXRateWrapper, and uses FxMarketDataRetrieverFactory to get the exchange rates.

note

The legacy implementations of the IFxRates (AFxRate, FXRates) directly read the FX Rate from the FxRateMarketData store. They shouldn’t be used anymore.

The RiskFactor hierarchy plugin

The HierarchyWithFxRiskFactors hierarchy plugin adds the FX Risk Factors in the Risk Factors hierarchy. This hierarchy plugin is a fact one level hierarchy based on the cube retrieval, which adds all possible FX Risk Factors to the members based on the available currencies and the currency-pair-to-risk-factor translator.

The FX Market Data post-processor

Atoti Market Risk uses a specific post-processor to compute the FX Delta market data: FxSpotMarketDataPostProcessor. It first tries to use the risk factor to find the currency pair. If the risk factor is not a currency pair, it assumes that the pair is RiskCurrency/RiskFactor.

Risk Factor Risk CCy Base Ccy Counter Ccy
USD/CAD * USD CAD
CAD USD USD CAD
CAD_FX Equivalent * EUR CAD