How MEV bots operate and what a sandwich attack means. The post MEV Bots and Sandwich Attacks: How do they work? appeared first on Tokenist.
Join us in showcasing the cryptocurrency revolution, one newsletter at a time. Subscribe now to get daily news and market updates right to your inbox, along with our millions of other subscribers (that’s right, millions love us!) — what are you waiting for?
MEV’s Role in the Blockchain Networks
For example, an MEV arbitrage bot could be deployed to monitor trades on decentralized exchanges (DEXes). If there is an incoming large buy order in play, this will point toward the price increase of a particular cryptocurrency.
When identifying such a sizeable incoming trade, the MEV bot executes its order. This way, it would take advantage of the price shift likely resulting from the DEX order. The MEV bot would typically place a buy order at a lower price just moments before the DEX order is executed.
As the asset price increases following the DEX trade, the MEV arbitrage bot would extract the value – profits – from the price discrepancy. Therefore, although MEV bots are independent of miners/validators, they take advantage of their transaction ordering.
However, some MEV profit extraction strategies are more manipulative than others.
MEVs: Sandwiching and Frontrunning
Another way to extract value from incoming trades is to submit a sell/buy order between trades. For example, if the MEV bot places a large sell order just before a large buy order, it could decrease the asset price. The goal is to repurchase the asset at a lower price, which the bot would sell for a higher price.
This MEV strategy is called a “sandwich attack” because the bot inserts its trades between the large buy order and the follow-up sell orders. Based on the market liquidity at the time and the buy order size, sandwich-based MEV extraction has a varying degree of success.
In April, sandwich-based MEV profits more than doubled compared to standard MEV arbitrage.
MEV bots can also front-run users’ transactions just before they are confirmed on the network. They do so by copying them but setting a higher gas fee to push transactions through ahead of the original one.
Of course, the network throughput is burdened as a side effect of people deploying MEV bots to insert orders to extract value. Consequently, transaction fees go up as the network gets congested, which happened in April with increased bot activity.
Suffice it to say the resulting fees, averaging $29 on Uniswap, do not constitute a welcoming user experience. Even simple stablecoin transfers, at $8.54, makes it exceedingly difficult to make a case for mass DeFi adoption.
MEV Bots: Exploiting Complexity
Technically, Bitcoin has smart contracts, but they are severely limited in scope. They focus on basic financial transactions, such as sending and receiving BTC and enforcing multi-sig requirements. In contrast, Ethereum’s Solidity programming language supports complex smart contracts and functions.
However, unlike Ethereum, Bitcoin’s mempool doesn’t include the entire transaction pool because transactions have to become eligible to be included, following strict criteria such as non-conflicting transaction ID, fees, and valid signatures. This makes it exceedingly difficult for MEV bots to manipulate transaction orders.
Moreover, Bitcoin’s 10-minute block interval, compared to Ethereum’s 12-second block finalization time, creates drastically fewer opportunities to front-run transactions. Ironically, this creates a situation in which Bitcoin inherently disincentivizes excessive network load, leading to lower transaction fees and lesser fee volatility.
Have you ever used MEV bots to generate profits? Let us know in the comments below.