This app runs inside the BotSurf browser. Don't have it yet? Get the app or extension now!

Sandwich Attack Simulation Tool for New Contracts

Security · All
0 installs · Verified BotGentz app
Launch App
Opens in BotSurf — nothing to install.
CategorySecurity
PlatformAll
Pricing Free
Installs0
Download BotSurf to use — free
No account needed for free apps. Once BotSurf is open, find this app in Apps from the + menu.

About this app

WHAT IT DOES

Sandwich Attack Simulation Tool for New Contracts helps developers and auditors assess whether a transaction is vulnerable to front-running and back-running — the classic sandwich attack pattern. You provide the contract or pool address, the transaction amount, and optional parameters like gas price; the tool simulates the three-step attack: a front-run transaction, the victim's transaction, and a back-run transaction. It calculates price impact, attacker profit, and overall vulnerability score. This is critical for new contracts that interact with AMMs like Uniswap or Curve, where sandwich attacks can cost users thousands of dollars in slippage.

HOW TO USE

Enter the contract or pool address, the transaction amount (in wei or token units), and optional gas price and transaction data. Click "simulate sandwich". The tool models the sandwich attack using a constant product formula, estimating the price impact of the front-run, the victim's trade, and the back-run. Results include a vulnerability score, estimated attacker profit, price impact percentage, and a clear status (Safe or Vulnerable). The tool also generates actionable recommendations to mitigate the risk, such as adding slippage protection, using private mempools, or splitting large trades.

THE REAL MECHANISM

The simulator uses a constant product AMM model (x*y=k) to simulate the price impact of sequential trades. Given the pool reserves and transaction amount, it calculates the front-run amount (typically half the victim's amount), the price after the front-run, the price after the victim's trade, and the back-run profit. The vulnerability score is a weighted sum of risk factors: absence of slippage protection (30 points), large trade size relative to reserves (25 points), low gas price (15 points), high price impact (20 points), and high slippage tolerance (10 points). A score above 60 triggers a "Vulnerable" status. Recommendations are generated from the same risk factors, providing actionable steps to reduce sandwich attack exposure. All calculations are heuristic — they do not execute on-chain or interact with the mempool.

WHAT IT CANNOT SEE

The tool cannot predict actual mempool conditions, detect if a sandwich attack will be successful in real‑time, account for miner/builder behavior, simulate all possible sandwich attack variants, detect if the contract has built‑in protections (e.g., time‑weighted average prices or commit‑reveal schemes), or predict future transaction ordering or gas price changes. The simulation is based on current pool state and assumed attacker behavior — real-world conditions may differ significantly. Always combine with real‑time monitoring and additional security measures.

PLEASE NOTE — EVM CHAINS ONLY

This tool is designed for AMMs on Ethereum Virtual Machine (EVM) compatible chains, such as Uniswap V2, Uniswap V3, Curve, and PancakeSwap. It assumes standard constant product or similar pricing models. All processing occurs in your browser; no contract data is stored or transmitted.

Similar Apps

Log in to BotGentz

Suggest an App

Tell us what you'd find useful — if we build it, we'll email you the moment it's ready.