Advanced Crypto · DeFi Foundations
Automated Market Makers and Liquidity Pools
What You'll Learn
- How an AMM lets trading happen without a traditional order book
- What a liquidity pool actually is
- Why people are incentivized to contribute to one
The Big Idea
Let me teach you the automated market maker, almost always shortened to AMM. It is a smart contract that enables trading directly against a shared pool of funds, called a liquidity pool, using a mathematical formula to set prices, rather than matching individual buy and sell orders the way the exchanges you learned about in Digital Assets and Trading Fundamentals do.
Let's Break It Down
Remember the bid/ask and order-matching concepts from Trading Fundamentals — a traditional exchange matches individual buyers and sellers against each other. An AMM works differently. It trades directly against a pool of two, or more, assets, using a formula to continuously calculate a price based on the current ratio of assets in that pool.
A liquidity pool is exactly that shared pool of funds — assets deposited by users specifically to enable this trading. When someone trades against the pool, they add one asset and remove the other, shifting the pool's ratio, which is what moves the AMM's calculated price.
Why would someone contribute their own assets to a liquidity pool? Because doing so — becoming a "liquidity provider" — typically earns them a share of the trading fees generated by trades against that pool, in proportion to how much of the pool they have contributed.
Real Example
A traditional exchange is like a matchmaking service, pairing up individual buyers and sellers directly. An AMM is more like a vending machine stocked with two types of item that can be swapped for each other. The exact swap rate is determined by a formula based on how much of each item is currently in the machine, adjusting automatically as items are swapped in and out.
Why It Matters
AMMs are the mechanism behind most decentralized exchanges, from Digital Assets. Understanding liquidity pools is foundational for the staking and yield lesson that follows next, since contributing to a liquidity pool is one of the most common ways people earn yield within DeFi.
Common Mistake
Please do not assume an AMM works the same way as the bid/ask order-matching system from Trading Fundamentals. An AMM sets price algorithmically based on a pool's asset ratio — it is not matching individual buy and sell orders against each other at all.
Quick Check
What does an AMM use to set trading prices?
Key Takeaways
- An AMM is a smart contract that enables trading directly against a shared liquidity pool, using a formula to set price.
- A liquidity pool is the shared pool of deposited assets that trades happen against.
- Liquidity providers are incentivized with a share of trading fees, proportional to their contribution to the pool.
Finished reading?
Mark this lesson as complete to track your progress.