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

  • The total open interest of Bitcoin contracts on the entire network reached 31.41 billion US dollars

    According to Coinglass data, the total open position of Bitcoin futures contracts on the entire network is 487,500 BTC (approximately 31.41 billion US dollars).Among them, the open position of CME Bitcoin contracts is 143,600 BTC (approximately 9.23 billion US dollars), ranking first;The open position of Binance Bitcoin contracts is 109,400 BTC (approximately 7.07 billion US dollars), ranking second.

  • Bitcoin mining difficulty increased by 1.99% to 88.1T yesterday, a record high

    According to BTC.com data reported by Jinse Finance, the mining difficulty of Bitcoin has increased by 1.99% to 88.1T at block height 840,672 (22:51:52 on April 24), reaching a new historical high. Currently, the average network computing power is 642.78EH/s.

  • US Stablecoin Bill Could Be Ready Soon, Says Top Democrat on House Financial Services Committee

    The top Democrat on the U.S. House Financial Services Committee, Maxine Waters, has stated that a stablecoin bill may be ready soon, indicating progress towards a new stablecoin law in the U.S. before the elections. Waters has previously criticized a version of the stablecoin bill, but emphasized the importance of protecting investors and ensuring that stablecoins are backed by assets. Congressional movement on stablecoin legislation has recently picked up pace, with input from the U.S. Federal Reserve, Treasury Department, and White House in crafting the bill. The stablecoin bill could potentially be tied to a must-pass Federal Aviation Administration reauthorization due next month, and may also be paired with a marijuana banking bill.

  • Crypto mining company Argo mined 1,760 bitcoins last year and earned $50.6 million

    Crypto mining company Argo Blockchain has released its 2023 financial year performance report, which includes:

  • Crypto VC market hits 12-month high in March, with total investment exceeding $1 billion

    According to data from Cointelegraph, the cryptocurrency venture capital market continued to recover in March and April 2024. In March, 161 individual transactions were completed, setting a record in the past 12 months, with a total investment of more than $1 billion, an increase of 52% from the previous month. Although April has not yet ended, as of now, 90 transactions have been completed, attracting more than $820 million in investment.

  • Ethereum Layer 2 TVL has reached $39 billion

    L2BEAT data shows that Ethereum Layer2 TVL has reached $39 billion, with a 7-day increase of 6.66%.

  • Caixin: Mainland investors are currently not allowed to participate in the trading of Hong Kong virtual asset spot ETFs

    According to Caixin, the first batch of six virtual asset spot ETFs issued by Boshi International, Huaxia Fund (Hong Kong), and Jiashi International has been officially approved by the Hong Kong Securities Regulatory Commission. The goal is to be listed on April 30, 2024. It should be noted that mainland Chinese investors are currently not able to participate in the trading of these ETFs, despite the fact that they are first issued by Hong Kong companies under the umbrella of Chinese public funds.According to the product list on the Hong Kong Securities Regulatory Commission website, these six virtual asset spot ETFs were officially approved on April 23, 2024. The products are as follows: Jiashi Bitcoin Spot ETF (03439.HK), Jiashi Ethereum Spot ETF (03179.HK), Huaxia Bitcoin ETF (03042.HK), Huaxia Ethereum ETF (03046.HK), Boshi HashKey Bitcoin ETF (03008.HK), and Boshi HashKey Ethereum ETF (03009.HK).

  • Another person involved in the OneCoin scheme was arrested and the US prosecutors have filed a lawsuit against him

    According to court documents submitted by the Southern District of New York, William Morro, a person involved in OneCoin, has been arrested. Prosecutors said Morro lied to banks about the source of funds to conceal the source of funds related to OneCoin. He was involved in transferring $35 million related to OneCoin to an account in Hong Kong and about $6 million to an account in the United States.

  • Samourai Wallet crypto-currency mixing service co-founder arrested for money laundering

    According to The Block, the co-founders of the encrypted coin-mixing service, Samourai Wallet, have been arrested. Prosecutors allege that they laundered $100 million from Silk Road and other illegal markets. On Wednesday, Samourai CEO Keonne Rodriguez and CTO William Lonergan Hill were charged with operating the Samourai wallet.Prosecutors claim that Samourai is an unlicensed money transfer company that participated in "over $2 billion in illegal transactions and provided over $100 million in money laundering transactions for illegal dark web markets, including Silk Road." Rodriguez was arrested on Wednesday morning and will face trial in Pennsylvania.Hill was reportedly arrested in Portugal, and the US is seeking extradition. Prosecutors say that Samourai's network servers and domain name have also been seized, and the app can no longer be downloaded from the US Google Play store. Rodriguez and Hill are charged with money laundering and unlicensed money transmission, with maximum sentences of 20 years and 5 years, respectively.

  • Rune token DOG's transaction volume exceeded 100 BTC within 4 hours of launch

    According to data from Ordinal News forwarded by Runestone founder Leonidas, the Bitcoin symbol token DOG broke through a trading volume of 118.72 BTC (approximately $7,685,101 USD) within 4 hours of trading. The trading volume on three platforms was: Magic Eden on Bitcoin: 45.21 BTC; OKX Wallet: 20.37 BTC; UniSat: 53.14 BTC.