Skip to content

Chapter 4 Spec — The Searcher

Status: SPEC (Phase 0 — written by Nick, handed to the agent) Production order: First chapter to draft


Learning objective

By the end of this chapter, the reader can:

  1. Define MEV without using the acronym's expansion
  2. Distinguish arbitrage, liquidations, and sandwich attacks — and articulate which is extractive and which is price discovery
  3. Describe a searcher's economics in plain terms (what they spend on, what they earn from, why their margins compress)
  4. Identify which actor pays the searcher in each of the three MEV flavors

Why this chapter first

Chapter 4 is the agent's voice calibration chapter. It's:

  • Adversarial enough to test the book's tone on its hardest material
  • Self-contained enough that the agent doesn't yet need to coordinate with other chapters
  • Concrete enough to anchor in worked examples without requiring the reader to understand chain-specific architecture

If we get the searcher chapter right, the rest of the book has a template.

Key questions answered

  • What is a searcher and why does the role exist?
  • What are the three things searchers do, and how are they economically different from each other?
  • Where does the searcher's profit come from in each case?
  • Why is searching a real business with real costs, not free money?
  • Who pays for sandwich attacks, and why don't they notice?

Characters introduced

  • The searcher (full sidebar)
  • The builder (cameo — full sidebar in Chapter 5)
  • The unsuspecting trader (the "you" of the worked example)
  • The liquidatable borrower (cameo in the liquidations section)

Worked example candidates

The agent should consider all three and pick one to anchor:

  1. A retail user swaps $10,000 of USDC for SOL on Jupiter, gets sandwiched for $73. Pros: continues the prologue's example, vivid, easy to follow the dollar. Cons: forces a Solana-first frame in Part II.
  2. A DeFi borrower's collateral falls below threshold and is liquidated by a searcher who pays a $400 priority fee to land first. Pros: shows the "useful" face of MEV. Cons: liquidations are less universally relatable.
  3. A trader on a DEX accidentally creates a 2% price gap with a CEX; an arbitrage bot closes it within one block and earns $1,200. Pros: cleanest case of "MEV is just price discovery". Cons: doesn't have a clear loser, which weakens the chapter's adversarial thesis.

Nick's preference: Option 1, with Options 2 and 3 as 1–2 paragraph cameos showing the full spectrum. The chapter's job is to introduce the searcher and to make the reader feel the sandwich. Option 1 does both.

Glossary terms this chapter introduces

  • MEV
  • Searcher
  • Mempool (cameo; full treatment in Chapter 3, but the term will appear)
  • Sandwich attack
  • Backrun
  • Frontrun
  • Arbitrage (in the on-chain sense)
  • Liquidation
  • Priority fee
  • Bundle (Jito-style — cameo only)

Diagrams needed

  1. The sandwich: a 4-panel sequence showing (a) the user's pending swap visible in the mempool, (b) the searcher's frontrun buy, (c) the user's swap executing at the now-worse price, (d) the searcher's backrun sell. Each panel annotated with the dollar flow.
  2. The dollar splits: a small horizontal bar showing where the $73 ends up — searcher profit, gas, builder/validator tip, network fee. Visually intuitive at a glance.
  3. (Optional): a "Searcher P&L" table showing a hypothetical day — opportunities seen, opportunities won, gas spent on losing bids, net profit. This makes the "real business with real costs" point land.
  • Backward: Chapter 2 (LPs lose to informed flow), Chapter 3 (mempool visibility makes sandwiches possible). If those chapters aren't written yet, this chapter can stand alone but must briefly establish both concepts inline.
  • Forward: Chapter 5 (the builder/validator gets paid by the searcher — who pays for that?), Chapter 7 (exclusive flow changes who can searcher what), Chapter 11 (LPs and retail are the chronic losers in this game).

Tone notes specific to this chapter

  • The temptation here is moral outrage. Resist it. The chapter is more effective if it describes the mechanics with surgical neutrality and lets the reader feel the indignation themselves.
  • Searchers are not villains. Many of them are smart engineers running competitive businesses. The chapter should respect them as economic actors while being clear about who bears the cost of their work.
  • Use the TradFi parallel hard: a searcher is to on-chain markets what an HFT desk is to NASDAQ. The differences matter, but the role is familiar.

Open questions for the agent's Phase 1 research

  • What's the most recent credible estimate of total MEV extracted across major chains? Aim for 2024 or 2025 numbers.
  • Are there public estimates of average sandwich loss as % of trade size, broken down by trade size?
  • Is there a clean public source on searcher economics (what an established searcher's gas spend looks like as % of revenue)? Flashbots and EigenPhi research are starting points.
  • For the worked example: what's a realistic priority fee for a sandwich pair on Solana in 2025? Real number, not made up.
  • Sandwich-specific note: confirm whether the chapter should distinguish "true" sandwiches (intent-revealing frontruns) from JIT liquidity provision, which is sometimes lumped in but is economically different.

Out of scope for this chapter

  • Specific MEV mitigation strategies (mentioned in Chapter 3, expanded in Chapter 11)
  • The validator's role in MEV (Chapter 5)
  • The infrastructure layer that sells MEV access (Chapter 6)
  • Exclusive flow arrangements (Chapter 7)
  • Cross-chain MEV (Chapter 10)

Keep this chapter focused on the searcher. Everything else is a cameo.