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
554 stars 143 forks source link

Error in Farming + Rewards - IL #13

Open PowerPress opened 2 years ago

PowerPress commented 2 years ago

pair = ['terra-luna','terrausd'] apr = 30 dft.farmSimulate(pair, apr, start='2021-01-01') Downloading terra-luna Downloading terrausd {'Token 1': 'terra-luna', 'Token 2': 'terrausd', 'start': '2021-01-01', 'fixed APR': '30%', 'Buy & Hold': '4470.13%', 'Impermanent Loss': '-79.13%', 'Farming Rewards': '64.44%', 'Farming + Rewards - IL': '4613.70%'}

Seems to be incorrectly adding the IL to the total instead of subtracting. Additionally not sure the farming rewards are correct on how it could be 64.44% when its been slightly over a year and the APR has more than doubled.

gauss314 commented 2 years ago

Yes you are right, bug fixed now!