What Is the Mathematical Relationship between the Price and the Ratio of Tokens in an X Y = K Pool?
The price of token X in terms of token Y is equal to the ratio of the token Y quantity to the token X quantity (Price_X = y / x). Conversely, Price_Y = x / y.
As arbitrageurs trade, they change the quantities of x and y, which in turn adjusts the price according to this ratio. This continuous adjustment is how the AMM facilitates trading and price discovery.