Skip to main content
The FX Rates service controls how currency conversion is performed across all cubes. By default, creates a ScenarioFxRates bean that reads rates from the FXRates datastore table and supports scenario-specific FX vectors for IMA Expected Shortfall and Stress Calibration.

Default configuration

The bean is defined in FxRatesServiceConfig:
This bean is then injected into every FX post-processor and FX analysis hierarchy by FRTBPostProcessorConfig.apManagerInitPrerequisitePluginInjections():
No changes to FRTBPostProcessorConfig are needed when replacing the bean — the injection calls automatically pick up whichever IScenarioFxRates bean Spring resolves.

Replacing the FX Rates bean

To provide a custom FX rates implementation (for example, parameter-set-specific rates), create a new @Configuration class that extends FxRatesServiceConfig and override the fxRates() bean method:
The custom implementation must implement IScenarioFxRates (or extend ScenarioFxRates). The two key methods to implement or override are:

Example: parameter-set-specific FX rates

To return different FX rates depending on the Parameter Set dimension, the custom implementation should:
  1. Override updateLeafCoordinatesFunction to register the Parameter Set level as an extra leaf level using a LocationFunction:
  1. Override getFxRate to read the parameter set from leafCoordinates and return the appropriate rate: