Sandwich Attack Detector
Free to download on every platform. Comes pre-installed on BotFone, BotPad and BotFlip — with extra free apps included.
About this app
WHAT IT DOES
Sandwich Attack Detector gives DeFi traders, protocol users, and security researchers a powerful tool to detect sandwich attacks on their transactions. It reads live on-chain data including transaction history, block data, transaction logs, token balances, pool reserves, transaction traces, and mempool state. You can analyze any transaction hash to determine if it was sandwiched between a front-run and back-run transaction, identify the attacker address, calculate extracted profit, and assess confidence levels. The tool shows you in real time whether your transaction was targeted, who the attacker was, how much profit they extracted, and the exact transactions involved—so you can identify malicious actors and avoid future attacks.
HOW TO USE
Connect your EVM wallet (optional—the tool can work in read-only mode). Enter a transaction hash to analyze for sandwich attack activity. Optionally provide the pool address for reserve checks. Click "Detect sandwich attack" to fetch current data from the chain and run detection heuristics. The tool displays the transaction hash, detection result (Yes/No), confidence level percentage, attacker address, victim address, front-run transaction hash, back-run transaction hash, extracted profit, and block number. A visual dashboard shows the confidence score, block transaction count, and logs count. If a sandwich is detected, a visualization shows the front-run, victim, and back-run transactions with color-coded indicators.
TECHNICAL APPROACH
This tool queries live blockchain data using ethers v5.7.2. It fetches transaction data and receipts using getTransaction() and getTransactionReceipt(), and retrieves full block data with getBlock() to access all transactions in the block. The tool identifies the position of the target transaction within the block and examines transactions immediately before and after it. It checks if those transactions share the same from address (indicating an MEV bot) and whether they interact with the same pool. The tool also scans transaction calldata for common swap signatures like 0x38ed1739, 0x7ff36ab5, 0x18cbafe5, and 0x5c11d795 to identify DEX interactions. It calculates potential profit by comparing the attacker's balance before and after the block. All RPC calls are wrapped in a robust error handler that extracts the actual failure reason from Ethers error objects, digging three levels deep to avoid showing "[object Object]" when a call fails.
WHAT IT CANNOT SEE
This tool cannot detect sandwich attacks that occur through private mempools or Flashbots. It cannot guarantee detection of all sandwich attacks. It cannot see transactions that are not included in the public block data. It cannot detect attacks that span multiple blocks or use complex transaction patterns. It cannot identify attackers who use multiple addresses or obfuscation techniques. It cannot predict future sandwich attacks before they happen. It cannot guarantee that the confidence score is always accurate. The tool provides detection based on available data, but it does not guarantee that all sandwich attacks will be detected or that false positives will not occur.
PLEASE NOTE
This tool supports EVM‑compatible chains only (Ethereum, Goerli, Sepolia, Arbitrum, Optimism, Polygon). Solana, Tron, Starknet, SUI, TON, Aptos, Bitcoin, Cosmos, and XRP are not supported. The tool is read‑only and does not require signing transactions—connect is optional. No contract addresses are hardcoded; you paste the transactions you are analyzing. The tool is free and open under the BotGentz PLAYBOOK‑C specification.