Group 3 · Building on it

Decentralized finance (DeFi) basics

the open market

The idea

uses smart contracts so people can swap, lend/borrow, and provide liquidity without a bank teller. Risks include bugs, , and .

Why it matters

No human teller does not mean no risk — the risk is in the code and the market moves.

How it works

DeFi replaces a bank’s staff with pools and rules. In a swap pool, people deposit two assets side by side. A formula sets the price from the balance in the pool: as you take out more of one asset, it gets pricier. Lending pools work in a similar way. Borrowers lock up collateral, and if its value falls below a set line, the code sells it to repay the lenders. That forced sale is called a liquidation.

People who deposit into a pool are liquidity providers. They earn a share of trading fees, but if prices move, they can end up with less value than if they had just held their assets.

Real example: the XRP Ledger has built-in automated market makers. Each one holds a pool of two assets. A big trade shifts the balance more, so you get a worse rate, which is slippage. The pool also charges a small trading fee that goes into the pool. Source: Automated Market Makers.

AMM pool swap

Two-asset pool sets price from balances; big trades slip; fee goes into the pool.

  1. Two-asset pool
  2. Price from balance
  3. Slippage
  4. Fee into pool

Step 1In a swap pool, people deposit two assets side by side.

Read all steps
  1. Two-asset pool: In a swap pool, people deposit two assets side by side.
  2. Price from balance: A formula sets the price from the balance in the pool: as you take out more of one asset, it gets pricier.
  3. Slippage: A big trade shifts the balance more, so you get a worse rate, which is slippage.
  4. Fee into pool: The pool also charges a small trading fee that goes into the pool.

Picture it

Automated market stall with posted rules = DeFi pool. Price moving while your order fills = . Collateral sold when it thins = .

Watch out

Depositing rent money into a pool you have not tested with a tiny amount first.