How Liquidity Pools Work in DeFi: Providers, Swaps and Fees
A liquidity pool is a smart contract holding two or more tokens that traders swap against. Anyone can deposit tokens into the pool and receive a share, called LP tokens or a position. Each swap pays a fee that is split among providers, who in return carry risks such as impermanent loss.
Decentralized exchanges don’t have a company holding a stockpile of tokens to sell you. Instead, ordinary users supply the tokens. Those shared piles are liquidity pools, and they are what makes swapping possible.
The pool at a glance
| Piece | What it does |
|---|---|
| Pool | A smart contract holding a token pair, for example ETH and USDC |
| Liquidity provider (LP) | A user who deposits tokens into the pool |
| LP token or position | A record of your share of the pool, which you redeem to withdraw |
| Trader | A user who swaps one token for the other |
| Swap fee | A small cut of each trade, paid to the pool’s providers |
| Pricing formula | The rule that sets the exchange rate from the pool’s balances |
How a pool works, step by step
- A pool is created for a pair of tokens, and the first provider sets the starting price by choosing how much of each to deposit.
- Providers add liquidity. On a simple pool you deposit both tokens in equal value. You receive an LP token or a position that proves your share.
- Traders swap. They send tokens in and take the other token out. The pool’s formula sets the price. How that works is explained in automated market maker.
- Fees accumulate. The fee from each swap is added to the pool or tracked for providers, depending on the protocol.
- Providers withdraw. You redeem your LP token or position and get your share of the current pool back, including earned fees. The mix of tokens may differ from what you deposited.
Worked example: one swap and one provider’s share
This example uses a simple constant product pool and round, hypothetical numbers. It ignores fees at first to show the pricing rule.
- A pool holds 10 ETH and 20,000 USDC. The product of the two balances is 10 times 20,000, which is 200,000. The pool keeps this product constant during a swap.
- The starting price is 20,000 divided by 10, which is 2,000 USDC per ETH.
- A trader wants 1 ETH. After the swap the pool holds 9 ETH, so it must hold 200,000 divided by 9, about 22,222 USDC.
- The trader pays about 22,222 minus 20,000, which is about 2,222 USDC for 1 ETH. That is higher than the 2,000 starting price, because the swap moved the pool’s balance. The gap is the price impact.
- Suppose the fee is 0.3% of the amount paid, about 6.67 USDC, which goes to providers.
- If you own 10% of the pool, you earn about 10% of that fee, roughly 0.67 USDC, from this one swap.
Larger trades relative to the pool move the price more. That is why deeper pools give better prices.
How to add liquidity safely, in order
- Use a wallet you control and open the official app from a bookmark.
- Choose a pool and look at its token pair, fee level and recent trading volume.
- Check both token contract addresses against the project’s official pages, so you do not pair a fake token.
- Enter the amount of one token. The app shows how much of the other you need.
- Approve each token for the exact amount you plan to deposit, then confirm the deposit.
- Note your position or LP token, and check it from time to time.
- To leave, remove liquidity and confirm the withdrawal. Revoke approvals you no longer need.
Who earns what
Providers earn fees in proportion to their share of the pool and the trading volume it sees. A busy pool with a large share to you means more fees; a quiet pool pays little. Pool fee levels are set by the protocol or the pool’s creator. For the fee structure of one major DEX, see the Uniswap fees page.
Some protocols also pay extra incentive tokens to attract providers. These can be volatile or lose value, so don’t count them as safe income. Our page on DeFi wallets goes into how a self-custody wallet connects to apps and what approvals you are signing.
Risks for liquidity providers
- Impermanent loss. When the price ratio of the two tokens changes, your share of the pool is worth less than simply holding. Read impermanent loss for a worked example.
- Smart-contract risk. Bugs and exploits can drain a pool. Audits reduce but do not remove this risk.
- Rug pulls and fake tokens. Anyone can create a pool for any token. If you pair a real token with a scam token, you can end up holding only the worthless one.
- Token approvals. To deposit, you approve a contract to spend your tokens. An unlimited approval stays active until you revoke it. Approve only what you need and review approvals regularly with a token-approval checker or your wallet.
- Fake front-ends. Use a bookmarked official address and check the URL before you connect a wallet. Never enter a seed phrase on a website.
- Liquidity risk. Depending on the protocol, withdrawing during extreme markets can return an unfavorable token mix.
Only use money you can afford to lose.
Pool types you will see
- Full-range pools spread your funds across all prices. Simple, but most of the money is rarely used.
- Concentrated liquidity lets you pick a price range. Your funds work harder inside the range but earn nothing outside it.
- Stable-pair pools are tuned for tokens meant to track the same price.
What it means for you
If you only want to swap, you are a trader, not a provider, and your main concerns are slippage and fees; see what slippage is. If you consider providing liquidity, start with the Uniswap guide to see how one DEX presents pools, and test with a small amount first. If this topic is new to you, the impermanent loss calculator explains how a price move changes a liquidity position against simply holding.
Common questions
Do I need to own both tokens to provide liquidity?
On a standard two-token pool, yes, in roughly equal value. Some apps let you deposit one token and swap part of it for you, which still counts as exposure to both.
Can I lose money even if the pool earns fees?
Yes. If the token prices move apart, impermanent loss can be larger than the fees you earn. A scam token or a contract bug can also cause losses that fees never cover.
Why does the price in the pool differ from other markets?
The pool sets its price from its own balances. If it drifts from other markets, traders swap against it until the gap closes. Those trades pay fees to providers.
Is providing liquidity the same as staking?
No. Staking usually locks a single token to secure a network or earn rewards. Providing liquidity exposes you to a token pair’s price changes and pays fees from trades.
Sources
- ethereum.org supports: Liquidity pools and decentralized exchanges in DeFi
- uniswap.org supports: How a constant product pool prices swaps and rewards liquidity providers