finos / FDC3

An open standard for the financial desktop.
https://fdc3.finos.org
Other
193 stars 115 forks source link

Standardize the representation of currency pairs by fdc3.instrument #1291

Open kriswest opened 1 month ago

kriswest commented 1 month ago

Currency pairs are not currently represented in a Standard way by FDC3 Context types. An fdc3.currency type exists as does a convention for fields that represent a currency (see: https://fdc3.finos.org/docs/next/context/spec#currency-codes), but no convention or type representing a currency pair, which are commonly traded instruments.

Currencies themselves are standardized via 3 letter codes defined in ISO 4217 Currency pairs are defined by convention based on two such code, bought currency first, sold currency second with an optional / character in between.

This proposal seeks to standardize currency pairs in the form including a / (e.g. "GBP/USD") as part of the Context Part's field type conventions, and to standardize the key "CURRENCY_PAIR" in the fdc3.instrument type's id field.

openfin-johans commented 1 month ago

Hi @kriswest, I don't disagree or doubt you about the convention of currency pairs but would be great if we could get some verification from data providers and app developers that it's how they use it today and would be generally open to utilize this new format.

Uppercase will show that it's a specific format but perhaps we should use FDC3.CURRENCY_PAIR to further make it clear that it's a format defined by FDC3 as most others have the "vendor" in the name or are well known names eg ISIN, RIC, FDS_ID

So basically FDC3.CURRENCY_PAIR would be ("CURRENCY_ISOCODE for bought currency" + "/" + "CURRENCY_ISOCODE for sold currency") and anything else would be considered invalid?

timjenkel commented 1 month ago

This was previously brought up with #227 which suggested using "ticker": "GBPUSD". We were using this recommendation, but I prefer your suggestion. Using a separate CURRENCY_PAIR type will prevent any confusion with equity tickers, and I also think "GBP/USD" is clearer and more commonly used than "GBPUSD".

Just the currency pair would be sufficient for currency spot trades. We might want to also consider standardizing the representation for currency forwards (which need both the currency pair and a settlement date) and currency swaps, (which need a currency pair and two settlement dates).

nemery-flextrade commented 1 month ago

Hi,

Every liquidity provider I've interacted with at Flex (either bank or ECN) has used the format of XYZ/ABC, while it is a convention rather than a standard it is a very ubiquitous one.

To Tim's point about settlement dates it is worth considering the concept of 'standard tenors' as well, these are things like SP, 1W, 1M (Spot, 1 Week, 1 Month respectively) where the tenor remains a constant and the underlying settlement date rolls over time. At first glance it seems simply using the underlying settlement dates covers this but you could well want to see a chart of a standard tenor price over a period, for example (likely in this situation you would use a stacked line chart or similar to visualise the spot price and forward point components separately).

Agree that currency swaps are also a widely traded thing and standard tenors could apply here as well.

nemery-flextrade commented 1 month ago

Additionally, to Johan's query: Given the rise of cryptocurrency trading (most of which do not have ISO codes to my knowledge) is it worth making this a case of "When a fiat currency is part of the currency pair the ISO 4217 code MUST be used where it exists"?

kriswest commented 1 month ago

@nemery-flextrade are there also some minor currencies that fall outside of ISO 4217? If so that wording would be useful.

kriswest commented 1 month ago

@timjenkel @nemery-flextrade Regarding forwards and swaps, would these be better modelled as products, with an instrument as part of their definition: https://fdc3.finos.org/docs/next/context/ref/Product

The product type is in need of extension to be able to describe tradeable products properly - and may be where some understanding of the Common Domain Model might be useful.

nemery-flextrade commented 1 month ago

@nemery-flextrade are there also some minor currencies that fall outside of ISO 4217? If so that wording would be useful.

Minor currencies exist but aren't officially part of 4217, they're usually represented as either the first two letters of the major then X e.g. GBX or first two letters then the first letter of the minor unit in lower case e.g. USc (US Cent). That said, these aren't typically used in FX trading (to my knowledge), they tend to be used more in the case of equities pricing for example.

@timjenkel @nemery-flextrade Regarding forwards and swaps, would these be better modelled as products, with an instrument as part of their definition: https://fdc3.finos.org/docs/next/context/ref/Product

The product type is in need of extension to be able to describe tradeable products properly - and may be where some understanding of the Common Domain Model might be useful.

I think this is what we were discussing when we dipped our foot in this pool some time ago, I remember one of the gents on the call saying especially for swaps that they create a product ID representing a given swap deal internally so maybe that is the way to go, at least for swaps. I guess the question is - is a spot trade on day X considered a different product than a spot trade on day Y? Or do we support both, a simple instrument of XYZ/ABC for spot rates and for anything with a forward component require a product structure?

wvos commented 3 weeks ago

the product structure is a good idea for qualification purposes, ideally adding a couple more fields. With reference to the "instrument" component in the FIX protocol https://fiximate.fixtrading.org/en/FIX.Latest/cmp1003.html, the likes of a SecurityType defines what type of instrument it is (spot, forward, swap, option, or other type), while separate fields are used to indicate maturity date/tenor

So basically FDC3.CURRENCY_PAIR would be ("CURRENCY_ISOCODE for bought currency" + "/" + "CURRENCY_ISOCODE for sold currency") and anything else would be considered invalid?

Ideally we have a market convention followed as Base Currency/Quoted Currency to avoid confusion with inverted quotes. For example, GBP/USD will have a rate quoted as 1.29523 while USD/GBP would be 0.7806