协议概述
Aave 是 DeFi 领域领先的去中心化借贷协议,允许用户通过流动性池进行无中介的加密资产借贷。自 2017 年创立以来(最初名为 ETHLend),Aave 已演变为多链生态的核心组件,强调非托管、开源和社区治理。截至 2025 年 11 月,Aave V3 是主流版本,TVL(总锁定价值)约 370 亿美元(DeFiLlama 数据),活跃贷款额超 150 亿美元,日交易量(包括闪电贷)达数十亿美元。
- 核心机制:用户存入资产作为供应方赚取利息,或以超额抵押借出资产。协议通过 AAVE 治理代币实现 DAO 决策,支持变量/稳定利率借贷。
- 演进历史:
- V1/V2(2017-2021):引入闪电贷(Flash Loans)和 aTokens。
- V3(2022+):添加门户(Portal)跨链、E-Mode 高效模式、孤立市场,提升资金效率和风险隔离。
- 2025 更新:GHO 稳定币整合深化(DAO 治理的美元挂钩稳定币),Safety Module 回购 AAVE 代币(4 月后启动),支持 20+ 链(如 Ethereum、Polygon、Base、Avalanche),并与机构(如 JPMorgan)合作。
Aave 定位为 DeFi 的“流动性引擎”,通过创新如闪电贷推动套利和衍生品开发,2025 年市场份额约 40%(借贷协议中)。
关键技术
Aave V3 构建在 Solidity 智能合约基础上,集成 Chainlink 预言机和多层风险管理。以下是核心技术对比(V2 vs V3):
| 技术 | V2 | V3 | 说明 |
|---|---|---|---|
| 流动性池 | 单一池模型 | 多储备池 + 孤立市场 | V3 支持风险隔离资产(如新代币),供应/借贷上限防攻击 |
| 利率模型 | 变量/稳定 | 动态利率 + E-Mode | E-Mode:相关资产(如稳定币)借贷上限提升至 97%,资金效率 +50% |
| 代币化 | aTokens(供应利息) | aTokens + vdTokens(债务) | vdTokens 非可转移,追踪债务;aTokens 自动复利 |
| 闪电贷 | 基本支持 | 简单/高级模式 | 0 抵押,单交易内归还;2025 年费率 0.05%,用于 MEV 防护 |
| 跨链 | 桥接依赖 | Portal 功能 | 无缝转移流动性,支持 LayerZero/Connext;桥角色由治理授予 |
| 风险管理 | 健康因子(HF) | 改进清算 + 伞状系统 | HF < 1 时全清算(之前半清算);伞状:DAO 代理风险参数调整 |
| 治理 | AAVE 投票 | 多奖励 + GHO 整合 | 支持多代币奖励;Safety Module 质押 AAVE 赚取 + 保险 |
| 预言机 | Chainlink | Chainlink + 自定义 | 防操纵,支持 GHO 挂钩 USD |
- AAVE 代币经济:总供应 1600 万,流通 1520 万。用于治理、质押(Safety Module)和费用折扣。
- 2025 亮点:GHO TVL 超 5 亿美元,DAO 国库多元化(稳定币 + BTC/ETH);审计由 CertiK/OpenZeppelin 保障。
核心流程
Aave 的交互通过 Pool 合约 入口,支持供应、借贷和清算。以下是 Mermaid 图示的核心流程:
graph TD
A[用户连接钱包] --> B{角色选择}
B -->|供应方| C[supply 存入资产 → mint aTokens]
B -->|借款方| D[borrow 抵押资产 → mint vdTokens]
C --> E[赚取利息 → aTokens 自动复利]
D --> F[监控 HF → 若 <1 清算]
E --> G[withdraw 提取本金 + 利息]
F --> H[repay 还款 → burn vdTokens]
G & H --> I[Flash Loan 或跨链 Portal]
I --> J[治理:Stake AAVE → 投票/奖励]
详细步骤:
-
供应流动性:
- 选择资产(如 USDC),调用
supply存入 → 立即获得 aTokens(1:1 锚定 + 利息)。 - 支持 onBehalfOf(委托供应)。
- 选择资产(如 USDC),调用
-
借贷资产:
- 抵押超额资产(LTV 通常 70-80%),选择变量/稳定利率。
- 调用
borrow→ mint vdTokens 追踪债务;E-Mode 优化相关资产借贷。
-
还款与提取:
repay还款(部分/全额),burn vdTokens。withdraw提取供应资产,按当前利率计算收益。
-
清算:
- HF < 1 时,任何人可调用
liquidationCall,以 5% 折扣获取抵押品(奖金激励)。
- HF < 1 时,任何人可调用
-
闪电贷与治理:
- 单交易借贷(e.g., 套利),归还 + 0.05% 费。
- Stake AAVE 于 Safety Module → 赚取协议费 + 投票权。
核心算法
Aave 使用动态利率和健康因子算法,确保协议稳健。
1. 利率模型(动态利用率)
- 利用率(U):$ U = \frac{Total\ Borrowed}{Total\ Supplied} $
- 供应利率(r_s):$ r_s = U \times r_b \times (1 - R_f) $,其中 r b r_b rb 为基准借贷利率, R f R_f Rf 为储备因子(协议费)。
- 借贷利率(r_b):分段线性:
r b = { r 0 + U × ( r 1 − r 0 ) / U o p t U ≤ U o p t r 1 + ( U − U o p t ) × ( r 2 − r 1 ) / ( 1 − U o p t ) U > U o p t r_b = \begin{cases} r_0 + U \times (r_1 - r_0) / U_{opt} & U \leq U_{opt} \\ r_1 + (U - U_{opt}) \times (r_2 - r_1) / (1 - U_{opt}) & U > U_{opt} \end{cases} rb={r0+U×(r1−r0)/Uoptr1+(U−Uopt)×(r2−r1)/(1−Uopt)U≤UoptU>Uopt
( U o p t U_{opt} Uopt 优化利用率 ~80%, r 0 / r 1 / r 2 r_0/r_1/r_2 r0/r1/r2 治理参数)。
2. 健康因子(HF)
H F = ∑ ( C o l l a t e r a l i × P r i c e i × L T V i ) T o t a l D e b t × L i q u i d a t i o n T h r e s h o l d HF = \frac{\sum (Collateral_i \times Price_i \times LTV_i)}{Total\ Debt \times Liquidation\ Threshold} HF=Total Debt×Liquidation Threshold∑(Collaterali×Pricei×LTVi)
- HF > 1:安全;HF < 1:可清算。
- 清算奖金:5%(HF 接近 1 时)。
3. E-Mode 效率提升
- 相关资产(如稳定币)LTV 升至 97%,清算阈值 97.5%,借贷上限 x2。
4. 闪电贷公式
- 借 a m o u n t amount amount,归还 a m o u n t + f e e amount + fee amount+fee(0.05%),单交易执行(防失败)。
核心合约源码解析
Aave V3 合约开源(GitHub: aave/aave-v3-core),基于 Solidity 0.8+,使用 OpenZeppelin 库。核心为 Pool(借贷入口)、aToken/vdToken(代币化)和 PoolAddressesProvider(注册表)。以下是关键方法解析(简化版,含注释):
1. 供应流动性(IPool.sol)
// SPDX-License-Identifier: AGPL-3.0
pragma solidity ^0.8.0;
import {IPoolAddressesProvider} from './IPoolAddressesProvider.sol';
import {DataTypes} from '../protocol/libraries/types/DataTypes.sol';
/**
* @title IPool
* @author Aave
* @notice Defines the basic interface for an Aave Pool.
*/
interface IPool {
/**
* @notice Supplies an `amount` of underlying asset into the reserve, receiving in return overlying aTokens.
* @dev E.g. User supplies 100 USDC and gets in return 100 aUSDC.
* @param asset The address of the underlying asset to supply.
* @param amount The amount to be supplied.
* @param onBehalfOf The address that will receive the aTokens, same as msg.sender if the user
* wants to receive them on his own wallet, or a different address if the receiver is a
* different wallet.
* @param referralCode Code used to register the integrator originating the operation, for potential rewards.
* 0 if the action is executed directly by the user, without any middle-man.
*/
function supply(
address asset,
uint256 amount,
address onBehalfOf,
uint16 referralCode
) external;
}
解析:调用 supply 转移资产 → mint aTokens(ERC20,可转移);onBehalfOf 支持委托;referralCode 追踪积分。集成 TransferHelper 防重入。
2. 借贷资产(IPool.sol)
/**
* @notice Borrow `amount` of specified `asset` from the reserve, using the `asset` as collateral.
* @dev The caller will receive the underlying asset and will have to repay the stable/variable debt.
* @param asset The address of the underlying asset to borrow.
* @param amount The amount to be borrowed.
* @param interestRateMode The interest rate mode: 1 for stable, 2 for variable.
* @param referralCode Code used to register the integrator originating the operation, for potential rewards.
* 0 if the action is executed directly by the user, without any middle-man.
* @param onBehalfOf The address of the user who will receive the borrowed asset.
*/
function borrow(
address asset,
uint256 amount,
uint256 interestRateMode,
uint16 referralCode,
address onBehalfOf
) external;
解析:检查 HF/LTV → mint vdTokens(非转移);利率模式选择稳定/变量;预言机验证价格。
3. 还款(IPool.sol)
/**
* @notice Repay a variable or stable debt.
* @dev E.g. User repays 100 USDC, burning 100 variable/stable tokens of the same underlying asset.
* @param asset The address of the underlying asset previously borrowed.
* @param amount The amount to repay.
* @param rateMode The interest rate mode of the debt to repay: 1 for stable, 2 for variable.
* @param onBehalfOf Address of the user who will get his debt reduced/removed. Should be the address of the user
* calling the function if he wants to reduce/remove his own debt, or the address of any other
* other borrower whose debt should be removed.
*/
function repay(
address asset,
uint256 amount,
uint256 rateMode,
address onBehalfOf
) external returns (uint256);
解析:转移资产 → burn vdTokens;部分还款更新债务;计算利息累积。
4. 清算(IPool.sol)
/**
* @notice Liquidates an under-collateralized position.
* @dev Emits a 'LiquidationCall' event.
* @param collateralAsset The address of the underlying asset used as collateral, to receive as result of the liquidation.
* @param debtAsset The address of the underlying borrowed asset to be repaid with the liquidation.
* @param user The address of the borrower getting liquidated.
* @param debtToCover The debt amount of borrowed `asset` to be covered with the liquidation.
* @param receiveAToken true if the liquidators want to receive the collateral aTokens, false if want to receive the underlying asset directly.
*/
function liquidationCall(
address collateralAsset,
address debtAsset,
address user,
uint256 debtToCover,
bool receiveAToken
) external;
解析:验证 HF < 1 → 以折扣(5%)转移抵押品;奖金激励清算者;V3 支持全清算(HF < 0.95)。
安全:Errors.sol 定义错误码(如 ‘1’ 为非管理员);经多轮审计,bug bounty 超 100 万美元。
协议层级
Aave 采用模块化架构,支持多链部署:
应用层 Aave App / SDK / APIs (@aave/react)
协议层 Core (Pool / aToken / vdToken) + Periphery (Portal / SafetyModule)
治理层 Aave DAO (Timelock + Governor) + GHO Facilitators
基础设施 多链 EVM (ETH/Polygon/Base) + 预言机 (Chainlink)
索引层 The Graph / Dune Analytics
- 跨层交互:PoolAddressesProvider 注册组件;治理提案升级参数(如利率曲线)。
应用场景
Aave 的非托管设计支持多样化 DeFi 活动:
| 场景 | 描述 | 示例 |
|---|---|---|
| 借贷交易 | 超额抵押借出流动性 | 抵押 ETH 借 USDC,LTV 80% |
| 收益耕作 | 供应资产赚利息 | aUSDC 年化 2-5%,复利自动 |
| 闪电贷套利 | 单交易无抵押借贷 | 跨 DEX 价格差,2025 日费超 100 万美元 |
| 跨链桥接 | Portal 转移资产 | ETH → Polygon 供应,零滑点 |
| 稳定币铸造 | GHO 抵押生成 | 抵押 DAI 铸 GHO,DAO 治理挂钩 |
| 机构级 | 折扣费 + 合规 | JPMorgan 集成,用于 RWA(真实世界资产) |
| 2025 新场景 | E-Mode 杠杆 | 稳定币池借贷上限 x2,吸引机构 TVL |
- 开发者级:SDK 集成市场数据查询,便于 DApp 嵌入。
补充点
- GHO 稳定币:2023 推出,2025 TVL 爆发;抵押超额资产,DAO 调整供应,清算维持挂钩。
- Safety Module:质押 AAVE 作为保险,覆盖协议损失;2025 回购机制提升代币价值。
- 风险参数:治理可委托 DAO 调整(如伞状系统),支持自动化代理。
- 多奖励:V3 支持多代币激励(如 AAVE + 外部 token)。
- MEV 防护:闪电贷集成 Flashbots,减少三明治攻击。
- 集成生态:与 MetaMask、Kraken、Fireblocks 合作;Dune 仪表盘追踪 HF/TVL。
- 风险提示:预言机故障、市场波动;建议监控 HF > 1.2。
- 开发者工具:@aave/core-v3 NPM 包,快速导入 IPool 接口。
总结:Aave 核心价值
| 维度 | 贡献 |
|---|---|
| 创新 | 闪电贷 + Portal 开启 DeFi 组合时代,V3 效率提升 50%+ |
| 社区 | AAVE DAO 驱动,190k+ 持有者,确保去中心化与可持续 |
| 效率 | TVL 370 亿主导借贷市场,GHO 推动 RWA 整合 |
| 未来 | 2025 路线图(多链扩展 + AI 风险代理)巩固 Aave 为 DeFi 基石 |
Aave 不仅是借贷协议,更是 DeFi 基础设施,推动从 CeFi 向真正去中心化转型。当前(2025.11),其在 Base 链的 TVL 增长标志着 L2 流动性新时代。
备注:本文基于 Aave 官方文档、DeFiLlama 和 2025 更新数据编写。 若有技术细节或数据错误(如合约版本变更),欢迎指出并提供来源,我将及时修正。

816

被折叠的 条评论
为什么被折叠?



