Cointime

Download App
iOS & Android

The Most Common Types of MEV and Protection From Toxic Strategies

Validated Project

MEV can be an effective mechanism for making profits in DeFi, but often, profits come at the expense of other users.

MEV refers to the maximal extractable value generated from reordering transactions within a block. While MEV originally stood for “miner extractable value,” after last year’s Ethereum Merge, which replaced miners with validators, the term was changed to “maximal extractable value.”

MEV opportunities

Block builders benefit from “priority” fees users are willing to pay to speed up their transactions. Meanwhile, so-called searchers can detect potentially lucrative transactions that could impact a crypto asset’s value, bringing them a profit. Then, they pay extra in order to slip in their transactions early in a block. Potentially vulnerable transactions could be detected in the mempool, the node’s holding area for submitted and unconfirmed transactions before they are added to a block. Those pending transactions, especially large ones that can potentially move market prices and create arbitrage opportunities, can become a target for malicious searchers.

On the one hand, MEV is an integral part of DeFi’s market environment and could be used for healthy profit strategies, as long as other users are not harmed. At the same time, when searchers take advantage of MEV opportunities in a toxic way, it can lead to other users’ losses, as well as increased transaction costs and other negative consequences.

Overall, MEV scenarios could be divided into those based on the source of extraction (DEX arbitrage, liquidation) and on the type of implementation (generalized front-running, front-running, back-running and sandwich attacks).

MEV sources

DEX arbitrage

The price of the same crypto asset can vary across different DEXes, and an arbitrageur, while simultaneously buying and selling on various markets, profits from the price difference. Basically, arbitrageurs are simply relying on natural price fluctuations. Meanwhile, front-running also happens in arbitrage. For instance, a searcher bot can find a pending transaction and insert its own transaction in front of it to extract the value offered by that arbitrage opportunity. A searcher can also create an artificial arbitrage opportunity by reordering transactions on a liquidity pair before a back-run (described below).

Liquidation

When a user takes out a collateralized loan, and, due to crypto volatility, the collateral’s value later falls below a specified figure, the liquidation of the loan takes place: the smart contract sells the collateral to cover the debt and allows any user to buy it. A MEV opportunity occurs when such a transaction is identified. A searcher’s liquidation transaction is inserted in the block before all other transactions, enabling the searcher to buy the liquidated collateral at the most advantageous price.

Also, when a trader tries to re-collateralize their loan, the transaction can be censored in the process of adding funds. At the same time, the liquidation might still continue allowing searchers to buy the original collateral at a discount.

MEV types

Generalized front-running

Searchers use mempool-tracking bots to identify profitable transactions. An attacker then replaces the address of a potentially profitable transaction with their address and checks whether it is lucrative by running the transaction locally. If the result is favorable, the transaction with the replaced address will front-run the original transaction by setting a higher gas price.

Front-running

Front-running occurs when a transaction similar to that made by a user is placed directly before it in a queue to be filled. By doing that, the front-runner impacts the prices of the swapped assets, making a profit at the expense of the victim, who ends up receiving a lower amount of the target token than expected.

Back-running

Conversely, back-running occurs when a transaction is inserted immediately after the target transaction to make a profit from the market fluctuations generated by a large transaction. Although, technically, back-running does not affect other traders, an active use of this tactic can substantially increase transaction fees.

Sandwich attacks

One common form of front-running/back-running is a sandwich attack in which orders are placed before and after a target price-changing transaction, thus taking advantage of price pressure on both sides. The front-run transaction causes the movement of value. The victim’s transaction is executed at a new, less favorable price, and the final transaction captures the price difference, leaving the victim’s transaction front-run and back-run as if in a sandwich.

MEV protection with 1inch

While arbitrage and liquidations are generally neutral MEVs, traders can lose the entire amount of slippage tolerance as a result of front-running and sandwich attacks since users’ trades settle at a higher price than expected. 1inch makes sure that traders avoid the risk of being front-run or sandwiched.

In Fusion mode: Fusion swaps are performed by resolvers, with whom transactions are directly matched and then placed in a bundle with other orders to be included in the block. Bots cannot attack Fusion swaps since they are combined with other transactions.

In Legacy mode: Legacy mode does not involve resolvers and the transaction execution process follows a regular scenario. But the 1inch Wallet has long been featuring an opportunity for users to create and sign a transaction without broadcasting it to the mempool, where it could be visible to bots. In late 2022, 1inch’s frontrunning protection was stepped up by the introduction of the RabbitHole feature. With the 1inch RabbitHole, all swap transactions are sent directly to validators, bypassing mempools where sandwich bots could attack them.

Read more: https://medium.com/1inch-network/the-most-common-types-of-mev-and-protection-from-toxic-strategies-53ec43202e12

Comments

All Comments

