Learn about Miner Extractable Value (MEV) in one article and how to maximize the benefits of trading

As defined in the original Flash Boys 2.0, Miner Extractable Value (MEV) is the value that miners can extract by including in the blocks they produce, re…

As defined in the original Flash Boys 2.0, Miner Extractable Value (MEV) is the additional profit that miners can earn by including, reordering, inserting, or ignoring transactions in the blocks they produce. While the process of winning a block is fairly democratic, the winning block producer has a great deal of control over the transactions that can be included in the block. This right is fundamental to MEV, and in theory this right should only be for the good. The Flashbots team advocates renaming “Miner Extractable Value” to “Maximum Extractable Value” to cover all values that can be extracted by privileged participants (e.g. validators in ETH2), not just PoW system, not just the value that can be extracted by miners in the PoW system.

Understanding MEV
Before an Ether transaction is included in a block, it first enters the memory pool, a publicly accessible staging area. This is also where MEV bots search for transactions that can be used to capture certain MEVs, such as through arbitrage markets or liquidating new under-collateralized loans.

For example, suppose there is a large Uniswap order to buy SNX / WETH in the memory pool. The MEV robot will immediately trade behind the large Uniswap order to take advantage of the price slippage in the Uniswap pool against the SNX/WETH price in another AMM pool, such as SushiSwap arbitrage. This is considered benign or positive MEV because it benefits the ecosystem.

However, miners have an ace up their sleeve as the ultimate gatekeepers of on-chain content, even vis-à-vis MEV bots. A miner with a “generalized runner” bot can replicate the MEV bot’s arbitrage trades and replace them with his own, thereby capturing arbitrage profits for himself. Broad-based robotic trading is considered a pernicious MEV trade, or a trade that destabilizes the ecosystem. Censorship attacks and centralized MEV withdrawals are two issues that Ed Felten has identified regarding MEV auctions and pose a significant danger to the Ether community.

Time-bandit attacks are another MEV attack vector identified in the seminal Flash Boys 2.0 paper, which have the potential to destabilize consensus. They pose a greater risk to the survival of stateful blockchains (i.e., Ether). The lower the block reward, the greater the incentive for miners to restructure blocks to capture historical MEV.

MEV Strategies
Many strategies for capturing MEV require precise transaction ordering. For example, by placing transactions before or after large orders on DEX. Clearing strategies use bots that run in reverse to trade immediately after a price prognosticator update. A relatively new MEV strategy is called “uncle bandit”, where transactions in uncle blocks are used to capture MEV.

Front-running: A target trade is identified in the memory pool and the bot tries to be mined immediately before the trade by submitting a slightly higher gas price. For example, the bot looks for a new list of deals on Uniswap and will send a large number of purchase orders immediately after the list to push up the price.

Back-running: The bot seeks to be mined immediately after a target trade by submitting a slightly lower gas price than the trade. For example, submitting a liquidation order immediately after a price prognosticator update.

Sandwiching (sandwiching): A combination of robotic and back-running. For example, a large buy order is identified in the memory pool and a pre-emptive order is placed before the buy order to buy tokens at a lower price. The large buy order then pushes up the price, and then the backward bot sells the prior order tokens for a profit.

Uncle bandit: As detailed by Alchemy and Robert Miller of Flashbots, the bot is able to back-run the sandwich bundle it sees in the uncle block, effectively using the uncle block as a memory pool.

The MEV extraction boom prompted miners to run their own MEV bots. The Uncle Bandit attack is an example of an MEV extraction where miners have a significant advantage because they can see the uncle blocks first. As the MEV space has become more competitive, some MEV participants have evolved into predators. Nathan Worsley’s Salmonella contract demonstrates how flaws in simulated logic can be exploited to take advantage of sandwich arbitrage bots.

Bots submitted in a public memory pool, for prioritized strategies, bid against each other at increasingly higher gas prices to capture MEV in a so-called Priority Gas Auction (PGA). this creates a feedback loop as the cost estimator uses elevated Gas prices as a reference, causing non-MEV users to pay too much for the trades to be executed. In addition, since only one bot can capture MEV, all non-winning bots will cancel or resume their transactions, which takes up unnecessary gas. in other words, extracting MEV through the PGA leads to externalities that affect all ethereum users.

