Skip to content

Making Sense of Base/Quote Currency Ordering for Symbol Strings #500

Closed
@nh43de

Description

@nh43de

Ok,

So typically a currency pair is expressed as BASE-QUOTE (note ordering)

E.g.

  • EUR-USD is 1.2
  • XLM-BTC is 0.0000077

Some exchanges list these reverse, e.g. Bittrex. For these exchanges that list the symbols in reverse, there is a property called MarketSymbolIsReversed which will translate symbols for the exchange properly. However, it does not function as designed.

When translating between global market symbols <->exchange symbols, there is some unexpected behavior based on our assumptions above. See the following evaluations (this is using the Bittrex API where MarketSymbolIsReversed = true):

image

  1. gms (global market symbol) above should be "XLM-BTC" because Bittrex symbols are reversed, and XLM is the base currency, so using global standards of BASE-QUOTE, it should be "XLM-BTC" but it does not evaluate as such

image

  1. ems (exchange market symbol) should be "BTC-XLM" because again, using global standards of BASE-QUOTE, and Bittrex is reversed, converting "XLM-BTC" global ticker to market ticker should evaluate to "BTC-XLM", which is the Bittrex market ticker
  2. ems2 is correctly evaluated to the exchange market symbol for Bittrex composed using the base/quote currency strings as separate inputs
  3. gms2, which is the global market symbol of the "BTC-XLM" market on the Bittrex exchange should be "XLM-BTC", again because XLM is the base currency

The comments in the code are confusing/ambiguous at best and contradictory at worst:

image

Can someone shed some light on this?

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions