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.

How Would This Formula Change for a Liquidity Pool Governed by a Constant Mean or Constant Sum Formula?
What Is an Automated Market Maker (AMM) and How Does It Facilitate Trading on a DEX?
How Do Different AMM Models, like Balancer or Curve, Modify the Constant Product Formula?
How Is the Value of Assets in a Liquidity Pool Maintained by an Automated Market Maker (AMM)?
What Is an Automated Market Maker (AMM) and What Is Its Role in Decentralized Exchanges?
What Is the Mathematical Relationship between the Price and the Ratio of Tokens in an X Y = K Pool?
How Is the Invariant Formula for a Multi-Asset Pool, like Balancer’s Value Function, Different from the Constant Product Formula?
How Does an Automated Market Maker (AMM) Use Its Liquidity Pool to Determine a Price?

Glossar