Traditional MEV
Robo-running transactions are not new and have existed in traditional financial markets for decades. But it wasn’t until Michael Lewis’ 2014 book, Flash Boys: A Wall Street Revolt, that the world became widely aware of these predatory strategies. Over the years, high-frequency trading venues have used a variety of strategies to gain latency advantages – colocation, cable lines, microwave towers, etc. In some cases, exchange employees were also involved in market manipulation.

Post-run trading in traditional markets typically occurs when trading venues use exchange mechanisms that enable them to enter orders immediately after the event. This means either cracking a method to get event data faster or sending orders to the matching engine faster. Accidental HFT Firm is a great blog that documents some of these high frequency vulnerabilities.

Dark pools are another trading system that allows buyers and sellers to place orders without publicly revealing their orders. HFT firms look for large orders by sending 1 lot orders to the market to detect liquidity. When large amounts of liquidity are found, a sandwich style strategy is used to take advantage of price movements once the block is filled.

Growth of MEV
MEV has recently been redefined as “maximum extractable value” as the number of MEVs achieved has grown exponentially with the adoption of DeFi and the recognition that block producers in the blockchain that do not rely on proof-of-work can also extract value, such as the validators in ETH2.

Learn about Miner Extractable Value (MEV) in one article and how to maximize the benefits of trading

Figure 1. Flashbots MEV Browser: cumulative MEVs extracted from January 1, 2020.

As the number of realized MEVs grows, MEV bot operators are starting to send transactions through private networks such as Flashbot. These private networks allow bot operators to send their transactions directly to miners and share MEV revenue with miners in exchange for transaction execution.

Learn about Miner Extractable Value (MEV) in one article and how to maximize the benefits of trading

Figure 2. Flashbots MEV Explorer: Extracted MEV breakdowns.

How do miners get compensated?

Miners are currently compensated from three sources.

Base fee – 2 ETH bonus per block + uncle block bonus

Transaction fee – the gas bid paid by the user to include the transaction in the block

MEV – additional fee that miners extract by inserting transactions at specific points in the block

Transaction fees are the source of congestion in the ethereum network, as orders compete for inclusion in blocks by bidding on the price of their transactions in Gas. The current transaction fee mechanism is called a first price auction, where the creator of a transaction submits a gas bid to be included in the next block. Miners then populate the block with the highest paying transactions, and each included transaction must pay their gas bid. EIP-1559, to be implemented in July 2021 via the London hard fork, will eliminate transaction fees and first price auctions and will replace them with fixed price sales.

What is EIP-1559?
The goal of EIP-1559 is to reduce the high gas fees that cause congestion on the Ether network. Tim Roughgarden’s paper on EIP-1559 breaks down the reasons for creating EIP-1559 and the implications for miners and transaction creators.

Key concepts of EIP-1559.

Each transaction requires a base fee to be paid in order to be included in the block. The base fee is based on the size of the preceding block. All base fee revenues are burned, removing them from the circulating supply of ETH (deflationary effect).

The maximum block size is increased from 12.5 million gas to 25 million gas. 12.5 million gas is now the target block size. This allows the base fee to be adjusted based on the distance between the previous block size and the target block size.

Transactions include a tip and fee cap instead of a gas price. The tip is the amount that the transaction creator pays to the miner in excess of the base fee. The fee cap must be equal to the base fee to be included in the block.

Transaction creator pays = gasLimit * min {base fee + tip, fee cap}
Miner receives = gasLimit * min {tip, fee cap – base fee}
Miners participating in the Flashbots MEV-Geth pool already receive tips from MEV bots. By April 2021, miners receive an additional 0.18 ETH for each block containing Flashbots transactions, and this is expected to grow significantly due to the release of new products that increase the number of MEVs that can be captured per block.

Learn about Miner Extractable Value (MEV) in one article and how to maximize the benefits of trading

Figure 3. Flashbots Transparency Report – April 2021

