dapp-aave
Original:🇺🇸 English
Translated
This skill should be used when the user asks about Aave, lending, borrowing, 'supply to Aave', 'deposit into Aave', 'withdraw from Aave', 'Aave APY', 'Aave markets', 'lending rates', 'health factor', or mentions Aave V3, DeFi lending, supply/withdraw assets, or checking lending rates. Covers market data, reserve details, account positions, and supply/withdraw operations on Ethereum, Polygon, and Arbitrum. Do NOT use for DEX swaps — use okx-dex-swap instead. Do NOT use for prediction markets — use okx-dapp-polymarket instead.
3installs
Added on
NPX Install
npx skill4agent add purong-huang-1121/skills-store dapp-aaveTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Aave V3 Lending Protocol CLI
7 commands for lending market data, reserve details, account positions, supply/withdraw, and borrow/repay operations.
Pre-flight Checks
Every time before running any command, always follow these steps in order. Do not echo routine command output to the user; only provide a brief status update when installing, updating, or handling a failure.
plugin-store-
Confirm installed: Run. If not found, install it:
which plugin-storebashcurl -sSL https://raw.githubusercontent.com/purong-huang-1121/skills-store/main/install.sh | shIf the install script fails, ask the user to install manually following the instructions at: https://github.com/okx/plugin-store -
Check for updates: Readand compare it with the current timestamp:
~/.plugin-store/last_checkbashcached_ts=$(cat ~/.plugin-store/last_check 2>/dev/null || true) now=$(date +%s)- If is non-empty and
cached_ts(12 hours), skip the update and proceed.(now - cached_ts) < 43200 - Otherwise (file missing or older than 12 hours), run the installer to check for updates:
bash
curl -sSL https://raw.githubusercontent.com/purong-huang-1121/skills-store/main/install.sh | sh
- If
-
If anycommand fails with an unexpected error during this session, try reinstalling before giving up.
plugin-store
Skill Routing
- For token search / analytics → use
okx-dex-token - For DEX swap → use
okx-dex-swap - For token prices / charts → use
okx-dex-market - For wallet balances → use
okx-wallet-portfolio - For transaction broadcasting → use
okx-onchain-gateway - For prediction markets → use
okx-dapp-polymarket
Authentication
Data commands (markets, reserve, account): No authentication needed. Work immediately.
Transaction commands (supply, withdraw, borrow, repay): Require an EVM wallet private key:
bash
# Add to .env file
EVM_PRIVATE_KEY=0x...The private key is used to sign supply, withdraw, borrow, and repay transactions on-chain.
Quickstart
Browse and Research
bash
# List all Aave V3 markets on Ethereum
plugin-store aave markets --chain ethereum
# Get reserve details for USDC
plugin-store aave reserve USDC --chain ethereum
# Check account positions
plugin-store aave account 0xYourAddress --chain ethereumSupply and Withdraw
bash
# Supply 100 USDC to Aave on Ethereum
plugin-store aave supply --token USDC --amount 100 --chain ethereum
# Withdraw 50 USDC from Aave
plugin-store aave withdraw --token USDC --amount 50 --chain ethereum
# Withdraw all USDC (full balance)
plugin-store aave withdraw --token USDC --amount max --chain ethereumBorrow and Repay
bash
# Borrow 500 USDC against your collateral (variable rate)
plugin-store aave borrow --token USDC --amount 500 --chain ethereum
# Repay 200 USDC of your debt
plugin-store aave repay --token USDC --amount 200 --chain ethereum
# Repay all outstanding USDC debt
plugin-store aave repay --token USDC --amount max --chain ethereumCommand Index
| # | Command | Auth | Description |
|---|---|---|---|
| 1 | | No | List all Aave V3 reserve markets on a chain |
| 2 | | No | Get detailed reserve data (APY, liquidity, config) |
| 3 | | No | View account positions, health factor, borrowing power |
| 4 | | Yes | Supply assets to earn yield |
| 5 | | Yes | Withdraw supplied assets (use "max" for full withdrawal) |
| 6 | | Yes | Borrow assets at variable rate against collateral |
| 7 | | Yes | Repay borrowed assets (use "max" for full repayment) |
Cross-Skill Workflows
Workflow A: Research and Supply (most common)
User: "What are the best lending rates on Aave right now?"
1. aave markets --chain ethereum → show all reserves with APYs
↓ user picks an asset
2. aave reserve USDC --chain ethereum → show detailed reserve info
↓ user wants to supply
3. Check EVM_PRIVATE_KEY is set
↓ not set → prompt user to add to .env
↓ set → continue
4. aave supply --token USDC --amount 100 --chain ethereum
↓
5. "Supplied 100 USDC to Aave V3. You will receive aUSDC as a receipt token."Data handoff:
- from markets data →
symbolfor reserve/supply/withdraw commands<symbol> - address is resolved automatically from the symbol
underlyingAsset
Workflow B: Portfolio Review and Withdrawal
1. aave account 0xYourAddress --chain ethereum → show positions, health factor
2. aave reserve WETH --chain ethereum → check current rates on a position
3. aave withdraw --token WETH --amount max --chain ethereum → withdraw full balanceWorkflow C: Multi-Chain Comparison
1. aave markets --chain ethereum → Ethereum rates
2. aave markets --chain polygon → Polygon rates
3. aave markets --chain arbitrum → Arbitrum rates
4. aave supply --token USDC --amount 100 --chain arbitrum → supply on best chainWorkflow D: With OKX Skills
1. okx-wallet-portfolio balance --chain ethereum → check token balances
2. aave markets --chain ethereum → check lending rates
3. aave supply --token USDC --amount 100 --chain ethereum → supply to AaveOperation Flow
Step 1: Identify Intent
- Browse markets/rates →
markets - Check specific asset details →
reserve - Check account status →
account - Deposit/lend assets →
supply - Withdraw assets →
withdraw - Borrow against collateral →
borrow - Repay debt →
repay
Step 2: Collect Parameters
- Missing chain → ask user which chain (ethereum, polygon, or arbitrum)
- Missing symbol for reserve → use first, then pick from the list
markets - Missing address for account → ask user for their wallet address
- Missing amount for supply/withdraw/borrow/repay → ask user how much
- Missing private key (for supply/withdraw/borrow/repay) → prompt to set in
EVM_PRIVATE_KEY.env
Step 3: Execute
- Data phase: show market info, rates, positions, let user make informed decision
- Confirmation phase: before any supply/withdraw, display token, amount, chain, estimated APY, and ask for confirmation
- Execution phase: submit transaction, show result with tx hash
Step 4: Suggest Next Steps
| Just completed | Suggest |
|---|---|
| 1. Check specific reserve details → |
| 1. Supply assets → |
| 1. Withdraw assets → |
| 1. Check updated position → |
| 1. Check updated position → |
| 1. Check health factor → |
| 1. Check updated debt → |
Present conversationally — never expose skill names or endpoint paths to the user.
CLI Command Reference
1. plugin-store aave markets
bash
plugin-store aave markets --chain <chain>| Param | Required | Default | Description |
|---|---|---|---|
| Yes | - | Chain: ethereum, polygon, arbitrum |
Key return fields per reserve:
| Field | Description |
|---|---|
| Asset symbol (e.g. USDC, WETH, DAI) |
| Token contract address |
| Current annual supply yield (as decimal, multiply by 100 for %) |
| Current annual borrow rate |
| Total amount supplied |
| Total amount borrowed |
| Amount available to borrow |
| Ratio of borrowed to supplied |
| Loan-to-value ratio for collateral |
| Threshold at which position can be liquidated |
2. plugin-store aave reserve
bash
plugin-store aave reserve <symbol> --chain <chain>| Param | Required | Default | Description |
|---|---|---|---|
| Yes | - | Asset symbol (e.g. USDC, WETH, DAI) |
| Yes | - | Chain: ethereum, polygon, arbitrum |
Return fields:
| Field | Description |
|---|---|
| Asset symbol |
| Current supply APY |
| Variable borrow rate |
| Stable borrow rate (if available) |
| Total supplied amount |
| Total borrowed amount |
| Available to borrow |
| Current utilization |
| Max loan-to-value for collateral |
| Liquidation trigger threshold |
| Bonus for liquidators |
| Protocol fee on interest |
| Whether asset can be used as collateral |
| Whether borrowing is enabled |
3. plugin-store aave account
bash
plugin-store aave account <address> --chain <chain>| Param | Required | Default | Description |
|---|---|---|---|
| Yes | - | Wallet address (0x...) |
| Yes | - | Chain: ethereum, polygon, arbitrum |
Return fields:
| Field | Description |
|---|---|
| Total value of supplied assets in USD |
| Total value of borrowed assets in USD |
| Net position value in USD |
| Health factor (< 1.0 = liquidatable) |
| Remaining borrowing capacity in USD |
| Current loan-to-value ratio |
| List of supplied positions |
| List of borrow positions |
4. plugin-store aave supply
bash
plugin-store aave supply --token <symbol> --amount <amount> --chain <chain>| Param | Required | Default | Description |
|---|---|---|---|
| Yes | - | Asset symbol (e.g. USDC, WETH) |
| Yes | - | Amount to supply (in token units) |
| Yes | - | Chain: ethereum, polygon, arbitrum |
Return fields:
| Field | Description |
|---|---|
| Transaction hash |
| Transaction status (pending, confirmed, failed) |
| Amount supplied |
| Token symbol |
| Chain used |
5. plugin-store aave withdraw
bash
plugin-store aave withdraw --token <symbol> --amount <amount> --chain <chain>| Param | Required | Default | Description |
|---|---|---|---|
| Yes | - | Asset symbol (e.g. USDC, WETH) |
| Yes | - | Amount to withdraw (in token units, or "max" for full withdrawal) |
| Yes | - | Chain: ethereum, polygon, arbitrum |
Return fields:
| Field | Description |
|---|---|
| Transaction hash |
| Transaction status (pending, confirmed, failed) |
| Amount withdrawn |
| Token symbol |
| Chain used |
6. plugin-store aave borrow
bash
plugin-store aave borrow --token <symbol> --amount <amount> --chain <chain>| Param | Required | Default | Description |
|---|---|---|---|
| Yes | - | Asset symbol to borrow (e.g. USDC, WETH) |
| Yes | - | Amount to borrow (in token units) |
| No | ethereum | Chain: ethereum, polygon, arbitrum |
Return fields:
| Field | Description |
|---|---|
| Transaction hash |
| Transaction status (success, reverted) |
| Amount borrowed |
| Token symbol |
| Chain used |
7. plugin-store aave repay
bash
plugin-store aave repay --token <symbol> --amount <amount> --chain <chain>| Param | Required | Default | Description |
|---|---|---|---|
| Yes | - | Asset symbol to repay (e.g. USDC, WETH) |
| Yes | - | Amount to repay (in token units, or "max" for full repayment) |
| No | ethereum | Chain: ethereum, polygon, arbitrum |
Return fields:
| Field | Description |
|---|---|
| Transaction hash |
| Transaction status (success, reverted) |
| Amount repaid |
| Token symbol |
| Chain used |
Key Concepts
- Supply APY: Annual percentage yield earned by supplying assets. Rates are variable and change based on utilization.
- Health Factor: Ratio indicating position safety. Above 1.0 is safe; below 1.0 means the position can be liquidated. Keep it well above 1.0 (recommended > 1.5).
- aTokens: Receipt tokens received when supplying (e.g. supply USDC, receive aUSDC). aTokens accrue interest automatically — their balance grows over time.
- RAY: Aave uses 27-decimal fixed-point numbers (1 RAY = 10^27) for rate calculations internally. The CLI converts these to human-readable percentages.
- LTV (Loan-to-Value): Maximum percentage of collateral value that can be borrowed. E.g. 80% LTV means you can borrow up to 80% of your collateral value.
- Liquidation Threshold: The LTV level at which a position becomes eligible for liquidation. Always higher than the max LTV.
- Utilization Rate: Ratio of total borrowed to total supplied. Higher utilization = higher rates for both suppliers and borrowers.
Edge Cases
- Insufficient balance: If the user tries to supply more than their wallet balance, the transaction will fail. Check balance first via .
okx-wallet-portfolio - Health factor risk: When withdrawing collateral or borrowing, warn if the resulting health factor would drop below 1.5. Withdrawing/borrowing too much can trigger liquidation.
- Borrow capacity: User must have sufficient collateral before borrowing. Check available borrows via command.
account - Max repay: Use to repay the full outstanding debt including accrued interest.
--amount max - Max withdrawal: Use to withdraw the full supplied balance including accrued interest. This uses
--amount maxinternally.type(uint256).max - Token approval: First-time supply of a token requires an ERC-20 approval transaction. The CLI handles this automatically but it will use additional gas.
- Private key not set: For supply/withdraw commands, show clear error: "Set EVM_PRIVATE_KEY in your .env file"
- Unsupported chain: Only ethereum, polygon, and arbitrum are supported. Other chains will return an error.
- Asset not listed: If a token symbol is not recognized as an Aave V3 reserve, suggest using to see available assets.
markets - Rate limiting: OKX API has rate limits. Use retry with backoff.