How Is the Price of a Token within an AMM Pool Determined by the X Y=k Formula?
The instantaneous price of Token A in terms of Token B is determined by the ratio of the reserves, specifically P sub A equals y over x. This ratio represents the marginal rate of exchange for an infinitesimally small trade.
For a real-world trade, the average price paid is slightly higher due to slippage, but the instantaneous price is always the ratio of the token reserves in the pool. Arbitrage ensures this internal pool price stays closely tied to the external market price.