Recommended resources
The freely available resources this lesson will direct you to.
Hello! In our last lesson, we explored the fascinating world of Decentralized Exchanges (DEXs) and the Automated Market Maker (AMM) model that powers them. You learned how the x * y = k formula allows for permissionless trading without a traditional order book. We saw how traders can swap one token for another by interacting with a smart contract.
This raises a crucial question: where do the tokens inside that smart contract come from? For a trade to happen, there must be a pool of assets available. This lesson will answer that question by diving into the concepts of liquidity pools and the vital role of liquidity providers (LPs).
Your ultimate goal is to launch a successful token. A token without a market to trade it in has very little utility. Understanding how to create and foster these markets is a critical step toward that goal.
1. What is a Liquidity Pool?
In the previous lesson, we referred to the "pool of tokens" that traders interact with. The formal name for this is a liquidity pool.
At its core, a liquidity pool is a smart contract that holds reserves of two or more different tokens. By locking these tokens, the contract creates a market, allowing anyone to trade between the tokens in the pair. It's the foundational technology that makes AMMs and most of DeFi possible.
How do crypto liquidity pools work?
To start, let's get a solid definition from the article 'How do crypto liquidity pools work?' on LiquidityFinder.
Read the sections 'How do liquidity pools work?' up to 'The Fundamentals of Liquidity Pools', and then 'What is a liquidity pool?'. Focus on how these pools function as automated market makers and enable trading without traditional order books.
As the article mentions, liquidity is crucial, especially for newer tokens like the one you're building. Without sufficient liquidity, a large buy or sell order can cause massive price swings (high volatility), which discourages traders. Liquidity pools solve this by creating a ready supply of tokens that can absorb these trades.
The video below provides a great visual recap of how these pools fit into the bigger picture of decentralized trading.
How do LIQUIDITY POOLS work? (Uniswap, Curve, Balancer) | DEFI Explained
This segment from the Finematics video 'How do LIQUIDITY POOLS work?' effectively contrasts the liquidity pool model with the order book model we discussed in the last lesson.
Watch from 00:31 to 02:20. Pay attention to how the video explains that instead of matching individual buyers and sellers, a DEX matches buyers and sellers with a single entity: the liquidity pool.
The entire system can be visualized as a cycle involving traders, liquidity providers, and the pool itself.

2. The Role of the Liquidity Provider (LP)
If liquidity pools are the markets, Liquidity Providers (LPs) are the market makers. They are the individuals or entities who supply the tokens to the pools.
So, who can be an LP, and why would they do it?
In the permissionless world of DeFi, anyone can be a liquidity provider. You don't need to be a large financial institution. When providing liquidity to a standard x * y = k pool, an LP must deposit an equal value of both tokens in the pair. For example, if 1 ETH is worth 2,000 USDC, an LP wanting to provide liquidity to the ETH/USDC pool would need to deposit both ETH and USDC in that 1:2000 value ratio (e.g., 0.5 ETH and 1,000 USDC).
The primary motivation for providing liquidity is to earn trading fees. Every time a trader makes a swap using the pool, they pay a small fee (e.g., 0.3% on Uniswap v2). This fee is distributed pro-rata to all the liquidity providers in the pool, proportional to their share of the total liquidity.
Understanding Liquidity Provision in DeFi
The Uniswap blog provides an excellent, straightforward explanation of what liquidity provisioning is and how to become an LP.
Read the sections 'What is liquidity provisioning?' and 'How do I become a liquidity provider on Uniswap?'. This will clarify the process and the incentive structure for LPs.
This creates a powerful symbiotic relationship:
- Traders get access to a liquid, always-on market to swap tokens.
- Liquidity Providers earn passive income from the fees generated by those trades.
The following diagram clearly distinguishes the actions of a trader from those of an LP.

Test your understanding!
Imagine you've launched your MyToken and want to create its first liquidity pool with ETH. The initial price you want to set is 1 ETH = 200 MyToken.
- If a friend wants to become a liquidity provider and deposit 10 ETH into the pool, how many
MyTokenmust they also deposit to maintain the price? - What is the main reason they would be willing to lock up their assets in this way?
Show answer
- They must deposit
10 ETH * 200 MyToken/ETH = 2,000 MyToken. This is because LPs must supply an equal value of both assets to the pool. - Their main motivation is to earn a share of the trading fees that will be generated every time someone swaps ETH for
MyTokenor vice-versa using this pool.
3. Proof of Deposit: LP Tokens
When a liquidity provider deposits their tokens into a pool, how does the smart contract keep track of their share? The answer is with LP tokens.
When you provide liquidity, the pool's smart contract mints and sends you a special ERC-20 token known as an LP token. This token represents your proportional share of the total assets locked in the pool.
- Example: If you provide 10% of the total liquidity in a
MyToken/ETH pool, you will receive LP tokens that represent that 10% share.
These LP tokens are crucial for several reasons:
- Proof of Ownership: They are your claim on your share of the pool's underlying assets.
- Redemption: To exit your position and get your tokens back (plus any accrued fees), you send your LP tokens back to the pool contract, which then burns them and returns your share of the liquidity.
- Composability: Because LP tokens are themselves ERC-20 tokens, they can be used in other parts of DeFi. For instance, you could stake your LP tokens in a different contract to earn additional rewards, a process known as "liquidity mining." We'll explore this in a later lesson.
How do crypto liquidity pools work?
The LiquidityFinder article also provides a concise explanation of the role of LPs and the LP tokens they receive.
Read the section 'Role of Liquidity Providers'. Focus on the part that describes what LPs receive in return for their contribution.
Conclusion
In this lesson, we've pulled back the curtain to reveal who funds the markets on decentralized exchanges. You now have a solid understanding of what liquidity pools are and the essential role that liquidity providers play in the DeFi ecosystem.
Key Takeaways:
- Liquidity Pools are smart contracts containing reserves of token pairs, forming the backbone of Automated Market Makers.
- Liquidity Providers (LPs) are the users who fund these pools by depositing an equal value of both tokens in a pair.
- The primary incentive for LPs is to earn a proportional share of the trading fees generated by the pool.
- LP Tokens are ERC-20 tokens given to liquidity providers that represent their share of the pool and act as a receipt for their deposit.
Preview of the Next Lesson:
Theory is essential, but practice is where the real learning happens. Now that you understand the "what" and "why" of liquidity provision, it's time for the "how." In the next lesson, you will create the very first market for your own ERC-20 token by setting up a liquidity pool on the Uniswap testnet.