DEX mechanics: what a liquidity provider lives on
The formula that forms the price — and the calculation that decides whether providing was worth it.
This lesson has had no expert review. It was written for this platform and against the evidence it cites; nobody has gone through it independently.
Learning objectives
- You can explain how an AMM forms a price with no order book.
- You can name the three quantities a liquidity provider's result is made of.
Check your prior knowledge
Answer these for yourself before reading on. Wherever you hesitate is where this lesson pays off.
- How does a price arise in an order book?
- Who provides the other side of a swap in a pool?
- What exactly are trading fees paid for?
Core concept
The price follows from the balances
A classic AMM holds two assets and keeps their product constant. Taking one out means putting in enough of the other to keep the product unchanged. The price follows from that — and so does the fact that every order moves it: the larger the share of the balance, the more so. There is no order book executing an order at the last price.
Concentrated liquidity moves the problem
Newer designs let a liquidity provider choose a price range. Inside that range depth is far greater than with an even spread — outside it depth is zero, and the position then consists entirely of the weaker of the two assets. The TVL of such a pool therefore says even less about depth effective at the current price than in the classic model.
Three quantities, not one
A liquidity provider's result is the sum of fees earned, any reward emissions, and impermanent loss — the difference between the position's value in the pool and the value of the same assets simply held. The third item is the only one not reported, and the only one that can be negative. An APY that excludes it answers a different question from the one asked.
Fees are not the protocol's revenue
Most trading fees flow to the liquidity providers, not to the protocol. Reading fee income as protocol revenue systematically overstates its economic viability. Conversely, part of the volume comes from arbitrage correcting a price divergence — and for liquidity providers that very volume is the process realizing their impermanent loss.
Definitions
- AMM in the glossary
- A trading mechanism forming prices by formula from pool balances rather than through an order book.
- Impermanent loss in the glossary
- The difference between a position's value in the pool and the value of the same assets simply held.
- Price impact
- The price change an order causes through its own execution.
- MEV
- Value extractable from how transactions are ordered within a block.
Model
Trading fees — rise with volume
Reward emissions — end by schedule or decision
Impermanent loss — grows with price divergence
Transaction costs — fixed, independent of size
Only the sum answers the question asked
Formulas
Constant product
x × y = k- x, y
- balances of the two assets in the pool
- k
- the quantity a swap leaves unchanged
Limit: Describes the classic case. With concentrated liquidity the relation holds only inside the chosen range, and outside it the position is one-sided.
A liquidity provider's result
Result = fees + rewards − impermanent loss − transaction costs- fees
- share of the pool's trading fees
- impermanent loss
- difference against simply holding, driven by price divergence
Limit: The third item is final only when the position is withdrawn; until then it is a snapshot that moves with every price change.
Worked example
A year of providing liquidity
- Fees earned
- +6.1 % of the deposit
- Reward emissions
- +3.4 % of the deposit
- Price divergence of the two assets
- one +80 %, the other unchanged
- Resulting impermanent loss
- −4.2 % of the hold value
Per 100 deposited: holding gives (180 + 100) / 2 = 140. In the pool: 100 × √1.8 ≈ 134.2 — 5.8, or 4.2 %, below the hold value. With fees and rewards: 134.2 + 6.1 + 3.4 = 143.7.
About 3.7 % of the deposit more than simply holding (143.7 against 140) — with a quoted APY of 9.5 %. The three items can only be netted on the same base: the IL is a share of the hold value, fees and rewards are shares of the deposit.
Reading: The quoted APY was not wrong; it answers “what does the pool pay out” rather than “what was gained against holding”. Under strong divergence the second figure can be negative while the first stays double-digit.
Interactive model
The worked example, with movable figures. Estimate first what happens — then check.
Constant product and price impact
An order moves the pool along the curve x × y = k — the larger it is, the further from the spot price.
Estimate first, then check
Estimate first: does price impact double when the order size doubles? Check it with USD 450,000 and USD 900,000 against a USD 9m pool balance — and see in the chart why not.
The starting values are the worked example's own figures — change one input at a time.
Price impact: 4.8%. Amount received: $428,571. Round trip (entry and exit): 9.3%.
What the model does not show: The model is a fee-less 50/50 constant-product pool. Concentrated liquidity, stable curves and fees change the curve; the picture shows the mechanism, not any particular pool.
Retrieval
Exercise on real data
The beginner Academy has a simulator for exactly this quantity. Run an 80 % divergence through it and compare the result with the worked example above.
Impermanent loss in the simulator →Find a pool with two volatile assets and check the base share of its APY. Note: impermanent loss appears in none of the figures shown.
Look at a DEX pool in the Explorer →Application
Your organization is considering providing liquidity in a pool of two volatile assets. Which question do you answer first, and with what figure?
Related case studies
Institutional reading
- Asset management
- Is the position economically fee income, or an implicit option on the price divergence?
- Bank
- How should the unreported item be reflected in a valuation at the reporting date?
Metrics in this lesson
Key takeaways
- In an AMM the price follows from the balances; every order moves it.
- A liquidity provider's result has three parts — two of them are reported.
- Fee income is not protocol revenue.
Evidence
- EVD-2026-0008
DeFiLlama — DeFiLlama yields endpoint (/pools)