@hypurrquant/defi-cli 0.3.5 → 0.4.1
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 +195 -200
- package/config/pools.example.toml +31 -0
- package/dist/index.js +655 -2195
- package/dist/index.js.map +1 -1
- package/dist/main.js +663 -2208
- package/dist/main.js.map +1 -1
- package/dist/mcp-server.js +422 -865
- package/dist/mcp-server.js.map +1 -1
- package/package.json +3 -1
- package/skills/defi-cli/SKILL.md +181 -0
- package/skills/defi-cli/package.json +38 -0
- package/skills/defi-cli/references/commands.md +162 -0
- package/skills/defi-cli/references/protocols.md +115 -0
- package/skills/defi-cli/scripts/exploit-scan.sh +10 -0
- package/skills/defi-cli/scripts/portfolio-snapshot.sh +19 -0
- package/skills/defi-cli/scripts/preflight.sh +14 -0
- package/skills/defi-cli/scripts/yield-scan.sh +10 -0
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
[](https://www.npmjs.com/package/@hypurrquant/defi-cli)
|
|
5
5
|
[](https://github.com/hypurrquant/defi-cli/blob/main/LICENSE)
|
|
6
6
|
|
|
7
|
-
Multi-chain DeFi CLI — **HyperEVM** and **Mantle**
|
|
7
|
+
Multi-chain DeFi CLI — **HyperEVM** (17 protocols) and **Mantle** (4 protocols) for lending, DEX, LP, bridge, and portfolio operations.
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
10
|
npm install -g @hypurrquant/defi-cli # global install
|
|
@@ -17,18 +17,17 @@ npx -y @hypurrquant/defi-cli --json status
|
|
|
17
17
|
## Features
|
|
18
18
|
|
|
19
19
|
- **2 Chains** — HyperEVM (chain 999) and Mantle (chain 5000)
|
|
20
|
-
- **
|
|
21
|
-
- **Lending** — rates, positions, supply,
|
|
22
|
-
- **DEX** —
|
|
23
|
-
- **LP Management** —
|
|
24
|
-
- **
|
|
25
|
-
- **
|
|
26
|
-
- **
|
|
27
|
-
- **
|
|
28
|
-
- **Farm** — deposit, withdraw, claim yields
|
|
29
|
-
- **Portfolio** — unified balance and position overview
|
|
20
|
+
- **21 Protocols** — lending (Aave V3 forks, Morpho, HypurrFi), DEX (KittenSwap, Ramses, Uniswap V3, Merchant Moe LB), vaults, CDP
|
|
21
|
+
- **Lending** — rates, positions, supply, withdraw across all lending protocols
|
|
22
|
+
- **DEX** — add/remove liquidity with multicall optimization
|
|
23
|
+
- **LP Management** — discover emission pools with APR/TVL/MOE-per-day, add, farm, claim, remove, autopilot
|
|
24
|
+
- **DEX Aggregator** — best-price swap via KyberSwap, OpenOcean, LiquidSwap
|
|
25
|
+
- **Bridge** — cross-chain token transfer via LI.FI, deBridge, CCTP
|
|
26
|
+
- **Portfolio** — aggregate positions across lending and LP
|
|
27
|
+
- **Auto-Approve** — checks allowance, exact-approves, then executes in one flow
|
|
30
28
|
- **Agent-First Design** — `--json`, `--fields`, `--ndjson`, `--dry-run`, runtime schema introspection
|
|
31
|
-
- **
|
|
29
|
+
- **MCP Server** — 14 tools for Claude Desktop, Cursor, and other MCP clients
|
|
30
|
+
- **Claude Code Skill** — installable skill for AI-assisted DeFi operations
|
|
32
31
|
|
|
33
32
|
## Setup
|
|
34
33
|
|
|
@@ -41,262 +40,230 @@ export DEFI_WALLET_ADDRESS="0x..." # Wallet address for queries
|
|
|
41
40
|
export HYPEREVM_RPC_URL="https://..."
|
|
42
41
|
export MANTLE_RPC_URL="https://..."
|
|
43
42
|
|
|
43
|
+
# Interactive setup wizard
|
|
44
|
+
defi setup
|
|
45
|
+
|
|
44
46
|
# Verify setup
|
|
45
47
|
defi --json status
|
|
46
48
|
```
|
|
47
49
|
|
|
48
|
-
## Command
|
|
49
|
-
|
|
50
|
-
|
|
|
51
|
-
|
|
52
|
-
| `
|
|
53
|
-
| `
|
|
54
|
-
| `
|
|
55
|
-
| `
|
|
56
|
-
| `
|
|
57
|
-
| `farm` |
|
|
58
|
-
| `
|
|
59
|
-
| `
|
|
60
|
-
| `
|
|
61
|
-
| `
|
|
62
|
-
| `
|
|
63
|
-
| `
|
|
64
|
-
| `
|
|
65
|
-
| `
|
|
66
|
-
| `
|
|
67
|
-
| `
|
|
68
|
-
| `
|
|
69
|
-
| `
|
|
70
|
-
| `compare` | yields, rates, costs | Cross-protocol comparison |
|
|
71
|
-
| `swap` | aggregator | Aggregated DEX swap finder |
|
|
72
|
-
| `arb` | scan, execute, monitor | Arbitrage opportunities |
|
|
73
|
-
| `monitor` | positions, yields, risks | Live monitoring and alerts |
|
|
74
|
-
| `alert` | setup, add, test, list, start, stop | Telegram price and yield alerts |
|
|
75
|
-
| `nft` | collections, balances | NFT portfolio tracking |
|
|
50
|
+
## Command Reference
|
|
51
|
+
|
|
52
|
+
| Command | Description |
|
|
53
|
+
|---------|-------------|
|
|
54
|
+
| `defi` | Dashboard — multicall balances across all protocols |
|
|
55
|
+
| `defi yield` | Cross-chain lending APY comparison (all chains, filter with `--chain`) |
|
|
56
|
+
| `defi swap` | DEX aggregator swap (KyberSwap, OpenOcean, LiquidSwap) |
|
|
57
|
+
| `defi lp discover` | Scan emission pools with APR, TVL, rewards data |
|
|
58
|
+
| `defi lp add` | Add liquidity to a pool |
|
|
59
|
+
| `defi lp farm` | Add liquidity and auto-stake for emissions |
|
|
60
|
+
| `defi lp claim` | Claim fee and emission rewards |
|
|
61
|
+
| `defi lp remove` | Auto-unstake and remove liquidity |
|
|
62
|
+
| `defi lp autopilot` | Whitelist-based auto-allocation across pools |
|
|
63
|
+
| `defi lending` | Supply, withdraw, rates, position |
|
|
64
|
+
| `defi portfolio` | Aggregate positions across all protocols |
|
|
65
|
+
| `defi price` | Oracle and DEX prices |
|
|
66
|
+
| `defi token` | Approve, allowance, transfer, balance |
|
|
67
|
+
| `defi wallet` | Address management |
|
|
68
|
+
| `defi bridge` | Cross-chain transfer (LI.FI, deBridge, CCTP) |
|
|
69
|
+
| `defi status` | Protocol overview |
|
|
70
|
+
| `defi schema` | JSON schema for agent introspection |
|
|
71
|
+
| `defi setup` | Interactive wallet/RPC config wizard |
|
|
76
72
|
|
|
77
73
|
## Supported Protocols
|
|
78
74
|
|
|
79
|
-
###
|
|
80
|
-
|
|
81
|
-
|
|
|
82
|
-
|
|
83
|
-
|
|
|
84
|
-
|
|
|
85
|
-
|
|
|
86
|
-
|
|
|
87
|
-
|
|
|
88
|
-
|
|
|
89
|
-
|
|
|
90
|
-
|
|
|
91
|
-
|
|
|
92
|
-
|
|
|
93
|
-
|
|
|
94
|
-
|
|
|
95
|
-
|
|
|
96
|
-
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
|
104
|
-
|
|
105
|
-
|
|
|
106
|
-
|
|
|
107
|
-
|
|
|
108
|
-
|
|
|
109
|
-
| Both | Morpho Blue | Lending |
|
|
110
|
-
| Both | Felix Morpho | CDP + Lending |
|
|
111
|
-
|
|
112
|
-
### Other Protocols
|
|
113
|
-
|
|
114
|
-
| Category | Chain | Protocol |
|
|
115
|
-
|----------|-------|----------|
|
|
116
|
-
| **Liquid Staking** | HyperEVM | stHYPE (Generic LST) |
|
|
117
|
-
| — | HyperEVM | Kinetiq (Mantle LST) |
|
|
118
|
-
| **Vaults** | HyperEVM | Hyperbeat (ERC4626) |
|
|
119
|
-
| — | HyperEVM | Hypersurface (ERC4626) |
|
|
120
|
-
| — | HyperEVM | Looping (ERC4626) |
|
|
121
|
-
| — | Mantle | Upshift (ERC4626) |
|
|
122
|
-
| — | Both | Felix Vaults (ERC4626) |
|
|
123
|
-
| **CDP** | Both | Felix (MorphoBlue) |
|
|
124
|
-
| **Yield Aggregator** | HyperEVM | Lazy Summer |
|
|
125
|
-
| **NFT** | HyperEVM | Seaport |
|
|
75
|
+
### HyperEVM (17 protocols)
|
|
76
|
+
|
|
77
|
+
| Protocol | Category | Interface |
|
|
78
|
+
|----------|----------|-----------|
|
|
79
|
+
| KittenSwap | DEX | Algebra V3 (CL) |
|
|
80
|
+
| NEST V1 | DEX | Algebra V3 (CL) |
|
|
81
|
+
| Ramses HL | DEX | Solidly V2 (ve(3,3)) |
|
|
82
|
+
| Ramses CL | DEX | Uniswap V3 (CL) |
|
|
83
|
+
| Project X | DEX | Uniswap V2 |
|
|
84
|
+
| Hybra | DEX | Solidly V2 |
|
|
85
|
+
| HyperLend | Lending | Aave V3 |
|
|
86
|
+
| HypurrFi | Lending | Aave V3 |
|
|
87
|
+
| Felix Morpho | Lending | Morpho Blue |
|
|
88
|
+
| Felix Vaults | Vault | ERC-4626 |
|
|
89
|
+
| Felix CDP | CDP | Liquity V2 |
|
|
90
|
+
| Hyperbeat | Vault | ERC-4626 |
|
|
91
|
+
| Looping | Vault | ERC-4626 |
|
|
92
|
+
| Upshift | Vault | ERC-4626 |
|
|
93
|
+
| Lazy Summer | Yield Aggregator | ERC-4626 |
|
|
94
|
+
| Hypersurface | Options | — |
|
|
95
|
+
| Seaport | NFT | — |
|
|
96
|
+
|
|
97
|
+
### Mantle (4 protocols)
|
|
98
|
+
|
|
99
|
+
| Protocol | Category | Interface |
|
|
100
|
+
|----------|----------|-----------|
|
|
101
|
+
| Aave V3 | Lending | Aave V3 |
|
|
102
|
+
| Lendle | Lending | Aave V3 Fork |
|
|
103
|
+
| Uniswap V3 | DEX | Uniswap V3 (CL) |
|
|
104
|
+
| Merchant Moe | DEX | Uniswap V2 + Liquidity Book |
|
|
126
105
|
|
|
127
106
|
## Core Commands
|
|
128
107
|
|
|
129
|
-
###
|
|
108
|
+
### Dashboard
|
|
130
109
|
|
|
131
110
|
```bash
|
|
132
|
-
#
|
|
133
|
-
defi --json
|
|
111
|
+
# Multicall balance dashboard
|
|
112
|
+
defi --json
|
|
134
113
|
|
|
135
|
-
#
|
|
136
|
-
defi --json
|
|
114
|
+
# Protocol overview (all chains)
|
|
115
|
+
defi --json status
|
|
137
116
|
|
|
138
|
-
#
|
|
139
|
-
defi --json
|
|
117
|
+
# Single chain
|
|
118
|
+
defi --json --chain mantle status
|
|
140
119
|
```
|
|
141
120
|
|
|
142
|
-
###
|
|
121
|
+
### Lending
|
|
143
122
|
|
|
144
123
|
```bash
|
|
145
|
-
#
|
|
146
|
-
defi --json
|
|
147
|
-
|
|
148
|
-
# Execute swap
|
|
149
|
-
defi --json dex swap --protocol hyperswap --token-in HYPE --token-out USDC --amount 1000000000000000000 --broadcast
|
|
124
|
+
# Cross-chain lending APY comparison (scans all chains by default)
|
|
125
|
+
defi --json yield
|
|
126
|
+
defi --json --chain mantle yield --asset USDT
|
|
150
127
|
|
|
151
|
-
#
|
|
152
|
-
defi --json
|
|
128
|
+
# Check user position
|
|
129
|
+
defi --json --chain hyperevm lending position --protocol hyperlend
|
|
153
130
|
|
|
154
|
-
#
|
|
155
|
-
defi --json
|
|
131
|
+
# Supply collateral (auto-approve included)
|
|
132
|
+
defi --json --chain hyperevm lending supply --protocol hyperlend --asset USDC --amount 1000000000 --broadcast
|
|
156
133
|
|
|
157
|
-
#
|
|
158
|
-
defi --json
|
|
134
|
+
# Withdraw collateral
|
|
135
|
+
defi --json --chain hyperevm lending withdraw --protocol hyperlend --asset USDC --amount 500000000 --broadcast
|
|
159
136
|
```
|
|
160
137
|
|
|
161
|
-
###
|
|
162
|
-
|
|
163
|
-
```bash
|
|
164
|
-
# Get lending rates across all protocols
|
|
165
|
-
defi --json lending rates
|
|
138
|
+
### DEX Aggregator Swap
|
|
166
139
|
|
|
167
|
-
|
|
168
|
-
defi --json lending position --protocol hyperlend
|
|
140
|
+
Uses KyberSwap, OpenOcean, and LiquidSwap to find the best route automatically.
|
|
169
141
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
# Borrow assets
|
|
174
|
-
defi --json lending borrow --protocol hyperlend --token HYPE --amount 1000000000000000000 --broadcast
|
|
142
|
+
```bash
|
|
143
|
+
# Dry-run (default — no transaction)
|
|
144
|
+
defi --json --chain hyperevm swap --from WHYPE --to USDC --amount 1000000000000000000
|
|
175
145
|
|
|
176
|
-
#
|
|
177
|
-
defi --json
|
|
146
|
+
# Execute swap
|
|
147
|
+
defi --json --chain hyperevm swap --from WHYPE --to USDC --amount 1000000000000000000 --broadcast
|
|
178
148
|
|
|
179
|
-
#
|
|
180
|
-
defi --json
|
|
149
|
+
# With slippage (basis points)
|
|
150
|
+
defi --json --chain hyperevm swap --from WHYPE --to USDC --amount 1000000000000000000 --slippage 100 --broadcast
|
|
181
151
|
```
|
|
182
152
|
|
|
183
|
-
###
|
|
153
|
+
### LP Operations
|
|
154
|
+
|
|
155
|
+
#### Discover Pools
|
|
184
156
|
|
|
185
157
|
```bash
|
|
186
|
-
#
|
|
187
|
-
defi --json
|
|
158
|
+
# Discover emission pools with APR, TVL, rewards (requires --chain)
|
|
159
|
+
defi --json --chain hyperevm lp discover
|
|
188
160
|
|
|
189
|
-
#
|
|
190
|
-
defi --json
|
|
161
|
+
# Mantle LB pools with MOE/day, APR, pool TVL
|
|
162
|
+
defi --json --chain mantle lp discover
|
|
191
163
|
|
|
192
|
-
#
|
|
193
|
-
defi --json
|
|
164
|
+
# Filter by protocol
|
|
165
|
+
defi --json --chain hyperevm lp discover --protocol kittenswap
|
|
194
166
|
```
|
|
195
167
|
|
|
196
|
-
|
|
168
|
+
#### Add Liquidity
|
|
197
169
|
|
|
198
170
|
```bash
|
|
199
|
-
|
|
200
|
-
defi --json gauge deposit --protocol kinetiq --amount 1000000000000000000 --broadcast
|
|
201
|
-
|
|
202
|
-
# Lock tokens for voting power
|
|
203
|
-
defi --json gauge lock --protocol kinetiq --amount 1000000000000000000 --weeks 52 --broadcast
|
|
204
|
-
|
|
205
|
-
# Vote on proposals
|
|
206
|
-
defi --json gauge vote --protocol kinetiq --gauge <ADDRESS> --weight 100 --broadcast
|
|
207
|
-
|
|
208
|
-
# Claim gauge rewards
|
|
209
|
-
defi --json gauge claim --protocol kinetiq --broadcast
|
|
171
|
+
defi --json --chain hyperevm lp add --protocol kittenswap --pool 0x... --amount-a 1000000000000000000 --amount-b 5000000000 --broadcast
|
|
210
172
|
```
|
|
211
173
|
|
|
212
|
-
|
|
174
|
+
#### Farm (Add + Auto-stake)
|
|
213
175
|
|
|
214
176
|
```bash
|
|
215
|
-
#
|
|
216
|
-
defi --json
|
|
217
|
-
|
|
218
|
-
# Withdraw from vault
|
|
219
|
-
defi --json vault withdraw --protocol hyperbeat --shares 1000000000000000000 --broadcast
|
|
220
|
-
|
|
221
|
-
# Check vault info and yield
|
|
222
|
-
defi --json vault info --protocol hyperbeat
|
|
177
|
+
# Add liquidity and stake into gauge/farming in one step
|
|
178
|
+
defi --json --chain hyperevm lp farm --protocol kittenswap --pool 0x... --amount-a 1000000000000000000 --amount-b 5000000000 --broadcast
|
|
223
179
|
```
|
|
224
180
|
|
|
225
|
-
|
|
181
|
+
#### Claim Rewards
|
|
226
182
|
|
|
227
183
|
```bash
|
|
228
|
-
#
|
|
229
|
-
defi --json
|
|
184
|
+
# Claim fee and emission rewards from a pool
|
|
185
|
+
defi --json --chain hyperevm lp claim --protocol kittenswap --pool 0x... --broadcast
|
|
186
|
+
```
|
|
230
187
|
|
|
231
|
-
|
|
232
|
-
defi --json bridge --token USDC --amount 1000000000 --to-chain mantle --provider debridge --broadcast
|
|
188
|
+
#### Remove Liquidity
|
|
233
189
|
|
|
234
|
-
|
|
235
|
-
|
|
190
|
+
```bash
|
|
191
|
+
# Auto-unstake (if staked) and remove liquidity
|
|
192
|
+
defi --json --chain hyperevm lp remove --protocol kittenswap --pool 0x... --broadcast
|
|
236
193
|
```
|
|
237
194
|
|
|
238
|
-
|
|
195
|
+
#### LP Autopilot
|
|
239
196
|
|
|
240
|
-
|
|
241
|
-
# Get yield comparison across protocols
|
|
242
|
-
defi --json yield compare
|
|
197
|
+
Reads `~/.defi/pools.toml` for whitelisted pools and allocates budget automatically.
|
|
243
198
|
|
|
244
|
-
|
|
245
|
-
|
|
199
|
+
```bash
|
|
200
|
+
# Dry-run autopilot allocation
|
|
201
|
+
defi --json lp autopilot --budget 1000000000 # 1000 USDC
|
|
246
202
|
|
|
247
|
-
# Execute
|
|
248
|
-
defi --json
|
|
203
|
+
# Execute
|
|
204
|
+
defi --json lp autopilot --budget 1000000000 --broadcast
|
|
205
|
+
```
|
|
249
206
|
|
|
250
|
-
|
|
251
|
-
defi --json farm deposit --protocol lazy-summer --amount 1000000000000000000 --broadcast
|
|
207
|
+
**pools.toml example:**
|
|
252
208
|
|
|
253
|
-
|
|
254
|
-
|
|
209
|
+
```toml
|
|
210
|
+
[[pools]]
|
|
211
|
+
protocol = "kittenswap"
|
|
212
|
+
pool_address = "0xYourPoolAddress"
|
|
213
|
+
weight = 50 # 50% of budget
|
|
255
214
|
|
|
256
|
-
|
|
257
|
-
|
|
215
|
+
[[pools]]
|
|
216
|
+
protocol = "nest-v1"
|
|
217
|
+
pool_address = "0xAnotherPool"
|
|
218
|
+
weight = 50
|
|
258
219
|
```
|
|
259
220
|
|
|
260
|
-
|
|
221
|
+
Default location: `~/.defi/pools.toml`
|
|
222
|
+
|
|
223
|
+
### Bridge
|
|
261
224
|
|
|
262
225
|
```bash
|
|
263
|
-
#
|
|
264
|
-
defi --json
|
|
226
|
+
# Bridge via LI.FI (default)
|
|
227
|
+
defi --json bridge --token USDC --amount 100000000 --to-chain mantle
|
|
265
228
|
|
|
266
|
-
#
|
|
267
|
-
defi --json
|
|
229
|
+
# Bridge via deBridge DLN
|
|
230
|
+
defi --json bridge --token USDC --amount 100000000 --to-chain arbitrum --provider debridge --broadcast
|
|
268
231
|
|
|
269
|
-
#
|
|
270
|
-
defi --json
|
|
232
|
+
# Native USDC via Circle CCTP V2
|
|
233
|
+
defi --json bridge --token USDC --amount 100000000 --to-chain arbitrum --provider cctp --broadcast
|
|
271
234
|
```
|
|
272
235
|
|
|
273
|
-
###
|
|
236
|
+
### Portfolio
|
|
274
237
|
|
|
275
238
|
```bash
|
|
276
|
-
#
|
|
277
|
-
defi --json
|
|
278
|
-
|
|
279
|
-
# Approve token spending
|
|
280
|
-
defi --json token approve --token USDC --spender 0x... --amount 1000000000 --broadcast
|
|
239
|
+
# Aggregate positions across all protocols
|
|
240
|
+
defi --json --chain hyperevm portfolio show --address 0xYourAddress
|
|
241
|
+
```
|
|
281
242
|
|
|
282
|
-
|
|
283
|
-
defi --json wallet balance --address 0x...
|
|
243
|
+
### Token & Wallet
|
|
284
244
|
|
|
285
|
-
|
|
286
|
-
|
|
245
|
+
```bash
|
|
246
|
+
# Token operations (--chain required)
|
|
247
|
+
defi --json --chain hyperevm token balance --owner 0x... --token USDC
|
|
248
|
+
defi --json --chain hyperevm token allowance --owner 0x... --token USDC --spender 0x...
|
|
249
|
+
defi --json --chain hyperevm token approve --token USDC --spender 0x... --amount 1000000 --broadcast
|
|
250
|
+
defi --json --chain hyperevm token transfer --token USDC --to 0x... --amount 1000000 --broadcast
|
|
251
|
+
|
|
252
|
+
# Wallet management
|
|
253
|
+
defi --json --chain hyperevm wallet balance --address 0x...
|
|
287
254
|
```
|
|
288
255
|
|
|
289
256
|
### Price & Market Data
|
|
290
257
|
|
|
291
258
|
```bash
|
|
292
|
-
#
|
|
293
|
-
defi --json price --asset
|
|
259
|
+
# Oracle + DEX prices (--chain required)
|
|
260
|
+
defi --json --chain hyperevm price --asset WHYPE
|
|
294
261
|
|
|
295
|
-
#
|
|
296
|
-
defi --json price --asset
|
|
262
|
+
# DEX prices only
|
|
263
|
+
defi --json --chain hyperevm price --asset WHYPE --source dex
|
|
297
264
|
|
|
298
|
-
#
|
|
299
|
-
defi --json price --asset
|
|
265
|
+
# Oracle prices only
|
|
266
|
+
defi --json --chain hyperevm price --asset USDC --source oracle
|
|
300
267
|
```
|
|
301
268
|
|
|
302
269
|
## Agent-First Design
|
|
@@ -315,15 +282,17 @@ defi --json schema
|
|
|
315
282
|
defi --json --fields balance,positions status
|
|
316
283
|
|
|
317
284
|
# Stream large lists as NDJSON (one JSON per line)
|
|
318
|
-
defi --json --ndjson
|
|
285
|
+
defi --json --ndjson lp discover
|
|
319
286
|
|
|
320
287
|
# Pre-validate before executing
|
|
321
|
-
defi --json --
|
|
288
|
+
defi --json --chain hyperevm swap --from WHYPE --to USDC --amount 1000000000000000000
|
|
322
289
|
|
|
323
290
|
# Safe by default: --dry-run is on, use --broadcast to execute
|
|
324
|
-
defi --json
|
|
291
|
+
defi --json --chain hyperevm swap --from WHYPE --to USDC --amount 1000000000000000000 --broadcast
|
|
325
292
|
```
|
|
326
293
|
|
|
294
|
+
Responses include `needs_approval` simulation status. Auto-approve flow: check allowance → exact approve → execute tx.
|
|
295
|
+
|
|
327
296
|
All responses are auto-sanitized (control chars stripped, prompt injection patterns blocked).
|
|
328
297
|
Errors include `retryable` flag — only retry when `true`.
|
|
329
298
|
|
|
@@ -333,7 +302,7 @@ Errors include `retryable` flag — only retry when `true`.
|
|
|
333
302
|
--json # Output as JSON (structured for agents)
|
|
334
303
|
--ndjson # Output as newline-delimited JSON
|
|
335
304
|
--fields <f> # Select output fields (comma-separated)
|
|
336
|
-
--chain <chain> # Target chain: hyperevm (
|
|
305
|
+
--chain <chain> # Target chain: hyperevm or mantle (required for tx commands)
|
|
337
306
|
--dry-run # Dry-run mode (default, no broadcast)
|
|
338
307
|
--broadcast # Execute transaction on-chain
|
|
339
308
|
```
|
|
@@ -347,9 +316,35 @@ HYPEREVM_RPC_URL # Override HyperEVM RPC endpoint
|
|
|
347
316
|
MANTLE_RPC_URL # Override Mantle RPC endpoint
|
|
348
317
|
```
|
|
349
318
|
|
|
350
|
-
## MCP Server
|
|
319
|
+
## MCP Server
|
|
320
|
+
|
|
321
|
+
17 MCP tools for Claude Desktop, Cursor, and other MCP clients.
|
|
322
|
+
|
|
323
|
+
```json
|
|
324
|
+
{
|
|
325
|
+
"mcpServers": {
|
|
326
|
+
"defi-cli": {
|
|
327
|
+
"command": "npx",
|
|
328
|
+
"args": ["-y", "@hypurrquant/defi-cli", "mcp"]
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
**Available tools:** `defi_status`, `defi_yield`, `defi_lending_rates`, `defi_lending_supply`, `defi_lending_withdraw`, `defi_lp_discover`, `defi_lp_add`, `defi_lp_farm`, `defi_lp_claim`, `defi_lp_remove`, `defi_swap`, `defi_bridge`, `defi_price`, `defi_token_balance`, `defi_token_approve`, `defi_portfolio`, `defi_schema`
|
|
335
|
+
|
|
336
|
+
See `mcp-config.example.json` for full configuration.
|
|
337
|
+
|
|
338
|
+
## Claude Code Skill
|
|
339
|
+
|
|
340
|
+
Install the skill for AI-assisted DeFi operations:
|
|
341
|
+
|
|
342
|
+
```bash
|
|
343
|
+
# Install from npm package
|
|
344
|
+
npx -y @hypurrquant/defi-cli skill install
|
|
345
|
+
```
|
|
351
346
|
|
|
352
|
-
|
|
347
|
+
Or copy `skills/defi-cli/` into your Claude Code skills directory.
|
|
353
348
|
|
|
354
349
|
## License
|
|
355
350
|
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Pool whitelist — autopilot only operates within these pools
|
|
2
|
+
# Copy this file to ~/.defi/pools.toml and customize for your strategy.
|
|
3
|
+
# Run: defi lp autopilot --budget 300 --dry-run
|
|
4
|
+
|
|
5
|
+
[[whitelist]]
|
|
6
|
+
chain = "mantle"
|
|
7
|
+
protocol = "merchantmoe-mantle"
|
|
8
|
+
pool = "WMNT/USDT0" # pool name or address
|
|
9
|
+
type = "lb" # lb, gauge, farming, lending
|
|
10
|
+
max_allocation_pct = 40 # max % of budget for this pool
|
|
11
|
+
|
|
12
|
+
[[whitelist]]
|
|
13
|
+
chain = "mantle"
|
|
14
|
+
protocol = "lendle-mantle"
|
|
15
|
+
asset = "USDC"
|
|
16
|
+
type = "lending"
|
|
17
|
+
max_allocation_pct = 40
|
|
18
|
+
|
|
19
|
+
[[whitelist]]
|
|
20
|
+
chain = "hyperevm"
|
|
21
|
+
protocol = "kittenswap"
|
|
22
|
+
pool = "WHYPE/USDC"
|
|
23
|
+
type = "farming"
|
|
24
|
+
max_allocation_pct = 30
|
|
25
|
+
|
|
26
|
+
[[whitelist]]
|
|
27
|
+
chain = "hyperevm"
|
|
28
|
+
protocol = "hyperlend"
|
|
29
|
+
asset = "USDC"
|
|
30
|
+
type = "lending"
|
|
31
|
+
max_allocation_pct = 30
|