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

  • Cointime MAY 1 News Express

    1.Celsius Network destroys 94% of total supply of CEL, worth over $89 million2.USDC Treasury destroyed more than 200 million USDC3.Pike was suspected of being hacked and lost 479 ETH4.Fantom launches $6.5 million development fund, betting on safer memecoins5.Yesterday, the U.S. spot Bitcoin ETF had a net outflow of $162 million6.The balance of Binance Bitcoin wallet increased by 6249.36 in the past 24 hours, and 15565.89 inflows in the past 7 days7.In April, NFT sales on the Bitcoin chain exceeded US$685 million, setting the third highest monthly record in history8.On-chain content distribution agreement Metale Protocol completes additional $2 million in seed round financing9.A whale deposited 1,140 MKR into Coinbase, losing about $1.1 million10.The Bitcoin stablecoin project, bitSmiley, goes live with its Alphanet V1, marking its debut deployment on the Bitcoin Layer 2 network, Bitlayer.

  • CZ sentenced: A chronology of Binance’s legal battles in the US

    Former Binance CEO Changpeng “CZ” Zhao was sentenced to four months in prison for violating U.S. money laundering laws.

  • Here’s what happened in crypto today

    Need to know what happened in crypto today? Here is the latest news on daily trends and events impacting Bitcoin price, blockchain, DeFi, NFTs, Web3 and crypto regulation.

  • Barcelona-based Web3 Video Games Startup GFAL Raises $3.2M in Seed Funding to Expand Team and Accelerate Production Plans

    Barcelona-based startup GFAL has secured $3.2 million in seed funding from investors including Supercell Ltd and Mitch Lasky. The company plans to use the funds to expand its team and accelerate its game production plans, which leverage AI and Web3 technology for immersive gameplay. GFAL's Elemental Raiders mobile game soft-launched in March 2023, with plans to build on this for a 2024 launch. CEO Manel Sort expressed gratitude for the investment and excitement to work with former colleagues from Digital Chocolate.

  • US Court to hear proposed remedies from Terraform Labs, Do Kwon in May

    The SEC proposed that Do Kwon and Terraform pay roughly $5.3 billion in disgorgement, prejudgment interest and civil penalties, while the firm’s team suggested only $1 million.

  • BTC falls below $58,000

    Golden Finance reported that according to OKX market data, BTC briefly touched $57,700 and is now trading at $58,581.53, with a daily decline of 7.15%. The market is volatile, so please be prepared for risk management.

  • On-chain content distribution agreement Metale Protocol completes additional $2 million in seed round financing

    Metale Protocol, a content distribution protocol on the blockchain, announced the completion of an additional $2 million seed round of financing. Waterdrip Capital led the investment, with participation from Aipollo Investment and Ultiverse. As of now, the total size of its seed round financing has reached $4 million. Metale Protocol was formerly known as Read2N, a Web3 decentralized reading application. The new funds will be allocated to its content creation fund to stimulate more content creation activities and promote the construction of its protocol as a platform for issuing and distributing content assets on the blockchain.

  • Bitcoin’s ‘euphoria phase’ cools, but a BTC bottom could be near — Glassnode

    Data suggests that newer investors are behind Bitcoin’s sell-off, but sell-side exhaustion will eventually mark BTC’s price bottom.

  • DWF Ventures announces investment in blockchain game developer Overworld

    DWF Ventures announced an investment in Overworld, a chain game developer. Overworld recently announced plans to launch another NFT series, and in addition, Overworld will soon launch the main world arena.

  • Cryptool invests $2 million in digital currency trading platform Bittime

    On May 1st, investment firm Cryptool invested $2 million in cryptocurrency trading platform Bittime in Series A funding. Founded in 2017, Cryptool focuses on first and second-level investments in digital currency, with a total investment of $30 million by 2023.