How Liquidity Pools Power Token Swaps

When you swap tokens on an automated exchange, a buyer and seller don’t have to submit matching orders at the same time. A liquidity pool holds assets that are available to trade. A smart contract calculates how much of one token you can take out in exchange for what you put in. That exchange changes the pool’s balances, which can change the price for the next trade.
The size and shape of a pool matter in a trade you can feel. A pool that can comfortably exchange $20 worth of tokens may offer a much worse average rate for $2,000. To see why, it helps to follow a single trade through the reserves before looking at fees or routes.
How do liquidity pools work?
A standard two-token pool has reserves of each asset and a rule governing how those reserves can change. In a constant-product pool, the basic rule is x × y = k, where x and y are the reserves and k is their product. In a simplified fee-free example, trading increases one reserve and decreases the other while keeping the product unchanged. Real implementations also account for fees, exact integer arithmetic, and their own safety checks. Uniswap v2 is an example of a constant-product protocol. Uniswap v2 swap mechanics
A liquidity pool explained with one trade
Imagine a pool with 1,000 units of token A and 2,000 units of token B. The starting product is 2,000,000. The pre-trade marginal rate in this simplified model is 2 B per A. You add 100 A, taking the first reserve to 1,100 A. To keep the product constant, the second reserve finishes at 2,000,000 ÷ 1,100, or about 1,818.18 B. The pool pays you roughly 181.82 B.
That gives you an average of about 1.82 B per A. The difference from the pre-trade rate is roughly 9.09% before fees. The marginal rate falls during the trade because the pool holds more A and less B. A second trade of 100 A against that changed pool would finish with about 1,666.67 B in reserve and pay roughly 151.52 B. The conditions for the second trade are different even when its input amount is identical.
Pool size changes the result. If both initial reserves were ten times larger, the same 100 A trade would return about 198.02 B in the fee-free model. The two pools start at the same reserve ratio and marginal rate. The larger pool can deliver more B because 100 A represents a smaller share of its reserves.
Which pool design determines the price?
The constant-product model explains the direction of price impact. Other designs change where funds are available and how the exchange rate moves. Some markets route a trade across different pool designs during the same transaction.
| Design | How trading liquidity is arranged | What to look at in a quote |
|---|---|---|
| Full-range constant product | Reserves support the curve across a wide price range | Total reserves relative to order size and fees |
| Concentrated liquidity | Providers choose price ranges where their deposits participate | Depth around the current price and across the proposed trade |
| Stable-asset curve | The formula is designed for assets expected to trade near a shared reference value | Depth near the reference price and behavior if one asset moves away |
In a concentrated-liquidity pool, a deposit can help trades inside its selected range. As the market moves across price boundaries, positions can enter or leave the active range. A pool can report substantial overall value and have only a fraction of it available near the current price. The amount your trade can receive depends on the active liquidity it encounters along the path. Uniswap v3 white paper
A stable-asset curve can concentrate trading depth around prices close to parity. That can make trades cheaper between assets that reliably track the same reference. If one moves far away from its target, the pool can become unbalanced and the quote can change sharply. A formula designed for similar prices still relies on the assets behaving as expected. Curve’s StableSwap paper
How pools stay connected to other markets
A pool price responds to transactions against its reserves. Say a token is worth about $2 elsewhere but is momentarily available from a pool for less. A trader can buy from the pool and sell in the other market if the gap covers costs and both trades can complete. Buying from the pool removes the token from its reserves and tends to raise its price there. These trades help pull the pool price toward outside markets.
Arbitrage takes time and requires enough depth to execute. During heavy volatility or if one market goes offline, prices can diverge. If two tokens look equally priced in one pool, check their prices elsewhere and consider whether withdrawals are open. A stale price in a shallow pool may be easy to display and hard to trade in size.
Price impact and slippage
In the 100 A example, getting about 181.82 B was predictable from the starting reserves. That difference from the initial marginal price is the trade’s modeled price impact. If the interface quotes 181.82 B and someone moves the pool first, the actual result can differ from the quote. That difference is slippage on the updated execution. A minimum-output check can stop the trade if the output available when it runs falls too far. Some interfaces also account for changes in fees or route details in the displayed estimate.
Where the reserves come from
Liquidity providers contribute assets under the pool’s rules. A full-range pool can issue shares that track claims on its reserves, while a concentrated pool can track each deposit by its price range and fees. Swap fees may accrue to providers under the protocol’s rules. Your share of those fees depends on the pool design, applicable fee split, and whether your position participates in the relevant trades.
Adding liquidity also changes your exposure to the pair. In a simplified fee-free full-range pool, say your initial share corresponds to 1 A and 100 B with A valued at 100 B. If A’s outside price later doubles and arbitrage aligns the pool, that same share would correspond to about 0.707 A and 141.42 B. At 200 B per A, the position is worth about 282.84 B. Holding the original amounts would be worth 300 B. That 17.16 B gap, about 5.72%, illustrates impermanent loss before fees. Your pool position can rise in value and still trail holding the original assets.
Real positions may face further differences from this example. Concentrated positions can end up on one side of a pair when the price leaves their range. Once a position goes out of range, it generally stops earning swap fees from that range until the market returns. A price change in a token itself can affect both a pool position and a wallet holding, while contract, admin, and withdrawal rules add risks specific to providing liquidity.
What to read on a swap screen
- Verify the exact input and output tokens. On a smart-contract chain, use the contract addresses and network to distinguish tokens with similar names.
- Request a quote for your actual amount. Compare the average rate and estimated price impact with an independent reference where possible.
- Look at the route. A direct pool may be shallow. A router can use intermediate tokens or split an order, with each hop or path affecting the output and fees.
- Check the minimum output and network fee. The first helps you understand the worst permitted swap result. The second affects your total cost.
- Use the receipt to reconcile amounts. A routed trade may create several transfers. Find the output that reached your destination and compare it with the signed request.
Liquidity pools also turn up in borrowing products and programs that pay token incentives. Those products can apply additional rules to a pool share, position, or deposited token. The Ethereum.org’s overview of decentralized finance explains where pooled trading fits alongside those other activities.
Find more crypto explainers in the Swapuz Academy.






