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

  • U.S. July Nonfarm Payrolls Fall by 23,000, Missing Market Expectations

    On August 7, U.S. nonfarm payrolls decreased by 23,000 in July, compared with market expectations of an increase of 80,000, and the previous value was an increase of 57,000.

  • US May and June Nonfarm Payroll Additions Revised Down by 103,000 Combined

    On August 7, the US Bureau of Labor Statistics: May nonfarm payroll additions were revised down from 129,000 to 63,000; June nonfarm payroll additions were revised down from 57,000 to 20,000. After the revisions, the combined additions for May and June were 103,000 lower than previously reported.

  • U.S. Rate Futures Market Sees Lower Odds of Fed September Hike

    On August 7, the probability of a Fed rate hike in September as priced by U.S. interest rate futures declined.

  • New York Gold Futures Top $4,400 per Ounce

    New York gold futures topped $4,400 per ounce, up 2.36% on the day.

  • Japan Finance Minister: FX Market Affected by Moves Not Driven by Actual Demand

    Japanese Finance Minister Satsuki Katayama said she and U.S. Treasury Secretary Bessent agreed that the foreign exchange market has been affected by moves not driven by actual demand.

  • BTC Breaks Through $65,000

    Market data shows BTC has broken through $65,000, currently reported at $65,007.44, with a 24-hour increase of 0.6%. The market is highly volatile, please exercise risk control.

  • Brent Crude Drops 2.00% Intraday to $81.07/Barrel

    Brent crude oil fell 2.00% during the day, now at $81.07 per barrel. (Jin Shi)

  • Trump: Data Centers May Be More Important Than Oil

    August 7 news, U.S. President Trump said in an interview with Punchbowl News, "I saw the other day that Texas seems to be opposed to building data centers. I think that's a mistake. I'm not taking a position—I just think it's a mistake, because there are other communities that want to build data centers. When a community is willing to accept data centers, it means a lot of money will flow into that community. I don't think they're ugly. Some of the data centers I've seen are the most incredible buildings I've ever seen. They are very important to the economy. If Texas says no to data centers, that's a mistake, because data centers may be more important than oil."

  • Trump to Meet with Mining Executives

    On August 7, according to CCTV International News, US President Trump will convene executives from some of the world's largest mining companies at the US State Department on August 7 local time, in an effort to take action to 'secure critical mineral supplies for the US and its allies.' Reuters reported that the US urgently needs critical minerals to replenish weapons inventories depleted during the war against Iran. During the more than five-month war with Iran, the US military expended large quantities of precision-guided missiles and air defense interceptors. US defense officials and lawmakers have warned that given existing production capacity constraints, replenishing some stockpiles could take years—although the Trump administration has denied reports of a so-called 'severe shortage of ammunition stockpiles.' According to Pentagon officials and defense companies, supplies of minerals such as rare earths, tungsten, germanium, and scandium are essential for manufacturing precision-guided missiles, fighter jets, armored vehicles, infrared sensors, and other advanced weapons systems. Expected attendees include industry giants such as global mining giant Rio Tinto Group, Australia's BHP, US Freeport-McMoRan, US Mountain Pass Materials, US Rare Earths, US Energy Fuels, and Canada's Metals Company. According to sources, the Trump administration plans to announce multiple deals and memorandums of understanding.

  • US Regulators Systematically Review Chinese AI Firms' Third-Country Computing Power Leasing

    August 7 news, according to Bloomberg, people familiar with the matter revealed that the U.S. government department responsible for investigating chip export control violations is reviewing Chinese AI companies' leasing of computing power in third countries to obtain Nvidia advanced chips.