jamesbachini / DEX-Arbitrage

Example arbitrage trading bot
GNU General Public License v3.0
615 stars 350 forks source link

Implimenting Flashloans #30

Closed Fifi55555 closed 1 year ago

Fifi55555 commented 1 year ago

What should i modify in this code in order to impliment a flashloan.. Of any value i set for my base tokens.

Such that anytime the bot finds an arbitrage opportunity of that amount; it executes the flashloan, does the trade, pays back the loan and i remain with the profit.

A detailed response will be greatly appreciated.

jamesbachini commented 1 year ago

I get this question a lot. Flash loans generally don't work for arbitrage trading because it increases slippage and you have to pay a percentage fee for the loan. Both these things make the trade less profitable unfortunately.

Aave does flashloans if you want to experiment but it doesn't help scaling in my experience

Fifi55555 commented 1 year ago

I appreciate the precautionary information. And i choose to take the risk.

Kindly let me know how i can implement a flashloan in this bot in the way i have suggested in my first post.

jamesbachini commented 1 year ago

https://docs.aave.com/developers/v/1.0/tutorials/performing-a-flash-loan

Fifi55555 commented 1 year ago

any specifics in your code that I should or shouldn't change

jamesbachini commented 1 year ago

Maybe implement it at the start of dualDexTrade function in https://github.com/jamesbachini/DEX-Arbitrage/blob/main/contracts/Arb.sol

Just note that the fees for the loan and increased slippage will likely make it unprofitable

On Sun, 9 Apr 2023 at 17:26, Fifi55555 @.***> wrote:

any specifics in your code that I should or shouldn't change

— Reply to this email directly, view it on GitHub https://github.com/jamesbachini/DEX-Arbitrage/issues/30#issuecomment-1501164900, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE6GVY7G4INV2DZ2AE24CPTXALPLPANCNFSM6AAAAAAWYBIALY . You are receiving this because you commented.Message ID: @.***>