A set of protocols that enables traders to efficiently buy and sell coins at the best price possible using a liquidity pool.
The role of a market maker in the traditional financial system is to create the conditions for a buyer and seller to trade currencies, stocks or commodities at the best price. The market maker achieves this by agreeing to stand-in as the default buyer of an asset at or below the current market price, with the goal of reselling that asset to a willing buyer at a marginally higher price so that they can profit by pocketing the difference (i.e the bid-ask spread).
AMMs replace the traditional market maker with a set of protocols that allow groups of people to assume the role of a market maker by contributing liquidity to a pool and earning fees on trades made between a buyer and seller.
AMMs rely on a pricing formula that adjusts the price of a coin based on the available supply that sits in the pool relative to the other coin it is trading against.
For example, let's say a liquidity pool is created to trade DAI and ETH. If there is greater demand for DAI, it means that more people are putting ETH into the pool and taking out DAI. This creates an imbalance that results in the price of ETH going down as its supply within the pool increases.
AMMs also rely on price oracles to relay information about what the current price of ETH is on centralized exchanges. If, for example, the price of ETH in the pool falls 4% below the price of ETH on centralized exchanges, an arbitrage opportunity is created because traders can now buy ETH from the pool at a 4% discount and sell it elsewhere at the current price to pocket a 4% profit.
This arbitrage opportunity creates new demand for ETH that allows the price within the pool to fall back in line with the broader market, as traders begin to take ETH out of the pool and replace it with DAI to take advantage of the temporary arbitrage.