Skip to main content

How Is the Marginal Exchange Rate (Price) Calculated within a Constant Product AMM?

The marginal exchange rate, or the instantaneous price of one token in terms of the other, is calculated by taking the derivative of the constant product formula, $x y = k$. Specifically, the price of token Y in terms of token X is approximately the ratio of the token quantities in the pool, $x/y$.

This ratio changes with every trade, reflecting the new balance of assets in the pool.

What Is the Role of the ‘Constant Product Formula’?
How Does the Constant Product Formula (X Y=k) Govern AMMs?
How Does an Automated Market Maker (AMM) Algorithm Maintain the Constant Product in a Liquidity Pool?
How Does a Constant Sum Market Maker ($x+y=k$) Differ from a Constant Product AMM?