aave-risk-assessor
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseAAVE V3 Risk Assessor
AAVE V3 风险评估器
Assess risk metrics for AAVE V3 positions including Health Factor, LTV ratios, and liquidation risk.
Runtime Compatibility: This skill usesfor interactive prompts. IfAskUserQuestionis not available in your runtime, collect the same parameters through natural language conversation instead.AskUserQuestion
评估AAVE V3仓位的风险指标,包括健康因子、LTV比率和清算风险。
运行时兼容性: 本Skill使用实现交互式提示。如果您的运行环境不支持AskUserQuestion,请通过自然语言对话收集相同参数。AskUserQuestion
Overview
概述
Calculate and interpret risk metrics for AAVE V3 positions:
- Health Factor (HF) - Primary liquidation risk indicator
- LTV (Loan-to-Value) - Current and maximum borrowing capacity
- Liquidation Threshold - Point at which liquidation becomes possible
- Risk Level Classification - Safe, Moderate, High, Critical, Liquidation
计算并解读AAVE V3仓位的风险指标:
- 健康因子(Health Factor, HF) - 主要清算风险指标
- LTV(贷款价值比) - 当前及最大借款额度
- 清算阈值(Liquidation Threshold) - 触发清算的临界点
- 风险等级分类 - 安全、中等、高风险、临界、清算
Trigger Phrases
触发短语
This skill should be invoked when users say:
- "health factor"
- "liquidation risk"
- "aave risk"
- "will I be liquidated"
- "safe to borrow"
- "my account health"
- "collateral risk"
- "liquidation price"
当用户说出以下内容时,应调用本Skill:
- "健康因子"
- "清算风险"
- "AAVE风险"
- "我会被清算吗"
- "借款是否安全"
- "我的账户健康状况"
- "抵押品风险"
- "清算价格"
Risk Metrics
风险指标
Health Factor
健康因子
The Health Factor is a numeric representation of position safety:
HF = (Σ Collateral_i × LiquidationThreshold_i) / TotalDebt| Health Factor | Risk Level | Description | Recommended Action |
|---|---|---|---|
| > 2.0 | Safe | Position is well-collateralized | Normal operation |
| 1.5 - 2.0 | Moderate | Position is healthy but monitor | Continue monitoring |
| 1.2 - 1.5 | High | Position is at risk | Consider adding collateral or repaying debt |
| 1.0 - 1.2 | Critical | Position is near liquidation | Urgent: Add collateral or repay immediately |
| < 1.0 | Liquidation | Position can be liquidated | Position is being or will be liquidated |
健康因子是仓位安全性的数值体现:
HF = (Σ Collateral_i × LiquidationThreshold_i) / TotalDebt| 健康因子 | 风险等级 | 描述 | 建议操作 |
|---|---|---|---|
| > 2.0 | 安全 | 仓位抵押充足 | 正常操作 |
| 1.5 - 2.0 | 中等 | 仓位状况良好,但需监控 | 持续监控 |
| 1.2 - 1.5 | 高风险 | 仓位存在风险 | 考虑追加抵押品或偿还债务 |
| 1.0 - 1.2 | 临界 | 仓位接近清算 | 紧急:立即追加抵押品或偿还债务 |
| < 1.0 | 清算 | 仓位可被清算 | 仓位正在或即将被清算 |
Risk Level Implementation
风险等级实现
typescript
function getRiskLevel(healthFactor: number): RiskLevel {
if (healthFactor > 2.0) return 'safe';
if (healthFactor >= 1.5) return 'moderate';
if (healthFactor >= 1.2) return 'high';
if (healthFactor >= 1.0) return 'critical';
return 'liquidation';
}
type RiskLevel = 'safe' | 'moderate' | 'high' | 'critical' | 'liquidation';
const riskLevelMessages: Record<RiskLevel, string> = {
safe: 'Your position is well-collateralized.',
moderate: 'Your position is healthy, but continue monitoring.',
high: 'Your position is at risk. Consider adding collateral or repaying debt.',
critical: 'Warning: Your position is near liquidation! Add collateral or repay immediately.',
liquidation: 'Your position is eligible for liquidation.'
};typescript
function getRiskLevel(healthFactor: number): RiskLevel {
if (healthFactor > 2.0) return 'safe';
if (healthFactor >= 1.5) return 'moderate';
if (healthFactor >= 1.2) return 'high';
if (healthFactor >= 1.0) return 'critical';
return 'liquidation';
}
type RiskLevel = 'safe' | 'moderate' | 'high' | 'critical' | 'liquidation';
const riskLevelMessages: Record<RiskLevel, string> = {
safe: 'Your position is well-collateralized.',
moderate: 'Your position is healthy, but continue monitoring.',
high: 'Your position is at risk. Consider adding collateral or repaying debt.',
critical: 'Warning: Your position is near liquidation! Add collateral or repay immediately.',
liquidation: 'Your position is eligible for liquidation.'
};Risk Assessment Interface
风险评估接口
typescript
interface RiskAssessment {
// Core metrics
healthFactor: string; // Current health factor (e.g., "1.85")
maxLTV: string; // Maximum LTV allowed (e.g., "0.80")
currentLTV: string; // Current LTV ratio (e.g., "0.45")
liquidationThreshold: string; // Liquidation threshold (e.g., "0.825")
liquidationPenalty: string; // Liquidation penalty (e.g., "0.05")
// eMode status
eModeStatus: boolean; // Whether eMode is enabled
eModeCategory?: number; // eMode category ID if enabled
// Risk classification
riskLevel: 'safe' | 'moderate' | 'high' | 'critical' | 'liquidation';
// Additional metrics
totalCollateralUSD: string; // Total collateral value in USD
totalDebtUSD: string; // Total debt value in USD
availableBorrowsUSD: string; // Available borrowing power in USD
}typescript
interface RiskAssessment {
// 核心指标
healthFactor: string; // 当前健康因子(例如:"1.85")
maxLTV: string; // 允许的最大LTV(例如:"0.80")
currentLTV: string; // 当前LTV比率(例如:"0.45")
liquidationThreshold: string; // 清算阈值(例如:"0.825")
liquidationPenalty: string; // 清算惩罚(例如:"0.05")
// eMode状态
eModeStatus: boolean; // 是否启用eMode
eModeCategory?: number; // 若启用eMode,则为分类ID
// 风险分类
riskLevel: 'safe' | 'moderate' | 'high' | 'critical' | 'liquidation';
// 额外指标
totalCollateralUSD: string; // 抵押品总价值(美元)
totalDebtUSD: string; // 债务总价值(美元)
availableBorrowsUSD: string; // 可用借款额度(美元)
}Workflow
工作流
Step 1: Get Wallet Address
步骤1:获取钱包地址
If not provided in context, ask the user for their wallet address.
Input validation:
- Address must match
^0x[a-fA-F0-9]{40}$ - Must be a valid checksummed Ethereum address
若上下文未提供,向用户询问其钱包地址。
输入验证:
- 地址必须匹配正则表达式
^0x[a-fA-F0-9]{40}$ - 必须是有效的以太坊校验和地址
Step 2: Determine Chain
步骤2:确定链
If not specified, ask which chain to check: Ethereum or Arbitrum.
若未指定,询问用户要查询的链:以太坊(Ethereum)或Arbitrum。
Step 3: Query On-Chain Data
步骤3:查询链上数据
Use the Pool contract to get user account data:
typescript
import { createPublicClient, http, parseAbi } from 'viem';
import { mainnet, arbitrum } from 'viem/chains';
const POOL_ADDRESSES = {
1: '0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2', // Ethereum
42161: '0x794a61358D6845594F94dc1DB02A252b5b4814aD' // Arbitrum
};
const poolAbi = parseAbi([
'function getUserAccountData(address user) view returns (uint256 totalCollateralBase, uint256 totalDebtBase, uint256 availableBorrowsBase, uint256 currentLiquidationThreshold, uint256 ltv, uint256 healthFactor)'
]);使用Pool合约获取用户账户数据:
typescript
import { createPublicClient, http, parseAbi } from 'viem';
import { mainnet, arbitrum } from 'viem/chains';
const POOL_ADDRESSES = {
1: '0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2', // Ethereum
42161: '0x794a61358D6845594F94dc1DB02A252b5b4814aD' // Arbitrum
};
const poolAbi = parseAbi([
'function getUserAccountData(address user) view returns (uint256 totalCollateralBase, uint256 totalDebtBase, uint256 availableBorrowsBase, uint256 currentLiquidationThreshold, uint256 ltv, uint256 healthFactor)'
]);Step 4: Present Risk Assessment
步骤4:展示风险评估结果
Format the output with clear risk indicators:
markdown
undefined使用清晰的风险指标格式化输出:
markdown
undefinedAAVE Position Risk Assessment
AAVE 仓位风险评估
Risk Summary
风险摘要
| Metric | Value | Status |
|---|---|---|
| Health Factor | {healthFactor} | {riskEmoji} {riskLevel} |
| Total Collateral | ${totalCollateralUSD} | - |
| Total Debt | ${totalDebtUSD} | - |
| Available to Borrow | ${availableBorrowsUSD} | - |
**Risk Emojis:**
- Safe: ✅
- Moderate: ℹ️
- High: ⚠️
- Critical: 🚨
- Liquidation: ❌| 指标 | 数值 | 状态 |
|---|---|---|
| 健康因子 | {healthFactor} | {riskEmoji} {riskLevel} |
| 总抵押品 | ${totalCollateralUSD} | - |
| 总债务 | ${totalDebtUSD} | - |
| 可用借款额度 | ${availableBorrowsUSD} | - |
**风险表情符号:**
- 安全: ✅
- 中等: ℹ️
- 高风险: ⚠️
- 临界: 🚨
- 清算: ❌Asset-Specific Risk Parameters
特定资产风险参数
Ethereum Mainnet (Chain ID: 1)
以太坊主网(Chain ID: 1)
| Asset | LTV | Liquidation Threshold | Liquidation Penalty |
|---|---|---|---|
| USDC | 77% | 80% | 5% |
| USDT | 75% | 80% | 5% |
| DAI | 77% | 80% | 5% |
| WETH | 80% | 82.5% | 5% |
| WBTC | 73% | 78% | 7.5% |
| 资产 | LTV | 清算阈值 | 清算惩罚 |
|---|---|---|---|
| USDC | 77% | 80% | 5% |
| USDT | 75% | 80% | 5% |
| DAI | 77% | 80% | 5% |
| WETH | 80% | 82.5% | 5% |
| WBTC | 73% | 78% | 7.5% |
Arbitrum (Chain ID: 42161)
Arbitrum(Chain ID: 42161)
| Asset | LTV | Liquidation Threshold | Liquidation Penalty |
|---|---|---|---|
| USDC | 80% | 85% | 5% |
| USDT | 75% | 80% | 5% |
| DAI | 75% | 80% | 5% |
| WETH | 80% | 82.5% | 5% |
| WBTC | 73% | 78% | 7.5% |
| 资产 | LTV | 清算阈值 | 清算惩罚 |
|---|---|---|---|
| USDC | 80% | 85% | 5% |
| USDT | 75% | 80% | 5% |
| DAI | 75% | 80% | 5% |
| WETH | 80% | 82.5% | 5% |
| WBTC | 73% | 78% | 7.5% |
References
参考资料
- - Detailed Health Factor calculation
references/health-factor.md - - Complete risk parameters by asset
references/risk-thresholds.md
- - 健康因子计算详情
references/health-factor.md - - 各资产完整风险参数
references/risk-thresholds.md