> ## Documentation Index
> Fetch the complete documentation index at: https://docs.allium.so/llms.txt
> Use this file to discover all available pages before exploring further.

# MEV

> Why the order of transactions in a block has value, the main extraction strategies, and how MEV distorts onchain metrics.

**MEV** — maximal extractable value, originally *miner* extractable value — is the profit available to whoever decides which transactions go into a block and in what order.

The order matters because onchain state changes as each transaction executes. Two transactions touching the same AMM pool produce different results depending on which runs first, so the party choosing the sequence holds an option, and that option is worth money.

MEV is not a bug in a particular protocol. It is a consequence of public transaction ordering, and it exists on every chain that has both a public mempool and shared state.

## How extraction works

<AccordionGroup>
  <Accordion title="Arbitrage" icon="right-left">
    The same asset trades at different prices on two venues. A searcher buys on the cheaper one and sells on the dearer one in a single atomic transaction, taking the spread with no price exposure.

    This is the benign majority of MEV. It is what keeps prices consistent across venues, and it is the same function arbitrageurs serve in any market.
  </Accordion>

  <Accordion title="Sandwich attacks" icon="bread-slice">
    A searcher sees a large pending swap, places a buy immediately before it and a sell immediately after. The victim's swap executes at a worse price, and the searcher captures the difference.

    This is extraction at a user's direct expense. The victim sees it as unexpectedly bad slippage, and usually never learns why.
  </Accordion>

  <Accordion title="Liquidations" icon="gavel">
    Lending protocols pay a bonus to whoever liquidates an undercollateralized position. Bots race to be first, and the race is won by transaction ordering rather than by speed of observation.

    Necessary for protocol solvency, so the competition is over who is paid, not whether the work happens.
  </Accordion>

  <Accordion title="Oracle and long-tail games" icon="satellite-dish">
    Transacting immediately before or after an oracle update, or moving a thin market's price to shift a valuation elsewhere. This shades from arbitrage into manipulation depending on the size of the market involved. See [Oracles](/guides/oracles).
  </Accordion>
</AccordionGroup>

## Who captures it

Modern MEV runs through a supply chain rather than through the block producer alone.

**Searchers** find opportunities and build transaction bundles. **Builders** assemble those bundles into full blocks and bid for the right to have theirs used. **Validators or proposers** accept the highest bid. On Ethereum this is formalized as proposer-builder separation, so most blocks are built by specialist builders rather than by the validator that proposes them.

The practical effect is that most MEV never appears in the public mempool at all. It arrives as a private bundle, so a naive mempool observer sees only the settled result.

## Why it matters for your data

Even if you never trade, MEV changes what your numbers mean.

| Effect                            | What it does to a metric                                                                                                                             |
| :-------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Inflated volume**               | An arbitrage cycle routes value through several pools. Naive volume counts each leg as demand, when there was one economic trade and no net position |
| **Phantom users**                 | A high-frequency bot is one actor with thousands of addresses. Active-address counts read it as thousands of users                                   |
| **Distorted volume distribution** | On some chains and pairs, bot volume dominates. Cohort and retention analysis built on it describes bots                                             |
| **Misleading price prints**       | A sandwich's own swaps print prices that no ordinary participant could trade at. Averaged in, they skew derived prices                               |
| **Unexplained slippage**          | A user's realized price differs from the quote for reasons that are not fee or pool depth                                                            |

<Tip>
  Before reading any DEX metric as user demand, decide whether you want bot activity in or out — and say which. Allium's [Wallet Classification](/historical-data/wallet-classification) excludes bot and MEV-labelled addresses from its end-user universe, and [Payments](/historical-data/payments/adjusted-volume) publishes an adjusted volume that strips out non-organic flow. Both are the shape you want when the question is about people.
</Tip>

## Where to look in Allium

| You want                                                   | Where to look                                                                          |
| :--------------------------------------------------------- | :------------------------------------------------------------------------------------- |
| Trade-level data to reconstruct routing and ordering       | [DEX Trades](/historical-data/dex-trades)                                              |
| Volume with non-organic flow removed                       | [Adjusted volume](/historical-data/payments/adjusted-volume)                           |
| End-user wallets with bots excluded                        | [Wallet Classification](/historical-data/wallet-classification)                        |
| Liquidation events on lending markets                      | [Lending liquidations](/historical-data/lending/liquidations)                          |
| Transaction position within a block, for ordering analysis | Each chain's `raw.transactions` table in the [Data Catalog](/historical-data/overview) |
| NFT volume with wash trades flagged                        | [Wash trading flags](/historical-data/nft-trades/wash-trading-flags)                   |

## Next steps

* [AMMs vs CLOBs](/guides/amms-vs-clobs) — why AMM swaps are the main target
* [Reorgs](/guides/reorgs) — the other reason a block's contents are not settled
