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

  • Crypto trading ecosystem LazyBear completes strategic financing of 4 million USDT

    The cryptocurrency trading ecosystem LazyBear announced the completion of a strategic financing of 4 million USDT, with participation from Gogeko Labs, DWF Labs, Shadow Labs, Salad Labs, Bees Network, REI Network, IBIT, Crypto Bullish, SYNBO Protocol, Bazaars, Sypool, Bitcoin Gbox, GemX Crypto, Wikibit, and others. It is reported that LazyBear is a cryptocurrency trading ecosystem for retail traders, committed to providing users with an industry-leading, low-fee, inclusive, and enjoyable trading experience.

  • Tether Invests $200M in Majority Stake of Brain-Computer Interface Company Blackrock Neurotech

    Tether's venture capital division, Tether Evo, has invested $200 million to acquire a majority stake in Blackrock Neurotech, a company that develops medical devices powered by brain signals to aid those impacted by paralysis and neurological disorders. The investment will fund the roll-out and commercialization of the devices and research and development purposes. Tether, the issuer of stablecoin USDT, has recently established four divisions to expand beyond stablecoin issuance and believes in nurturing emerging technologies with transformative capabilities. Paolo Ardoino, CEO of Tether, stated that Blackrock Neurotech's brain-computer-interfaces have the potential to open new realms of communication, rehabilitation, and cognitive enhancement.

  • Turnkey Raises $15M Series A Funding to Expand Wallet Infrastructure for Crypto Developers

    New York-based Turnkey has secured $15m in Series A funding led by Lightspeed Faction and Galaxy Ventures, with participation from Sequoia, Coinbase Ventures, Alchemy, Figment Capital, and Mirana Ventures. The company, founded by the team behind Coinbase Custody, offers a wallet infrastructure that enables developers to build anything that involves a wallet or cryptographic transaction. Turnkey plans to use the funds to expand operations and development efforts, and has already integrated with companies including Alchemy, Dynamic, Goldfinch, Halliday, Thunder Terminal, and Kinto. The product suite offers embedded and smart wallet services, biometric passkey logins, and seamless onboarding experiences for users.

  • Thai regulator to crack down on deceptive cryptocurrency ads

    Cryptocurrency advertisements that contain false, exaggerated, distorted, concealed, or misleading information violate Thai regulations. Regulatory agencies in major cryptocurrency markets have also taken similar measures to minimize investment losses in cryptocurrencies. For example, the UK Financial Conduct Authority (FCA) issued 450 illegal cryptocurrency advertising alerts in 2023 alone. In addition, in November 2023, the Spanish National Securities Market Commission, the main securities market regulatory agency, condemned fraudulent cryptocurrency asset promotion activities on X and reiterated the company's obligation to comply with local laws. The Thai Securities and Exchange Commission reminded cryptocurrency exchanges to include appropriate warnings about investment risks and to avoid attracting new users through special promotions. He warned that violating the above guidelines would result in "legal punishment".

  • Russia to impose cryptocurrency restrictions, exempting miners and central bank projects

    Russia will implement cryptocurrency restrictions, exempting miners and central bank projects. Starting from September 1st, Russia will impose strict restrictions on the circulation of cryptocurrencies such as Bitcoin, only allowing the issuance of digital financial assets within its jurisdiction. Anatoly Aksakov, Chairman of the Financial Market Committee of the State Duma, led this initiative. This is part of a wider government effort to control the cryptocurrency ecosystem in the face of escalating geopolitical tensions. Aksakov stated that the upcoming legislation aims to restrict non-Russian cryptocurrency transactions to strengthen the dominance of the ruble. Meanwhile, recent reports indicate that Russian entities have used cryptocurrencies, particularly Tether's USDT, to purchase key components for military technology.

  • Ethereum stablecoin transaction volume exceeds $1 trillion so far in April, setting a new record

    On April 29th, The Block data shows that as of April 28th, the trading volume of stablecoins on the Ethereum blockchain reached a record high of $1.08 trillion in April, with DAI trading volume ranking first at $578.07 billion, followed by USDC at $268.15 billion in second place, and USDT at $198.62 billion in third place.

  • Shenyu: Up to one billion users' cloud input methods may have leaked input content. Please take immediate measures to reduce the risk.

    On April 29th, Cobo co-founder and CEO Shen Yu wrote on X platform that the cloud input method used by up to one billion users may have leaked input content. If you have entered mnemonic words or other sensitive information through any of the following cloud input methods, please take immediate measures to reduce the risk.

  • EU member states prepare to enforce landmark crypto law, MiCA

    The European Union is set to enforce MiCA, a crypto law that mandates national regulators to license and supervise service providers. While the regulation is EU-wide, countries can implement slightly different technical standards that crypto firms must adhere to. MiCA's specialized rules for stablecoin issuers will take effect in a few months, followed by licensing and other requirements for crypto firms broadly in December. Each jurisdiction must transpose the EU regulation into local law, select which of their regulators will oversee crypto, and prepare to authorize token issuers and other service providers. Regulators are facing challenges in implementing the new legislation, particularly in terms of licensing requirements, and each country's crypto industry has its own concerns about implementation and proposed laws.

  • The total open interest of BTC contracts on the entire network dropped to $29.83 billion

    According to Coinglass data, the total open position of BTC futures contracts on the entire network is 478,180 BTC, equivalent to 29.83 billion US dollars.

  • An independent Bitcoin miner obtained the entire 3.125 BTC block reward by verifying block 841,286

    On April 29th, independent mining pool ckpool's software engineer and administrator Con Kolivas posted on social media that a miner had mined the 282nd independent block in Bitcoin history. The miner's computing power at the time was about 120PH, which is equivalent to about 0.12 EH, with an average of about 12 PH per week, accounting for about 0.02% of the total network hash rate.