Skip to content
Finance Lessons

On-chain Arbitrage & Cross-DEX MEV

The Cost Stack & the Auction

Gas, priority fees, the builder's cut and slippage; backrunning vs sandwiching; and the uncomfortable result that competition bids most of the arbitrage spread straight through to builders and validators.

11 min Updated Jun 18, 2026

You spotted a clean $1000 mispricing across two pools. You build the bundle, it lands, it commits. Congratulations — you keep maybe a hundred of it. The rest evaporates into a stack of costs you half-forgot and an auction you didn’t realize you were bidding in. This lesson is the part nobody puts on the highlight reel: the slow, undignified subtraction that turns “I found $1000” into “I netted $96.”

The cost stack — gross spread is not profit

Before you read — take a guess

You find a gross arbitrage spread of 1000 USDC. Before anything else, what should you assume your take-home is?

Think of the gross spread as a restaurant’s menu price and your net as what’s in your pocket after tax, tip, and the parking ticket you got walking in. The number on the menu was never the number you keep.

Here’s the full subtraction, top to bottom:

  1. Slippage / price impact — your own trade moves the pool price against you. The bigger your size, the worse the fill. This is already baked into the realized spread: when we say “gross of $1000 after slippage,” we mean the spread you can actually execute, not the dreamy mid-price you saw on a chart.
  2. Gas — the EVM charges you for computation whether you win or lose. Land the bundle: you pay gas. Get front-run and revert: you still pay gas. It’s the cover charge.
  3. Priority fee / builder payment — the bribe. To get included and ordered correctly (your backrun must land right after the trade it targets), you pay the block builder. This is the big, variable one, and the next two sections are entirely about how brutal it gets.

The formula is just honest bookkeeping:

net=grossslippagegasbuilder payment\text{net} = \text{gross} - \text{slippage} - \text{gas} - \text{builder payment}

A worked stack on a $1000 gross opportunity:

Line itemAmountRunning total
Gross spread (already after slippage)+$1000$1000
Gas (paid win or lose)−$40$960
Builder payment (priority fee)−$864$96
Net to searcher$96

You found a thousand. You keep ninety-six. Welcome to arbitrage.

Warning:

Gas is sunk — even on a loss

The seductive mistake is modeling gas as “a cost of winning.” It isn’t. You pay gas on every reverted attempt too. A searcher who tries ten bundles and lands two has paid gas ten times. Price your edge against attempts, not wins, or the cost stack will quietly bury you.

Order the cost stack correctly.

Choose the correct option for each blank and check.

Starting from the gross spread, you subtract (already folded into the realized spread), then (paid win or lose), then (the bribe for inclusion and correct ordering) to reach your net.

When it matters

Always — but most of all when your gross edge is thin. A $1000 spread can absorb $40 of gas and shrug. A $50 spread cannot: gas alone might revert it into a loss. The cost stack is the difference between an opportunity and a trap, and the thinner the spread, the more the stack decides your fate.

Backrunning vs sandwiching

Before you read — take a guess

A searcher lands a transaction right AFTER a big swap to buy the now-cheaper token and rebalance the pools. Who gets hurt?

Both backrunning and sandwiching are about where you stand in line relative to someone else’s trade. The difference is whether you’re a scavenger or a mugger.

Backrunning = you land immediately after the trade or block that created a misalignment. Cross-DEX arbitrage is the textbook benign backrun: a whale dumps ETH on pool A, knocking it below pool B’s price; you follow with a buy-low-on-A, sell-high-on-B loop that drags the two pools back into alignment. You harmed no specific user. The whale already got their fill; you just cleaned up the price gap they left behind, the way a janitor follows the parade. This is why arbitrage searchers are mostly backrunners — and why arbitrage is generally considered the good MEV.

Sandwiching = you wrap a victim’s pending swap with two of your own. You buy in front (pushing the price up), let the victim execute at the worse price you just created, then sell behind them for profit. Recall from the MEV & ordering lessons: this is the classic harmful MEV — the victim’s slippage is the attacker’s revenue. You didn’t find a misalignment; you manufactured one at someone’s expense.

Backrun (arbitrage)Sandwich
Position relative to targetAfter onlyBefore and after
Source of profitA misalignment that already existedSlippage forced onto the victim
Who’s harmedNo specific userThe wrapped swapper
ReputationBenign — realigns pricesPredatory — degrades a trade

Match each MEV behavior to its defining trait.

Pick a term, then click its definition.

When it matters

It matters for both your strategy and your conscience. Benign backrunning is broadly tolerated and even encouraged — it makes markets more efficient — while sandwiching is increasingly detected, filtered, and punished by private orderflow and anti-MEV relays. Building a backrun-only arbitrage business keeps you on the side of the market that gets welcomed rather than blocked.

The auction bids your profit away

Before you read — take a guess

Ten searchers all spot the same 960-USDC post-gas opportunity. In a priority-gas auction, what happens to the priority fee they bid?

When several searchers chase the same opportunity, they don’t politely take turns. They bid against each other for the one block slot that captures it — a priority-gas auction (PGA), or in proposer-builder separation (PBS) terms, a block-space auction run by the builder. And auctions do exactly what auctions are designed to do: they transfer the prize from the bidders to the seller. Here the seller is whoever orders the block.

