Automated market maker (AMM)
An automated market maker, or AMM, is a smart contract system that lets users trade crypto through liquidity pools instead of a traditional order book. Prices are often set by a formula that changes as assets enter or leave the pool. Users who add assets to the pool are called liquidity providers, and they may be rewarded with a share of the trading fee for their contributions. AMMs are common in decentralized exchanges, but they may introduce risks such as slippage, smart contract bugs, low liquidity, or impermanent loss.
If user wants to swap 1 ETH for a stablecoin on a decentralized exchange. Instead of matching with a specific buyer, the trade is priced by an ETH/stablecoin liquidity pool, and the amount received changes based on the pool’s balance at the time of the swap.