How Does an Automated Market Maker Work? Liquidity Pools Explained
How Does an Automated Market Maker Work? Liquidity Pools Explained with Raydium
Written by Marcus Chen, Research Fellow. Reviewed by Dr. Sarah Mitchell, Blockchain Security Analyst. Updated August 26, 2026.
Research Notice: This guide is part of our fintech research series examining decentralized finance and blockchain infrastructure. It is intended for educational purposes only and does not constitute financial or investment advice.
An automated market maker is a way to trade tokens without matching individual buyers and sellers. Instead, trades happen against a shared pool of funds priced by a formula. This guide explains the idea conceptually, using Raydium on Solana as a familiar example, and covers pools, swaps, fees and the risk known as impermanent loss.
What is an automated market maker?
An automated market maker, shortened to AMM, is a system that lets people trade tokens against a pooled reserve of funds rather than against other traders directly. A mathematical formula sets the price automatically based on how much of each token the pool holds, so trades can happen at any time.
The idea solves a practical problem. A traditional exchange needs a steady stream of buyers and sellers posting orders, and when few are active, trading stalls. An AMM removes that dependency by letting a pool always stand ready to trade. In exchange for supplying the pool, contributors earn a share of the fees that traders pay.
Raydium is a well known AMM on the Solana blockchain, and it makes a useful example because it runs entirely as on-chain smart contracts. Nothing about the mechanism requires trusting a company to match your order. The contract holds the pooled tokens, applies the pricing formula, and settles the trade in a single transaction that you approve from your own wallet.
How do liquidity pools actually work?
A liquidity pool is a shared reserve of two tokens that people can trade against. Providers deposit an equal value of both tokens, and traders swap one for the other by adding to one side and removing from the other. The pool's balance is what determines the current price.
Picture a pool holding two assets, call them token A and token B. When someone wants token A, they put token B into the pool and take token A out. That makes token A scarcer inside the pool and token B more plentiful, so the formula nudges the price of token A upward for the next trader. Nothing central decides this; the ratio of reserves does.
Providers who fund the pool receive a claim, sometimes called an LP position, that represents their share. That share entitles them to a slice of the trading fees and can be redeemed later for the underlying tokens. The more of the pool a provider funds, the larger their share of both the fees and any incentives attached to it.
How does a swap change a pool's price?
A swap changes the price by shifting the balance of the two reserves. Many standard pools use a constant product rule, where the two reserves multiplied together stay roughly the same. Buying one token shrinks its reserve and raises its price, so bigger trades move the price more.
This is why the depth of a pool matters so much. In a large pool, a single trade barely changes the ratio, so the price stays close to where it started, an effect traders call low slippage. In a thin pool, the same trade can swing the price sharply, because it represents a big fraction of the reserves. Slippage is simply the gap between the price you expected and the price you actually got.
The formula also explains why an AMM can never be permanently drained at a fixed price. As one token becomes scarcer in the pool, each additional unit costs progressively more, which naturally resists emptying the reserve. The pricing curve does the work that an order book does elsewhere, but through arithmetic rather than through matched offers.
What does providing liquidity mean, and what is impermanent loss?
Providing liquidity means depositing two tokens into a pool so others can trade against it, in return for a share of fees. Impermanent loss is the risk that, if the two tokens' prices move apart, your pooled value ends up lower than if you had simply held the tokens.
The name is a little misleading. The loss is called impermanent because it can shrink or disappear if prices return to their starting ratio, but it becomes real the moment you withdraw at a different ratio. The wider the two tokens' prices drift apart, the larger the effect. Fees earned along the way can offset it, though they do not guarantee a net gain.
The table below contrasts simply holding two tokens with putting them into a pool, so the tradeoff is easier to see at a glance. Neither choice is automatically better; they suit different goals and different views on where prices are heading.
| Aspect | Holding both tokens | Providing to a pool |
|---|---|---|
| Fee income | None | A share of trading fees |
| If prices stay flat | Value unchanged | Value plus accumulated fees |
| If prices diverge | You keep the full moves | Impermanent loss reduces value |
| Effort | Passive | Requires monitoring the position |
Read the table as a starting point for judgment rather than a verdict. The right choice depends on how volatile the pair is, how much fee activity the pool sees, and how long you plan to stay in the position.
How does Raydium apply these ideas?
Raydium applies these ideas with more than one kind of pool. It offers standard constant-product pools, where liquidity spreads across the whole price range, and concentrated liquidity pools, known as CLMM, where providers can focus their funds within a chosen price band for greater efficiency.
The standard pool is the simplest expression of everything above: two tokens, a constant-product formula, and fees shared by providers. A concentrated liquidity pool keeps the same underlying logic but lets a provider decide the price range in which their funds are active. Within that band the liquidity is deeper, which can mean more fees, but it also demands more attention, since funds outside the chosen range stop earning.
Because Raydium runs on Solana, these swaps settle quickly and cheaply, which makes the mechanics easy to observe in practice. The point for a learner is that the same core concept, a pool priced by a formula, scales from the most basic pool to more advanced designs without changing what is really happening underneath.
How can you research a liquidity pool before adding funds?
You research a pool by identifying both tokens, checking how deep the pool is, understanding its fees and rewards, weighing the impermanent loss exposure, and starting small. These steps turn a blind deposit into an informed decision and take only a few minutes.
Step 1: Identify both tokens in the pair
Write down both tokens in the pool and confirm each one's official mint address on a Solana block explorer. Two tokens can share a ticker symbol, so the mint address is what actually tells you whether an asset is the real one or a copycat.
Step 2: Check how deep the pool is
Look at how much liquidity the pool holds, because a very thin pool can move in price sharply on a single trade. A shallow pool is easier to manipulate and harder to exit cleanly, so depth is a basic measure of how usable a pool is.
Step 3: Understand the fee and reward setup
Read how the pool's trading fee and any extra rewards work so you know where a return would actually come from. If most of an advertised return comes from a temporary incentive rather than trading fees, it may not last, and that changes how you judge it.
Step 4: Consider the impermanent loss exposure
Think through how far the two tokens' prices could drift apart, since a wider gap increases potential impermanent loss. A pool of two closely linked assets carries less of this risk than a pool pairing a stable asset with a highly volatile one.
Step 5: Start small and record your entry
Begin with an amount you can afford to lose and note the pool details so you can review the position later. A small first position lets you learn how a pool behaves without turning a mistake into a large one.
How is an AMM different from an order book?
An AMM prices trades from a pool and a formula, while an order book matches specific buy and sell orders posted by traders. Both let you exchange assets, but the AMM is always available to trade, whereas an order book needs active participants on both sides.
This contrast has real history on Solana. In its early design, Raydium connected its pooled liquidity to the Serum central limit order book, so the same funds could serve order-book trades as well as pool swaps. After Serum declined following the collapse of the FTX exchange in late 2022, the ecosystem shifted toward the OpenBook order book. The episode is a useful reminder that these two models can coexist and complement each other.
For a newcomer, the simplest way to hold the distinction is this. An order book is like a noticeboard of offers waiting to be matched. An AMM is like a vending machine that always has stock and adjusts its price as the stock changes. Neither is inherently superior; they make different tradeoffs around availability, price precision and who provides the liquidity.
Frequently asked questions
Do liquidity providers earn fees?
Yes. When people swap against a pool, they pay a small trading fee, and that fee is shared among the liquidity providers in proportion to their stake. It is the main way providers are compensated, though it has to be weighed against the risk of impermanent loss.
Can you lose money in a pool even if neither token crashes?
Yes, through impermanent loss. If the two tokens' prices move apart, the pool rebalances in a way that can leave you with less value than if you had simply held both tokens. Fees can offset this, but they do not guarantee it, so the outcome depends on how prices move.
Is an automated market maker the same as a crypto exchange?
Not quite. An automated market maker is a type of exchange, but it prices trades from a pool and a formula rather than from an order book of buyers and sellers. Both let you trade, yet the mechanism underneath is different, which changes how prices and liquidity behave.
What is the constant product formula?
It is a simple rule used by many standard pools where the two token reserves multiplied together stay roughly constant. As one side is bought, its reserve falls and its price rises, which keeps the pool balanced and means large trades move the price more than small ones.