The progress in cryptocurrency trading is way too fast! The overall global interest in crypto-markets is skyrocketing! Investing in stock seems to be more well-established but investing in crypto is way more appealing! No wonder why. The daily profit may be as high as +10%, to start with, though the risk of price plummeting with a bunch of people screaming are omnipresent at the same time. This is a game. Worth playing. Worth losing. Worth winning. But foremost worth learning and self-improving!
Questions never end. One of the most frequently asked is the following one. Say, I live in Australia and I’m interested in finding crypto-exchange trading the cryptocurrency of my interest versus a selected fiat currency. Where can I trade that pair?
In this article, using Python language, we will develop the code allowing us to scan all crypto-exchanges to provide the answer to the question above.
Let’s start as usual:
# Crypto vs Fiat Currency: (1) Where is it Traded? # (c) 2021 by Pawel Lachowicz, QuantAtRisk.com import ccrypto as cc import pandas as pd import requests import json from bs4 import BeautifulSoup ccy1 = 'ETH' # cryptocurrency ccy2 = 'AUD' # fiat currency
where we have defined a pair we are looking for. In other words, we want to find out where we can trade ETH (Ether) vs AUD (Australian Dollar)?
This kind of search has a lot of benefits. We are able to get a list of crypto-exchanges for further investigation. This means you can visit the page of this exchange and analyse the terms and conditions of creating/having your account with one of suggested exchanges. Does it allow to trade ETH vs AUD with fees low enough to make your trading (or algo-trading) profitable in a long run? Does it make your strategy successful?
Let’s find out how to identify these crypto-exchanges in a next step…
We will use the API of CryptoCompare.com to build our queries. It is easy to spot All the Exchanges and Trading Pairs section which helps to form an URL-base query. The goal is to get a list of all crypto-exchanges allowing trading vs AUD (our case study).
url = 'https://min-api.cryptocompare.com/data/v4/all/exchanges?tsym=' + ccy2 + '?topTier=0' # fetch the raw data response = requests.get(url) soup = BeautifulSoup(response.content, "html.parser") dic = json.loads(soup.prettify()) # convert from json to dictionary print(dic)
This code will return the feedback from the server:
{'Response': 'Success', 'Message': '', 'HasWarning': False, 'Type': 100, 'RateLimit': {}, 'Data': {'exchanges': {'ABCC': {'pairs': {'CND': {'tsyms': {'BTC': {'histo_minute_start_ts': 1598918400, 'histo_minute_start': '2020-09-01', 'histo_minute_end_ts': 1611100800, 'histo_minute_end': '2021-01-20'}, 'ETH': {'histo_minute_start_ts': 1598918400, 'histo_minute_start': '2020-09-01', 'histo_minute_end_ts': 1611100800, 'histo_minute_end': '2021-01-20'}}}, 'ELF': {'tsyms': {'ETH': {'histo_minute_start_ts': 1533081600, 'histo_minute_start': '2018-08-01', 'histo_minute_end_ts': 1611100800, 'histo_minute_end': '2021-01-20'}, 'BTC': {'histo_minute_start_ts': 1533081600, 'histo_minute_start': '2018-08-01', ...
It is rather dense response with lots of embedded information within. Let’s analyse in Python, step by step, what we’ve got.
print(dic['Data'].keys())
dict_keys(['exchanges'])
Given that, we can develop:
d = dic['Data']['exchanges'] print(d)
{'ABCC': {'pairs': {'CND': {'tsyms': {'BTC': {'histo_minute_start_ts': 1598918400, 'histo_minute_start': '2020-09-01', 'histo_minute_end_ts': 1611100800, 'histo_minute_end': '2021-01-20'}, 'ETH': {'histo_minute_start_ts': 1598918400, 'histo_minute_start': '2020-09-01', 'histo_minute_end_ts': 1611100800, 'histo_minute_end': '2021-01-20'}}}, 'ELF': {'tsyms': {'ETH': {'histo_minute_start_ts': 1533081600, 'histo_minute_start': '2018-08-01', 'histo_minute_end_ts': 1611100800, 'histo_minute_end': '2021-01-20'}, 'BTC': {'histo_minute_start_ts': 1533081600, 'histo_minute_start': '2018-08-01', 'histo_minute_end_ts': 1611100800, 'histo_minute_end': '2021-01-20'}}}, 'BEE': {'tsyms': {'BTC': {'histo_minute_start_ts': 1598918400, 'histo_minute_start': '2020-09-01', ...
You can spot what’s coming next:
print(d.keys())
dict_keys(['ABCC', 'ACX', 'Abucoins', 'AidosMarket', 'BCEX', 'BTC38', 'BTCAlpha', 'BTCBOX', 'BTCChina', 'BTCE', 'BTCExchange', 'BTCMarkets', 'BTCTurk', 'BTCXIndia', 'BTER', 'BXinth', 'Bgogo', 'Bibox', 'BigONE', 'Binance', 'Binanceje', 'Bit2C', 'BitBank', 'BitBay', 'BitFlip', 'BitGrail', 'BitMarket', 'BitMart', 'BitSquare', 'BitTrex', 'BitZ', 'BitexBook', 'Bitfinex', 'Bitforex', 'Bithumb', 'Bitinfi', 'Bitkub', 'Bitlish', 'Bitmex', 'Bitpoint', 'Bitsane', 'Bitshares', 'Bitso', 'Bitstamp', 'Blackturtle', 'Bleutrade', 'Bluebelt', 'Braziliex', 'Buda', 'CBX', 'CCCAGG', 'CCEDK', 'CCEX', 'CHBTC', 'Catex', 'Cexio', 'ChileBit', 'Codex', 'CoinBene', 'CoinCorner', 'CoinDeal', 'CoinEx', 'CoinFalcon', 'CoinHub', 'CoinJar', 'CoinPulse', 'CoinTiger', 'Coinbase', 'Coincap', 'Coincheck', 'Coinfloor', 'Coinmate', 'Coinnest', 'Coinone', 'Coinroom', 'CoinsBank', 'Coinsbit', 'Coinse', 'Coinsetter', 'Cryptagio', 'CryptoBulls', 'CryptoCarbon', 'CryptoExchangeWS', 'CryptoX', 'Cryptonit', 'Cryptopia', 'Cryptsy', 'DDEX', 'DEx', 'DSX', 'DigiFinex', 'EXRATES', 'EXX', 'EtherDelta', 'Ethermium', 'EthexIndia', 'Ethfinex', 'Everbloom', 'Exenium', 'Exmo', 'ExtStock', 'FCCE', 'FCoin', 'Foxbit', 'Gatecoin', 'Gateio', 'Gemini', 'Globitex', 'Gneiss', 'Gnosis', 'Graviex', 'HADAX', 'Hikenex', 'HitBTC', 'Huobi', 'HuobiPro', 'IDAX', 'IDEX', 'IQFinex', 'Incorex', 'IndependentReserve', 'InstantBitex', 'Ironex', 'Jubi', 'Korbit', 'Kraken', 'Kucoin', 'Kuna', 'LAToken', 'LBank', 'LakeBTC', 'Liqnet', 'Liqui', 'Liquid', 'LiveCoin', 'LocalBitcoins', 'Luno', 'Lykke', 'MercadoBitcoin', 'Minebit', 'MonetaGo', 'MtGox', 'NDAX', 'Nebula', 'Neraex', 'Nexchange', 'Nlexch', 'Novaexchange', 'Nuex', 'OKCoin', 'OKEX', 'OpenLedger', 'Ore', 'P2PB2B', 'Paymium', 'Poloniex', 'Qryptos', 'QuadrigaCX', 'Quoine', 'Remitano', 'RightBTC', 'SafeCoin', 'Simex', 'SingularityX', 'StocksExchange', 'StocksExchangeio', 'Surbitcoin', 'Switcheo', 'TDAX', 'TheRockTrading', 'Threexbit', 'Tidex', 'TokenStore', 'Tokenomy', 'TradeSatoshi', 'TrustDEX', 'TuxExchange', 'Unocoin', 'Upbit', 'VBTC', 'Vaultoro', 'Velox', 'ViaBTC', 'WEX', 'WavesDEX', 'WorldCryptoCap', 'XS2', 'Yacuna', 'Yobit', 'Yunbi', 'ZB', 'ZBG', 'Zaif', 'Zecoex', 'aax', 'aliexchange', 'alphaex', 'altilly', 'ataix', 'bcbitcoin', 'beldex', 'bequant', 'bhex', 'biki', 'bilaxy', 'binancedex', 'binanceusa', 'bingcoins', 'bitFlyer', 'bitFlyerFX', 'bitasset', 'bitbuy', 'bitci', 'bitcoincom', 'bitfex', 'bitflyereu', 'bitflyerus', 'bithumbglobal', 'bitmax', 'bitpanda', 'bitspark', 'bkex', 'blockchaincom', 'btcXchange', 'btcmex', 'btse', 'bw', 'bybit', 'chainrift', 'chainx', 'chaoex', 'cobinhood', 'coinall', 'coineal', 'coinegg', 'coinfield', 'coinspro', 'coinsuper', 'coinzest', 'compound', 'coss', 'crex24', 'crosstower', 'cryptofacilities', 'cryptonex', 'currency', 'darbfinance', 'dcoin', 'decoin', 'deribit', 'e55com', 'eidoo', 'equos', 'erisx', 'etoro', 'exscudo', 'fatbtc', 'ftx', 'gopax', 'hbus', 'huobijapan', 'huobikorea', 'iCoinbay', 'idevex', 'indodax', 'itBit', 'lmax', 'oex', 'onederx', 'paribu', 'primexbt', 'probit', 'raidofinance', 'seedcx', 'sigenp2p', 'sigenpro', 'sistemkoin', 'slicex', 'smartrade', 'sushiswap', 'tchapp', 'thore', 'timex', 'tokensnet', 'tokok', 'trxmarket', 'uniswap', 'uniswapv2', 'unnamed', 'utorg', 'valr', 'wbb', 'xbtpro', 'xcoex', 'xena', 'zebitex', 'zloadr'])
These are all crypto-exchanges trading vs AUD. We can collect an information about them by executing the following code:
exchanges = list() for exchange in d.keys(): exchanges.append(exchange)
Now, let’s define a list-type variable that will help us to store an information about these crypto-exchanges where we can truly trade ETH vs AUD:
exchanges_CCCFFF = list() for exchange in exchanges: try: test = ccy2 in d[exchange]['pairs'][ccy1]['tsyms'].keys() if test: print(exchange) exchanges_CCCFFF.append(exchange) except: pass
ACX BTCMarkets Binance CoinJar IndependentReserve Kraken Liquid Luno Nexchange Quoine Remitano btse ftx
We have identified 13 crypto-excghanges where ETH vs AUD is possible. Great! What can we do more? Lots of useful stuff. One of them is checking the historical/live data availability. Analyse the following code:
for i, exchange in enumerate(exchanges_CCCFFF): df = cc.getCryptoSeries(ccy1, ccy2, freq='d', exch=exchange) print(i+1, exchange, '\t', df.index.min(), '\t', df.index.max(), '\t', df.shape[0])
returning
1 ACX 2018-08-14 02:00:00 2020-04-28 02:00:00 526 2 BTCMarkets 2016-03-13 01:00:00 2021-01-20 01:00:00 1653 3 Binance 2020-07-31 02:00:00 2021-01-20 01:00:00 172 4 CoinJar 2018-08-21 02:00:00 2021-01-20 01:00:00 805 5 IndependentReserve 2018-07-24 02:00:00 2021-01-20 01:00:00 895 6 Kraken 2020-06-16 02:00:00 2021-01-20 01:00:00 218 7 Liquid 2018-10-03 02:00:00 2021-01-20 01:00:00 795 8 Luno 2020-08-24 02:00:00 2021-01-20 01:00:00 112 9 Nexchange 2020-11-24 01:00:00 2020-11-24 01:00:00 1 10 Quoine 2016-07-09 02:00:00 2018-12-05 01:00:00 275 11 Remitano 2020-08-11 02:00:00 2020-08-22 02:00:00 4 12 btse 2020-09-21 02:00:00 2021-01-20 01:00:00 119 13 ftx 2020-12-30 01:00:00 2021-01-20 01:00:00 21
What is interesting here is that not all abovementioned crypto-exchanges still trade ETH/AUD pairs. The data kept by CryptoCompare.com rather suggests some of these exchanges ceased that pair trading.
Let’s allow ourselves for one more check. Let’s pick up randomly from the above list, say, Luno exchange. Indeed, it exists and can be reached at luno.com.
Doing a bit of clicking here and there, sooner or later we will discover that at the webpage of https://www.luno.com/trade/markets/ETHAUD we can track Luno’s ETH vs AUD quotations live:
That would confirm the validity of our Python solution presented above.
IN NEXT PART: We will look at BTC/USD pairing and show how to verify that Bitcoin moves in the same direction for all crypto-exchanges trading BTC/USD pair. This might reveal some hidden trading opportunities!