FX Rates Service
With the ReferenceCurrency context value you can change the dashboard’s currency for the Value-at-Risk, sensitivities, PL and other measures.
Please note, that some of the measures will remain unaffected when the reference currency is changed, the measures in this list display values in the native currency by design. Please refer to the individual measures documentation for more information.
Default Reference Currency
If the ReferenceCurrency is not set, the results will be converted into the default calculation currency configured in the application properties (fx-rates.common-currency
in the risk.properties
).
Market data
The FX Rates are defined along the [AsOfDate] dimension to allow for historical rate conversions.
Multiple data sets - official end-of-date, trader’s marks, etc - can be provided, and each data set will have to list the applicable currency pairs. 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: 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:
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 data store.
-
In most cases, the algorithm will simply lookup the rate based on these key fields: AsOfDate, BaseCcy, CounterCcy. Initially the algorithm will search for the rate that will have AsOfDate, NativeCurrency, 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 therisk.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:
AsOfDate | BaseCcy | CounterCcy | FxRate |
---|---|---|---|
2019-01-01 | EUR | CHF | 1.0794 |
The risk in CHF will be displayed as 107.94 = 100 x 1.0794.
FX Crosses Example
- Let’s imagine a user wishes to see the measures expressed in CHF - she selects “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 will use EUR as the common currency.
- The relevant FxRates for the business date:
AsOfDate | BaseCcy | CounterCcy | FxRate |
---|---|---|---|
2019-01-01 | EUR | CHF | 1.0794 |
2019-01-01 | EUR | KZT | 370.0427 |
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 will be displayed as 0.2916961 = 100 x 0.002916961.
See also
- Delta FX Rate (cube)
- Gamma FX Rate (cube)
- MarketDataSet (cube)
- ReferenceCurrency (cube)
- VaR FX Rate (cube)
- Vanna FX Rate (cube)
- Vega FX Rate (cube)