◇ Theory
Spot prices can be moved
An AMM’s spot price is just the ratio of its reserves, and anyone can change that ratio with a large enough trade. A protocol that reads a spot price at one instant is reading a number an attacker can set.
Manipulation-resistant designs use time-weighted average prices, independent oracle networks, sanity bounds, and circuit breakers on sudden moves.
Flash loans make capital free
A flash loan lends any amount with no collateral, provided it is repaid within the same transaction. It turns "only a whale could move this price" into "anyone could" — so economic assumptions must hold against unlimited, momentary capital.
Transaction ordering is not neutral
Pending transactions are visible before they are included, and block producers choose the order. Front-running, sandwiching and back-running exploit that visibility.
Slippage limits, commit–reveal schemes and private order flow reduce exposure. On-chain values such as block timestamps are also poor sources of randomness; use a verifiable randomness service.
Every lab pairs the vulnerable contract with its patched twin in the Post-Mortem stage — the exact lines that fail, and the exact lines that fix them.