The inefficiencies of the Ethereum DeFi are up for the taking by hyper-efficient and rationally driven miners — those whose power in making profits on the Ethereum blockchain has only been increasing, with miners bagging over $700M in January 2021 alone.
While criminal in the global financial markets, front-running is a necessary tool in every miner’s arsenal. It helps them anticipate the rise and fall in assets and provides opportunities to sandwich the users’ transactions to make them better returns. This is loosely called miner-extractable value, which often takes different forms.
Let’s break it down.
MEV — For the miner from the user
In a PoW consensus, miners provide the much-needed layer of security that makes the whole decentralization process work. They are then incentivized, to be honest, when it comes to transaction validation.
However, one thing that commonly goes unnoticed is that miners are in a position to continuously observe the different types of transactions that traders are initiating. Noticing patterns within those transactions becomes easy, and miners can apply models and extract additional value from their users without ever being aware of it. A miner can duplicate transactions, sandwich them or censor the transactions to make their own.
A complex blockchain like Ethereum that facilitates various types of complex transactions — thanks to a growing number of applications in DeFi — implies miners have more instances of “extracting” this value from the network. But where does this value come from in the first place? When you initiate a transaction, your transaction goes to the mempool. These transactions are then gradually picked by miners and further validated.
Two things are going on at this stage:
- The miner observes a pattern of transactions on a particular dApp/ that favors a single token.
- Because Ethereum is a public blockchain, other trading bots notice the pattern and start bidding higher transaction fees on the same transactions.
Where does the MEV come in then?
In the first instance where the miner decides to reap the rewards to themselves. When you initiate a transaction onto the Ethereum blockchain, you set the gas limit and pay the gas fees. Because a bidding war has already started — thanks to the numerous arbitrage bots that are also placing similar trades for higher transaction fees — your transaction is in the “unconfirmed and not yet mined” stage.
Consequently, you notice that there are bots offering higher transaction fees for the same transaction, and you get tempted to submit a “gas replacement” transaction — most likely with a higher fee — to incentivize the miner to serve you first. However, they (miners) realize the profits they can make themselves by duplicating your transaction. Hence, they initiate their own and prioritize it over everyone else’s. Eventually, they can validate their own transaction whilst also claiming all the Priority Gas Auctions (PGAs) being offered to them (even if those transactions don’t go through).
They are, thus, able to generate “pure revenue” from the overall transaction. Miners mostly “extract” huge amounts of MEV from DEXes — Uniswap being the most popular one.
MEV Attack Arsenal
As discussed above, miners have several places and opportunities to “extract” value from the process because of their position in the transactions. In the famous Flash Boys 2.0, the team of Cornell University experts outlined two major vectors of attacks — undercutting attacks and time-bandit attacks.
- Undercutting attack — in this case, a miner attempts to fork a high-fee block by retaining some of the transaction fees to entice other miners to build on it;
- Time-bandit attack — this attack utilizes a type of rewinding technique wherein the attacker rewinds to the previous block height and then utilizes the subsequent MEV to forge a 51% attack that mines a fork up to the most recent block height.
Another type of attack that has proven quite profitable is the sandwich attack, wherein the miner will sandwich your transaction between theirs to generate a profit. For instance, you want to buy token X at price Y. The miner carries out two transactions T1 and T3, wherein T1 is a buy order for token X at your price Y. Because they have already initiated the transaction, the price that you pay for buying that token could potentially be Y+2, followed by the third transaction carried out by the miner in T3, where they sell their tokens for a price Y+4, thus making a profit not only on that token but also from the fees that you pay for the transaction.
Sometimes, miners can also use arbitrage bots, which track price differences between different DEXes and then buy an asset for a low price at DEX 1 and then sell it for a higher price on DEX 2. These bots and the entities who deploy them (called arbitrageurs) are sometimes considered to “balance” out the uneven asset prices on different exchanges. That being said, most bots are known to utilize the asset price different opportunities to make profits.
While not considered attacks, front-running and back-running are considered to be ways using which miners can use traders’ transactions to derive profits. This happens either by sandwiching the latter’s transactions, or duplicating them, or strategically placing their transactions in a way that they make a profit.
It’s a common way of utilizing market inefficiencies and/or access to data that predicts market direction but is not yet publicly available. A front-runner is literally at the “front” and has access to this information (in our case, the miners or the arbitrage front-running bots) who can utilize the information to their favor.
For example, if someone has placed a huge transaction for the purchase of a cryptocurrency — an amount that can have an impact on the currency’s price — then the front-runner can easily place their transaction before and make a profit by selling their holdings when the price does go up.
Here, miners make a profit by tracing the trading pattern of users and the resulting profits they make from it. They then use those strategies as models for their own transactions so they can make a similar amount of profit as the users.
Miners Wrest the Arbitrage
Decentralized exchanges (DEXes) run on smart contracts and often make it easier for bots to notice the arbitrage opportunities. This is because of the atomicity of smart contract-based transactions — i.e., either the transactions succeed or fail — which helps the arbitrageurs observe the rise in the initiations of a particular type of transactions that their bots (called arbitrage bots) can then duplicate.
The crucial thing to note is that these opportunities can often be wrested by miners who more-or-less have a casual hand in ordering transactions. This is counterintuitive to the predicted selflessness of miners in any consensus protocol.
In fact, there has been an astronomical rise in the rise of the total value that miners have extracted through MEV.
We are also seeing an increase in the number of zero-gas transactions that imply that miners have been putting many of their own transactions.
Combatting MEV & Making Transactions Fair
Absolute fairness of transactions is a promise of blockchain and DeFi — while MEV is a weed in the amazing grassland of a plethora of applications. Enthusiasts and experts have suggested some possible solutions all over the world.
Order Sequencing Auctions
By auctioning the order sequencing of transactions, the miners are given a chance to focus only on validating the transactions, while separate entities called sequencers shoulder the responsibility of ordering. This is often considered “centralized” management of order sequencing as it rests the power within a few “elected” sequencers that are (because of the nature of the auction) able to front-run transactions as much as they like.
To prevent frontrunning, however, Chainlink offers Fair Sequencing Services where the ordering of transactions is the responsibility of an oracle network. Since the latter only gets to “order” transactions and not mine them, chances of frontrunning are presumably reduced.
It is a research organization that has been built specifically to shed light on MEV metrics by “quantifying” the overall MEV value. This can be further used in understanding how the MEV-ecosystem works, potentially giving us some headway in countering it.
To avoid centralization of extracted value, they have introduced MEV-Geth, which sits atop the go-Ethereum client to enable a sealed-bid block space auction mechanism and create an efficient communication channel between miners and traders. By allowing users to communicate their transaction bid and order preference privately, miner payoffs are maximized, and frontrunning instances are reduced.
In fact, we can see an increase in bundles that have been included on-chain, which tells us there has been an increase in Flashbot usage.
Archer’s MEV Shield
ArcherDAO has just launched the MEV Shield product that helps protect its users from front-running and sandwich attacks. They have already integrated with SushiSwap, so users can now stay protected from undue loss of revenue.
MEV — The Inescapable Anomaly
A necessary evil is the presence of a wrong in broad daylight because its removal results in tedious fundamental alterations. MEV reminds us of the cold-yet-true existence of the black market in the world (which itself totals a value of $1.8T).
About 30% of blocks have unconventional ordering, a percentage that has a history of increases.
As powerful as they sound, the proposed solutions have been carefully constructed to only reinforce the problem of centralization of MEVs by simply avoiding the pivotal discussion around finding ways to either reduce front-running or make the transactions actually fair for the users.
- If an efficient communication channel is created between miners and traders, that can also be misused for divided profits.
- While what seems like a fair solution in auctioning the order-optimization to an oracle network, it can again centralize the power within that network as third-parties optimizing the transaction can communicate off-chain (or even on-chain) with miners.
- Front-running-as-a-service is getting popularized as a way of selling/auctioning block-construction services to miners. This fails to decentralize the MEV from being concentrated to a few hands and reinvests more power to the sequencer.
- While MEVA (MEV Auctions) promise the “much-needed” divorce of transaction validators from transaction-order optimizers, there is a heightened possibility of both the mining and order-optimizing being done by the same entity — thereby defeating the very purpose of that auction.
A person in power will want to stay in power — is a principle that most politicians and businessmen abide by, and they do everything in their power to retain their authority. Notwithstanding the regulations around MEV, the truth is that the process of keeping any decentralized network safe comes at the cost of giving some power away to the ones who keep it safe, which in most cases are miners. The arguments for fair transactions are not unwarranted, but how does auctioning off order optimization to a third-party network help in achieving that? In fact, it makes things annoyingly more centralized.
A need for a “regulated” (although decentralized) network that optimizes the block structure can break decentralization. Regulated or not, MEV does not give us the feeling of being an escapable phenomenon.
Staking economy stats
Top headlines from PoS world:
Polygon Devs Can Now Use Alchemy’s Toolkit
Alchemy recently announced their support for Polygon developers. They can now utilize their developer resources along with the infrastructure and the tools. In return, Alchemy also helps its developers gain access to Polygon.
Polkadot V0.9.8 Upgrade
Polkadot has just announced its upgrade which entails setting new staking limits, doubling the allocator limits, and a few other important updates. This upgrade is purported to enhance the gossip topology.
Swiss Digital Asset Bank Offers Eth Staking
Sygnum, a digital asset bank based in Switzerland has now become the first digital asset bank to be offering Ethereum staking. Staked Ethereum can generate up to 7% APY.
Avalanche Bridge Launch
Cross-chain communication between Avalanche and Ethereum has been made possible by the launch of the Avalanche-Ethereum bridge in early 2021. An upgraded version of the bridge is soon going to launch enabling “faster and cheaper” transactions. It is purported to enhance the user experience as well.
Gravity DEX to Launch on Cosmos
Cosmos Network welcomed DeFi with Gravity’s DEX launch last week. Cosmos is a decentralized network of various interoperable blockchains. The DEX utilizes an inter-blockchain protocol to facilitate swaps between blockchains connected to Cosmos network and beyond.
ClayStack is a decentralized liquid staking protocol that enables you to earn staking rewards while keeping your assets liquid. Without any lockups.
Get the latest updates!
Learn more about ClayStack, interact with our team, engage in community discussions, and share your valuable feedback.