Where MEV comes from on Ethereum
This topic complements the subject of Ethereum gas fees and how to reduce them, but the underlying logic is different. Gas pays for execution and helps prioritize a transaction. MEV comes from the economic advantage created by its position relative to other operations.
Users generally broadcast a transaction to a public mempool. Searchers analyze pending operations and look for profitable sequences. They then submit transactions or bundles to block builders. The validator proposes the block that appears most profitable based on the infrastructure being used.
Arbitrage can bring prices closer together across two markets. A liquidation can protect a lending protocol. These forms create economic utility, even if they concentrate revenue among technical operators. A sandwich, by contrast, extracts value directly from the price accepted by a trader.
The Ethereum documentation on MEV defines this value as surplus obtained beyond ordinary rewards and fees through control over transaction ordering, inclusion or exclusion. It also describes arbitrage, liquidations and sandwich trades.
How a sandwich attack works
A bot spots a large order on a DEX. That order is going to move the price in a pool. The bot buys the asset just beforehand, making the victim’s execution more expensive, then sells immediately afterward at the higher price.
The victim’s transaction does not revert if the final price remains within the accepted slippage tolerance. The user simply receives fewer tokens than they would have in a market without a sandwich. The bot earns the difference after paying gas and pool fees.
The trade size, pool depth and slippage determine whether the attack is worthwhile. A large order in a small pool with 5% tolerance creates more room than a small swap on a deep market with 0.2% tolerance.
An attack can fail if the price moves in another direction or a competitor takes the position. Bots therefore simulate bundles and compete by increasing payments to builders. That competition does not automatically protect the user.
Slippage and price impact are not the same
Price impact results from the effect of your order on a pool’s curve. The closer the trade size gets to available liquidity, the further the average price moves from the initial price. Splitting the order or choosing another pool can reduce it.
Slippage tolerance is the maximum gap accepted between simulation and execution. A tolerance that is too low causes a revert when the market moves; one that is too high gives a sandwich more room to operate.
An interface may automatically adjust slippage based on the token. Always check the value before signing. Tokens with a transfer tax or low liquidity may sometimes require high tolerance, which increases the risk.
Minimum received is the practical figure to monitor. It shows the minimum amount the transaction will accept. Compare it with the current quote and the price offered by a competing aggregator.
Arbitrage and liquidations: sometimes-useful MEV
Two DEXs may display different prices. An arbitrageur buys on the cheaper market and sells on the more expensive one. This brings prices closer together and makes markets more consistent. The revenue compensates for capital, gas and execution risk.
In a lending protocol, liquidators repay an undercollateralized debt and receive a premium. The race to execute the operation creates MEV. Without liquidators, the protocol could accumulate bad debt.
This utility does not eliminate the side effects. Priority competitions can congest the network, increase payments and favor specialized infrastructure. The concentration of builders or relays also raises censorship concerns.
Users must therefore distinguish between MEV that helps maintain a market and MEV that directly worsens their execution. Absolute protection against all reordering could eliminate some useful functions; the realistic goal is to reduce harmful extraction.
Private routes and protection against frontrunning
A private route sends a transaction to builders or relays without immediately broadcasting it to the public mempool. Ordinary bots then cannot copy it as easily. Some wallets and aggregators offer this mode under the name MEV protection.
Privacy remains conditional. The provider can see the transaction, and the user depends on its rules. Check the policy in case of failure: the transaction may be broadcast publicly after a delay or may expire.
Using several builders can improve the chances of inclusion, but it broadens the circle of trust. A single channel simplifies the model while creating a point of dependency. The terms should specify whether the service protects against sandwich attacks or merely facilitates inclusion.
A private route does not fix a bad price. If the order accepts an excessively low minimum amount, normal market movement or internal counterparties can still result in poor execution. Complete protection requires appropriate slippage, liquidity and simulation.
Steps that reduce exposure
Choose a deep pool and an aggregator that compares several routes. Check the token address: a fake asset can display artificial liquidity. The guide to reading a smart contract without coding provides the basic checks.
Set slippage to the lowest level compatible with the asset and market. For a large order, compare a single execution with several smaller tranches. Splitting the order does, however, increase fees and may reveal a repeated strategy.
Avoid periods of low liquidity or extreme volatility when the transaction is not urgent. Rapid price changes multiply reverts and discrepancies. Use a limit order if the protocol offers sufficiently clear execution.
Enable a reputable MEV protection service and read how it works. Do not copy an RPC URL received in a private message. A malicious endpoint can observe, censor or manipulate interface responses.
Why increasing gas does not solve everything
Higher priority can speed up inclusion, but it can also signal that a transaction is profitable to target. Searchers use sophisticated bundles and payments; simply increasing the max priority fee does not guarantee first position.
Under EIP-1559, the max fee sets an upper limit while the burned base fee depends on the block. The economic payment linked to MEV may use other mechanisms between the searcher, builder and validator.
A pending transaction exposes its intent in the mempool for longer. Replacing it with a higher fee can help inclusion without removing the possibility of a sandwich. If the minimum price remains wide, the replacement still carries the same risk.
The right setup combines gas estimation, a short expiry and cautious slippage. Each parameter addresses a different problem.
MEV in NFTs, bridges and personal liquidations
A popular NFT mint can trigger a race for priority. Some actors buy ahead of others or bundle several operations. The value comes from scarcity and transaction ordering rather than from a token pool.
Bridges also create opportunities when prices diverge across chains. A cross-chain transaction introduces a delay during which value can change. Consult the guide to transferring assets with a crypto bridge before interpreting a discrepancy.
Your own DeFi loan may attract liquidators as it approaches the threshold. MEV then accelerates the liquidation. An alert does not guarantee enough time to react, because bots monitor the oracle and contract directly.
New intent-based systems leave solvers to find an execution. They may improve the price, but require analysis of auction rules, permissions and settlement.
Measuring the cost incurred
Compare the amount expected just before submission, the minimum accepted and the amount received. Separate protocol fees, gas, price impact and market movement. Poor execution alone does not prove a sandwich attack.
A specialized explorer may show the transactions placed before and after yours in the block. Look for a purchase of the same asset before your order and a sale afterward. The addresses, amounts and pools should form a coherent pattern.
On-chain analysis and its limitations can help interpret these traces, but intent remains difficult to prove. Several independent arbitrage trades can produce a similar sequence.
For an organization, record the quote, slippage, route and result of every significant swap. This data makes it possible to compare providers and adjust limits.
Checklist before a major swap
Confirm the token and network. Compare at least two price sources. Check liquidity, price impact, slippage and minimum received. Review gas and expiry.
Then choose the broadcasting method: public mempool or protected route. Read the provider’s commitments and its failure policy. Test a small amount when the contract or network appears new to you.
Revoke unnecessary approvals after the transaction and keep the TXID. If execution seems abnormal, analyze the block before blaming a specific platform or bot.
MEV is part of Ethereum’s economic architecture. Some forms bring prices closer together or secure loans; others transfer value away from a trader. Effective protection combines liquidity, tight slippage, simulation, evaluated private routes and a reasonable order size. No single button replaces all of these checks.