DEV Community

ANDI NUGROHO
ANDI NUGROHO

Posted on

The Hidden Architecture Behind Crypto’s Most Sophisticated Bots

How MEV searchers are evolving from hacky scripts into institutional-grade trading systems — and what the future looks like

If you’ve ever had a transaction sandwiched, a liquidation sniped in milliseconds, or watched an arbitrage opportunity vanish before your eyes, you’ve already felt the presence of MEV searchers. You just didn’t see them.
These bots operate in the shadows of every blockchain — constantly watching, waiting, and striking the moment an opportunity appears. And as the stakes have grown from thousands to millions of dollars, the people building them have had to rethink everything about how they’re built.

This is the story of that evolution.

What Is an MEV Searcher, Exactly?
MEV stands for Maximal Extractable Value — the profit that can be captured by reordering, inserting, or censoring transactions within a block. MEV searchers are the automated systems that hunt for and extract this value.

Not all searchers are villains. Some are:

  • Arbitrageurs — keeping prices aligned across DEXs so markets stay efficient

  • Liquidators / Keepers — protecting lending protocols by closing undercollateralized positions

  • Backrunners — capturing value after large trades without harming the original user

Others, like sandwich bots, profit directly at the expense of regular users.

What they all share: it’s a winner-takes-all game. If two searchers spot the same opportunity, only one gets paid. The loser burns gas and gets nothing. This pressure has pushed searcher design to become increasingly sophisticated — and increasingly interesting.

A few real examples of the scale of opportunity here:

  • The top MEV winner in 2022 made over $3 million in a single arbitrage by back-running large swap transactions during the Nomad bridge exploit
  • DEX/DEX atomic arbitrage is one of the most competitive and lucrative strategies running today
  • Some teams go further — from mass minting NFTs to running sandwich attacks on meme tokens — taking on inventory risk for larger potential payoffs

How Searchers Are Built Today (The Monolith Problem)
Every searcher, regardless of complexity, follows the same core loop:

  1. Listen for on-chain events (new blocks, mempool transactions, price changes)
  2. Check whether a trigger condition is met
  3. Construct a transaction to exploit the opportunity
  4. Broadcast it to be included on-chain

Here’s what real open-source implementations look like:

Jito Labs MEV Bot — Solana, Rust The official reference bot from Jito Labs — the dominant MEV infrastructure on Solana (used by 92%+ of validators by stake). It backruns arbitrage across Orca and Raydium using Jito bundles. This is the closest thing to a production-standard, credibly neutral open-source searcher available right now.

solidquant/mev-templates — Python / JS / Rust One of the best modern learning resources. Three templates across three languages, all implementing DEX flashloan arbitrage with a shared design pattern — graph-based pool discovery, multicall reserve fetching across 6,000+ pools, and triangular arb path construction. A rare example of clean, readable MEV code written intentionally for education.

RenatoDev3/rusty-john — Rust An open-sourced Ethereum DEX arbitrage bot, shared explicitly as a learning resource by a practitioner. The author notes it’s profitable on lesser-known EVM chains with low competition — a realistic, unglamorized view of where open-source bots actually work in 2024.

uniswapx-artemis — Rust (Paradigm Artemis framework) A real bot by Uniswap Labs built on top of Paradigm’s Artemis framework — fills UniswapX orders using on-chain liquidity. This is a live example of the “user-benefiting searcher” model: competing to give users better execution rather than extracting from them.

DonggeunYu/MEV-Attack-on-the-BSC — Python A rare case: a fully documented, working sandwich + arbitrage bot on BSC that was live from January–May 2024, shared after the author stopped running it. Includes real transaction hashes as proof of operation, bloXroute mempool integration for 200ms speed advantage, and honest post-mortem notes on why it stopped.

The Smart Contract Complication
Many searcher strategies require deploying a smart contract to execute logic atomically on-chain. This introduces a painful constraint: smart contracts are immutable.

