0Pricing
Web3 & DApp Development Fundamentals · 课时

DeFi 概览

借贷、DEX 与收益

DeFi 概览 是 CoddyKit 上的免费 Web3 & DApp Development Fundamentals 课时。 这是第 1 节课,共 4 节。 你可以在下方免费阅读本课时的完整内容 — 然后在浏览器中使用内置代码编辑器和全天候 AI 导师进行实践。 这是 Web3 & DApp Development Fundamentals 学习路径的一部分,你的进度在网页和 CoddyKit 应用中同步。 Web3 & DApp Development Fundamentals 课程共包含 4 节课。

本课时的部分内容尚未翻译,以英文显示。

What Is DeFi?

Decentralized Finance (DeFi) recreates financial services — lending, trading, borrowing, earning interest — using smart contracts on a blockchain instead of banks or brokers.

Anyone with a wallet can use these services permissionlessly, with no account approval and no intermediary holding the funds.

Smart Contracts as the Backbone

Every DeFi protocol is built from smart contracts: self-executing code deployed on-chain. The contract holds the rules and often the funds.

Because the logic is transparent and runs deterministically, users can audit exactly how a protocol behaves before trusting it.

Lending and Borrowing

Lending protocols like Aave and Compound let users deposit assets to earn interest, while borrowers take out loans against collateral.

Loans are overcollateralized: you must lock more value than you borrow, protecting lenders from default.

Deposit:  Alice supplies 1000 USDC -> earns APY
Borrow:   Bob locks 1.5 ETH collateral
          -> borrows 1000 USDC
If collateral value falls -> liquidation

Decentralized Exchanges (DEXs)

A DEX lets users swap tokens directly from their wallets without a centralized order book or custodian.

Most modern DEXs (Uniswap, Curve) use Automated Market Makers instead of matching buyers and sellers.

Yield and Liquidity Provision

Yield is the return earned by putting capital to work. Liquidity providers earn trading fees, lenders earn interest, and stakers earn protocol rewards.

This is the engine that attracts capital into DeFi.

Composability: Money Legos

DeFi protocols are composable — one contract can call another freely. A single transaction can borrow, swap, and deposit across several protocols.

This stacking of building blocks is nicknamed money legos.

tx {
    1. borrow USDC from Aave
    2. swap USDC -> ETH on Uniswap
    3. deposit ETH into a vault
}  // all atomic

Stablecoins

Stablecoins are tokens pegged to a stable value, usually the US dollar. They are the lifeblood of DeFi, used for trading pairs, loans, and savings.

Examples include USDC, USDT, and DAI (which is crypto-collateralized).

Governance and Tokens

Many DeFi protocols issue governance tokens that let holders vote on parameters like fees and supported assets.

This pushes control toward the community and away from a single company — a step toward true decentralization.

Risks in DeFi

DeFi is powerful but risky:

  • Smart contract bugs — code exploits drain funds
  • Oracle manipulation — bad price feeds
  • Liquidation — collateral sold in a crash
  • Impermanent loss — for liquidity providers

Oracles

Smart contracts cannot read off-chain data on their own. Oracles like Chainlink bring real-world prices on-chain so protocols know an asset is worth.

Reliable oracles are critical — a manipulated price can trigger wrongful liquidations or drain a pool.

Putting It Together

DeFi rebuilds finance as open, composable smart contracts: lending markets, DEXs, stablecoins, and yield strategies, all coordinated by governance and fed by oracles.

Next we focus on the core trading engine: Automated Market Makers.

Quick Check

Test your DeFi fundamentals.

Recap: DeFi Overview

You learned that:

  • DeFi recreates finance with smart contracts, no intermediaries
  • Core pieces: lending, DEXs, stablecoins, yield
  • Protocols are composable money legos
  • Oracles feed real-world prices on-chain
  • Risks include bugs, liquidation, and oracle attacks

Next: how AMMs price trades.

常见问题解答

「DeFi 概览」课时是免费的吗?

是的 — 「DeFi 概览」的完整文本可在网页上免费阅读。要进行交互式练习(内置代码编辑器和全天候 AI 导师)并解锁 Web3 & DApp Development Fundamentals 课程的其余内容,请升级到 CoddyKit PRO。 Web3 & DApp Development Fundamentals 课程共包含 4 节课。

「DeFi 概览」这节课中我会学到什么?

借贷、DEX 与收益 你通过在浏览器中直接运行的动手代码来练习 Web3 & DApp Development Fundamentals,全天候 AI 导师会在你学习这节课的过程中回答你的问题。

学习 Web3 & DApp Development Fundamentals 需要有经验吗?

无需任何先前经验。CoddyKit 上的 Web3 & DApp Development Fundamentals 课程适合初学者到高级学习者,你可以从这里开始或从头开始,按照自己的节奏学习。 这是第 1 节课,共 4 节。

「DeFi 概览」课时需要多长时间?

大多数 CoddyKit 课程大约需要 5–10 分钟。每节课都很精短且互动,所以你能稳步进步,并在网页和应用中从离开的地方继续。

我能在这节 Web3 & DApp Development Fundamentals 课中编写并运行代码吗?

能。每节 Web3 & DApp Development Fundamentals 课都包含内置代码编辑器,你可以在浏览器中直接编写并运行真实代码,并获得即时 AI 反馈 — 无需本地设置。

此课程中的所有课时

  1. DeFi 概览
  2. 自动做市商
  3. 流动性池
  4. 构建简单交换
← 返回 Web3 & DApp Development Fundamentals