6eer / uniswap-sushiswap-arbitrage-bot

Two bots written in JS that uses flashswaps and normal swaps to arbitrage Uniswap. Includes an automated demostration.
MIT License
586 stars 264 forks source link

Wrong calculation of the profit #21

Open oussaki opened 2 years ago

oussaki commented 2 years ago

If you look on how you calculated the profit

const profit = (totalDifference*priceToken0Eth)-gasCost

the profit should be calculated this way :

const profit = (totalDifferencepriceToken1Eth)-(gasCost2)

because you wanted the difference to be calculated in price of the token that you are arbitraging with and what the point if you pay 0.02 Eth for gas and then your total profit is less of what you paid for gas

victoralmm commented 2 years ago

The bot still working nowadays?

skswain96 commented 2 years ago

The bot still working nowadays?

Did you get this working on local?

bmwmenthusiast commented 2 years ago

The bot still working nowadays?

Is it working? Am about to try to set it up and get it all figured out.