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.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TypeError: unsupported operand type(s) for *: 'float' and 'NoneType'

zjay096 opened this issue · comments

Hi, hope you are having a wonderful day.

Im Running:
CPLEX Studio IDE 12.9.0 Academic Version
Python 3.7.4
Windows 7 SP1

Modified:
Commented out -- > main.py:36-37 (kucoin_move_to_trade())
API Key --> utils.py

And getting this error:

path_optimizer.py:239: FutureWarning: Using a non-tuple sequence for multidimensiona
l indexing is deprecated; use `arr[tuple(seq)]` instead of `arr[seq]`. In the fu
ture this will be interpreted as an array index, `arr[np.array(seq)]`, which wil
l result either in an error or a different result.
  exc_name]
Traceback (most recent call last):
  File "main.py", line 40, in <module>
    path_optimizer.find_arbitrage()
  File "C:\Users\WeilZa01\Downloads\crypto-arbitrage-framework-master\crypto\cry
pto\path_optimizer.py", line 102, in find_arbitrage
    self.update_objectives()
  File "C:\Users\WeilZa01\Downloads\crypto-arbitrage-framework-master\crypto\cry
pto\path_optimizer.py", line 278, in update_objectives
    self.update_vol_matrix()
  File "C:\Users\WeilZa01\Downloads\crypto-arbitrage-framework-master\crypto\cry
pto\path_optimizer.py", line 301, in update_vol_matrix
    usd_values[key] = val['baseVolume'] * self.crypto_prices[base_coin]['price']
 * percentile
TypeError: unsupported operand type(s) for *: 'float' and 'NoneType'

Is this a known issue?

Regards.

Hi, thank you for pointing this out, this issue is because Coin Market Cap API added some new coins recently whose prices might not be accessible, thus leading to 'NoneType'. I have done some slight changes in the latest commit, it should be ok now.