Recommended for you

  • Family Offices Evolve into Powerful Investment Entities with Innovative Strategies and Advanced Technologies

    Family offices, which traditionally focused on conservative investment strategies, have transformed into powerful investment entities with a focus on alternative investments, private equity, co-investments, venture capital, and impact investing. This shift has been driven by innovative financial solutions and modern investment strategies, responding to technological advancements and an evolving global financial landscape. Family offices are taking a more active role in direct investments and co-investments, particularly in high-growth companies and startups, enhancing their control and flexibility. They are also diversifying further into private markets and real assets due to geopolitical and macroeconomic uncertainties, while embracing innovative financing solutions and cutting-edge risk management techniques. Additionally, family offices are implementing AI technologies to improve their decision-making processes, particularly in investment analysis, reflecting their commitment to innovation and strategic planning.

  • The Evolution of Family Offices: Embracing Innovative Investment Strategies and Technology

    Family offices have shifted from conservative investment strategies to more active roles in direct investments and co-investments, thanks to innovative financial solutions and modern investment strategies. They are now leaders in alternative investments, private equity, co-investments, venture capital, and impact investing, leveraging their capital through non-recourse and limited-recourse financing to expand their investments across sectors and regions. Family offices are also adopting sophisticated risk management strategies, diversifying further into private markets and real assets, and integrating advanced technologies such as AI-driven platforms to enhance decision-making processes. A family office in the UAE, International Venture Investments Holding, takes an active investment approach, emphasizing operational autonomy and forming dedicated management teams for specific projects. The UBS Global Family Office Report 2024 shows that 78% of family offices plan to invest in generative artificial intelligence in the next two to three years.

  • XEX officially launched the Slerf/USDT perpetual contract at 19:00 (UTC+8) on November 22

    On November 22nd, XEX officially launched the Slerf/USDT perpetual contract at 19:00 (UTC+8).

  • Source: a16z expected to get a seat on Trump’s cryptocurrency advisory board

    On November 22nd, according to multiple executives in the digital asset industry, many cryptocurrency companies such as Ripple, Kraken, and Circle are vying for seats on the cryptocurrency advisory committee promised by President Trump, seeking to have a say in their plans for US policy reform. One source said that the cryptocurrency department of venture capital giant Andreessen Horowitz, a16z, is expected to receive a seat, but currently an a16z spokesperson declined to comment on the matter.

  • BTC breaks through $98,500

    market shows BTC breaking through $98,500 and is now trading at $98,501.24, with a 24-hour increase of 0.84%. The market is volatile, so please be prepared for risk control.

  • UK to Draft Regulatory Framework for Crypto Industry by Early Next Year

    The U.K. intends to create regulations for the cryptocurrency industry by early 2022, with a focus on stablecoins and staking services. This announcement by Economic Secretary Tulip Siddiq at a conference in London will provide clarity for the industry after months of uncertainty. The new framework will be eagerly awaited by those in the industry, as Bitcoin continues to break records and gain mainstream acceptance.

  • Cardano's ADA Hits Highest Level Since May 2022 as Bitcoin Nears $100K and Capital Rotates into Alternative Cryptocurrencies

    Cardano's ADA has reached its highest level since May 2022, with evidence of significant participation from large traders in the on-chain activity. As Bitcoin approaches the $100,000 mark for the first time, capital is shifting towards alternative cryptocurrencies, generating excitement in the wider crypto market. Additionally, Bitcoin has broken a new record above $98,000, and there are reports that former US President Donald Trump is considering appointing a "Crypto Czar" and a crypto lawyer for SEC Chair. BlackRock's IBIT options launch has also contributed to Bitcoin's new ATH.

  • Matrixport: It is recommended that institutional investors allocate both Bitcoin and gold

    On November 22, Matrixport's latest weekly report shows that the progress of the fifth Bitcoin bull market coincides with its prediction for July 2023. The report predicts that Bitcoin will reach $125,000 in December 2024, and with Bitcoin approaching the $100,000 mark, this prediction becomes more credible.

  • How Crypto Could Help Open-Source AI Reach Its Potential

    The impact of artificial intelligence (AI) is being felt across various sectors, including drug discovery, workforce productivity, and personalized content on streaming platforms like Netflix. Experts predict that the AI industry will grow by 40% annually and reach a trillion-dollar market by 2030, potentially transforming industries on an unprecedented scale. The use of cryptocurrency could play a crucial role in enabling open-source AI to overcome current limitations and reach its full potential.

  • ECB board member Patsalides warns Trump's tariff plan could lead to stagflation in Europe

    Christodoulos Patsalides, a member of the European Central Bank's board, warns that if US President-elect Donald Trump follows through on his threatened trade tariffs, the European economy could ultimately fall into stagflation. "Trade tensions are escalating," said the Cyprus Central Bank governor on Thursday in Nicosia. "If trade restrictions become a reality, the outcome could be inflation, economic recession, or worse, stagflation." He said that although there is room for further lowering of borrowing costs, it should be done "at a stable pace and magnitude."