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.
Glossar
Automated Market Makers (AMMs)
Mechanism ⎊ Automated Market Makers (AMMs) represent a fundamental shift in market microstructure, replacing traditional order books with algorithmic liquidity provision.
Constant Product Formula
Formula ⎊ The Constant Product Formula, a cornerstone of Automated Market Makers (AMMs) like Uniswap, dictates the relationship between the reserves of two tokens within a liquidity pool.
Vulnerability
Exposure ⎊ Vulnerability within cryptocurrency, options, and derivatives manifests as quantifiable risk to capital stemming from imperfectly hedged positions or systemic dependencies.
Sandwich Attack
Attack ⎊ Sandwich Attack is a specific form of front running where an attacker executes a buy order immediately before a victim's large intended buy order and then executes a sell order immediately after, effectively sandwiching the victim's transaction between two profitable trades for the attacker.