DEXs & Liquidity Pools
How you can swap tokens with no order book and no broker.
Swapping without a counterparty
A traditional exchange matches a buyer with a seller. A decentralized exchange (DEX) often skips the match entirely. Instead, you trade against a pool of tokens held by a smart contract - an automated market maker.
Liquidity providers deposit two assets into the pool. A formula (classically x · y = k) sets the price based on the ratio in the pool. Your swap shifts that ratio, which is why large trades move the price - an effect called slippage.
Where the yield comes from
Every swap pays a small fee that goes to the liquidity providers. That's their reward for supplying the assets others trade against.
But providing liquidity isn't risk-free. If the two assets' prices diverge, a provider can end up worse off than simply holding them - a phenomenon called impermanent loss.
Remember
More liquidity in a pool means less slippage - big trades barely move the price when the pool is deep.
Concept map · schematic
What a swap actually consumes
Available depth along the execution route—not headline TVL—determines price impact.
- 01
Trade size
How much the user wants to exchange
- 02
Available depth
Executable liquidity at successive prices or bins
- 03
Execution
Output depends on fees, depth and route
Important: Pool TVL alone cannot determine slippage; request a fresh executable quote.
Self-check
Check your understanding
Choose an answer for each question, then check the results and explanations.
Primary references
Documentation and standards
References added
Official technical references for further verification. A source link is not a guarantee that every earlier editorial sentence has been reverified; provider specifications may also change over time.
The curriculum predates this reference index. These sources are offered to check technical details; no original publication date has been inferred.
- ERC-20 token and allowance specificationEthereum Improvement ProposalsRead source ↗
- Uniswap v3 swap mechanicsUniswapRead source ↗
Apply what you learned
Related practical guides
Read DEX Liquidity Before You Swap
Use liquidity, depth and price impact to judge whether a pool can absorb the trade size you actually want to place.
Read guide →Slippage Tolerance, Explained
What slippage tolerance controls, why very tight settings can fail and why very loose settings can produce worse execution.
Read guide →How Swap Routing Finds a Better Path
Why an aggregator may use several pools or intermediate assets instead of sending the entire trade through one obvious pair.
Read guide →Bridge Fees vs. Slippage
Separate network and protocol fees from execution slippage so you can compare cross-chain quotes on the number that matters: what arrives.
Read guide →
Continue learning