MEV Demo

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.

Fair Ordering Demo

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.

Victim savings
$120

This trade would have saved $120 without sandwiching.

MEV reduction
82%

Sequencer discretion drops while the attacker’s extracted value collapses from $146 to a residual arbitrage profile.

Scenario

Rollup DEX · Slot 812 / round 0

Victim
Treasury rebalance swap
0x9f...3c1
Quoted
$3,420
Manipulated
$3,458
Fair
$3,426

Before fair ordering

Privileged sequencing lets the attacker bracket the user trade.

1
Front-run
Searcher-17
attacker
Side
buy
Notional
$26,000
Execution
7.60 ETH
Slippage
8 bps

Attacker buys ahead of the visible user swap and lifts the execution price.

2
Victim trade
Treasury wallet
user
Side
buy
Notional
$48,000
Execution
13.99 ETH
Slippage
42 bps

Execution clears after the attacker, so the user receives less ETH than the pre-trade quote implied.

3
Back-run
Searcher-17
attacker
Side
sell
Notional
$26,224
Execution
$26,370
Slippage
5 bps

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.

1
Victim trade
Treasury wallet
user
Side
buy
Notional
$48,000
Execution
14.03 ETH
Slippage
11 bps

The user clears at the fair slot order and stays close to the quoted execution.

2
Residual flow
Searcher-17
attacker
Side
buy
Notional
$26,000
Execution
7.57 ETH
Slippage
27 bps

The attacker can still trade, but not by jumping ahead of the user in the same slot.

User outcome

Victim execution quality

Loss without fair ordering$120
Recovered under fair ordering$120

The demo is intentionally simple: same market, same trades, different ordering rule.

Attacker outcome

MEV extraction profile

Extracted with sandwich$146
Reduction under fair ordering82%

Residual arbitrage remains possible. What disappears is selective sequencing around a user trade.

Demo script

Three beats for the video

The user broadcasts a $48k ETH buy with moderate slippage tolerance.
A privileged sequencer inserts a front-run and a back-run around the victim order.
Under fair ordering, the victim remains in public arrival order and the sandwich edge collapses.