Find a bug? Deploy a new contract. Need an optimization? Deploy a new contract. Every deployment costs real money in gas.

Pinocchio: The Solana Equivalent of Going Bare Metal
On Ethereum, the optimization game is about EVM gas. On Solana, it’s about compute units (CUs) — a hard per-transaction budget that determines whether your program even executes. Run over the limit and the transaction fails, regardless of what you were trying to do.

This made framework choice a strategic decision, not just a developer preference. And in 2025, one framework changed the conversation entirely: Pinocchio.

To understand why this matters for searchers, you need to understand what the standard tooling costs you. The dominant Solana framework, Anchor, is beloved by developers for good reason — macros, autogenerated boilerplate, built-in IDL generation. But Anchor’s convenience speeds up the development process at the cost of more CU usage. Every macro hides allocations. Every abstraction adds deserialization. When you’re competing on microseconds and compute budgets, that cost is real. GitHub

Pinocchio eliminates it. Zero-copy access to account data eliminates expensive serialization and deserialization, saving compute units — critical in programs that operate close to Solana’s compute limits. Instead of deserializing account data into structs, Pinocchio reads directly from the raw byte array the Solana runtime hands you, using pointers. You parse exactly what you need, when you need it. Solana

The numbers from real benchmarks are striking. A reimplementation of the SPL token program using Pinocchio achieved an 88–95% reduction in compute unit usage and a 40% reduction in binary size while maintaining identical behavior. A separate benchmark comparing frameworks on a simple counter program found: Anchor used 281 compute units, Pinocchio 108, and a hand-written assembly version just 104.

Assembly on Solana: The Final Frontier
Solana programs don’t compile to EVM bytecode — they compile to eBPF (extended Berkeley Packet Filter), a register-based instruction set originally designed for high-performance kernel networking code. It’s fast, lean, and can be written directly.

At Solana’s Accelerate 2025 conference, Dean Little from Blueshift demonstrated this live. He showed how disabling certain Anchor features, hand-rolling account contexts, and ultimately switching to the Pinocchio framework could dramatically reduce CU consumption — and then live-coded an assembly language version of the program, achieving even further reductions. The assembly version consumed fewer CUs and resulted in a significantly smaller program size.

The Bundle Conflict Problem Nobody Talks About
Here’s a scenario that rarely gets discussed publicly:

You’re running two strategies simultaneously — a DEX arbitrage bot and a liquidation bot. The liquidation bot sells a large chunk of UNI to ETH as part of a liquidation. Your arbitrage bot spots what looks like a mispricing and tries to trade in the same pool. The two transactions conflict. One reverts. You lose gas.

At small scale, this is annoying. At institutional scale, it’s a serious drag on performance.

The solution is a bundler — a service that looks at all pending transactions together, understands their relationships, and finds the “best” collective execution. A smart bundler can:

  • Internalize trades — if two strategies are trading in opposite directions in the same pool, match them internally via Coincidence-of-Wants, skipping the DEX entirely and saving protocol fees
  • Reroute orders — if two strategies push through the same pool in the same direction, split them across venues to reduce slippage
  • Sequence transactions optimally — order transactions to minimize total gas cost while ensuring none revert, then insert additional transactions to capture any leftover MEV

This kind of bundle-level intelligence is the difference between a collection of bots and an actual trading system.

What Traditional Finance Got Right
This modular thinking isn’t new. Electronic trading firms in traditional finance figured it out decades ago.

The canonical architecture, described in Eugene A. Durenard’s Professional Automated Trading, works like this:

An Architecture for a Swarm-Based Trading System — Professional Automated Trading by Eugene A. Durenard

An Architecture for a Swarm-Based Trading System — Professional Automated Trading by Eugene A. Durenard

