Skip to content
Hexncoin
Track 4: DeFi & TokensLesson 2 of 3·7 min

DEXs & Liquidity Pools

How you can swap tokens with no order book and no broker.

01

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.

02

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.

Self-check

Check your understanding

Try each question before opening the answer.

3 questions
01

On an AMM-based DEX, who is your trade matched against?

  1. A.Another individual trader
  2. B.A liquidity pool held by a smart contract
  3. C.A central bank
  4. D.A broker
Reveal answer

B. A liquidity pool held by a smart contract

You trade against a pool of assets priced by a formula, not against a matched counterparty.

02

Why do large trades move the price on an AMM?

  1. A.The exchange charges more for big trades
  2. B.They shift the ratio of assets in the pool, which sets the price
  3. C.Validators vote on each price
  4. D.Gas fees change the price
Reveal answer

B. They shift the ratio of assets in the pool, which sets the price

Price comes from the pool ratio, so a big swap changes that ratio - the effect known as slippage.

03

How do liquidity providers earn a return?

  1. A.A share of the swap fees
  2. B.Interest from a bank
  3. C.Mining rewards
  4. D.Government subsidies
Reveal answer

A. A share of the swap fees

Each swap pays a fee that is distributed to the pool's liquidity providers.

Continue this track