Transcription
Did you know that there are trading bots on Ethereum making hundreds of thousands of dollars per year? These bots are called MEV searchers, and they're completely anonymous. No one actually knows who is running them. And the worst part is the vast majority of those profits are coming directly from normal Ethereum users like you.
Even though the bots are anonymous, all their activity is still visible on chain. So, we can see how much they're making. In the last 30 days, the top bot made almost $1 million with others making $400,000, $300,000, $200,000 from this MEV. But luckily, there are some concrete steps that you can take to make sure that these bots are not earning directly from your trades. By the end of this video, you'll know how these bots work. You'll have an overview of the entire MEV landscape on Ethereum, and you'll know how to protect yourself from bots like these.
These bots are doing something called MEV, which used to stand for minor extractable value, but now because Ethereum switched to proof of stake, it's called maximum extractable value. The official definition is that MEV is the additional profit a validator can make by strategically including, excluding, or reordering transactions within a block. If you don't understand exactly what that means, don't worry. We'll cover it in a little bit more detail later. The one thing that's important to know is that MEV used to be viewed as an existential threat to Ethereum and its users. But in the last year or two, a bunch of tools have been developed to protect users from the bad effects of MEV.
But before I tell you about those tools, let's talk about what these bots are actually doing and how they're making hundreds, if not millions a year. In order to understand that, you'll have to learn just a little bit about how Ethereum transactions work. When you hit send on an Ethereum transaction on your wallet, it's going into something called the mempool. These broadcasted transactions don't enter the blockchain right away. They're in this public pool, which is basically saying, "Hey, here's an available transaction, and here's the fee I'm going to pay for that transaction." In order to actually complete these transactions, they need to be packaged into something called a block, which is basically a group of transactions. On Ethereum, there's one block every 12 seconds, which means when you broadcast your transaction to the mempool, it's going to hang out there at least until the next block is built. If there are a lot of transactions waiting in the mempool, you might not actually be included in the next block. It kind of depends on what your priority fees are.
The way it used to work is that Ethereum validators were in charge of taking their favorite transactions from the mempool, which were usually the ones with the highest priority fees, and then packaging those transactions into a block that would be put into the official Ethereum blockchain. But validators quickly realized that if they're the ones deciding the order of the block and the transactions, they can do some sneaky things to make some extra money. They can do this by adding their own transactions to buy and sell coins into the block ahead or behind other high-value transactions. This is called MEV. And there are three primary attacks that are used: front running, sandwich attacks, and back running.
Different forms of front running have been around in the traditional stock market for a long time. But the difference with Ethereum is that all transactions are public before they're included. Basically, what front running is is that when there's a specific high-value transaction for a specific coin, let's just say that you are an Ethereum searcher and I am a normal Ethereum whale. I decide that I'm going to make a trade to buy $10 million of a specific coin. So, I submit that transaction into my MetaMask. MetaMask publishes that transaction to the mempool, which is visible to everybody, including you. So, how would you profit off of my big transaction? Obviously, my transaction is probably going to move the price. So, if you buy before I do, you can make some money after I push the price up. All you have to do is sneak your buy transaction ahead of mine, which is completely possible if you are the validator that's building these blocks.
Back running is basically the same thing, but instead of sneaking your transaction in before mine, you sneak it in so that you're the first one after mine to move the price from my big buy back to normal. And sandwich attacks are when front running and back running are used at the same time. And this normally happens in the same block. What that means is I post my massive transaction to the mempool. You see it and put a buy transaction before my buy transaction, which means that you get to buy the tokens right before my transaction moves the price of those tokens up. Then immediately after my transaction moves the price up, you can sell your tokens at a profit. When all of these transactions happen in the same block, it's basically a risk-free way for you to take money out of my pockets. That's because if it weren't for you, I would be getting those coins at a much better price.
The reason this was an existential threat to Ethereum was because it takes a lot of resources and computing power to be the first one in line to take advantage of these MEV opportunities. Not only that, but because Ethereum operates on a proof-of-stake model, the validators that are staking the most Ethereum are usually the ones that get to decide the next block and be the ones ordering all of these transactions. This causes a pretty destructive feedback loop where the richest Ethereum validators could also spend the most resources finding MEV and make the most money. Then they could put that money back into finding more blocks and eventually they'd become the biggest validator with almost all the ETH, while the entire time users are getting screwed.
Luckily, some really smart people came up with something called proposer-builder separation, which is how MEV and block building operate today. Basically, there are three different players: MEV searchers, block builders, and validators. MEV searchers are the bots that we've been talking about that are actually looking in the mempool for these sandwich attack and front running and back running opportunities. But instead of taking profitable transactions and building an entire block, today these MEV searchers just take a couple of transactions from the mempool, input their own transactions to do the sandwich attacks and other MEV things, and then send that bundle of a couple transactions to a block builder.
Block builders take these bundles from the MEV searchers and then combine them along with transactions from the mempool into a complete block. Because the block builder is actually simulating all of these transactions, they can see how profitable the block will be. These block builders send their blocks to a validator through a relay, which hides the specific transactions within the block. But they attach a tip to each block that they send, which is the profit that the Ethereum validator will make by choosing that block. This means that the MEV searchers, block builders, and validators are each getting a piece of that MEV profit. But the reality is that the validators are getting the lion's share.
Doing all of this every single 12 seconds on a loop forever takes a ton of sophisticated algorithms and high-powered computers. Which is why the block building space is dominated by two block builders, BeaverBuilder and Titan. And the MEV searcher space has been historically dominated by one guy who goes by the pseudonym Jared from Subway. No one knows who he is, but he's made millions in the last few years from MEV.
Before we end the video, I'm going to give you three tangible ways that you can protect yourself from MEV. The first is to reduce slippage every time you make a trade on a decentralized exchange. The slippage value is the price movement that you're willing to accept when you make a trade on Ethereum. But that value is actually a part of the transaction and visible to all of these MEV searchers in the mempool. So if they're going to front-run you, they know exactly how much they can do that. And the bigger the slippage value, the more money they can extract from your trade.
The second way to protect yourself is to use a decentralized exchange that has MEV protection built in. The most famous of which is CowSwap. Instead of putting your trade directly onto the blockchain, CowSwap actually makes searchers compete to find the best path for the trade, which means that you're getting the best deal. CowSwap is the favorite DEX that whales use to protect themselves and it does millions and millions of volume.
And the final way to protect yourself is to use Layer 2 networks. Layer 2s built on top of Ethereum like OP Mainnet and Base have two distinct advantages. The first is that their block times are only 2 seconds and getting faster, which means there's less time for these searchers to find all of these profit opportunities. The second is that the mempool on Layer 2s is actually private, which means that MEV searchers can't get ahead of your transactions.
If you're working to improve your knowledge of Ethereum and the blockchain, hit that subscribe button because I've got a lot more high-quality content coming out soon. Thanks for watching and I'll see you in the next one.