FX Rates
Download sample file: FXData.csv
This file provides FX spot rates used for currency conversion.
This FX Rates file type is identified using the pattern: **/FXData*.csv (as specified by fx.data.file-pattern
).
This file is loaded using the FXRates topic. See the Topic Aliases table for an understanding of the topic aliases associated with each topic.
FXHistorical Topic
The FXHistorical topic has the same file format as FXData.csv. The difference is the file location.
- When loading the FXRates topic, the as-of date is provided in the scope and the file will be loaded from the corresponding directory.
- When loading the FXHistorical topic, no as-of date is provided in the scope and all FXData.csv files from the historical directory are loaded.
FX Conversion Formula
Input values are converted into the same currency according to this formula:
FxRate Lookup
The $FxRate$ for converting the input currency value into the target currency value is obtained based on the data in the FX Rates data store.
-
In most cases, the algorithm will simply look up the rate based on these key fields: AsOfDate, BaseCcy, CounterCcy. Initially the algorithm searches for the rate that has AsOfDate, input currency, target currency 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, target currency, input currency 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 input currency, let this result be referred to as “baseCcyComponent”
-
Search for the rate from commonCcy to the target currency, 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 we want the values expressed in CHF.
- The delivered risk for a position is 100 EUR: 100 is the risk value in units of input 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 we wish to see the values expressed in CHF.
- The delivered risk for a position is 100 KZT: 100 is the risk value in units of input 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 target 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.
Field | Key | Null | FieldType | Description | Example |
---|---|---|---|---|---|
BaseCurrency | Y | N | String | The left side of the currency pair. | |
CounterCurrency | Y | N | String | The right side of the currency pair | |
Rate | N | N | Double | Forex rate between the two currencies. | |
AsOfDate | Y | N | Date ‘YYYY-MM-DD’ | Timestamp (at close of business) for the data. |