How do Liquidity Pools work?
Liquidity pools use algorithms called Automated Market Makers (AMM) to provide constant liquidity for trading.
A single liquidity pool holds a pair of tokens and each pool creates a new market for that particular pair of tokens. The first depositor to the pool or liquidity provider sets the initial price of assets in the pool. Liquidity providers are incentivized to supply an equal value of both tokens to the pool. They receive special tokens called LP tokens in proportion to their contribution to the pool. When a trade occurs, a transaction fee is collected and distributed proportionally to all LP token holders.
When a token swap occurs through a pool, the supply of an asset decreases while that of the other increases. Therefore, price changes occur that are adjusted by an algorithm called an automated market maker (AMM). This is where liquidity pools shine as they do not need a professional, centralized market maker to manage the prices of assets. Liquidity providers simply deposit their assets into the pool and the smart contract takes care of the pricing.
The most common risk that liquidity providers could face is that of impermanent loss. In simple terms, impermanent loss means that the fiat value of a user's crypto assets deposited to a pool could decline over time due change in the token value.