How to backrun a transaction on Solana
A backrun is a transaction that executes right after another transaction, the target, and captures the opportunity the target creates, for example an arbitrage after a large swap moves a pool's price. The target executes first and unchanged. This guide walks through the full loop with MEV Alpha Store.
1. See the target before it executes
Subscribe to Private Orderflow and send the pools and programs your strategy trades as your accounts and programs of interest. You receive matching transactions as they arrive at the TPU of validators in our network, before execution. Our relayer does not hold the target, so the sooner you react, the better.
2. Decide whether it is worth it
Decode the target's instructions and simulate its effect on the pool state you track. The program called by each top-level instruction is always among the transaction's static account keys, so you can filter on it without an RPC call. Then calculate your route and the expected profit.
3. Build the backrun
- Write-lock the same pool as the target.
- Add a minimum-profit check, so that your transaction fails safely if the opportunity is gone.
- Sign it with a recent blockhash.
4. Land it right behind the target
Send an atomic bundle through Private TPU Send: the target transaction first and your backrun right after it. The validator executes the bundle as a whole and in order, or not at all, so your backrun never executes before the target.
- Bundles land in the leader slots of validators in our network.
- The target also reaches the leader on its own. If the leader executes it before your bundle arrives, the bundle fails as a whole and costs you nothing, so send it as early as you can.
- Every searcher connected to us receives the stream at the same moment. When several of them send a bundle behind the same target, the first bundle to reach the validator wins.
You can also send the backrun as a separate transaction with a priority just below the target's. That placement is best effort. See Placing your backrun for both methods.
5. Confirm and measure
Confirm the outcome of each bundle through your RPC or Shreds and track how many you land. Latency & benchmarking shows how to measure the stream and your landing rate from your own server.
Need help or access? Contact our support on Telegram.
Contact