MEV Solutions
The easiest way to minimize trading MEV is to use a private memory pool to access miners, although this still trusts that miners will not steal your trades. Flashbots aims to be the MEV leader and has created a network that connects MEV extraction bots directly to miners. KeeperDAO, Secret Swap, BloXroute’s backrunme, ArcherSwap and Alchemist’s misX.io offer private networks and compensate transactions with MEV with profits from MEV bots. Sparkpool, an ethereum miner, also allows users to privately route their transactions through its private network, Taichi Network.

  1. Flashbots
    Flashbots is a research and development team working to build tools for understanding and performing unconventional MEV extractions. Flashbots launched in January 2021 with the release of two products: 1) Flashbot Alpha: a modified go-ethereum client that allows traders to communicate their trade order preferences with miners, and 2) MEV-Explore: a public dashboard that displays MEV trades in real time. Flashbot Alpha contains two main tools – MEV-Geth and MEV-Relay – that allow MEV “searchers” to submit their trades to miners privately. Extracted transactions are sorted and bundled (bundle) by MEV bot operators along with the original Mempool transactions. The bundle is then submitted to the miner, and the MEV bot operator gives the miner a portion of the profit from the transaction as a “tip” for including their transaction in the block.

As of April 2021, 84% of the pool’s computing power in the ethereum network is powered by Flashbots. The top 7 miners for the week of May 16-22, 2021 have joined Flashbots.

Learn about Miner Extractable Value (MEV) in one article and how to maximize the benefits of trading

Figure 4. Etherscan: top miners from May 16-22, 2021.

Flashbots recently released their MEV-Geth and MEV-Relay v0.2, which includes the following changes.

Improved auction pricing creates a function to estimate the opportunity cost for miners and address bundle (bundle) sales.

Discard bundles with recovered transactions: Reduces chain bloat by preventing accidental transactions from landing on the chain.

Bundle merging: allows multiple bundles to be included in a single block. Increases miner revenue and creates a higher chance of transaction inclusion for searchers.

Replacing HTTP endpoints with Websockets: reduces latency and improves node security.

Statistics for MEVs through the Flashbots network can be viewed through their dashboard.

Learn about Miner Extractable Value (MEV) in one article and how to maximize the benefits of trading

Figure 5. Flashbots dashboard: Percentage of blocks containing Flashbots packages as of June 1, 2021.

  1. KeeperDAO’s Hidden Order Book
    KeeperDAO is another protocol that uses a private virtual memory pool called a hidden order book. Users route their trades or debit transactions through a network of hidden order books, where Keeper bots withdraw MEV through arbitrage or clearing. Profits from MEV are deposited into the ROOK vault, and users receive a portion of the profits in the form of $ROOK tokens, minus admin fees. User trades are executed for free and are not affected by slippage and sandwich attacks.

KeeperDAO also has a coordination game where administrators are incentivized to cooperate, take turns and share profits rather than compete with each other through PGAs. This also prevents custodians from losing gas costs due to failed trade orders.

  1. Secret Networks’ Secret Swap
    Secret Swap is the AMM protocol on Secret Network. Secret Swap uses secret contracts (SNIP-20s) to protect users from preemption and other MEV bots while providing liquidity across chains. SNIP-20s contracts are encrypted while in the memory pool to prevent MEV withdrawals. Users are required to have a Keplr wallet and $SCRT tokens to pay the “gas fee”. Transactions on Secret Swap must pay a swap fee of 0.3% and a $SCRT gas fee. LPs and traders receive the Secret Swap governance token $SEFI.

The $SCRT token is the native governance token for the Secret Network protocol layer. Secret Network provides an encrypted memory pool that prevents nodes and verifiers from seeing transaction details. The Secret Network blockchain is based on Cosmos SDK/Tendermint with penalty and delegation capabilities. Secret Apps are built using CosmWasm smart contracts written in Rust and deployed on the Secret Network.

Learn about Miner Extractable Value (MEV) in one article and how to maximize the benefits of trading

Figure 6. Secret Swap analysis: March to May 2021.

  1. bloXroute BackRunMe
    BloXroute recently released BackRunMe, a Solidity contract that allows users to submit private transactions to prevent preemption and sandwich attacks. Trades are still available, thus providing MEV arbitrage opportunities. Users will receive a 25% rebate, while MEV bots will receive 20%, miners 50% and bloXroute 5%.
