flashbots / simple-blind-arbitrage

MIT License
352 stars 93 forks source link

Fix arbitrage calculation #5

Closed bertmiller closed 1 year ago

bertmiller commented 1 year ago

The previous getAmountIn() function wasn't working properly on mainnet because it would frequently under/overflow. I've updated the math to, I think, address this.

I'm not sure if this new function is optimal always, but it's directionally correct and a good place to start.