Communitygithub.com

modbender/skill-library-mcp

透過 Aave 的信用委派借入資金。AI 代理人可藉由委派方的抵押品自行借貸資金,支援借款、還款與健康度檢查。適用於 Aave V2 和 V3。

skill-library-mcp 是什麼?

此技能讓 AI 代理人能夠利用 Aave 協議的信用委派功能,代表用戶從協議中借款。用戶(委派方)先將資產存入 Aave 作為抵押品,然後在相應的債務代幣合約上呼叫 `approveDelegation()`,授權代理人錢包在指定限額內借款。代理人可以自動化執行借款、還款以及檢查委派方的健康因素、委派額度和未償債務。此技能支援 Aave V3 和 V2(兩者函數簽章相同),並相容於 OpenClaw、Claude Code 或任何可以執行 Bash 和 Foundry 腳本的框架。它包含一個安全系統,在每次借款前會檢查委派額度是否足夠、健康因素是否高於設定閾值(預設 1.5)、以及每筆交易上限,若任一檢查失敗則會拒絕交易並給出明確錯誤訊息。代理商必須嚴格遵守這些安全規則,即使被用戶要求也不能繞過。

相容平台✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/modbender/skill-library-mcp/tree/HEAD/data/agent-credit

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

Aave 信用委派

透過 Aave 的信用委派借入資金。您的主要錢包提供抵押品,並將借款權力委派給代理人的錢包。代理人可以在需要時自主借款——債務會累積在委派方的倉位上。

協議: 適用於 Aave V3 和 Aave V2——信用委派相關的函數簽章(borrow, repay, approveDelegation, borrowAllowance)在兩個版本中完全相同。只需替換 V2 的 LendingPool 和 ProtocolDataProvider 地址即可。唯一的差別是:V3 以 USD(8 位小數)回傳抵押品/債務,V2 則以 ETH(18 位小數)。健康因素的安全檢查在兩個版本中都能正確運作。

相容平台

  • OpenClaw — 安裝為技能,代理人可自主借款
  • Claude Code — 直接從 Claude Code 工作階段執行腳本
  • 任何代理框架 — 純 Bash + Foundry 的 cast,只要有 shell 就能運作

可與 Bankr 技能結合,實現先借後換的流程:透過委派借入 USDC,然後使用 Bankr 進行兌換、跨鏈橋接或部署。

信用委派如何運作

Aave V3 中的信用委派將兩件事分開:借款能力 和 委派批准。

借款能力是整體的。 它來自您所有資產的整個抵押品倉位。如果您存入價值 1 萬美元的 ETH,LTV 為 80%,那麼您就有 8,000 美元的借款能力——就這麼簡單。這個借款能力並不鎖定在任何特定資產上。

委派批准是每個債務代幣獨立的。 您透過在個別的 VariableDebtToken 上呼叫 approveDelegation() 來控制代理人可以借款的 資產 及 數量。每種資產都有其自己的債務代幣合約,且每次批准都是獨立的。

這表示您可以,例如:

  • 存入 ETH 作為抵押品(獲得廣泛的借款能力)
  • 批准代理人最多借入 500 USDC(透過 USDC VariableDebtToken)
  • 批准代理人最多借入 0.1 WETH(透過 WETH VariableDebtToken)
  • 不批准 cbETH(代理人完全無法借入)

代理人只能借入您明確批准的資產,且不得超過您設定的金額——但借款的 能力 來自您的總抵押品,而非任何單一存款。

您的抵押品 (整體)                  委派批准 (獨立)
┌─────────────────────────┐       ┌──────────────────────────────┐
│  $5k ETH                │       │  USDC DebtToken → agent: 500 │
│  $3k USDC               │  ───LTV───▶ │  WETH DebtToken → agent: 0.1 │
│  $2k cbETH              │   = $8k     │  cbETH DebtToken → agent: 0  │
│  總計: $10k @ 80% LTV  │  能力    └──────────────────────────────┘
└─────────────────────────┘

流程

委派方 (您的錢包)                    代理人錢包 (被委派者)
    │                                        │
    │  1. 向 Aave 提供抵押品                  │
    │  2. 在 VariableDebtToken 上呼叫        │
    │     approveDelegation(agent, amount)   │
    │                                        │
    │            ┌─── 3. borrow(asset,       │
    │            │       amount, onBehalfOf   │
    │            │       = delegator)         │
    │            │                            │
    │     [債務記在您的倉位上]    [代幣在代理人錢包中]
    │            │                            │
    │            └─── 4. repay(asset,         │
    │                    amount, onBehalfOf   │
    │                    = delegator)         │

