How Does an Automated Market Maker (AMM) Calculate Price Based on Liquidity?
An AMM uses a mathematical formula, most commonly the constant product formula (x y = k), where 'x' and 'y' are the quantities of the two tokens in the pool and 'k' is a constant. The ratio of the tokens in the pool determines the current price.
When a trade occurs, the balance of 'x' and 'y' shifts. In a low-liquidity pool, even a small trade causes a large shift in the ratio, resulting in a significant price change, which is the mechanism of price manipulation.