scrtlabs / catalyst

An Algorithmic Trading Library for Crypto-Assets in Python
http://enigma.co
Apache License 2.0
2.48k stars 724 forks source link

Use usdt instead of usd for Bitfinex #84

Open fredfortier opened 6 years ago

fredfortier commented 6 years ago

Bitfinex uses USD but it's just another tether. We should use usdt everywhere for consistency.

salihkilic commented 6 years ago

I found out that CCXT uses two ways of describing ID's of assets in "load_markets", namely "quote" which would sometimes also have a "quoteId" sister value in the same list. This is my little workaround for when I know an exchange has no fiat pairs.

    ```
    market_universe = exchange.load_markets()
    for x in market_universe:
        if 'quoteId' in market_universe[x]:
            base = market_universe[x]['quoteId']
        else:
            base = market_universe[x]['quote']

        # We catch USD/USDT naming differences between exchanges here
        # This does not work for exchanges that actually use USD (fiat) trading pairs
        if context.base_currency == 'usd':
            if base.lower() == 'usdt':
                context.base_currency = 'usdt'
lenak25 commented 6 years ago

Thanks for posting this @salihkilic!