When an event arrives from the Electronic Communication Network (ECN):

  1. A translation layer semantically processes it — telling the system what actually happened
  2. Event data updates a local state representation of the market (e.g. an orderbook)
  3. Trading agents run in parallel to find profitable trades or interactions
  4. Decisions pass through automated risk management and human control layers
  5. The Order Management System (OMS) finds optimal execution — using algorithms like TWAP and VWAP, and aggregating similar orders to reduce brokerage fees
  6. The translation layer sends trades out to the exchange
  7. Fill events return to confirm completed trades
  8. A middle/back office layer performs post-trade analysis to improve future execution

Every layer has a clear responsibility. A new trading strategy plugs in as a trading agent — it doesn’t rebuild the entire pipeline.

The on-chain equivalent of each layer maps surprisingly cleanly:

TradFi Component.                                On-Chain Equivalent

ECN / Exchange feed                              Mempool, block events, Order Flow Auctions
Translation layer                                Collectors (parse raw events into structured data)
State representation                             Data aggregators (track pool reserves, positions)
Trading agents                                   Searcher strategy logic
Risk management                                  EVM simulation, portfolio exposure checks
Order Management System                          Bundler (conflict resolution, optimization)
Execution                                        Transaction gateway, block builder
Middle office                                    Performance dashboards, competitor analysis
Enter fullscreen mode Exit fullscreen mode

The Modular Searcher Execution Platform
Bringing these ideas together gives you a Modular Searcher Execution Platform — a framework where multiple strategies share common infrastructure and benefit from system-level optimizations.

A Modular Searcher Execution Platform

A Modular Searcher Execution Platform

Here’s how each layer works:

1. Collectors
Event ingestion modules. One Collector watches Uniswap swap events. Another monitors Aave borrow positions. Another listens to the private mempool. Each translates raw network messages into structured, semantically meaningful events.

The naming convention comes from Paradigm’s open-source Artemis framework — a highly recommended read for anyone building in this space.

2. Data Aggregators
Raw events become useful state. A data aggregator might maintain a live graph of all DEX pool reserves, updated tick-by-tick as swaps come in. Rather than reconstructing state from scratch on every block, you start from an indexed snapshot (using tools like Subsquid, Transpose, or The Graph) and apply incremental updates — dramatically faster.

3. Strategy Agents (Searchers / Executors)
This is where your actual strategy logic lives. An agent consumes current state from data aggregators and decides whether to act. A liquidation agent scans borrow positions for unhealthy ones. An arbitrage agent runs negative cycle detection on the DEX reserve graph.

Crucially, strategy agents are decoupled from execution — they don’t know or care how their decisions get sent on-chain. That’s the bundler’s job. This also enables parallelisation — multiple agents can work on subgraphs simultaneously, with synchronisation happening at the bundle level.

4. Automated Risk Management
Before any transaction fires, it goes through a sanity layer. EVM simulation checks whether the trade will actually be profitable after gas. Portfolio exposure checks ask: does this trade push us into too much inventory risk? Are we holding assets that could depreciate before we can unwind?

5. Bundler
The OMS of the platform. Takes transactions from multiple strategy agents, resolves conflicts, applies optimizations (internalization, rerouting, sequencing), and packages everything into the most efficient possible bundle. This is where multi-strategy synergies are captured.

6. Gateways
Pure plumbing. Abstracts the network layer — handles communication with RPCs, sequencers, private mempools, block builders. The rest of the system doesn’t need to know whether it’s talking to Flashbots, a public RPC, or a custom node.

7. Block Builder (Optional)
Introduced by proposer-builder separation to offload block construction away from validators. Running your own block builder means you control execution — but it comes with the complexity of sourcing external orderflow to make your blocks competitive for validators. This role may also evolve into “gas-maximizing bundlers” in systems like SUAVE.

8. Middle Office
The sideline services that make you better over time:

Performance Analysis — slippage, executed price, revert rates, bundle execution metrics

Competitor Analysis — how many others are running the same strategy? Who won? What does their PGA (priority gas auction) performance look like?

Latency Benchmarking — where is time being lost across the transaction supply chain?

Top comments (0)