Skip to main content

How Does an Automated Market Maker (AMM) Calculate the Price of an Asset?

An AMM uses a constant product formula, most commonly $x cdot y = k$, where $x$ and $y$ are the quantities of the two tokens in the pool, and $k$ is a constant. The price of one token in terms of the other is determined by the ratio $y/x$.

When a user trades, the quantities $x$ and $y$ change, which must maintain the constant $k$, thus automatically adjusting the price for the next trade.

Explain the Difference between a Constant Product and a Constant Sum AMM Curve
How Does the Constant Product Formula (X Y=k) Govern the Price within a Liquidity Pool?
How Does the Constant Product Formula X Y = K Mathematically Dictate the Price in a Liquidity Pool?
How Does the Constant Product Formula (X Y=k) Work in an AMM?