wardbradt / peregrine

Detects arbitrage opportunities across 131 cryptocurrency exchanges in 50 countries
MIT License
1.18k stars 339 forks source link

ValueError: exchange is not a ccxt Exchange instance. #37

Closed guldam closed 6 years ago

guldam commented 6 years ago

Python 3.6.5 (default, Apr 25 2018, 14:23:58) [GCC 4.2.1 Compatible Apple LLVM 9.1.0 (clang-902.0.39.1)] on darwin Type "help", "copyright", "credits" or "license" for more information.

from peregrinearb import get_opportunity_for_market import asyncio opportunity = asyncio.get_event_loop().run_until_complete(get_opportunity_for_market("BTC/USD")) Traceback (most recent call last): File "", line 1, in File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/asyncio/base_events.py", line 468, in run_until_complete return future.result() File "/usr/local/lib/python3.6/site-packages/peregrinearb/async_find_opportunities.py", line 62, in get_opportunity_for_market return await finder.find_min_max() File "/usr/local/lib/python3.6/site-packages/peregrinearb/async_find_opportunities.py", line 54, in find_min_max [await self._test_bid_and_ask(exchange_name) for exchange_name in self.exchange_list] File "/usr/local/lib/python3.6/site-packages/peregrinearb/async_find_opportunities.py", line 54, in [await self._test_bid_and_ask(exchange_name) for exchange_name in self.exchange_list] File "/usr/local/lib/python3.6/site-packages/peregrinearb/async_find_opportunities.py", line 32, in _test_bid_and_ask raise ValueError("exchange is not a ccxt Exchange instance.") ValueError: exchange is not a ccxt Exchange instance.

I got the above error. What can I do?

wardbradt commented 6 years ago

Could you try running the following code?

from peregrinearb import get_opportunity_for_market
import asyncio
opportunity = asyncio.get_event_loop().run_until_complete(get_opportunity_for_market("BTC/USD", exchanges=['bittrex', 'binance', 'gdax', 'cex']))

Optionally, replace exchanges with any list of exchanges you would like.

guldam commented 6 years ago

It works. Thanks

Damiano-Franco commented 5 years ago

got the same error:

/usr/local/bin/python3.6 /Users/Edge-Rider/peregrine/test.py Task exception was never retrieved future: <Task finished coro=<OpportunityFinder._test_bid_and_ask() done, defined at /Users/Edge-Rider/peregrine/peregrinearb/async_find_opportunities.py:31> exception=ValueError('exchange is not a ccxt Exchange instance.',)> Traceback (most recent call last): File "/Users/Edge-Rider/peregrine/peregrinearb/async_find_opportunities.py", line 38, in _test_bid_and_ask raise ValueError("exchange is not a ccxt Exchange instance.") ValueError: exchange is not a ccxt Exchange instance. Task exception was never retrieved future: <Task finished coro=<OpportunityFinder._test_bid_and_ask() done, defined at /Users/Edge-Rider/peregrine/peregrinearb/async_find_opportunities.py:31> exception=ValueError('exchange is not a ccxt Exchange instance.',)> Traceback (most recent call last): File "/Users/Edge-Rider/peregrine/peregrinearb/async_find_opportunities.py", line 38, in _test_bid_and_ask raise ValueError("exchange is not a ccxt Exchange instance.") ValueError: exchange is not a ccxt Exchange instance. {'highest_bid': {'exchange': None, 'price': -1}, 'lowest_ask': {'exchange': None, 'price': 9999999}}

Process finished with exit code 0

same error with suggested code :

from peregrinearb import get_opportunity_for_market import asyncio opportunity = asyncio.get_event_loop().run_until_complete(get_opportunity_for_market("BTC/USD", exchanges=['bittrex', 'binance', 'gdax', 'cex']))