MEV bots steal 0.3–2% from every public swap. Purple Flea routes your agent's transactions through Flashbots Protect and private mempools — invisible to searchers, included directly by validators.
Maximal Extractable Value (MEV) refers to profit that block producers and specialized bots can extract by reordering, inserting, or censoring transactions within a block. For AI agents executing swaps, this translates directly into money taken from your agent on every trade.
When your agent submits a swap to the public mempool, it becomes visible to thousands of MEV searcher bots within milliseconds. These bots run highly optimized detection algorithms that identify profitable opportunities — and act on them before your transaction is included in any block.
The three primary attacks your agent faces are sandwich attacks, front-running, and back-running. Each one extracts value from your agent's position with no recourse once the transaction is broadcast publicly.
A bot detects your large buy order, front-runs it with its own buy (pushing the price up), lets your transaction execute at the inflated price, then immediately sells — pocketing the difference at your expense.
A bot copies your pending transaction and broadcasts it with a higher gas price, ensuring it executes first. When price-sensitive arbitrage or liquidation calls are involved, front-runners capture the entire profit.
Bots execute immediately after your transaction to capture the price impact you created. While less harmful than sandwich attacks, back-running contributes to overall slippage degradation on repeated agent activity.
Purple Flea routes all protected swap transactions through private relay infrastructure that bypasses the public mempool entirely. Transactions are submitted directly to block builders and validators who include them without broadcasting to the wider network.
This means MEV searcher bots never see your agent's transactions. They cannot front-run what they cannot observe. Purple Flea's protection layer handles routing transparently — your agent calls the same swap endpoint, passing a single parameter to opt into MEV-protected submission.
On Ethereum, Purple Flea integrates with Flashbots Protect — the gold-standard private relay operated by Flashbots. Transactions submitted via Flashbots Protect are delivered directly to MEV-aware block builders who include them without exposing them to the public mempool. The critical property: your transaction either succeeds or fails cleanly. There is no partial execution or failed-but-exposed state that leaks your intent to searchers.
Flashbots Protect transactions are included within 1–3 blocks under normal conditions — the same as public mempool transactions — with no additional gas cost.
Purple Flea extends MEV protection across all supported chains using chain-native private infrastructure:
| Chain | MEV Protection Method | Sandwich Protection | Front-Run Protection |
|---|---|---|---|
| Ethereum | Flashbots Protect + MEV Blocker | Yes | Yes |
| Arbitrum | Sequencer private feed | Yes | Yes |
| Solana | BloxRoute private relay | Yes | Partial |
| Base | OP Stack sequencer + Flashbots | Yes | Yes |
| Polygon | Bor private endpoints | Partial | Partial |
| Public Mempool (no protection) | — | No | No |
Note on Arbitrum: Arbitrum's centralized sequencer means transactions are ordered by arrival time rather than gas price bidding. This eliminates most traditional front-running but Purple Flea still uses private sequencer feeds to prevent inspection-based sandwich attacks from latency-sensitive bots.
MEV protection is a single parameter on Purple Flea's swap API. No configuration changes, no new keys, no added complexity. Your agent calls the same endpoint it already uses.
// Standard swap — visible in public mempool const swap = await purpleflea.swap({ chain: "ethereum", tokenIn: "ETH", tokenOut: "USDC", amountIn: "1.0", slippage: 0.5, // No mevProtection — will appear in public mempool });
// MEV-protected swap — routed through Flashbots Protect const swap = await purpleflea.swap({ chain: "ethereum", tokenIn: "ETH", tokenOut: "USDC", amountIn: "1.0", slippage: 0.5, mevProtection: true, // <-- single flag, full protection }); console.log(swap.route); // "flashbots-protect" console.log(swap.mevSaved); // estimated USD value protected console.log(swap.txHash); // transaction hash once included
// Get quotes for both routes and compare const [publicQuote, protectedQuote] = await Promise.all([ purpleflea.getSwapQuote({ chain: "ethereum", tokenIn: "ETH", tokenOut: "USDC", amountIn: "10.0", mevProtection: false, }), purpleflea.getSwapQuote({ chain: "ethereum", tokenIn: "ETH", tokenOut: "USDC", amountIn: "10.0", mevProtection: true, }), ]); const diff = protectedQuote.amountOut - publicQuote.amountOut; console.log(`MEV protection advantage: ${diff} USDC`); // Always use protected route for large swaps if (parseFloat(amountIn) > 1.0) { await protectedQuote.execute(); }
Real-world MEV extraction rates vary by market conditions, trade size, and token pair. The table below uses conservative estimates based on on-chain MEV data from 2024–2025.
For high-frequency trading agents executing millions of dollars per month, MEV protection transitions from a nice-to-have to a critical financial necessity. At $10M/month in swap volume, unprotected MEV extraction at 0.3% represents $30,000 in monthly losses — over $360,000 annually.
Sandwich attacks are the most damaging form of MEV for swap-heavy agents. A bot observes your pending swap, buys the token before you (front-run), waits for your transaction to execute at the worse price, then sells immediately (back-run). The bot profits from the price impact your own trade created.
Purple Flea eliminates sandwich attacks by routing your swap as a private bundle directly to validators. The bundle is either included atomically or not at all — searcher bots cannot observe it in any pending state.
Front-running occurs when a bot copies your transaction and pays higher gas to get included first. This is prevalent for liquidations, arbitrage captures, and NFT mints where being first has material economic value.
With private submission, your transaction is never broadcast to the public. No bot can copy and outbid it because the transaction does not enter any observable queue. Purple Flea's relay delivers it directly to the builder's private orderbook.
Even without a direct sandwich attack, public mempool transactions suffer from induced slippage caused by other bots repositioning around your expected execution. Purple Flea compares MEV-protected pricing against public routing before execution, selecting the better output automatically when the difference exceeds a configurable threshold.
MEV protection integrates natively with all Purple Flea swap and trading endpoints.