Blog Trading Strategy How MEV Works in Crypto (And How to Protect Your Trades)
Trading Strategy

How MEV Works in Crypto (And How to Protect Your Trades)

D
DennTech Team
May 14, 2026
Updated May 22, 2026
0 comments

Every time you swap tokens on Uniswap, Curve, or any public DEX, there is a class of sophisticated bots watching your transaction before it confirms — and quietly extracting value from it. This is Maximal Extractable Value, or MEV, and it costs DeFi traders hundreds of millions of dollars per year in worse fill prices, larger slippage, and outright theft of trade value. The good news: once you understand how it works, protecting yourself is straightforward.

What Is MEV and Why Does It Exist?

When you submit a transaction to Ethereum, it sits in the public mempool — a publicly visible waiting room of unconfirmed transactions. Anyone running an Ethereum node can see your pending swap: the token pair, the size, the slippage tolerance you've set. Block validators (who decide which transactions go into the next block and in what order) can exploit this information. So can specialised bots called "searchers" that continuously scan the mempool for profitable reordering opportunities.

MEV exists because blockchains give block producers discretion over transaction ordering, and because public mempools make pending trades visible before they execute. It is an inherent property of transparent blockchains — not a bug in any specific protocol, but a structural feature of how Ethereum's consensus and execution layers interact.

According to Flashbots' MEV-Explore tracker, cumulative MEV extracted on Ethereum has exceeded $1.5 billion since 2020. The per-trade tax is invisible to most users — you see a slightly worse fill price and attribute it to slippage, not realising a bot deliberately extracted value from your trade.

The Sandwich Attack: How Bots Steal From Your Swaps

The sandwich attack is the most direct and harmful form of MEV for retail traders. Here's how it works step by step:

  1. You submit a swap: buy 5 ETH using 13,000 USDC on Uniswap with 1% slippage tolerance.
  2. A bot detects your pending transaction in the mempool. It calculates that your trade will move the ETH/USDC price by approximately 0.3% due to the pool's depth.
  3. The bot inserts a front-run transaction immediately before yours: it buys ETH, pushing the price up before your trade executes.
  4. Your trade executes at the artificially elevated price — you get fewer ETH than you would have at the pre-bot price.
  5. The bot immediately inserts a back-run transaction after yours: it sells the ETH it just bought at the higher price your trade established, locking in the profit.

The bot profits the entire amount by which your trade moved the price — extracted directly from your fill quality. The higher your slippage tolerance, the more the bot can extract. A 0.5% slippage tolerance limits sandwich attack profit to 0.5% of your trade value; a 5% tolerance (often used for small-cap tokens) is an invitation for large extraction.

Sandwich attacks are most profitable on large trades relative to pool depth. A $100 swap on a deep pool is not worth sandwiching (gas costs exceed potential profit). A $50,000 swap with 1% slippage on a thin pool is extremely attractive.

Frontrunning: Copying Your Trade Before You

Pure frontrunning is simpler than sandwiching: a bot sees a profitable trade you're about to make and submits an identical transaction with a higher gas price to execute first. If you're buying a newly listed token and a bot sees your buy, it can front-run you — buy the token first, watch your purchase push the price up, then sell for profit. This is most damaging in NFT mints, token launches, and any scenario where the pending trade contains alpha the bot can exploit by executing first.

Frontrunning has become less profitable on Ethereum mainnet since MEV-Boost's adoption, as the private transaction relay system allows users to submit transactions that bypass the public mempool entirely. But it remains common on Solana (which lacks private mempool infrastructure for most users), BNB Chain, and other chains where all pending transactions are visible.

JIT Liquidity: The Passive LP Tax

Just-In-Time (JIT) liquidity is a Uniswap V3-specific MEV strategy that's less directly harmful to swappers but damages passive liquidity providers. A JIT bot detects a large pending swap, adds concentrated liquidity in the exact price tick range the swap will cross just before the transaction confirms, earns the LP fee from that swap, and immediately removes liquidity after. The swap executes with better pricing (the JIT liquidity reduced slippage) but the passive LP who deposited liquidity days or weeks ago earns nothing from that swap — the JIT bot captured the fee.

JIT liquidity is a significant contributor to passive LP underperformance on Uniswap V3 for large pools. If you're providing liquidity, be aware that sophisticated bots are competing with you for fee income on every large swap.

MEV on Solana: A Different Beast

