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.
552 stars 172 forks source link

Problem with update_commission_fee() #26

Open myroom opened 1 year ago

myroom commented 1 year ago

Hello

There is an error when starting, what could be the problem?

path_optimizer.py:241: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray. self.commission_matrix[np.meshgrid(indexes, indexes, indexing='ij', sparse=True)] = self.trading_fee[ Traceback (most recent call last): File "main.py", line 40, in path_optimizer.find_arbitrage() File "path_optimizer.py", line 101, in find_arbitrage self.update_commission_fee() File "path_optimizer.py", line 241, in update_commission_fee self.commission_matrix[np.meshgrid(indexes, indexes, indexing='ij', sparse=True)] = self.trading_fee[ IndexError: only integers, slices (:), ellipsis (...), numpy.newaxis (None) and integer or boolean arrays are valid indices

Process finished with exit code 1

myroom commented 1 year ago

image

mrdjehknhc commented 1 year ago

same issue , did you find solution ?

OPAYA commented 1 year ago

you should use a 0 index . self.commission_matrix[np.meshgrid(indexes, indexes, indexing='ij', sparse=True)[0]] = self.trading_fee[exc_name]