yuichiroaoki / poly-flashloan-bot

Flashloan Bot on Polygon
https://yuichiroaoki.medium.com/flashloan-bot-on-polygon-part-2-3eae0ac33986?sk=80821da4ca1d0462c7c9ae617df56bdd
MIT License
302 stars 192 forks source link

Finding best protocol for pair #73

Open spprss opened 2 years ago

spprss commented 2 years ago

Hi, since you recommended not using 1inch anymore I started redesigning the bot. I encountered the problem that we don’t know the „best“ protocol anymore. Executing the bot for every protocol makes no sense since cyclic arbitraging needs more than one pair. So i tried finding the protocol by asynchronously checking all exchange rates and returning the highest rate giving protocol BUT this causes the bot to fail at some point if i set low intervals. To summarize all my tests with different strategies the last weeks: i didn’t quite found the best performing solution for this :) since your private bot is profitable I’m highly interested in your strategy of finding the protocol!

xabozhu commented 2 years ago

Hey spprss, can you please teach me the step to step how to change the inquire way from 1inch to the defi pool directly, I can read those codes, but really have limited knowledge of how to make a change.

xabozhu commented 2 years ago

Here is what I found so far, each time there is quite profitable, and with like 7 sec delay, everytime it was unsuccessful. https://polygonscan.com/address/0xf651b785aa4aac0edcf2220ad88a9d2b52f640ff

yuichiroaoki commented 2 years ago

Thank you for sharing it. That's true. However, that way increases the slippage since it take a little before the flashloan tx. So, even if you find the best routes, you will end up missing the opportunity since the prices changes really fast.

I think it is more important to execute the flashloan fast even it's not the best than do it with best routes and pairs.