Solana's architecture creates an even more competitive MEV environment than Ethereum. Solana processes thousands of transactions per second with sub-second finality, and all transactions are visible in the pending pool before leader selection. Jito Labs — the Solana equivalent of Flashbots — built a modified validator client that enables bundle submission and auction-based MEV. Jito validators now represent a substantial fraction of Solana's stake-weighted validator set.

Solana MEV is particularly aggressive on Solana DEXs like Raydium and Orca during memecoin launches and high-volume trading periods. The speed advantage of co-located bots (running nodes in the same data centres as validator leaders) is even more pronounced on Solana than Ethereum, making the playing field particularly uneven for retail traders using standard consumer-grade connections.

How to Protect Yourself: Practical Tools

You have real, practical options to reduce MEV extraction on your trades. Here's what works:

1. Use CoW Protocol (CoW Swap)

CoW Protocol (formerly CowSwap) is the most MEV-resistant DEX aggregator available. Instead of routing directly through public DEX pools and the public mempool, CoW batches user orders and tries to match them peer-to-peer first (coincidence of wants). Unmatched orders are routed through an auction of professional solvers who compete to find the best execution path. The entire process bypasses the public mempool, eliminating sandwich attack exposure. CoW Protocol also settles trades at uniform clearing prices within each batch, meaning no single user in a batch pays a worse price than others. For large swaps especially, CoW Protocol typically delivers meaningfully better execution than a direct Uniswap trade.

2. MEV Blocker RPC

MEV Blocker is a free Ethereum RPC endpoint (replace your MetaMask's default RPC with the MEV Blocker endpoint) that routes your transactions through a network of searchers who sign a commitment not to sandwich your transactions. Instead, they can only backrun your trades (which has no negative impact on you) and share a portion of the backrunning revenue as a rebate. Using MEV Blocker costs nothing and is a significant improvement over submitting to the public mempool. Add it to MetaMask: Settings → Networks → Ethereum Mainnet → RPC URL → https://rpc.mevblocker.io.

3. Flashbots Protect

Flashbots Protect is another private RPC that routes your transactions directly to block builders without mempool exposure, eliminating frontrunning and sandwich attacks. It's particularly useful for time-sensitive transactions where you want confidentiality about the trade until it confirms. Available at https://rpc.flashbots.net.

4. Set Conservative Slippage

Your slippage tolerance is the sandwich attacker's maximum profit margin. Set it as low as your trade conditions permit. For stablecoin-to-stablecoin swaps on deep pools, 0.1% slippage is sufficient. For ETH or BTC on major pairs, 0.3–0.5% is usually enough. Reserve high slippage (1%+) only for genuinely illiquid tokens where it's unavoidable, and consider whether the trade is worth making if the slippage required is high enough to make sandwiching highly profitable.

5. Trade in Smaller Sizes on Thin Pools

Break large trades in thin markets into multiple smaller transactions separated by a few blocks. Each individual transaction is a less attractive sandwich target, and the cumulative price impact may be similar while each individual transaction is below the profitability threshold for most MEV bots.

The MEV Ecosystem Is Evolving

The Ethereum community continues to work on structural MEV mitigation. Encrypted mempools — where transaction content is hidden from validators until the block is committed — are on Ethereum's research roadmap and would eliminate mempool-based MEV strategies entirely. The SUAVE (Single Unified Auction for Value Expression) project from Flashbots aims to create a decentralised block building and transaction privacy infrastructure. These solutions are multi-year roadmap items, but the direction is clear: the MEV problem is taken seriously and long-term mitigation is being built into the protocol layer.

For now, using MEV-protected routing and conservative slippage is the practical solution available today. The tools exist, they're free, and the execution quality improvement on large swaps is measurable and real.

Conclusion

MEV is not a theoretical concern — it is actively taxing your trades every time you use a public DEX without protection. Understanding sandwich attacks, frontrunning, and JIT liquidity extraction gives you the context to appreciate why MEV-protected routing matters. Switching to CoW Protocol for large swaps and MEV Blocker for general Ethereum transactions requires five minutes of setup and costs nothing. For any active DeFi trader executing meaningful volume, these are among the highest-ROI optimisations available.

0 Comments

No comments yet — be the first to share your thoughts.

Leave a Comment

Your email won't be published. After submitting, you'll receive a quick verification email — click the link to publish your comment.

Used only to verify your comment — never shown publicly.

0 / 2000

Free Newsletter

Get weekly crypto trading insights

New guides, tool updates, and market analysis — straight to your inbox. No spam, unsubscribe anytime.