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 inFxRatesServiceConfig:
FRTBPostProcessorConfig.apManagerInitPrerequisitePluginInjections():
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:
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:- Override
updateLeafCoordinatesFunctionto register the Parameter Set level as an extra leaf level using aLocationFunction:
- Override
getFxRateto read the parameter set fromleafCoordinatesand return the appropriate rate: