Fair ordering against sandwich extraction
See how hidden execution costs build up in DEX swaps and how fair ordering reduces that loss without changing the chain's base gas fee.
Large ETH buy on a volatile block
A visible market buy is sandwiched by an attacker who pushes price up before execution and exits immediately after.
This trade would have saved $120 without sandwiching.
Sequencer discretion drops while the attacker’s extracted value collapses from $146 to a residual arbitrage profile.
Scenario
Rollup DEX · Slot 812 / round 0
Before fair ordering
Privileged sequencing lets the attacker bracket the user trade.
Attacker buys ahead of the visible user swap and lifts the execution price.
Execution clears after the attacker, so the user receives less ETH than the pre-trade quote implied.
Attacker exits into the victim’s market impact and captures the round-trip spread.
After fair ordering
The victim stays in deterministic order and sandwich extraction collapses.
The user clears at the fair slot order and stays close to the quoted execution.
The attacker can still trade, but not by jumping ahead of the user in the same slot.
User outcome
Victim execution quality
The demo is intentionally simple: same market, same trades, different ordering rule.
Attacker outcome
MEV extraction profile
Residual arbitrage remains possible. What disappears is selective sequencing around a user trade.
Demo script
Three beats for the video