gauss314 / defi

Tools for use in DeFi. Impermanent Loss calculations, staking and farming strategies, coingecko and pancakeswap API queries, liquidity pools and more
MIT License
555 stars 143 forks source link

IndexError: single positional indexer is out-of-bounds #12

Open PowerPress opened 2 years ago

PowerPress commented 2 years ago

Received the following error:

pair = ['ethereum','nexus-governance-token'] apr = 553.94 dft.farmSimulate(pair, apr, start='2021-11-30') Downloading ethereum Downloading nexus-governance-token Traceback (most recent call last): File "<pyshell#35>", line 1, in dft.farmSimulate(pair, apr, start='2021-11-30') File "C:\Users\jadmin\AppData\Local\Programs\Python\Python39\lib\site-packages\defi\defi_tools.py", line 276, in farmSimulate farm = farm.divide(farm.iloc[0]) File "C:\Users\jadmin\AppData\Local\Programs\Python\Python39\lib\site-packages\pandas\core\indexing.py", line 931, in getitem return self._getitem_axis(maybe_callable, axis=axis) File "C:\Users\jadmin\AppData\Local\Programs\Python\Python39\lib\site-packages\pandas\core\indexing.py", line 1566, in _getitem_axis self._validate_integer(key, axis) File "C:\Users\jadmin\AppData\Local\Programs\Python\Python39\lib\site-packages\pandas\core\indexing.py", line 1500, in _validate_integer raise IndexError("single positional indexer is out-of-bounds") IndexError: single positional indexer is out-of-bounds

gauss314 commented 2 years ago

Maybe it was a fail in coingecko API, now this example is working ok