@elizaos/plugin-aave 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +216 -0
- package/package.json +2 -2
package/README.md
ADDED
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
# @elizaos/plugin-aave
|
|
2
|
+
|
|
3
|
+
A comprehensive Aave V3 Protocol integration plugin for ElizaOS that enables DeFi lending and borrowing operations across 16+ supported networks.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Multi-Chain Support**: Ethereum, Polygon, Avalanche, Arbitrum, Optimism, Base, BNB Chain, and more
|
|
8
|
+
- **DeFi Operations**: Supply, borrow, repay, and withdraw assets
|
|
9
|
+
- **Portfolio Management**: Monitor health factors and liquidation risks
|
|
10
|
+
- **Market Data**: Real-time APYs and protocol statistics
|
|
11
|
+
- **Natural Language**: Intuitive command interface
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
bun add @elizaos/plugin-aave
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Configuration
|
|
20
|
+
|
|
21
|
+
```env
|
|
22
|
+
# RPC URLs (at least one required)
|
|
23
|
+
ETHEREUM_RPC_URL=https://eth.llamarpc.com
|
|
24
|
+
POLYGON_RPC_URL=https://polygon-rpc.com
|
|
25
|
+
ARBITRUM_RPC_URL=https://arb1.arbitrum.io/rpc
|
|
26
|
+
OPTIMISM_RPC_URL=https://mainnet.optimism.io
|
|
27
|
+
BASE_RPC_URL=https://mainnet.base.org
|
|
28
|
+
|
|
29
|
+
# Optional
|
|
30
|
+
WALLET_PRIVATE_KEY=your_private_key_here
|
|
31
|
+
AAVE_DEFAULT_CHAIN=ethereum
|
|
32
|
+
HEALTH_FACTOR_ALERT=1.5
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Supported Networks
|
|
36
|
+
|
|
37
|
+
| Network | Chain ID | Native | Status |
|
|
38
|
+
|---------|----------|--------|--------|
|
|
39
|
+
| Ethereum | 1 | ETH | ✅ Mainnet |
|
|
40
|
+
| Polygon | 137 | MATIC | ✅ Mainnet |
|
|
41
|
+
| Avalanche | 43114 | AVAX | ✅ Mainnet |
|
|
42
|
+
| Arbitrum One | 42161 | ETH | ✅ Mainnet |
|
|
43
|
+
| Optimism | 10 | ETH | ✅ Mainnet |
|
|
44
|
+
| Base | 8453 | ETH | ✅ Mainnet |
|
|
45
|
+
| BNB Chain | 56 | BNB | ✅ Mainnet |
|
|
46
|
+
| Gnosis Chain | 100 | xDAI | ✅ Mainnet |
|
|
47
|
+
| + 8 more networks including testnets | | | |
|
|
48
|
+
|
|
49
|
+
## Usage
|
|
50
|
+
|
|
51
|
+
### Register the Plugin
|
|
52
|
+
|
|
53
|
+
```typescript
|
|
54
|
+
import { aavePlugin } from '@elizaos/plugin-aave';
|
|
55
|
+
agent.registerPlugin(aavePlugin);
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Available Actions
|
|
59
|
+
|
|
60
|
+
#### Supply Assets
|
|
61
|
+
```typescript
|
|
62
|
+
// Natural language
|
|
63
|
+
"Supply 1000 USDC to Aave on Ethereum"
|
|
64
|
+
"Lend 0.5 ETH to Aave on Arbitrum"
|
|
65
|
+
|
|
66
|
+
// Action format
|
|
67
|
+
{
|
|
68
|
+
action: "AAVE_SUPPLY",
|
|
69
|
+
options: {
|
|
70
|
+
asset: "USDC",
|
|
71
|
+
amount: "1000",
|
|
72
|
+
chain: "ethereum",
|
|
73
|
+
enableAsCollateral: true
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
#### Borrow Assets
|
|
79
|
+
```typescript
|
|
80
|
+
// Natural language
|
|
81
|
+
"Borrow 500 USDC from Aave on Ethereum"
|
|
82
|
+
"Borrow 0.2 ETH against my collateral"
|
|
83
|
+
|
|
84
|
+
// Action format
|
|
85
|
+
{
|
|
86
|
+
action: "AAVE_BORROW",
|
|
87
|
+
options: {
|
|
88
|
+
asset: "USDC",
|
|
89
|
+
amount: "500",
|
|
90
|
+
chain: "ethereum",
|
|
91
|
+
interestRateMode: "variable"
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
#### Repay Debt
|
|
97
|
+
```typescript
|
|
98
|
+
// Natural language
|
|
99
|
+
"Repay 300 USDC debt to Aave"
|
|
100
|
+
"Pay back all my DAI debt on Polygon"
|
|
101
|
+
|
|
102
|
+
// Action format
|
|
103
|
+
{
|
|
104
|
+
action: "AAVE_REPAY",
|
|
105
|
+
options: {
|
|
106
|
+
asset: "USDC",
|
|
107
|
+
amount: "300",
|
|
108
|
+
chain: "ethereum",
|
|
109
|
+
isMax: false
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
#### Withdraw Assets
|
|
115
|
+
```typescript
|
|
116
|
+
// Natural language
|
|
117
|
+
"Withdraw 500 USDC from Aave"
|
|
118
|
+
"Remove 0.1 ETH from my position"
|
|
119
|
+
|
|
120
|
+
// Action format
|
|
121
|
+
{
|
|
122
|
+
action: "AAVE_WITHDRAW",
|
|
123
|
+
options: {
|
|
124
|
+
asset: "USDC",
|
|
125
|
+
amount: "500",
|
|
126
|
+
chain: "ethereum"
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### Providers
|
|
132
|
+
|
|
133
|
+
#### AAVE_POSITION_CONTEXT
|
|
134
|
+
```
|
|
135
|
+
Aave Portfolio Summary:
|
|
136
|
+
- Total Value: $12,500.00 (Health Factor: 2.45)
|
|
137
|
+
- Active Chains: 3
|
|
138
|
+
|
|
139
|
+
Ethereum:
|
|
140
|
+
- USDC: $5,000 supplied (4.25% APY)
|
|
141
|
+
- DAI: $1,000 borrowed (5.50% APY)
|
|
142
|
+
|
|
143
|
+
Arbitrum:
|
|
144
|
+
- ETH: $2,000 supplied (2.95% APY)
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
#### AAVE_MARKET_DATA
|
|
148
|
+
```
|
|
149
|
+
Aave Markets:
|
|
150
|
+
Ethereum: USDC 4.25%/5.50% APY, ETH 2.80%/3.95% APY
|
|
151
|
+
Arbitrum: USDC 4.10%/5.25% APY, ETH 2.95%/4.10% APY
|
|
152
|
+
Polygon: MATIC 6.20%/8.50% APY, USDC 3.80%/5.10% APY
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
## Service API
|
|
156
|
+
|
|
157
|
+
```typescript
|
|
158
|
+
const aaveService = runtime.getService<AaveService>('aave');
|
|
159
|
+
|
|
160
|
+
// Supply assets
|
|
161
|
+
await aaveService.supply({
|
|
162
|
+
asset: 'USDC',
|
|
163
|
+
amount: new BigNumber('1000'),
|
|
164
|
+
chain: 'ethereum'
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
// Get user position
|
|
168
|
+
const position = await aaveService.getUserPosition();
|
|
169
|
+
|
|
170
|
+
// Get market data
|
|
171
|
+
const markets = await aaveService.getMarketData('ethereum');
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
## Common Assets
|
|
175
|
+
|
|
176
|
+
- **Stablecoins**: USDC, USDT, DAI
|
|
177
|
+
- **Native Assets**: ETH, MATIC, AVAX, BNB
|
|
178
|
+
- **Wrapped Assets**: WETH, WBTC
|
|
179
|
+
- **DeFi Tokens**: AAVE, LINK, ARB, OP
|
|
180
|
+
|
|
181
|
+
## Safety Features
|
|
182
|
+
|
|
183
|
+
- Health factor monitoring with configurable alerts
|
|
184
|
+
- Liquidation prevention for risky operations
|
|
185
|
+
- Transaction validation and slippage protection
|
|
186
|
+
- Cross-chain risk assessment
|
|
187
|
+
|
|
188
|
+
## Development
|
|
189
|
+
|
|
190
|
+
```bash
|
|
191
|
+
bun run build # Build the plugin
|
|
192
|
+
bun run test # Run tests
|
|
193
|
+
bun run dev # Development mode
|
|
194
|
+
bun run lint # Code linting
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
## Error Handling
|
|
198
|
+
|
|
199
|
+
- `InsufficientBalanceError`: Not enough tokens
|
|
200
|
+
- `HealthFactorTooLowError`: Liquidation risk
|
|
201
|
+
- `AssetNotSupportedError`: Asset not available
|
|
202
|
+
- `NetworkConnectionError`: RPC issues
|
|
203
|
+
- `ChainNotSupportedError`: Unsupported chain
|
|
204
|
+
|
|
205
|
+
## Interest Rate Modes
|
|
206
|
+
|
|
207
|
+
- **Variable**: Fluctuating rates based on market (default)
|
|
208
|
+
- **Stable**: Fixed rates for predictable payments (limited)
|
|
209
|
+
|
|
210
|
+
## License
|
|
211
|
+
|
|
212
|
+
MIT
|
|
213
|
+
|
|
214
|
+
## Support
|
|
215
|
+
|
|
216
|
+
For issues and feature requests, please create an issue on the [GitHub repository](https://github.com/elizaos/eliza).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elizaos/plugin-aave",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "ElizaOS plugin for Aave Protocol - DeFi lending and borrowing",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -63,4 +63,4 @@
|
|
|
63
63
|
"name": "Aave Protocol Agent",
|
|
64
64
|
"description": "DeFi agent for Aave lending and borrowing operations"
|
|
65
65
|
}
|
|
66
|
-
}
|
|
66
|
+
}
|