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

  • Bitcoin scaling network Mezo completes $7.5 million in financing, led by Ledger Cathay Fund

    Bitcoin scaling network Mezo has completed a $7.5 million financing round, with Ledger Cathay Fund leading the investment and Mantle EcoFund ecosystem projects from ArkStream Capital, Aquarius Fund, Flowdesk, GSR, Origin Protocol, and Bybit participating. This round of financing brings its total funding to $30 million.The new funds will be used for Mezo's plan to expand the adoption of its network, including integrating more products into its network, such as its Bitcoin staking platform Acre.

  • Toyota’s love for Ethereum, HK nods inverse Bitcoin ETF, stablecoin: Asia Express

    Asia’s top automobile manufacturer is researching how Ethereum can play a role in autonomous vehicles, Hong Kong approves an inverse Bitcoin ETF and a new stablecoin, and more!

  • As of July 25, BlackRock IBIT held more than 338,000 bitcoins, an increase of more than 1,092 bitcoins from the previous day.

    BlackRock's official update on the Bitcoin ETF shows that as of July 25th, the market value of IBIT has reached $21,890,121,436.41, and the position has increased to 338,128.5551 BTC, an increase of 1,092.7881 BTC from the previous trading day.

  • Is government oversight non-negotiable for the future of crypto?

    Governments aren’t known for allowing anything to thrive without some oversight or control, but for the most part, crypto is proving to be an exception.

  • The U.S. core PCE price index rose 0.2% in June, compared with expectations of 0.1% and the previous value of 0.10%.

    The US core PCE price index for June was 0.2%, exceeding expectations of 0.1% and the previous value of 0.10%; the US core PCE price index for June recorded a year-on-year increase of 2.6%, higher than expected. The US core PCE price index for June recorded a monthly rate of 0.1%, unchanged from the previous month and in line with expectations.

  • LayerPixel Completes $2 Million Seed Round Led by Kenetic Capital

    LayerPixel, a DeFi solution based on TON, announced the completion of a $2 million seed round of financing, led by Kenetic Capital, with participation from Foresight Ventures, Waterdrip Capital, VentureSouq, Web3 Port Foundation, Microcosm Research, TMM Club, and dozens of angel investors. It is reported that this funding will help LayerPixel accelerate the development and integration of its DeFi solution suite in the Telegram Mini App ecosystem, fundamentally changing the way users interact with decentralized finance in the Telegram environment.

  • Grayscale GBTC holdings are approximately 271,200 BTC, and the number of ETHE shares in circulation has fallen below 300 million

    Official data from Grayscale shows that as of July 25th, Grayscale GBTC holds 271,212.2467 BTC, a decrease of 410.3257 BTC from the previous trading day, with an asset management scale (non-GAAP) of $17,542,084,056.48 and a circulation share of 306,180,100 shares; Grayscale ETHE holds 2,391,684.2607 ETH, a decrease of 97,390.7166 ETH from the previous trading day, with an asset management scale (non-GAAP) of $7,468,775,526.14 and a circulation share of 282,168,500 shares; Grayscale ETH holds 310,308.0733 ETH, an increase of 13,663.3797 ETH from the previous trading day, with an asset management scale (non-GAAP) of $969,033,154.46 and a circulation share of 329,308,500 shares.

  • US Senator Withdraws Support for Elizabeth Warren's Anti-Crypto Bill

    On July 24th local time, Republican Senator Roger Marshall withdrew his support for the "Digital Asset Anti-Money Laundering Act," which he and Democratic Senator Elizabeth Warren jointly formulated for 2022, aimed at regulating the cryptocurrency industry under existing anti-money laundering and anti-terrorism financing frameworks. Currently, according to the official congressional record on the bill, there are still 18 senators supporting the bill.

  • Web3 startups raised $3.7 billion in funding in the first half of 2024, showing signs of recovery

    According to the latest report from Crunchbase, Web3 startups raised $3.7 billion in the first half of 2024. Although this number decreased by 18% compared to the first half of 2023, it increased by 42% compared to the second half of last year. Quarterly, Web3 startups raised over $2 billion in the second quarter of 2024, slightly higher than the $1.8 billion raised in the first quarter, but down 18% from the $2.2 billion raised in the same period last year. However, after eight consecutive quarters of decline, Web3 startups have seen two consecutive quarters of funding increases. In addition, although the total amount of funding has increased, there have been few large financing rounds, with only seven rounds raising over $50 million.

  • Yesterday, the U.S. spot Bitcoin ETF had a net inflow of $31.4 million

    As monitored by Farside Investors, data from yesterday (July 25th) shows that the net outflow of funds for the US Bitcoin ETF GBTC was $39.6 million; BlackRock's iShares Bitcoin Trust (IBIT) had a net inflow of $71 million yesterday; EZBC, ARKB, and BITB had no inflows or outflows of funds.