FX Rates Service
With the ReferenceCurrency context value you can change the dashboard’s currency for input sensitivities and calculated margin.
Default reference currency
If the ReferenceCurrency is not set, the results are converted into the default calculation currency configured in the application properties (fx-rates.common-currency
in the simm.properties
).
Market data
The FX Rates are defined along the [AsOfDate] dimension to allow for historical rate conversions.
We don’t assume that all rates will be against the same currency. Please refer to the FxRate lookup section below for more information.
We expect that the rates are displayed in their natural way: the market convention for some currency pairs is to always be referenced in a certain way, such as always showing a rate that multiplies or divides one currency by the other. To simplify the coding, we have chosen a single unique way across all currency pairs such as always multiply, i.e. GBP/USD 1.55 means that the amount in GBP is multiplied by 1.55 to produce the amount in USD. Please refer to the [FX Conversion Formula] section below.
FX conversion formula
The conversion is applied according to this formula:
$$Value_{\text{reference currency}} = Value_{\text{native currency}} \cdot FxRate$$
FxRate lookup
The $FxRate$ for converting the native currency value into the reference currency value is obtained based on the data in the FX Rates datastore.
-
In most cases, the algorithm will simply look up the rate based on these key fields: AsOfDate, BaseCcy, CounterCcy. Initially, the algorithm will search for the rate that will have AsOfDate, NativeCurrency, and ReferenceCurrency in the key fields. See the Direct lookup example below.
-
If the rate was not found, the algorithm will try the indirect lookup - search rate by AsOfDate, ReferenceCurrency, NativeCurrency and take the reciprocal of the rate if found.
-
If the rate is still not found at this stage, the algorithm will compute the rate using the FX crosses via the “CommonCcy” configured in the application properties (
fx-rates.common-currency
in thesimm.properties
):- Search for the rate from CommonCcy to NativeCurrency, let this result be referred to as “baseCcyComponent”
- Search for the rate from commonCcy to the referenceCurrency, let this result be referred to as “counterCcyComponent”
- Compute the FxRate as counterCcyComponent divided by baseCcyComponent. See the FX Crosses example below.
Direct lookup example
- Let’s imagine you want to see the measures expressed in CHF. You select “CHF” using the ReferenceCurrency context value.
- The delivered risk for a position is 100 EUR: 100 is the risk value in units of native value currency EUR.
- The delivered FxRates for the business date are:
BaseCcy | CounterCcy | FxRate | AsOfDate |
---|---|---|---|
EUR | CHF | 1.0794 | 2019-01-01 |
The risk in CHF is displayed as 107.94 = 100 x 1.0794.
FX crosses example
- Let’s imagine you want to see the measures expressed in CHF. You select “CHF” using the ReferenceCurrency context value.
- The delivered risk for a position is 100 KZT: 100 is the risk value in units of native value currency KZT.
- The common currency is set to EUR, and the fx crosses use EUR as the common currency.
- The relevant FxRates for the business date are:
BaseCcy | CounterCcy | FxRate | AsOfDate |
---|---|---|---|
EUR | CHF | 1.0794 | 2019-01-01 |
EUR | KZT | 370.0427 | 2019-01-01 |
With CHF as the reference currency, the rate applicable to KZT exposure is computed as follows:
- baseCcyComponent = EUR/KZT = 370.0427
- counterCcyComponent = EUR/CHF = 1.0794
The KZT/CHF rate is computed as 1.0794/370.0427 = 0.002916961.
Hence, the risk in CHF is displayed as 0.2916961 = 100 x 0.002916961.