Let’s go through what this looks like in a typical trading situation, taking the constant product formula as an example.
Providing liquidity
As a crypto market maker, you provide an equal value of both asset A and asset B to a liquidity pool. Let’s say they’re worth the same, and you deposit 10 of each. The product of 10 A and 10 B is 100.
Trading
Now, let’s say Bob wants some of asset A and is willing to give up some more of asset B. He tells the AMM how much of A he wants to get. The AMM calculates how much B Bob must provide in order for the trade to keep the total value of A in the pool times the total value of B equal to 100. For example, if he wants to purchase 3 of A, he must provide ~4.286 of B. Every unit of A that Bob gets decreases its supply in the liquidity pool, making A worth more regarding B. Simple supply and demand.
Price determination
After the trade is made, the AMM automatically rebalances the price of A in terms of B one more time, so the next purchase also maintains a total liquidity of 100. If someone else comes along, they’ll find that the price of 1 A is “another step” higher than the price Bob got for his last unit of B.
To be exact, they’ll find that the price of the next unit of A will cost 6.666 B.
(*Play around with these values in a constant product simulator. You’ll find that the greater the amount of total liquidity provided, the less dramatic the price changes between assets A and B become. This is called market depth, and it is an essential part of crypto market makers’ role in reducing volatility.)