hzjken / crypto-arbitrage-framework

A cryptocurrency arbitrage framework implemented with ccxt and cplex. It can be used to monitor multiple exchanges, find a multi-lateral arbitrage path which maximizes rate of return, calculate the optimal trading amount for each pair in the path given flexible constraints, and execute trades with multi-threading implemenation.
590 stars 173 forks source link

TypeError: 'NoneType' object is not iterable #10

Open LucaCerullo1 opened 3 years ago

LucaCerullo1 commented 3 years ago

PS C:\Users\Luca Cerullo\Desktop\crypto-arbitrage-framework-master> & "C:/Users/Luca Cerullo/AppData/Local/Programs/Python/Python39/python.exe" "c:/Users/Luca Cerullo/Desktop/crypto-arbitrage-framework-master/main.py" Traceback (most recent call last): File "c:\Users\Luca Cerullo\Desktop\crypto-arbitrage-framework-master\main.py", line 35, in path_optimizer.find_arbitrage() File "c:\Users\Luca Cerullo\Desktop\crypto-arbitrage-framework-master\crypto\path_optimizer.py", line 103, in find_arbitrage
self.update_objectives() File "c:\Users\Luca Cerullo\Desktop\crypto-arbitrage-framework-master\crypto\path_optimizer.py", line 279, in update_objectives self.update_transit_price() File "c:\Users\Luca Cerullo\Desktop\crypto-arbitrage-framework-master\crypto\path_optimizer.py", line 167, in update_transit_price
self.price.update(exc_price) TypeError: 'NoneType' object is not iterable PS C:\Users\Luca Cerullo\Desktop\crypto-arbitrage-framework-master>

I have installed all library but when add exchange API Binance and Coinbase-pro program give me this error

hzjken commented 3 years ago

this issue seems like due to below function is returning None value: https://github.com/hzjken/crypto-arbitrage-framework/blob/882049565d92bdab0c79da95ffe353594b6cc89c/crypto/path_optimizer.py#L378-L389

You might need to have a check on this function using specific exchange names, it's possible that some of the exchanges in ccxt do not support fetch_tickers function. I believe Binance do support, Coinbase-pro I am not sure.