Picture an auction for a $960 banknote where the only cost of bidding is the bid itself. A rational bidder will go to $959. The next will go to $959.50. The note sells for essentially $960 — to the auctioneer’s benefit — and the “winner” walks away with pennies. That auctioneer is the builder/validator, and the banknote is your post-gas spread.

We capture this with a single dial, the competition intensity β\beta (between 0 and 1): the fraction of the post-gas profit that gets bid away to the builder/validator.

searcher net=(grossgas)(1β)builder/validator=(grossgas)β\text{searcher net} = (\text{gross} - \text{gas})(1 - \beta) \qquad \text{builder/validator} = (\text{gross} - \text{gas})\,\beta

  • β=0\beta = 0monopoly. You’re the only one who saw it. You keep the entire post-gas profit.
  • β=0.5\beta = 0.5 — you split the post-gas profit down the middle with the block.
  • β1\beta \to 1perfect competition. The fee is bid up to the full opportunity; your net collapses toward zero and the builder/validator pockets nearly all of it.

Drag the dials below. Watch your green slice shrink as the auction heats up:

Who keeps the arbitrage profit?Searcher net: 144 USDC
monopoly searcher keeps it allperfect competition → bid away
Gas
40 USDC
Builder / validator
816 USDC
Searcher net
144 USDC

Gas comes off the top no matter what. Whatever profit is left gets split with whoever orders the block — and the fiercer the auction, the more of it the searcher must bid away to win inclusion. At full competition the spread you found ends up in the builder’s and validator’s pockets, not yours.

Warning:

Competition is a cost you can't invoice

Gas and slippage feel like costs because you can see the line items. The auction cost is sneakier: it shows up as a priority fee you chose to pay — but you only “chose” it because a rival forced your hand. As more searchers run the same strategy, β creeps toward 1 and your edge silently bleeds upstream. The opportunity didn’t get worse; the competition for it did.

At β = 0.9 on a 960-USDC post-gas opportunity, who captures the larger share?

When it matters

β is highest exactly where the money looks easiest: large, obvious, well-known spreads on liquid pairs that every bot already monitors. Those are the most competitive, so β sits near 1 and nets you almost nothing. The durable edge lives where β is low — opportunities others can’t see (private orderflow, novel venues, faster detection) or can’t reach (latency, exclusive relationships). Lowering your effective β beats chasing a bigger gross.

Worked: who keeps the 1000

Before you read — take a guess

Gross 1000 USDC after slippage, gas 40 USDC, β = 0.9. Roughly what does the searcher net?

Let’s run the canonical numbers end to end, so the punchline lands with arithmetic behind it.

Step 1 — gross after slippage. The realized opportunity is $1000 (price impact already folded in).

Step 2 — subtract gas. Gas is a fixed $40, paid win or lose:

post-gas=100040=960\text{post-gas} = 1000 - 40 = 960

Step 3 — apply the auction at β = 0.9. The builder/validator takes β of the post-gas profit:

builder/validator=960×0.9=864\text{builder/validator} = 960 \times 0.9 = 864

Step 4 — what’s left for the searcher. The remaining (1β)(1 - \beta) slice:

searcher net=960×(10.9)=960×0.1=96\text{searcher net} = 960 \times (1 - 0.9) = 960 \times 0.1 = 96

WhoAmountShare of the original 1000
Gas (burned/paid)$404%
Builder / validator$86486.4%
Searcher (you)$969.6%

So of the $1000 spread you found, you keep $96 — under a tenth. The block builder and validator — who did none of the searching and took none of the discovery risk — pocket $864 just for controlling the order of transactions.

Info:

This is a feature of competition, not a bug

It feels unfair, but it’s exactly what a healthy auction should do: drive the price of a scarce resource (well-ordered block space) up to its value, and push easy profits toward whoever owns that resource. The lesson for searchers isn’t “the system is rigged” — it’s “compete where the auction is thin.” If everyone can find the spread, the auction takes it. Your real product is finding spreads others can’t.

Sort each amount by where it lands in the canonical 1000-USDC example at β = 0.9.

Place each item in the right group.

  • The (1 − β) slice of post-gas profit
  • About 96 USDC net
  • 40 USDC gas, paid win or lose
  • 864 USDC builder/validator payment
  • The β share of the 960 post-gas profit

When it matters

This is the single most important reframe in on-chain arbitrage economics: gross opportunity is not your business; net-after-auction is. When you size a strategy, model β honestly for the venues you target. A $1000 spread at β = 0.95 ($48 net) is a worse business than a $200 spread at β = 0.3 ($112 net) — even though the first headline number is five times bigger. Chase low β, not big gross.

Recap

Big picture

The cost stack and the auction

  • Cost stack and auction
    • Cost stack
      • Slippage baked into gross
      • Gas paid win or lose
      • Builder payment is the bribe
    • Backrun vs sandwich
      • Arbitrage is a benign backrun
      • Lands after, harms no one
      • Sandwich degrades a victim
    • The auction
      • Searchers bid the fee up
      • Competition intensity beta
      • High beta means tiny net
    • Who keeps the 1000
      • Gas takes 40
      • Builder takes 864
      • Searcher keeps 96
Gross is the menu price; net is what survives the deductions and the auction for block space.

The cost stack and the auction — mixed recap

Question 1 of 60 correct

Net profit on an arbitrage equals the gross spread minus which three things?

Check your answer to continue.

Mark lesson as complete