Skip to main content

How Do Automated Market Makers (AMMs) Create the Vulnerability for Sandwich Attacks?

AMMs, such as Uniswap, use a constant product formula (x y = k) to determine asset prices and execute trades. When a large trade is executed, it significantly shifts the ratio of assets in the liquidity pool, causing a predictable price change.

This deterministic price impact, combined with the public visibility of the pending transaction in the mempool, creates a clear, exploitable arbitrage opportunity that is the basis for the sandwich attack.

Explain the Difference between an Order Book Model and a Constant Product Formula Model for Liquidity
What Is the Primary Difference between Traditional Market Front-Running and ‘Sandwich Attacks’ in DeFi?
What Role Do Automated Market Makers (AMMs) Play in Impermanent Loss?
How Does the Constant Product Formula (X Y=k) Govern an LP?