flashbots / mev-inspect-py

🔎 an MEV inspector for Ethereum 🔎
MIT License
826 stars 261 forks source link

No support for sandwiches through multiple pools #198

Closed lukevs closed 2 years ago

lukevs commented 2 years ago

Description

A bot wants to sandwich a large trade on Pool 1 going from token A to token B

The bot currently holds token B, but not A

To frontrun this transaction, the bot needs to go A => B on Pool 1

So it will

Then do the reverse for the backrun

Currently we don't pick this up because we filter for tokens to be from the sandwicher address

Example

Block 13894234 should include a sandwich

first transaction in the block trades WETH => SUSHI on ShibaSwap (https://etherscan.io/address/0x6cbefa95e42960e579c2a3058c05c6a08e2498e9) then SUSHI => WETH on SushiSwap https://etherscan.io/tx/0xada77bc134f33628c0f7e1698db5ef13a1d5f302c18a90e80aca3a668e042cba

then sandwiched transaction trades SUSHI => WETH on Sushi https://etherscan.io/tx/0xb2f70d8400e39797dd0dbb1b5883fb76d4a8804579b2d15425cf6ec4db3d5077

then the same bot does the first tx in reverse (WETH => SUSHI on Sushi, SUSHI => WETH on Shiba) https://etherscan.io/tx/0x3d19c140aeca2076acdb42873569b49e3dd0764b01f48a7831341dc2e97e54b4

lukevs commented 2 years ago

This is fixed now Verified this is correctly tagged