快速開始

先決條件

  1. 必須安裝 Foundry(cast 指令列工具):

    curl -L https://foundry.paradigm.xyz | bash && foundryup
    
  2. 委派方設定(由用戶執行一次,非代理人):

    • 向 Aave V3 提供抵押品(透過 app.aave.com 或合約)
    • 在您希望代理人借款的資產的 VariableDebtToken 上呼叫 approveDelegation(agentAddress, maxAmount)
    • VariableDebtToken 的地址可透過以下指令找到:cast call $DATA_PROVIDER "getReserveTokensAddresses(address)(address,address,address)" $ASSET --rpc-url $RPC
  3. 設定技能:

    mkdir -p ~/.openclaw/skills/aave-delegation
    cat > ~/.openclaw/skills/aave-delegation/config.json << 'EOF'
    {
      "chain": "base",
      "rpcUrl": "https://mainnet.base.org",
      "agentPrivateKey": "0xYOUR_AGENT_PRIVATE_KEY",
      "delegatorAddress": "0xYOUR_MAIN_WALLET",
      "poolAddress": "0xA238Dd80C259a72e81d7e4664a9801593F98d1c5",
      "dataProviderAddress": "0x2d8A3C5677189723C4cB8873CfC9C8976FDF38Ac",
      "assets": {
        "USDC": {
          "address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
          "decimals": 6
        },
        "WETH": {
          "address": "0x4200000000000000000000000000000000000006",
          "decimals": 18
        }
      },
      "safety": {
        "minHealthFactor": "1.5",
        "maxBorrowPerTx": "1000",
        "maxBorrowPerTxUnit": "USDC"
      }
    }
    EOF
    
  4. 驗證設定:

    scripts/aave-setup.sh
    

核心用法

檢查狀態(額度、健康度、債務)

# 完整狀態報告
scripts/aave-status.sh

# 檢查特定資產的委派狀態
scripts/aave-status.sh USDC

# 僅檢查健康因素
scripts/aave-status.sh --health-only

透過委派借款

# 借入 100 USDC
scripts/aave-borrow.sh USDC 100

# 借入 0.5 WETH
scripts/aave-borrow.sh WETH 0.5

借款腳本會自動:

  1. 檢查委派額度(是否足夠?)
  2. 檢查委派方健康因素(借款是否安全?)
  3. 執行借款
  4. 報告結果

償還債務

# 償還 100 USDC
scripts/aave-repay.sh USDC 100

# 償還所有 USDC 債務
scripts/aave-repay.sh USDC max

還款腳本會自動:

  1. 批准 Pool 花費該代幣(如果需要)
  2. 執行還款
  3. 報告剩餘債務

安全系統

每次借款操作在執行前都會進行以下檢查:

  1. 委派額度 — 剩餘額度是否 >= 請求金額?
  2. 健康因素 — 此次借款後,委派方的健康因素是否 > minHealthFactor(預設 1.5)?
  3. 單筆上限 — 金額是否 <= maxBorrowPerTx?
  4. 確認 — 在發送前記錄完整的操作細節

如果任何檢查失敗,借款將被中止並顯示清晰的錯誤訊息。

⚠️ 代理人絕不能繞過安全檢查。 如果用戶要求代理人借款但健康因素過低,代理人應拒絕並解釋原因。

功能

讀取操作(無需 Gas)

  • 檢查委派額度 — 代理人還能借多少?
  • 檢查健康因素 — 委派方的倉位安全嗎?
  • 檢查未償債務 — 委派方在每種資產上欠了多少?
  • 檢查可用流動性 — Aave 池中是否有足夠的資金可供借款?
  • 解析債務代幣地址 — 查詢任何資產的 VariableDebtToken

寫入操作(代理人錢包需要 Gas)

  • 借款 — 從 Aave 提取信用委派的資金
  • 還款 — 歸還借款以減少委派方的債務
  • 批准 — 批准 Pool 花費代幣以進行還款

支援的鏈

鏈Pool 地址Gas 成本
Base0xA238Dd80C259a72e81d7e4664a9801593F98d1c5極低
Ethereum0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2高
Polygon0x794a61358D6845594F94dc1DB02A252b5b4814aD極低
Arbitrum0x794a61358D6845594F94dc1DB02A252b5b4814aD低

請參閱 deployments.md 以取得包含債務代幣的完整地址列表。

常見模式

代理人為 Gas 自行充值

