How Mempool Transactions Work and Where MEV Comes From
Why a transaction you sent at one price sometimes fills at another, and what an ordinary user can do about it. The answer sits in a queue most people never see: the pending transaction pool, and the automated systems competing to reorder it for profit.
What the mempool actually holds
A signed transaction waiting for inclusion is not yet part of a block. It sits in a public holding area that anyone can read, and most block explorers show it under the pending label within seconds of broadcast.
Each entry carries its own gas price or priority fee. The node building the next block chooses roughly what fits in the available space, favouring higher bids, which is why raising the fee changes how quickly you are included.
The consequence is that a transaction is a public bid before it becomes a transfer. The amount, the token, the slippage limit and the target contract are all readable by every competing bot the moment you send it.
Order is where the value changes hands
Two otherwise identical transactions produce different results based only on their position in the ordering. If a large swap lands first, it moves the price, and the small swap behind it fills against a worse number.
This is why slippage limits exist. A tolerance converts an open-ended exposure into a bounded one, and a transaction that would fill outside the bound simply fails rather than filling badly.
- Set a maximum slippage on every swap, especially the large ones where it feels unnecessary.
- Attach a deadline so a stuck transaction expires instead of executing later at a worse price.
- Prefer routing that quotes a price first and carries that quote into the transaction data.
- Split a very large swap into several smaller ones rather than sending it as one transaction.
The strategies that extract value
Searchers watch the pending pool and submit competing transactions designed to be placed around yours. Four patterns account for most of what is observed.
- Sandwiching: a bot buys before your large swap and sells immediately after it, capturing the price impact it just created.
- Frontrunning: a bot copies your transaction with a higher priority fee so its version lands first.
- Backrunning: a bot submits a transaction designed to land right after a known event, such as an oracle update or a liquidation.
- Reordering for position: a builder pays for inclusion to arrange a block in a way that favours an existing holding.
The ethical line here is genuinely contested. Sandwiching is regarded as theft by the users it targets and as harmless arbitrage by the searchers running it, which says something about the incentive structure rather than about ethics.
What protection looks like
Modern tooling attacks this at three separate layers.
Private pools keep a transaction off the public queue until a builder includes it directly in a block. The order is unknown to competitors while it waits, though you lose the ability to cancel it.
Simulation shows what a transaction will do before you sign, including the expected price impact and any permission it grants. Reading that output has become a habit worth forming, because it is the last moment the information is free.
Order-flow auctions let builders bid for the right to include your transaction and share part of the resulting value back with you. The mechanism is a partial answer: it changes who captures the value rather than removing it.
What stays outside your control
None of this eliminates price impact, liquidity quality, or the possibility of an unfavourable block. Routing through deep liquidity reduces the size of each effect rather than the chance of one.
The realistic goal is a bounded worst case: a slippage limit, a deadline, a simulation output you actually read, and a position small enough that a bad fill is survivable rather than career-defining.
Frequently asked questions
Does a slippage tolerance stop a sandwich attack?
It limits the damage rather than preventing it. The bot can still get in front of you, but the transaction fails if the combined price impact exceeds your limit, which is what prevents a worst-case fill.
Why does a transaction sit pending for many blocks?
Priority fees compete against everything else in the queue, and that queue is re-sorted continuously as new transactions arrive. A low fee is a low bid in an auction that has not started.
Are private transaction pools free?
Usually available at no extra cost, though some wallets charge for the feature. The trade-off is that once the transaction has been handed to a builder you generally cannot cancel it.