Cointime

Download App
iOS & Android

How MEV Is Preventing You From Making Profitable Trades

What is MEV?

MEV (maximal extractable value) is the highest possible value that can be obtained from mining a block, beyond the standard reward for mining and fees for processing transactions. This value can be obtained by including, excluding, or rearranging certain transactions within the block.

MEV is obtained by including, excluding, or rearranging transactions within a block.

MEV was originally coined in the context of proof-of-work (PoW) blockchain networks, where miners are responsible for adding transactions to the blockchain. In these networks, MEV referred to the value that miners could extract by including, excluding, or rearranging transactions within a block.

However, the Ethereum network has since transitioned from PoW to proof-of-stake (PoS), and mining is no longer part of the protocol. In PoS networks, validators rather than miners are responsible for adding transactions to the blockchain. Despite this change, the value extraction methods associated with MEV still exist, so the term is still used to refer to the value that can be extracted from the Ethereum network. However, the term “maximal extractable value” is now used instead of “miner extractable value” to reflect the fact that mining is no longer part of the process.

How does MEV affect transactions?

Validators are incentivized to adding transactions to the blockchain that adds up to the highest profitable MEV for the block they propose because this allows them to earn a higher reward for their work of proposing a block.

When independent network participants known as “searchers” use algorithms and bots to identify profitable MEV opportunities in the mempool, the list of transactions that are not yet included in a block, they submit a higher priority fee than their target transaction to ensure that the searcher’s transaction is submitted in accordance with their opportunity.

Let’s discuss what we mean by this MEV opportunity and how MEV is extracted to exploit your innocent transactions below.

How is MEV being exploited to attack your transactions?

Front-running

Front-running happens when a searcher identifies a potentially profitable transaction in the mempool, such as am arbitrage opportunity or a large transaction, and quickly executes a similar transaction with a higher fee. This transaction is more likely to be processed by the network first, allowing the miner to effectively steal the victim’s profits.

In short, you have worked hard to find a lucrative trade opportunity. But just as you are about to complete the transaction, an attacker swoops in and steals it by paying a higher gas fee to have their transaction processed before yours. This is like a seagull snatching a hot dog out of your hand just as you were about to take a bite. You are left feeling upset and defeated.

Sandwich Attack

In a sandwich attack, a searcher will monitor the mempool for large decentralized exchange trades to “sandwich” transactions.

As an example, if an individual wants to purchase 2,000 ETH with DAI on Uniswap, a trade of this size could significantly impact the ETH/DAI pair, potentially causing the price of ETH to significantly increase relative to DAI.

A searcher can determine the estimated price change that this large trade will have on the ETH/DAI pair and place a buy order just before the large trade. This allows the searcher to purchase ETH at the current price. Wait for the large trade to drive up the price, then execute a sell order immediately following the large trade, taking advantage of the increased price.

The process can be described as follows:

  1. Someone sees that you have made a deal to buy a large quantity of sandwiches at the current market price.
  2. They beat you to the punch and complete a similar deal to buy sandwiches at the market price.
  3. The increased demand for sandwiches due to the searcher’s deal causes a shortage (lower liquidity), driving up the price of sandwiches.
  4. Your deal is then completed at a higher price than you anticipated (higher slippage).
  5. The searcher then immediately resells the sandwiches for a higher price than they paid.

Back-running

Back-running refers to an attack where the searcher attempts to have their transaction processed immediately after a specific, unconfirmed “target transaction.”

For instance, a back-running bot might monitor the Ethereum mempool for new pairs being created on Uniswap. If the bot detects a new pair, it will place a buy transaction directly after the initial liquidity. The bot will then attempt to purchase as many tokens as possible (leaving some available for other traders), before waiting for the price to rise as other traders buy the token from Uniswap. The bot can then sell the tokens at a higher price. The success of this strategy depends on being the first to buy the tokens, but only after the token has been officially launched.

Back-runners can be seen as scalpers or resellers that quickly purchase large quantities of a newly released product, causing a shortage and driving up the price. They then sell the product at a higher price, profiting from the shortage they created.

So how can we protect ourselves from searchers exploiting MEV to hurt our trades?

The Salmonella Contract

The Salmonella contract is designed to lure and deceive front-running traders through the use of a decoy ERC-20 token and a misleading transfer function. If a transaction meets certain criteria (such as not being on a whitelist or initiated by the contract owner), the transfer function will only transfer a portion of the purchased amount to the front-runner. Other smart contracts have been created that impose a transaction tax specifically on known front-runners.

Liquidity Sniper Trap

In a Liquidity Sniper Trap is when the token contract has built-in code that can identify when a back-runner attempts to acquire the initial liquidity from a new decentralized exchange pair that includes the associated token. The back-runner is then added to a blacklist and prevented from selling their tokens. This restriction may be lifted at a later time.

Private mempool, “Dark pools”

Typically, transactions are broadcast to the mempool where they remain pending until validators pick them and add to the block. Private transactions however, are only visible to the pool and are not broadcast to other nodes. Private transactions usually come with a fee for the user, and may have their own rules and restrictions into which type of transaction can be included into their private pool.

We will discuss dark pools in more detail in the next part of these series, so if you haven’t, follow my account on Medium to learn more.

In conclusion:

I think none other than Dan Robinson and Georgios Konstantopoulos summarized what actually goes on in the short but decisive moment that happens between you submitting your transaction, and when it is published in a block to be immortalized for the world and future generation to verify in the post, Ethereum is a Dark Forest.