Learn about Miner Extractable Value (MEV) in one article and how to maximize the benefits of trading

Figure 7. bloXroute BackRunMe: how it works.

Learn about Miner Extractable Value (MEV) in one article and how to maximize the benefits of trading

Figure 8. bloXroute BackRunMe: profit sharing segmentation.

Archer DAO’s ArcherSwap
Archer DAO, launched in August 2020, enables miners to leverage MEV. MEV bots provided by third-party vendors offer profitable MEV bundles to miners. Providers and miners share MEV profits in the form of $ARCH governance tokens. Liquidity providers provide collateral to vendor bots for MEV strategies that require longer capital loans than lightning loans. ArcherSwap uses Archer Relay to bypass the public memory pool and send user transactions directly to their own miners and Flashbots MEV-GETH. ArcherSwap prevents preemption and slippage and is free for order cancellations and failed transactions.

Learn about Miner Extractable Value (MEV) in one article and how to maximize the benefits of trading

Figure 9. ArcherDAO network.

Archer DAO recently received a governance proposal to distribute ARCH tokens to ArcherSwap users. ARCH tokens are purchased from the marketplace using revenue generated by MEV from user transactions.

  1. TaiChi Network
    TaiChi Network is a private trading service operated by SparkPool. User transactions are only visible to Sparkpool and are not broadcast to other Ether nodes, thus preventing MEV bots from acting on orders. Since Spark Pool can view transactions, it remains vulnerable to attacks by MEV bots run by Spark Pool.
Learn about Miner Extractable Value (MEV) in one article and how to maximize the benefits of trading

Figure 10. TaiChi Network

  1. Alchemist mistX.io
    misX.io is a DEX running on the Flashbots network that enables users to send transactions as a Flashbots bundle. All misX token-ETH transactions have a gas price of 0 and users do not need to hold ETH in their wallets. misX users can also cancel transactions without paying a fee. The misX.io platform retains a percentage of miners’ tips for enriching the Crucible and Aludel rewards programs.

For DeFi users who perform exchange and debit transactions, MEV on Ether can only be reduced, not eliminated completely. The best current solution is a private network that prevents preemption and sandwich attacks in public memory pools, while also providing rebates from MEV profits or other benefits (e.g., no-gas transactions). However, as can be observed from Flashbot’s activity, new MEV extraction strategies are constantly being discovered and created, and current protections may become obsolete.

Further improvements to the current options that may reduce MEV would make the current design license-free and completely private. A permissionless design means that no trusted intermediary, i.e., the miner, will be able to review transactions. A fully private design means that no participants – i.e. aggregators, miners, gateway administrators – will be able to observe the details of the transactions. Flashbots recently submitted their MEV-SGX proposal, a license-free and fully private enhancement to Flashbot Alpha that leverages Intel’s SGX security enclave.

Learn about Miner Extractable Value (MEV) in one article and how to maximize the benefits of trading

Figure 11. MEV-SGX architecture.

Layer 2 Rollup offers another potential way to reduce MEV. Vitalik Buterin suggests that Rollup could handle the execution of all Ether-based data layers for transactions. Optimism proposes MEV Auction (MEVA), which would reduce miner MEV by creating two features: 1) transaction inclusion and 2) transaction ordering.

Learn about Miner Extractable Value (MEV) in one article and how to maximize the benefits of trading

Figure 12. Optimism MEV auction (MEVA)

In theory, proof-of-stake (PoS) can suppress time-bandit attacks by reducing the validators that attempt to reconfigure previous blocks. If MEV profits are significantly larger than the cut penalty, there is still the possibility of a time-bandit attack.

Thanks to Robert Miller of Flashbots for technical help and comments.

Posted by:CoinYuppie,Reprinted with attribution to:https://coinyuppie.com/learn-about-miner-extractable-value-mev-in-one-article-and-how-to-maximize-the-benefits-of-trading/
Coinyuppie is an open information publishing platform, all information provided is not related to the views and positions of coinyuppie, and does not constitute any investment and financial advice. Users are expected to carefully screen and prevent risks.

Like (2)
Donate Buy me a coffee Buy me a coffee
Previous 2021-06-14 06:49
Next 2021-06-14 08:06

Related articles