How do liquidity pools work?
For any economic activity to happen in DeFi, there needs to be crypto tokens. And that crypto needs to be supplied somehow, which is exactly what liquidity pools are set to do. This role is fulfilled by order books and market markers on centralized exchanges, but that’s a different thing altogether.
When someone sells token P to buy token Q on a decentralized exchange, they rely on tokens in the P/Q liquidity pool provided by other users. When they buy Q tokens, there will now be fewer Q tokens in the pool, and the price of Q will go up. That’s simple supply/demand.
A functional crypto liquidity pool must be designed in a way that incentivizes crypto liquidity providers to stake their assets in a pool. This is the reason why most liquidity providers earn trading fees and crypto rewards from the exchanges upon which they pool tokens. When a user supplies a pool with liquidity, the provider is often rewarded with liquidity provider (LP) tokens. LP tokens can be valuable assets in their own right, and can be used throughout the DeFi ecosystem in various capacities.
Liquidity pools maintain fair market values for the tokens they hold thanks to AMM algorithms, which maintain the price of tokens relative to one another within any particular pool. Liquidity pools in different protocols may use algorithms that differ slightly. For example: Uniswap liquidity pools use a constant product formula to maintain price ratios, and many DEX platforms utilize a similar model. This algorithm helps ensure that a pool consistently provides crypto market liquidity by managing the cost and ratio of the corresponding tokens as the demanded quantity increases.