This article was written in 2020, and 3 years later and with Ethereum transitioning from proof-of-work to proof-of-stake the MEV exploitation problem has not been solved and MEV has become a bigger problem that I think is not addressed as much as it should by the community.

I understand why MEV exists, and does seem essential to incentivize validators, and to offer users the opportunity to prioritize their transaction by paying a higher fee. However, condoning or encouraging specific users to be able to hurt other users by paying another fee is not beneficial for the health of the network or the broader crypto community in general, and solutions to this problem is necessary.

Please stay tuned for the next piece in this series where I dive deeper into topics related to MEV.

https://coinsbench.com/how-mev-is-preventing-you-from-making-profitable-trades-a9692698b08a

Comments

All Comments

Recommended for you

  • Putin: Russia "supports" Harris, calls her smile "contagious"

    According to foreign media such as TASS and Russia's Sputnik News, Jinse Finance reported that on the afternoon of September 5th local time, Russian President Putin said at the plenary session of the Eastern Economic Forum 2024 that Russia will "support" the US Democratic Party presidential candidate and vice president Harris as recommended by the US President Biden in the upcoming US presidential election. When asked how he viewed the 2024 US election, Putin said it was the choice of the American people. The new US president will be elected by the American people, and Russia will respect the choice of the American people. Putin also said that just as Biden suggested his supporters to support Harris, "we will do the same, we will support her." The report said that Putin also joked that Harris' laughter is "expressive and infectious," which shows that "she is doing everything well." He added that this may mean that she will avoid further sanctions against Russia.

  • An ETH whale repurchased 5,153 ETH with 12.23 million USDT 20 minutes ago

    A certain high-frequency trading ETH whale monitored by on-chain analyst Yu Jin bought 5,153 ETH with 12.23 million USDT 20 minutes ago.

  • CFTC: Uniswap Labs has actively cooperated with the investigation and only needs to pay a fine of US$175,000

    The CFTC has filed a lawsuit against Uniswap Labs and reached a settlement. It was found that Uniswap Labs illegally provided leveraged or margined retail commodity transactions of digital assets through a decentralized digital asset trading protocol. Uniswap Labs was required to pay a civil penalty of $175,000 and cease violations of the Commodity Exchange Act (CEA). The CFTC acknowledged that Uniswap Labs actively cooperated with law enforcement agencies in the investigation and reduced the civil penalty.

  • Federal Reserve Beige Book: Respondents generally expect economic activity to remain stable or improve

    The Federal Reserve's Beige Book pointed out that economic activity in three regions has slightly increased, while the number of regions reporting flat or declining economic activity has increased from five in the previous quarter to nine in this quarter. Overall employment levels remain stable, although some reports indicate that companies are only filling necessary positions, reducing working hours and shifts, or reducing overall employment levels through natural attrition. However, reports of layoffs are still rare. Generally speaking, wage growth is moderate, and the growth rate of labor input costs and sales prices ranges from slight to moderate. Consumer spending has declined in most regions, while in the previous reporting period, consumer spending remained stable overall.

  • Puffpaw Completes $6 Million Seed Round with Lemniscap Ventures as Participant

    Puffpaw has announced the completion of a $6 million seed round of financing, with participation from Lemniscap Ventures. The Puffpaw project plans to launch a blockchain-enabled electronic cigarette aimed at helping users reduce nicotine intake through token incentives. The project encourages users to quit smoking by recording their smoking habits and rewarding them with tokens. Puffpaw's token economics aims to cover 30% of the cost of users' first month of using their product and provide social rewards. The project also considers possible system abuse, but the issue of users potentially reporting smoking habits dishonestly is not yet clear.

  • Affected by Ethervista and others, Ethereum Gas temporarily rose to 33gwei

    According to Etherscan, due to the influence of contracts such as Ethervista, Ethereum Gas has temporarily risen to 33gwei, with the top three being EthervistaRouter, UniswapRouter, and BananaGun.

  • The probability of the Fed cutting interest rates by 25 basis points in September is 55%.

    The probability of the Federal Reserve cutting interest rates by 25 basis points in September is 55.0%, while the probability of a 50 basis point cut is 45.0%. The probability of the Federal Reserve cutting interest rates by a cumulative 50 basis points by November is 32.1%, by 75 basis points is 49.2%, and by 100 basis points is 18.8%.

  • Nvidia: No subpoena received from the US Department of Justice

    Nvidia (NVDA.O) stated that it has not received a subpoena from the US Department of Justice.

  • US SEC again postpones decision on environmentally friendly Bitcoin ETF listing application

    The US Securities and Exchange Commission (SEC) has once again postponed its final decision on the New York Stock Exchange (NYSE) Arca's application for a carbon offset Bitcoin ETF. According to a document dated September 4th, the decision has been extended to November 21st. The ETF aims to provide a Bitcoin investment exposure in an environmentally friendly way by offsetting carbon emissions, tracking an investment portfolio composed of 80% Bitcoin and 20% carbon credit futures. Tidal Investments submitted the fund registration application in December 2023, while NYSE Arca submitted the initial application in March. Concerns have been raised about the environmental impact of Bitcoin mining, with the International Monetary Fund (IMF) reporting that cryptocurrency mining accounts for 1% of global greenhouse gas emissions. The delay in this decision also includes the postponement of approval for the Nasdaq One-Stop Cryptocurrency Investment Portfolio ETF.

  • Japanese regulator calls for lower cryptocurrency tax rates by 2025

    On September 4th, it was announced that Japan's financial regulatory agency has released a comprehensive tax reform plan for the fiscal year 2025, which includes regulations on cryptocurrency to lower its tax rate.