Dashboard · VantagePlanned

Sandwich Attack Checker: Was My Swap Front-Run?

Was this swap sandwiched by a bot, and how much did the trader lose to it?

Paste a swap transaction to see whether a bot wrapped it in a front-run and a back-run, and what that sandwich cost the trader.

ShareEmail itvoltfincrypto.com/apps/sandwich-attack-checker
Blueprint

What the dashboard will show.

The dashboard as it will open in Vantage. Each figure is named here and arrives with its receipt; until its data is published, its place stays empty.

  • Transaction
  • Chain
  • Period

Check a swap

Whether one swap was sandwiched, by whom and what it cost.

Sandwiched

Whether the swap sat between a front-run and a back-run by the same actor in the same pool and block.

Figuremev_dailyAwaiting data

Loss to the sandwich

USD

The output the swap would have received at the pool state before the front-run, minus what it received.

Figuremev_dailyAwaiting data

Slippage limit used

%

How much of the swap's allowed slippage, from amountOutMin in its calldata, the sandwich consumed.

Figuremev_dailyAwaiting data

Attacker profit

USD

The attacker's gain from the front-run and back-run, after the gas and tips they paid.

Figuremev_dailyAwaiting data

The three transactions

The front-run, the swap and the back-run in block order, with amounts, prices, gas and tips.

Tablemev_dailyAwaiting data

Pool price through the block

The pool's price before the front-run, after it, after the swap and after the back-run.

Line chartmev_dailyAwaiting data

Transaction
Any swap transaction hash on a covered chain
Chain
Ethereum, BNB Chain, Base, Arbitrum or all
Period
Last 7, 30 or 90 days
About

What it answers, and for whom.

A sandwich attack wraps a victim's swap between two trades by the same bot: one just before it that moves the price against the victim, and one just after that trades back at the better price. The victim still gets a fill within their slippage limit, but a worse one, and the difference becomes the bot's profit. This checker takes a swap transaction and shows whether that happened and what it cost.

Everything it needs is in the block: the order of transactions, the pools they touched and each pool's state before the first trade. The loss is the output the swap would have received without the front-run, minus what it received. The page also counts sandwiches by day on each covered chain, each one linked to its transactions.

Method

How it will be measured.

Every figure will be read at a block, kept with its source and its exact read, and open a receipt anyone can re-check.

How receipts work →
  1. A sandwich is three swaps in one block and pool: a front-run and a back-run by the same sender or contract, in opposite directions, with the victim's swap between them in the same direction as the front-run.
  2. The victim's loss is its output at the pool state before the front-run, computed from sqrtPriceX96 and liquidity or from reserves, minus its actual output, valued at the day's oracle price.
  3. The attacker's profit is what the back-run returned beyond the front-run's cost, less the gas and the tip to the block builder or validator they paid.
  4. The victim's slippage limit, amountOutMinimum or amountOutMin, comes from its decoded calldata, which shows how much of the allowed slippage the sandwich used.
  5. Swaps are read from Uniswap v2, v3 and v4 Swap logs and their forks, with each transaction's index in the block, so the order is the chain's own.

The data it needs

Read from chain state and history

  • mev_dailyTo buildMEV, builders and sandwichesBlocks by builder, MEV-Boost relay share, and detected sandwich attacks with the value taken from users, per day.
  • dex_swaps_dailyTo buildDEX volumeSwap counts and volume per DEX, pool and chain per day, decoded from Swap events, valued with stablecoin legs and oracle prices.
  • native_prices_dailyTo buildOracle prices by dayReference prices of major assets read from on-chain oracle feeds (Chainlink latestRoundData) at each day's last block, with each round's update time.
  • DEX Swap logs (Uniswap v2, v3 and v4 and their forks) with each transaction's index in the block
  • Front-run and back-run legs by the same sender or contract in the same pool around the victim
  • Pool state (sqrtPriceX96 or reserves) before the front-run to price the counterfactual
  • Victim amountOutMin from decoded calldata
Questions

Questions people ask.

What is a sandwich attack?

A form of MEV where a bot sees a pending swap, trades just before it to move the price, lets the swap execute at the worse price and then trades back. The bot profits from the price move it caused, at the swapper's expense.

How can I tell if my swap was sandwiched?

Look at the transactions just before and after yours in the same block and pool. If the same address or contract traded in your direction just before you and the opposite way just after, your swap was sandwiched. This checker makes that comparison for you.

How much does a sandwich cost?

The cost is the difference between what the swap would have returned without the front-run and what it returned. It is bounded by the swap's slippage tolerance: a wide tolerance leaves a bot more to take.

What makes a swap harder to sandwich?

A sandwich needs the swap to be visible before it is included and room within its slippage limit. A tight limit leaves less to take, and private submission hides a swap until it lands in a block. Rollups whose sequencer keeps no public mempool see fewer sandwiches for the same reason.

Which chains does the checker cover?

Ethereum, BNB Chain, Base and Arbitrum to start, for swaps on Uniswap and its forks. Each detected sandwich links to the three transactions behind it.

MEV
Maximal extractable value: profit taken by choosing, ordering or inserting transactions within a block.
Front-run
A trade placed just before a known pending trade to profit from the price move it will cause.
Back-run
A trade placed just after another trade, here to trade back at the price the victim's swap moved to.
Slippage tolerance
The worst price a swap will accept, set as a minimum output; a sandwich can take up to that limit.

Build Sandwich Attack Checker: Was My Swap Front-Run? on verified data.

Start free in Voltfin Studio: boards, tables and reports where every number opens its receipt. Tell us which data you need first and we will build it next.