Aave Liquidation Monitor
Quick Start
Configure your wallet and thresholds once, then the skill runs automatically every 6 hours (configurable).
Step 1: Initialize Your Config
Run /aave-config init to set up:
- - Your Ethereum wallet address (read-only; no private keys required)
- Health factor thresholds (default: critical 1.05, warning 1.2, stable >1.5)
- Check interval in hours (default: 6)
- Notification verbosity (verbose = daily summaries even if stable; quiet = only alerts)
- Preferred notification channel (Telegram default, or specify Discord/Slack)
Example:
CODEBLOCK0
Step 2: Test the Monitor
Run /aave-monitor check to fetch your position immediately and see the alert format:
CODEBLOCK1
Step 3: Enable Proactive Monitoring
Run /aave-monitor enable to start automatic checks every 6 hours. The skill registers a cron job that silently runs in the background and alerts you only when health factor drops below threshold.
For manual override:
CODEBLOCK2
Configuration Reference
See references/config-guide.md for detailed config options, chain support, and threshold guidance.
See references/aave-api.md for Aave V3 GraphQL schema and query patterns.
Security & Credentials: See SECURITY.md for how credentials are handled and threat model.
For auditors: See SECURITY.md for code review checklist and architecture details.
How It Works
- 1. Query Phase: Calls Aave V3 GraphQL API with your wallet address
- Analysis Phase: Extracts health factor, collateral, debt, borrowed/supplied assets
- Alert Logic:
- If HF < 1.05 →
CRITICAL (red alert, send immediately)
- If HF < 1.2 →
WARNING (yellow alert, send immediately)
- If HF > 1.5 →
STABLE (no alert, unless verbose mode enables daily summary)
- 4. Notification Phase: Posts alert to your configured channel with clear summary
- Retry Logic: If API fails, retries up to 3 times with exponential backoff
Error Handling
- - Invalid wallet address → Logs error, skips check, retries next interval
- API timeout → Retries up to 3x with exponential backoff (2s, 4s, 8s)
- Malformed response → Alerts you to API changes, logs full response for debugging
- Network errors → Silently retries; alerts only if all retries fail
Security & Credentials
NO private keys are requested or stored — this is read-only monitoring only.
How messaging credentials work
The skill uses OpenClaw's built-in message routing — it does NOT store Telegram, Discord, or Slack tokens.
- 1. You configure your messaging channel in OpenClaw (outside this skill)
- The skill calls OpenClaw's messaging API with just the alert text
- OpenClaw routes the message using your configured channels
Example:
CODEBLOCK3
You must have a messaging channel already set up in OpenClaw. See OpenClaw docs for setting up Telegram/Discord/Slack integrations.
Data handling
- - Wallet address: Stored in OpenClaw's encrypted config (never sent to external services except Aave's public API)
- API responses: Parsed for health factor only; sensitive position data is NOT logged
- Credentials: Managed by OpenClaw, never stored in skill files
What the skill accesses
✅ Aave GraphQL API (public) — reads your position data
✅ OpenClaw message routing — sends formatted alerts to your configured channel
✅ Cron scheduler — runs background checks on your interval
❌ Does NOT:
- - Request private keys
- Store API tokens
- Execute transactions
- Modify your positions
Examples
Alert Examples
Critical Alert (HF < 1.05):
CODEBLOCK4
Warning Alert (HF < 1.2):
CODEBLOCK5
Stable Position (HF > 1.5, verbose mode only):
CODEBLOCK6
Command Examples
CODEBLOCK7
Chains Supported
Primary: Ethereum mainnet
Also works (with same config address where applicable):
- - Polygon
- Arbitrum
- Optimism
- Base
- Avalanche
- Gnosis
Edit scripts/monitor.js to add chains or customize per-chain endpoints.
Customization
Change check interval:
CODEBLOCK8
Change alert thresholds:
CODEBLOCK9
Enable verbose mode (daily summaries even if stable):
CODEBLOCK10
Switch notification channel:
CODEBLOCK11
Implementation Details
See scripts/monitor.js for the core monitoring logic (GraphQL queries, health factor calculation, alert formatting).
See scripts/cron-runner.js for cron job integration with OpenClaw's cron scheduler.
Troubleshooting
"Invalid wallet address"
→ Check format: must be 0x... format. Try /aave-config view to see current config.
"Health factor not returned by API"
→ Wallet may not have Aave position. Try /aave-monitor check for immediate response.
"API endpoint unreachable"
→ Aave API may be down. Skill retries automatically. Check https://status.aave.com.
"No notifications sent"
→ Check that your notification channel is active. Run /aave-monitor check to test delivery.
Notes
- - Health factor = Total Collateral / Total Debt (net of liquidation threshold ratios)
- Liquidation occurs when HF ≤ 1.0
- Variable debt accrues interest; stable debt is fixed-rate
- eMode allows higher LTV for correlated assets (e.g., stablecoins, ETH-LSTs)
- Supplied assets are collateral; they earn interest but can be seized if you're liquidated
Last Updated: 2026-02-11 |
Status: Ready for configuration
Aave 清算监控器
快速开始
配置一次钱包和阈值,之后该技能将每6小时(可配置)自动运行。
第一步:初始化配置
运行 /aave-config init 进行设置:
- - 你的以太坊钱包地址(只读;无需私钥)
- 健康因子阈值(默认:严重1.05,警告1.2,稳定>1.5)
- 检查间隔(小时,默认:6)
- 通知详细程度(详细模式=即使稳定也发送每日摘要;安静模式=仅发送警报)
- 首选通知渠道(默认Telegram,或指定Discord/Slack)
示例:
/aave-config init
→ 钱包:0x1234...5678
→ 阈值:1.05(严重),1.2(警告)
→ 间隔:6小时
→ 详细程度:安静(仅警报)
→ 渠道:telegram
第二步:测试监控器
运行 /aave-monitor check 立即获取你的仓位并查看警报格式:
/aave-monitor check
→ 正在获取以太坊上 0x1234...5678 的仓位...
→ 健康因子:2.31(稳定 ✓)
→ 总抵押品:$50,342.12
→ 总债务:$21,804.00
→ 借入资产:USDC(15,000),WETH(0.5),USDT(6,804)
→ 供应资产:WETH(10),USDC(20,000),DAI(30,000)
第三步:启用主动监控
运行 /aave-monitor enable 开始每6小时自动检查。该技能会注册一个定时任务,在后台静默运行,仅在健康因子低于阈值时提醒你。
手动覆盖:
/aave-monitor enable --interval 4 # 每4小时检查一次
/aave-monitor disable # 停止监控
/aave-monitor status # 查看当前配置 + 上次检查结果
配置参考
详细配置选项、链支持和阈值指南请参见 references/config-guide.md。
Aave V3 GraphQL 模式和查询模式请参见 references/aave-api.md。
安全与凭证: 凭证处理方式和威胁模型请参见 SECURITY.md。
审计人员: 代码审查清单和架构详情请参见 SECURITY.md。
工作原理
- 1. 查询阶段:使用你的钱包地址调用 Aave V3 GraphQL API
- 分析阶段:提取健康因子、抵押品、债务、借入/供应资产
- 警报逻辑:
- 如果 HF < 1.05 →
严重(红色警报,立即发送)
- 如果 HF < 1.2 →
警告(黄色警报,立即发送)
- 如果 HF > 1.5 →
稳定(无警报,除非详细模式启用每日摘要)
- 4. 通知阶段:将警报发布到你配置的渠道,附带清晰摘要
- 重试逻辑:如果API失败,最多重试3次,采用指数退避
错误处理
- - 无效钱包地址 → 记录错误,跳过检查,下一个间隔重试
- API超时 → 最多重试3次,采用指数退避(2秒、4秒、8秒)
- 格式错误的响应 → 提醒你API变更,记录完整响应以供调试
- 网络错误 → 静默重试;仅在所有重试失败时发出警报
安全与凭证
不请求或存储任何私钥 — 这仅为只读监控。
消息凭证的工作方式
该技能使用 OpenClaw 的内置消息路由 — 不存储 Telegram、Discord 或 Slack 令牌。
- 1. 你在 OpenClaw 中配置消息渠道(在此技能之外)
- 该技能仅使用警报文本调用 OpenClaw 的消息 API
- OpenClaw 使用你配置的渠道路由消息
示例:
/aave-config set channel telegram
→ OpenClaw 通过你预先配置的 Telegram 渠道发送警报
你必须在 OpenClaw 中已设置消息渠道。 有关设置 Telegram/Discord/Slack 集成的信息,请参见 OpenClaw 文档。
数据处理
- - 钱包地址: 存储在 OpenClaw 的加密配置中(除 Aave 的公共 API 外,绝不发送给外部服务)
- API 响应: 仅解析健康因子;敏感仓位数据不记录
- 凭证: 由 OpenClaw 管理,绝不存储在技能文件中
技能访问的内容
✅ Aave GraphQL API(公共) — 读取你的仓位数据
✅ OpenClaw 消息路由 — 将格式化警报发送到你配置的渠道
✅ 定时任务调度器 — 按你的间隔运行后台检查
❌ 不执行:
- - 请求私钥
- 存储 API 令牌
- 执行交易
- 修改你的仓位
示例
警报示例
严重警报(HF < 1.05):
🚨 AAVE 清算风险 – 严重
健康因子:1.02(清算阈值:1.0)
⏰ 需要立即操作!
📊 仓位摘要:
总抵押品:$50,000
总债务:$48,000
债务比率:96%
借入(有风险):
- - USDC:40,000
- WETH:8 ETH(约$31k)
建议操作:
- 1. 偿还债务(尤其是WETH)
- 提供更多抵押品
- 如可用,启用eMode(相关资产更高LTV)
上次检查:2026-02-11 08:15 UTC
警告警报(HF < 1.2):
⚠️ AAVE 警告
健康因子:1.15(接近1.2阈值)
仓位接近清算。考虑:
- - 偿还 $2,000 USDC 或
- 添加 $5,000 抵押品(WETH 或 stETH)
稳定仓位(HF > 1.5,仅详细模式):
✅ AAVE 仓位健康
健康因子:2.31
总抵押品:$50,342.12
总债务:$21,804.00
一切正常。明天再检查。
命令示例
bash
一次性仓位检查
/aave-monitor check
启动自动监控
/aave-monitor enable
更改阈值(例如,在HF 1.3时提前警告)
/aave-config set thresholds 1.05 1.3
检查监控状态
/aave-monitor status
查看最近5次带警报的检查结果
/aave-monitor history 5
临时禁用监控
/aave-monitor disable
支持的链
主要:以太坊主网
同样适用(在适用情况下使用相同配置地址):
- - Polygon
- Arbitrum
- Optimism
- Base
- Avalanche
- Gnosis
编辑 scripts/monitor.js 以添加链或自定义每链端点。
自定义
更改检查间隔:
/aave-config set interval 4 # 每4小时检查一次
更改警报阈值:
/aave-config set thresholds 1.1 1.25 # 严重为1.1,警告为1.25
启用详细模式(即使稳定也发送每日摘要):
/aave-config set verbosity verbose
切换通知渠道:
/aave-config set channel discord
实现细节
核心监控逻辑(GraphQL查询、健康因子计算、警报格式化)请参见 scripts/monitor.js。
与 OpenClaw 定时任务调度器的定时任务集成请参见 scripts/cron-runner.js。
故障排除
无效钱包地址
→ 检查格式:必须为 0x... 格式。尝试 /aave-config view 查看当前配置。
API未返回健康因子
→ 钱包可能没有 Aave 仓位。尝试 /aave-monitor check 获取即时响应。
API端点不可达
→ Aave API 可能宕机。技能会自动重试。检查 https://status.aave.com。
未发送通知
→ 检查你的通知渠道是否激活。运行 /aave-monitor check 测试投递。
备注
- - 健康因子 = 总抵押品 / 总债务(扣除清算阈值比率)
- 当 HF ≤ 1.0 时发生清算
- 可变债务产生利息;稳定债务为固定利率
- eMode 允许相关资产(如稳定币、ETH-LST)获得更高 LTV
- 供应资产为抵押品;它们产生利息,但如果你被清算,可能被没收
最后更新: 2026-02-11 |
状态: 可配置