Writing this as quick as I can but I gotta figure this one out first. It's a hard one.
Looks like tomorrow or Monday I’ll put something out. Taking awhile to understand and express in a way that makes sense and I’ve got stuff to do today. Sorry folks.
Fatal flaws in a bot, a sort of on-chain virus, a trojan horse token, and arbitrage gone wrong
Join me in looking at the latest MEV bot exploit in this thread 👇🏻
The victim today tried to arbitrage the CHUM token (!) for ~0.01 ETH in profit, but in the process had 30 WETH transferred out of their wallet.
They only interacted with Uniswap v2 pools, how did this happen!?
Searchers optimize their contracts to the extreme to do very specific things very efficiently.
However, occasionally they have a need to do random things & add in functions that can be used for to execute basically any arbitrary transaction in a contract
🥪 frontruns a user, buying the asset they intend to and increasing the price. The user gets less tokens now.
The user's buy is then included, pushing the price up more
🥪 sells after the user's tx at the higher price, thus capturing profit
🥪 bots will watch the mempool for users trading with high slippage that they can frontrun. Until recently 🥪 bots would only do this with one trade, and with the Uniswap v2 or Sushiswap router.
The tricky thing for this bot is it needs to land right behind another user's tx to succeed
Since it can't express those ordering preferences and because the costs of a transaction are so low, it chooses to spam the network with transactions and hope one lands in the right place
It's a golden age for searchers. Late enough that Flashbots and DeFi exists, but not so late that massive institutions are competing for MEV.
Even still the barrier to entry for the top strategies is getting higher very quickly. It's probably a few months of work to catch up to the best backrunning arb bots now.
It is funny to think about the early days of Flashbots when there was literally 1 market maker, 1 ESD bot, and 2 arb bots sending bundles. Unbelievably good opportunity to make money back then.