(exchange_ids)
| 11 | |
| 12 | |
| 13 | async def run_all_exchanges(exchange_ids): |
| 14 | results = {} |
| 15 | |
| 16 | for exchange_id in exchange_ids: |
| 17 | |
| 18 | exchange = getattr(ccxt, exchange_id)({ |
| 19 | 'options': { |
| 20 | 'useWebapiForFetchingFees': False, |
| 21 | } |
| 22 | }) |
| 23 | |
| 24 | symbol = 'ETH/BTC' |
| 25 | print('Exchange:', exchange_id) |
| 26 | |
| 27 | print(exchange_id, 'symbols:') |
| 28 | markets = await load_markets(exchange, symbol) # ←----------- STEP 1 |
| 29 | print(list(markets.keys())) |
| 30 | |
| 31 | print(symbol, 'ticker:') |
| 32 | ticker = await fetch_ticker(exchange, symbol) # ←------------ STEP 2 |
| 33 | print(ticker) |
| 34 | |
| 35 | print(symbol, 'orderbook:') |
| 36 | orderbook = await fetch_orderbook(exchange, symbol) # ←------ STEP 3 |
| 37 | print(orderbook) |
| 38 | |
| 39 | await exchange.close() # ←----------- LAST STEP GOES AFTER ALL CALLS |
| 40 | |
| 41 | results[exchange_id] = ticker |
| 42 | |
| 43 | return results |
| 44 | |
| 45 | |
| 46 | async def load_markets(exchange, symbol): |
no test coverage detected
searching dependent graphs…