> For the complete documentation index, see [llms.txt](https://token-transfer-desktoken-transfe.gitbook.io/token-transfer-desk/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://token-transfer-desktoken-transfe.gitbook.io/token-transfer-desk/flashbots-sandwich-attacks-arbitrage-and-liquidations.md). Agents can also search and read this documentation through its [MCP server](https://token-transfer-desktoken-transfe.gitbook.io/token-transfer-desk/~gitbook/mcp).

# Flashbots: Sandwich Attacks, Arbitrage, and Liquidations

![Flashbots: Sandwich Attacks, Arbitrage, and Liquidations](https://i.ibb.co/TD2WHfQk/post-0026.jpg)

Flashbots discussions make more sense when you separate sandwich attacks, arbitrage, and liquidations by what creates the profit; a bot’s place in a block alone cannot establish that a user was attacked. The project researches maximal extractable value (MEV) and builds infrastructure around transaction delivery and block production. For Ethereum users, the useful question is what the bot needed: a pending swap, a price gap, or a borrowing position eligible for liquidation. Ethereum’s MEV overview treats these as distinct opportunities.

## Sandwich Attacks Need a Victim Swap Between Two Trades

A sandwich attack profits by buying before a targeted swap and selling after it, using the swap’s price movement against the trader. Imagine, illustratively, that a user is about to buy a token from a liquidity pool. Before the user’s swap, the pool has a quoted price. A bot spots the pending order, buys from that pool first, and raises the token’s price. The user then buys fewer tokens for the same input than they would have without the bot’s purchase, provided the trade remains within its slippage limit. The bot sells afterward into the price raised by the user’s swap.

The bot must learn about the targeted trade in time to arrange both sides around it. The user’s swap would move the pool price even without a bot; that ordinary price impact is not itself a sandwich loss. The extra deterioration caused by the bot’s earlier buy is the relevant harm. The pool may end near its earlier price after the bot sells, but that does not restore the tokens the user missed.

## Flashbots Infrastructure Routes Transactions; Profit Sources Define Strategies

The project’s infrastructure affects how transactions reach builders and validators, while the strategy depends on what makes a trade profitable. Public mempool exposure can give a searcher time to target a pending swap; private delivery can reduce that exposure. It cannot undo an unfavorable pool price that already exists or guarantee a particular execution price. Flashbots MEV-Boost helps validators select externally built blocks, a block production role that does not identify which strategy, if any, occurred inside one.

Flashbots infrastructure leaves the route and the profit opportunity as separate questions. When you assess a claim about [Flashbots](https://flashbots.app), identify the source of profit first, then ask whether the bot needed to observe a pending user trade and where its transactions landed. A *backrun* is a transaction placed after another transaction; it describes position, not a profit strategy. A backrun might perform arbitrage after a swap changes a pool price, while a sandwich also requires a bot trade before the swap. The labels can overlap without meaning the same thing.

## Arbitrage Trades a Price Gap, With or Without a Targeted Swap

Arbitrage earns from a difference between market prices. Suppose, illustratively, a token costs less in one Ethereum pool than it sells for in another. A searcher buys in the cheaper pool and sells in the dearer one, often within a single transaction. Before that trade, the gap exists; afterward, buying pressure raises one pool’s price and selling pressure lowers the other’s, narrowing the gap. Trading fees, gas, and available liquidity determine whether the difference leaves a profit.

If a bot waits for a user’s swap and then arbitrages the resulting difference, its transaction is a backrun as well as arbitrage. That ordering does not by itself show that the bot worsened the user’s execution: the user’s swap may already have finished before the bot acted. To evaluate harm, compare the user’s execution with what it would have been without the bot’s trade. A profitable follow-up trade is not automatically a sandwich attack.

## Liquidations Require Protocol Eligibility, Not a Pending Swap

A liquidation opportunity exists when a borrowing position crosses a lending protocol’s eligibility threshold. A decline in collateral value, a rise in debt value, or an oracle update can make a previously healthy position liquidatable under that protocol’s rules. A liquidator then repays part of the debt and receives collateral with the protocol’s specified incentive. The position moves from eligible and untouched to partly repaid and liquidated; the borrower loses collateral under the lending agreement, while the lender’s risk is reduced.

The liquidator usually needs to act before competitors but does not need to surround a borrower’s pending swap. A private transaction route may conceal the liquidator’s submission from public mempool watchers; it does not make an already eligible position healthy again. If a borrower also has a swap pending, ordering may affect whether the position meets the threshold when liquidation executes. Inspect the protocol state and transaction sequence before attributing that profit to an attack on the swap.
