MEV Makes Visible Swaps Vulnerable to Worse Fills
MEV affects token swaps when bots trade around visible orders, worsening the price a swapper gets. Learn how sandwich attacks work and how to limit exposure.
By The Coin Wire Editorial5 min read

MEV affects a token swap by letting bots trade around a pending order, so the swapper can receive less at a worse price. The risk comes from transaction ordering: a bot sees the order, acts before it, then trades again after it.
MEV turns a visible swap into a trading signal
MEV, or maximal extractable value, is profit made by ordering, inserting or excluding transactions in a block. Block builders choose transaction order, and that choice matters when a pending swap is visible in the public mempool.
A swap sent through the public mempool reveals details such as its trade size and minimum output. That minimum is the least the user agreed to receive after slippage; it gives other traders a boundary they can use when estimating how far the swap price can move before the transaction fails.
Here is how a sandwich attack works, step by step:
- A user submits a swap for 10 ETH to USDC with 1% slippage tolerance. It waits in the public mempool.
- A bot sees the order and buys USDC with ETH first. That trade shifts the pool price, making USDC more expensive for the user.
- The user’s swap executes at the worse price and receives fewer USDC than it would have before the bot’s trade.
- The bot sells the USDC it bought, trading after the user and keeping the difference, provided the price movement and fees leave a profit.
The user’s minimum output limits how much the fill can worsen before the swap reverts. If the bot’s trade would push the result below that limit, the transaction should fail instead of completing at a still worse price. A tight tolerance narrows the attack’s room, though it can also make a swap more likely to fail when the market moves.
Back-running arbitrage is different from a sandwich. An arbitrage bot can trade after a swap to bring prices back in line across pools. That activity may restore the price discrepancy, but it does not itself take value from the swapper in the way the front-run and back-run of a sandwich do.
Exposure depends on which chain executes each swap leg
MEV exposure follows the chain and transaction path where a swap executes. A route that crosses chains can include several steps, but the relevant sandwich risk sits on legs that run where pending transactions are visible in a public mempool.
That is mainly a concern on Ethereum mainnet under the conditions described here. Sequencer rollups such as Arbitrum do not have a public mempool, so the same public-mempool sandwich pattern does not apply there in the same way. A route can still have other execution risks, but the mempool visibility that exposes a pending swap is the key distinction for this attack.
For a constructed example, imagine a user swapping ETH on Ethereum before moving the resulting USDC to Arbitrum. The Ethereum swap is the leg to examine for public-mempool exposure; the later rollup step has a different transaction-ordering setup. When comparing routes, the user needs to know which leg performs the trade and what minimum amount the route promises to deliver. The article on how LI.FI bridge routes work explains the route choice behind that comparison. A lifi bridge aggregator can offer routes across chains, but MEV affects the swap legs within a route, not the fact that assets are being moved between chains. The route’s minimum received amount caps the loss the user accepts before execution fails.
Three practical controls change the trade-off. A private RPC can send a transaction to builders without exposing it in the public mempool, reducing the opportunity for a public-mempool sandwich. Flashbots Protect is one such private RPC. Smaller trades in deeper pools usually move the price less, leaving less predictable movement for a bot to exploit. Tight slippage tolerance also limits the worst accepted fill, while increasing the chance a transaction reverts if the market changes.
Related
How to check if a swap was sandwiched
A sandwich is visible in the transaction sequence on-chain: a bot’s trade comes before the user’s swap, and a related trade comes after it. Compare the swap’s actual output with its minimum output and inspect the surrounding trades in the same block. A fill close to the minimum is a clue to investigate, not proof by itself.
What is Flashbots Protect?
Flashbots Protect is a private RPC that sends transactions to builders without putting them in the public mempool. It can reduce exposure to bots watching that mempool, while leaving the user to weigh that privacy against the usual route, price and execution considerations.
Is MEV always bad?
MEV is not always a loss imposed on a swapper. Sandwich attacks extract value by worsening a user’s fill, while back-running arbitrage can restore prices between pools without costing that swapper. Before trading, check the execution chain, route’s minimum received amount and slippage tolerance; use a private RPC when public-mempool exposure matters.