The FX Rates service controls how currency conversion is performed across all cubes. By default, creates aDocumentation Index
Fetch the complete documentation index at: https://docs.activeviam.com/llms.txt
Use this file to discover all available pages before exploring further.
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:
| Method | Purpose |
|---|---|
getFxRate(...) | Returns the FX rate for a given currency pair. The leafCoordinates parameter carries any extra coordinates registered by updateLeafCoordinatesFunction (e.g. the parameter set). |
updateLeafCoordinatesFunction(...) | Registers extra leaf levels that the FX post-processor should resolve at query time. Return a LocationFunction whose getRequiredLevels() declares the extra levels and whose apply() extracts the coordinate from the query location. |
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:
Related classes
| Class | Module | Description |
|---|---|---|
FxRatesServiceConfig | frtb-activepivot | Default bean definition |
FRTBPostProcessorConfig | frtb-activepivot | Injection into post-processors |
ScenarioFxRates | frtb-core | Default implementation (extends FxRates) |
IScenarioFxRates | frtb-core | Interface adding scenario FX vector support |
IFxRates | common-accelerator-library | Base interface for FX rate retrieval |
LocationFunction | common-accelerator-library | Interface for registering extra leaf levels |