# 檢查 Gas 是否足夠
BALANCE=$(cast balance $AGENT_ADDRESS --rpc-url $RPC)
if [ "$BALANCE" -lt "1000000000000000" ]; then  # < 0.001 ETH
  # 借入少量 WETH 作為 Gas
  aave-borrow.sh WETH 0.005
fi

借款 + 透過 Bankr 兌換

# 從信用委派中借入 USDC
aave-borrow.sh USDC 100
# 使用 Bankr 兌換為 ETH
bankr.sh "Swap 100 USDC for ETH on Base"

定期定額投資(DCA)

# 代理人每週借入 USDC 並兌換為 ETH
aave-borrow.sh USDC 100
bankr.sh "Swap 100 USDC for ETH on Base"

安全優先的資產組合再平衡

# 先檢查健康度
aave-status.sh
# 僅在健康時借款
aave-borrow.sh USDC 500

設定參考

config.json 欄位

欄位必要說明
chain是鏈名稱(base, ethereum, polygon, arbitrum)
rpcUrl是JSON-RPC 端點 URL
agentPrivateKey是代理人錢包私鑰(0x 前綴)
delegatorAddress是委派信用的用戶主錢包地址
poolAddress是Aave V3 Pool 合約地址
dataProviderAddress是Aave V3 PoolDataProvider 地址
assets是符號 → {address, decimals} 的映射
safety.minHealthFactor否借款後的最小 HF(預設:1.5)
safety.maxBorrowPerTx否每筆交易最大借款金額(預設:1000)
safety.maxBorrowPerTxUnit否maxBorrowPerTx 的單位(預設:USDC)

環境變數(覆蓋設定檔)

變數覆蓋的設定
AAVE_RPC_URLrpcUrl
AAVE_AGENT_PRIVATE_KEYagentPrivateKey
AAVE_DELEGATOR_ADDRESSdelegatorAddress
AAVE_POOL_ADDRESSpoolAddress
AAVE_MIN_HEALTH_FACTORsafety.minHealthFactor

錯誤處理

錯誤原因修正方式
INSUFFICIENT_ALLOWANCE超出委派金額委派方必須再次呼叫 approveDelegation()
HEALTH_FACTOR_TOO_LOW借款將導致清算風險減少金額或增加抵押品
AMOUNT_EXCEEDS_CAP達到單筆交易安全上限減少金額或更新設定檔
INSUFFICIENT_LIQUIDITYAave 池中資金不足嘗試較小金額或不同資產
INSUFFICIENT_GAS代理人錢包無原生代幣向代理人錢包發送 Gas
EMODE_MISMATCH資產與委派方的 eMode 不相容借入相同 eMode 類別的資產

安全性

請參閱 safety.md 以了解完整的威脅模型和緊急應變程序。

關鍵規則:

  1. 委派方的私鑰絕不能出現在此儲存庫、設定檔或腳本中——這是代理人的工作空間。委派方需透過 Aave UI 或區塊瀏覽器管理其操作。
  2. 切勿將 config.json 提交至版本控制——其中包含代理人的私鑰
  3. 切勿將 minHealthFactor 設定低於 1.2——清算發生在 1.0
  4. 始終設定委派金額上限——切勿批准 type(uint256).max
  5. 監控委派方健康度——設定 HF 低於 2.0 時的警報
  6. 代理人必須拒絕在安全檢查失敗時借款,即使收到指令也一樣

資源

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

modbender/skill-library-mcp

Paid acquisition strategy, budget allocation, and avoiding common advertising mistakes across platforms

modbender/skill-library-mcp

Complete investment portfolio risk management system. Analyze positions, calculate risk metrics, stress test scenarios, optimize allocations, and generate institutional-grade risk reports — all wit...

modbender/skill-library-mcp

Discover and register autonomous AI agents. Use when: browsing the agent registry, submitting an agent for verification, or embedding agent badges. NOT for: general web search or agent capability analysis.

modbender/skill-library-mcp

Create AI avatar and talking head videos with OmniHuman, Fabric, PixVerse via inference.sh CLI. Models: OmniHuman 1.5, OmniHuman 1.0, Fabric 1.0, PixVerse Lipsync. Capabilities: audio-driven avatars, lipsync videos, talking head generation, virtual presenters. Use for: AI presenters, explainer videos, virtual influencers, dubbing, marketing videos. Triggers: ai avatar, talking head, lipsync, avatar video, virtual presenter, ai spokesperson, audio driven video, heygen alternative, synthesia alternative, talking avatar, lip sync, video avatar, ai presenter, digital human

