← GlossaryTrading & DeFi
What Is a Liquidity Pool? How Automated Market Makers Work
A liquidity pool is a smart contract that holds reserves of two tokens so people can swap between them directly against the pool, with prices set by a formula instead of an order book.
Key takeaways
- Uniswap v2 pools hold two tokens and price trades with the constant product formula x * y = k.
- Anyone can become a liquidity provider by depositing both tokens into a pool.
- Large trades move the price more in a small pool, which is slippage.
- Providers earn fees but can lose value relative to simply holding, a risk called impermanent loss.
How a pool works
Instead of matching buyers and sellers in an order book, an automated market maker keeps a pool of two tokens and trades against it. In Uniswap v2 the pool prices tokens with a constant product formula: x times y equals k, where x and y are the reserves of each token and k must stay constant or grow after every trade. When you buy one token from the pool, its reserve falls and the other rises, which pushes the price of the token you bought up.
Who provides the tokens
Anyone can become a liquidity provider by depositing both tokens of a pair into the pool. Providers receive a claim on the pool, and in Uniswap v2 trading fees are added to the reserves, so a provider's share grows as trades happen. The pool is open to every trader, with no account or approval.
Why price impact depends on pool size
Because the formula keeps the product constant, a trade that is large compared with the reserves moves the price sharply. A deep pool absorbs the same trade with little change. That is why slippage is worse in small pools, and why checking the pool's size before swapping matters, especially for newer tokens.
What providers risk
Providing liquidity is not the same as holding. If the relative price of the two tokens changes, the pool rebalances and the provider ends up with a different mix of tokens than they deposited, which can be worth less than simply holding them. Smart-contract bugs and token-specific risks add to this, and fee income is not guaranteed.
Example
A pool holds 1,000 token A and 1,000 token B, so k = 1,000,000. A trader adds 100 token A. To keep the product constant the pool must now hold about 909.1 token B, so the trader receives about 90.9 token B for 100 token A, not 100 (ignoring the pool's fee). The difference is price impact.
Formula x × y = k
Put it into practice
Swap against pools from your wallet
Scrypt Wallet lets you swap Solana tokens through Jupiter and Ethereum tokens through Uniswap, showing the quote before you confirm.
Create a free wallet Get Scrypt for AndroidFrequently asked questions
Do I need an order book to trade against a pool?
No. You swap directly with the pool and the formula sets the price, subject to the pool's size and fee.
Is providing liquidity safe passive income?
No. Fees are variable, and impermanent loss, smart-contract risk and token risk can outweigh them.
Do all pools use x * y = k?
No. Uniswap v2 does. Other designs, including concentrated liquidity pools, use different pricing rules.
Written by the Scrypt Wallet team · Updated 2026-10-02. General education, not financial, tax or legal advice.