What Mechanism in Automated Market Makers (AMMs) Is Exploited by Sandwich Attacks?
Sandwich attacks exploit the deterministic pricing formula and the public nature of the transaction queue (mempool) in AMMs like Uniswap. The constant product formula ($x y=k$) means a large trade causes a predictable price shift.
The attacker sees the trade in the mempool and executes transactions to profit from this predictable, price-shifting impact before and after the target trade.