How Does a Constant Product Market Maker (X Y=k) Formula Enforce Price Equilibrium?
The formula x y=k dictates that the product of the reserves of the two tokens (x and y) must remain constant (k) after every trade. When a trader buys token X, they reduce the reserve of X and increase the reserve of Y. To keep k constant, the price of X must increase relative to Y, making subsequent purchases of X more expensive.
This mechanism automatically adjusts the price based on the reserves. Arbitrageurs ensure this internal price stays close to the external market price, thus enforcing equilibrium.