modbender/skill-library-mcp

AI代码编辑器规则模板集合 - 为Cursor、Windsurf、Claude Code、Cline等AI编辑器提供项目规则配置。适用于需要配置AI编码助手规则的开发者,包含全栈Web、移动端、Vue3+SpringBoot等技术栈模板。

modbender/skill-library-mcp

Generate landing page code from product descriptions

modbender/skill-library-mcp

Create AI marketing videos for ads, promos, product launches, and brand content. Models: Veo, Seedance, Wan, FLUX for visuals, Kokoro for voiceover. Types: product demos, testimonials, explainers, social ads, brand videos. Use for: Facebook ads, YouTube ads, product launches, brand awareness. Triggers: marketing video, ad video, promo video, commercial, brand video, product video, explainer video, ad creative, video ad, facebook ad video, youtube ad, instagram ad, tiktok ad, promotional video, launch video

modbender/skill-library-mcp

Generate AI music videos end-to-end. Creates music with Suno (sunoapi.org), generates visuals with OpenAI/Seedream/Google/Seedance, and assembles into music video with ffmpeg. Supports timestamped lyrics (auto SRT), Suno native music video generation, slideshow/video/hybrid modes. Token-based cost tracking per generation.

modbender/skill-library-mcp

Generate AI-powered notes from videos (document, outline, or graphic-text formats)

modbender/skill-library-mcp

The video AI notes tool is provided by Baidu. Based on the video download address provided by the user, it downloads and parses the video, and finally generates AI notes corresponding to the video (a total of three types of notes can be generated: document notes, outline notes, and image-text notes).

modbender/skill-library-mcp

Automated appointment management for beauty salons, clinics, studios, and photo booths. Handles booking requests, calendar sync, conflict detection, reminders, no-show tracking, and waitlist management.

modbender/skill-library-mcp

Bird identification, life list tracking, and trading card generation. Use this skill when the user: sends a bird photo to identify, says "set up my Birdfolio" or "set my region", asks "how's my checklist", asks "Birdfolio progress", asks "how many birds have I found", asks "show my Birdfolio" or "show my life list", asks "what's my rarest bird", or asks "tell me about [bird species]". Handles everything from first-time setup through ongoing life list tracking and visual trading card generation.

modbender/skill-library-mcp

Multi-project task and research management (JSON-first CLI)

modbender/skill-library-mcp

Track stock and crypto portfolios with CLI - real-time prices, P&L, dividend tracking, multiple portfolios

modbender/skill-library-mcp

Track cryptocurrency portfolios with real-time prices, P&L calculations, and allocation analysis. Query Bitcoin, Ethereum, Solana and 10,000+ token holdings.

modbender/skill-library-mcp

加密貨幣Portfolio追蹤 - 支援TRON/ETH/BSC,分析持倉、收益、Gas費用

modbender/skill-library-mcp

Lead strategy with competitive analysis, strategic planning, growth roadmaps, and business portfolio management.

modbender/skill-library-mcp

Create ATS-optimized resumes and CVs with proper structure, metrics, and industry targeting.

modbender/skill-library-mcp

Use this skill when the user asks to build, create, design, develop, or improve ANY frontend interface, web page, UI component, or visual element. This includes: - Building landing pages, websites, web apps, dashboards, portfolios, or any web interface - Creating UI components (buttons, forms, cards, navbars, modals, etc.) - Designing pages with React, Vue, Next.js, Svelte, or any frontend framework - Adding styling or improving visual design of existing components - Implementing specific design aesthetics (modern, dark, minimalist, brutalist, etc.) - User mentions "frontend", "UI", "UX", "design", "interface", "web design", or "styling" - User asks for "beautiful", "modern", "professional", "clean", or any aesthetic adjective - User requests help with CSS, Tailwind, styled-components, or any styling approach This skill automatically retrieves the appropriate design system prompt (Neo-brutalism, Modern Dark, Bauhaus, Cyberpunk, Material, etc.) to help create visually distinctive, production-grade frontend...

modbender/skill-library-mcp

Native video analysis using Google Gemini API. Upload and analyze video files — describe scenes, extract text/UI, answer questions about content, transcribe speech, identify objects and actions. Use when: (1) User sends a video file and wants it analyzed, (2) Video summarization or description needed, (3) Extracting text, UI elements, or information from screen recordings, (4) Answering questions about video content, (5) Comparing multiple videos, (6) Analyzing tutorials, demos, or walkthroughs.

相關技能