@hypurrquant/defi-cli 0.5.0 → 1.0.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 +148 -265
- package/config/pools.example.toml +1 -1
- package/dist/index.js +1489 -127
- package/dist/index.js.map +1 -1
- package/dist/main.js +1490 -128
- package/dist/main.js.map +1 -1
- package/dist/mcp-server.js +1266 -88
- package/dist/mcp-server.js.map +1 -1
- package/package.json +1 -1
- package/skills/defi-cli/SKILL.md +121 -91
- package/skills/defi-cli/package.json +11 -3
- package/skills/defi-cli/references/commands.md +106 -53
- package/skills/defi-cli/references/protocols.md +100 -68
- package/config/protocols/lending/lendle_mantle.toml +0 -14
package/README.md
CHANGED
|
@@ -1,325 +1,194 @@
|
|
|
1
|
-
# defi-cli
|
|
1
|
+
# @hypurrquant/defi-cli
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/@hypurrquant/defi-cli)
|
|
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 — **
|
|
7
|
+
Multi-chain DeFi CLI — **5 chains · 39 protocols · 5 aggregators**. Lending, LP farming with emission claim, DEX swap via aggregator, cross-chain bridge.
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
|
-
npm install -g @hypurrquant/defi-cli
|
|
10
|
+
npm install -g @hypurrquant/defi-cli
|
|
11
11
|
defi --json status
|
|
12
12
|
|
|
13
|
-
# Or
|
|
13
|
+
# Or one-shot
|
|
14
14
|
npx -y @hypurrquant/defi-cli --json status
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
-
##
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
17
|
+
## Supported Chains
|
|
18
|
+
|
|
19
|
+
| Chain | ID | Status | Protocols |
|
|
20
|
+
|---|---|---|---|
|
|
21
|
+
| HyperEVM | 999 | 🟢 production | 11 |
|
|
22
|
+
| Mantle | 5000 | 🟢 production | 3 |
|
|
23
|
+
| Base | 8453 | 🟢 production | 5 |
|
|
24
|
+
| BNB | 56 | 🟡 staged | 16 |
|
|
25
|
+
| Monad | 143 | 🟡 staged | 4 |
|
|
26
|
+
|
|
27
|
+
🟢 = full lifecycle broadcast verified (mint/supply → claim → withdraw)
|
|
28
|
+
🟡 = configs + read-only paths verified, awaiting funded broadcast
|
|
29
|
+
|
|
30
|
+
## Supported Protocols
|
|
31
|
+
|
|
32
|
+
### HyperEVM (11)
|
|
33
|
+
| Slug | Category | Notes |
|
|
34
|
+
|---|---|---|
|
|
35
|
+
| `hyperlend`, `hypurrfi` | Lending | Aave V3 forks |
|
|
36
|
+
| `felix-morpho` | Lending | Morpho Blue + MetaMorpho ERC-4626 routing |
|
|
37
|
+
| `project-x`, `hyperswap` | DEX | Uniswap V3 fee-only |
|
|
38
|
+
| `curve-hyperevm` | DEX | Curve StableswapNG |
|
|
39
|
+
| `ramses-cl` | DEX | Uniswap V3 + Ramses x(3,3) auto-stake |
|
|
40
|
+
| `ramses-hl` | DEX | Solidly V2 ve(3,3), RAM emission |
|
|
41
|
+
| `kittenswap` | DEX | Algebra V3 + Eternal Farming, KITTEN/WHYPE |
|
|
42
|
+
| `hybra` | DEX | Hybra V4 CL + GaugeManager (HYBR vesting) |
|
|
43
|
+
| `nest` | DEX | Algebra V3 + off-chain ticket NEST claim |
|
|
44
|
+
|
|
45
|
+
### Mantle (3)
|
|
46
|
+
| Slug | Category | Notes |
|
|
47
|
+
|---|---|---|
|
|
48
|
+
| `aave-v3-mantle` | Lending | |
|
|
49
|
+
| `uniswap-v3-mantle` | DEX | |
|
|
50
|
+
| `merchantmoe-mantle` | DEX | LB hooks + MasterChef MOE emission |
|
|
51
|
+
|
|
52
|
+
### Base (5)
|
|
53
|
+
| Slug | Category | Notes |
|
|
54
|
+
|---|---|---|
|
|
55
|
+
| `aave-v3-base` | Lending | |
|
|
56
|
+
| `compound-v3-base` | Lending | Comet |
|
|
57
|
+
| `uniswap-v3-base` | DEX | |
|
|
58
|
+
| `aerodrome-base` | DEX | Solidly V2, AERO emission |
|
|
59
|
+
| `aerodrome-cl` | DEX | Slipstream CL with NFT gauge, AERO emission |
|
|
60
|
+
|
|
61
|
+
### BNB (16)
|
|
62
|
+
- **Lending**: `aave-v3-bnb`, `kinza-bnb`, `venus-bnb`, `venus-flux-bnb`
|
|
63
|
+
- **DEX**: `pancakeswap-v3-bnb` (+ MasterChef CAKE), `pancakeswap-v2-bnb`, `uniswap-v3-bnb`, `thena-v1`, `thena-fusion`, `biswap-bnb`, `apeswap-bnb`, `bakeryswap-bnb`, `bscswap-bnb`, `babydogeswap-bnb`, `fstswap-bnb`
|
|
64
|
+
- **Vault**: `beefy-bnb`
|
|
65
|
+
|
|
66
|
+
### Monad (4)
|
|
67
|
+
`uniswap-v2-monad`, `uniswap-v3-monad`, `traderjoe-monad` (LB), `morpho-blue-monad`
|
|
68
|
+
|
|
69
|
+
## DEX Aggregators (Live-verified)
|
|
70
|
+
|
|
71
|
+
| Aggregator | HyperEVM | Mantle | Base | BNB | Monad |
|
|
72
|
+
|---|---|---|---|---|---|
|
|
73
|
+
| KyberSwap | ✅ | ❌ | ✅ | ✅ | — |
|
|
74
|
+
| OpenOcean | ✅ | ✅ | ✅ | ✅ | — |
|
|
75
|
+
| LiquidSwap | ✅ | — | — | — | — |
|
|
76
|
+
| LI.FI | ✅ | ✅ | ✅ | ✅ | — |
|
|
77
|
+
| Relay | ✅ | ✅ | ✅ | ✅ | — |
|
|
31
78
|
|
|
32
79
|
## Setup
|
|
33
80
|
|
|
34
81
|
```bash
|
|
35
|
-
#
|
|
36
|
-
export DEFI_PRIVATE_KEY="0x..."
|
|
37
|
-
export DEFI_WALLET_ADDRESS="0x..."
|
|
82
|
+
# Wallet credentials
|
|
83
|
+
export DEFI_PRIVATE_KEY="0x..."
|
|
84
|
+
export DEFI_WALLET_ADDRESS="0x..."
|
|
38
85
|
|
|
39
|
-
# Optional: override RPC endpoints
|
|
86
|
+
# Optional: override RPC endpoints
|
|
40
87
|
export HYPEREVM_RPC_URL="https://..."
|
|
41
88
|
export MANTLE_RPC_URL="https://..."
|
|
89
|
+
export BASE_RPC_URL="https://..."
|
|
90
|
+
|
|
91
|
+
# Or use OWS encrypted vault wallets
|
|
92
|
+
defi ows create my-wallet
|
|
93
|
+
export DEFI_WALLET_ADDRESS="ows:my-wallet"
|
|
42
94
|
|
|
43
95
|
# Interactive setup wizard
|
|
44
96
|
defi setup
|
|
45
|
-
|
|
46
|
-
# Verify setup
|
|
47
|
-
defi --json status
|
|
48
97
|
```
|
|
49
98
|
|
|
50
99
|
## Command Reference
|
|
51
100
|
|
|
52
101
|
| Command | Description |
|
|
53
102
|
|---------|-------------|
|
|
54
|
-
| `
|
|
55
|
-
| `
|
|
56
|
-
| `
|
|
57
|
-
| `
|
|
58
|
-
| `
|
|
59
|
-
| `
|
|
60
|
-
| `
|
|
61
|
-
| `
|
|
62
|
-
| `
|
|
63
|
-
| `
|
|
64
|
-
| `
|
|
65
|
-
| `
|
|
66
|
-
| `
|
|
67
|
-
| `
|
|
68
|
-
| `
|
|
69
|
-
| `
|
|
70
|
-
| `
|
|
71
|
-
| `
|
|
72
|
-
|
|
73
|
-
|
|
103
|
+
| `lp discover` | Scan emission pools (gauge/LB/MasterChef/Curve). `--emission-only` filters & sorts by APR |
|
|
104
|
+
| `lp add` | Add liquidity (V3 NPM, Slipstream CL, LB router auto-dispatch) |
|
|
105
|
+
| `lp farm` | Add + auto-stake into gauge or LB |
|
|
106
|
+
| `lp claim` | Claim emission/fees (auto-detects user's actual LB bins) |
|
|
107
|
+
| `lp remove` | Auto-unstake + remove (LB supports `--bins`, `--amounts`) |
|
|
108
|
+
| `lp compound` | V3 fee-only auto-compound (collect + increaseLiquidity multicall) |
|
|
109
|
+
| `lp positions` | Show all positions + pending rewards (LB auto-scans all rewarded pools) |
|
|
110
|
+
| `lp pipeline` | Print mint→stake→claim CLI sequence for a protocol |
|
|
111
|
+
| `lp autopilot` | Whitelist-based budget allocation (`~/.defi/pools.toml`) |
|
|
112
|
+
| `lending` | rates / position / supply / borrow / repay / withdraw |
|
|
113
|
+
| `yield` | compare / scan (cross-chain) / optimize / execute |
|
|
114
|
+
| `swap` | DEX aggregator (kyber, openocean, liquid, lifi, relay) |
|
|
115
|
+
| `bridge` | Cross-chain (lifi, debridge, cctp) |
|
|
116
|
+
| `portfolio` | show / snapshot / pnl / history |
|
|
117
|
+
| `price` | Oracle + DEX prices |
|
|
118
|
+
| `wallet` | Address management |
|
|
119
|
+
| `token` | balance / approve / allowance / transfer |
|
|
120
|
+
| `ows` | Encrypted vault wallet (multi-chain HD) |
|
|
121
|
+
| `setup` | Interactive wizard |
|
|
122
|
+
| `status` | Protocol overview |
|
|
123
|
+
| `schema` | JSON schema for agent introspection |
|
|
74
124
|
|
|
75
|
-
|
|
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 |
|
|
105
|
-
|
|
106
|
-
## Core Commands
|
|
107
|
-
|
|
108
|
-
### Dashboard
|
|
125
|
+
## Examples
|
|
109
126
|
|
|
127
|
+
### Cross-chain yield comparison
|
|
110
128
|
```bash
|
|
111
|
-
|
|
112
|
-
defi --json
|
|
113
|
-
|
|
114
|
-
# Protocol overview (all chains)
|
|
115
|
-
defi --json status
|
|
116
|
-
|
|
117
|
-
# Single chain
|
|
118
|
-
defi --json --chain mantle status
|
|
129
|
+
defi --json yield scan --asset USDC
|
|
119
130
|
```
|
|
120
131
|
|
|
121
|
-
###
|
|
122
|
-
|
|
132
|
+
### LB liquidity + auto-claim MOE on Mantle
|
|
123
133
|
```bash
|
|
124
|
-
#
|
|
125
|
-
defi --
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
# Check user position
|
|
129
|
-
defi --json --chain hyperevm lending position --protocol hyperlend
|
|
134
|
+
# Add LB liquidity centred ±3 bins around active
|
|
135
|
+
defi --chain mantle lp add --protocol merchantmoe-mantle \
|
|
136
|
+
--token-a WMNT --token-b USDT0 --amount-a 1000000000000000000 --amount-b 600000 \
|
|
137
|
+
--pool 0x03BeafC0d25BB553fCa274301832419C05269987 --num-bins 3 --broadcast
|
|
130
138
|
|
|
131
|
-
#
|
|
132
|
-
defi --
|
|
139
|
+
# See pending MOE across all my LB positions (auto-scans all pools)
|
|
140
|
+
defi --chain mantle lp positions --protocol merchantmoe-mantle
|
|
133
141
|
|
|
134
|
-
#
|
|
135
|
-
defi --
|
|
142
|
+
# Claim — auto-detects user's actual bins (active±50 scan)
|
|
143
|
+
defi --chain mantle lp claim --protocol merchantmoe-mantle \
|
|
144
|
+
--pool 0x03BeafC0d25BB553fCa274301832419C05269987 --broadcast
|
|
136
145
|
```
|
|
137
146
|
|
|
138
|
-
###
|
|
139
|
-
|
|
140
|
-
Uses KyberSwap, OpenOcean, and LiquidSwap to find the best route automatically.
|
|
141
|
-
|
|
147
|
+
### Aerodrome Slipstream CL on Base
|
|
142
148
|
```bash
|
|
143
|
-
#
|
|
144
|
-
defi --
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
defi --json --chain hyperevm swap --from WHYPE --to USDC --amount 1000000000000000000 --broadcast
|
|
149
|
+
# Mint + auto-stake CL position with ±5% range
|
|
150
|
+
defi --chain base lp farm --protocol aerodrome-cl \
|
|
151
|
+
--token-a WETH --token-b USDC --amount-a 50000000000000 --amount-b 110000 \
|
|
152
|
+
--range 5 --pool 0xb2cc224c1c9feE385f8ad6a55b4d94E92359DC59 --broadcast
|
|
148
153
|
|
|
149
|
-
#
|
|
150
|
-
defi --
|
|
154
|
+
# Claim AERO; gauge.withdraw also auto-claims pending on unstake
|
|
155
|
+
defi --chain base lp claim --protocol aerodrome-cl \
|
|
156
|
+
--gauge 0xF33a96b5932D9E9B9A0eDA447AbD8C9d48d2e0c8 --token-id <id> --broadcast
|
|
151
157
|
```
|
|
152
158
|
|
|
153
|
-
###
|
|
154
|
-
|
|
155
|
-
#### Discover Pools
|
|
156
|
-
|
|
159
|
+
### DEX aggregator swap
|
|
157
160
|
```bash
|
|
158
|
-
#
|
|
159
|
-
defi --
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
defi --json --chain mantle lp discover
|
|
163
|
-
|
|
164
|
-
# Filter by protocol
|
|
165
|
-
defi --json --chain hyperevm lp discover --protocol kittenswap
|
|
166
|
-
```
|
|
167
|
-
|
|
168
|
-
#### Add Liquidity
|
|
169
|
-
|
|
170
|
-
```bash
|
|
171
|
-
defi --json --chain hyperevm lp add --protocol kittenswap --pool 0x... --amount-a 1000000000000000000 --amount-b 5000000000 --broadcast
|
|
172
|
-
```
|
|
173
|
-
|
|
174
|
-
#### Farm (Add + Auto-stake)
|
|
175
|
-
|
|
176
|
-
```bash
|
|
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
|
|
179
|
-
```
|
|
180
|
-
|
|
181
|
-
#### Claim Rewards
|
|
182
|
-
|
|
183
|
-
```bash
|
|
184
|
-
# Claim fee and emission rewards from a pool
|
|
185
|
-
defi --json --chain hyperevm lp claim --protocol kittenswap --pool 0x... --broadcast
|
|
186
|
-
```
|
|
187
|
-
|
|
188
|
-
#### Remove Liquidity
|
|
189
|
-
|
|
190
|
-
```bash
|
|
191
|
-
# Auto-unstake (if staked) and remove liquidity
|
|
192
|
-
defi --json --chain hyperevm lp remove --protocol kittenswap --pool 0x... --broadcast
|
|
193
|
-
```
|
|
194
|
-
|
|
195
|
-
#### LP Autopilot
|
|
196
|
-
|
|
197
|
-
Reads `~/.defi/pools.toml` for whitelisted pools and allocates budget automatically.
|
|
198
|
-
|
|
199
|
-
```bash
|
|
200
|
-
# Dry-run autopilot allocation
|
|
201
|
-
defi --json lp autopilot --budget 1000000000 # 1000 USDC
|
|
202
|
-
|
|
203
|
-
# Execute
|
|
204
|
-
defi --json lp autopilot --budget 1000000000 --broadcast
|
|
205
|
-
```
|
|
206
|
-
|
|
207
|
-
**pools.toml example:**
|
|
208
|
-
|
|
209
|
-
```toml
|
|
210
|
-
[[pools]]
|
|
211
|
-
protocol = "kittenswap"
|
|
212
|
-
pool_address = "0xYourPoolAddress"
|
|
213
|
-
weight = 50 # 50% of budget
|
|
214
|
-
|
|
215
|
-
[[pools]]
|
|
216
|
-
protocol = "nest-v1"
|
|
217
|
-
pool_address = "0xAnotherPool"
|
|
218
|
-
weight = 50
|
|
219
|
-
```
|
|
220
|
-
|
|
221
|
-
Default location: `~/.defi/pools.toml`
|
|
222
|
-
|
|
223
|
-
### Bridge
|
|
224
|
-
|
|
225
|
-
```bash
|
|
226
|
-
# Bridge via LI.FI (default)
|
|
227
|
-
defi --json bridge --token USDC --amount 100000000 --to-chain mantle
|
|
228
|
-
|
|
229
|
-
# Bridge via deBridge DLN
|
|
230
|
-
defi --json bridge --token USDC --amount 100000000 --to-chain arbitrum --provider debridge --broadcast
|
|
231
|
-
|
|
232
|
-
# Native USDC via Circle CCTP V2
|
|
233
|
-
defi --json bridge --token USDC --amount 100000000 --to-chain arbitrum --provider cctp --broadcast
|
|
234
|
-
```
|
|
235
|
-
|
|
236
|
-
### Portfolio
|
|
237
|
-
|
|
238
|
-
```bash
|
|
239
|
-
# Aggregate positions across all protocols
|
|
240
|
-
defi --json --chain hyperevm portfolio show --address 0xYourAddress
|
|
241
|
-
```
|
|
242
|
-
|
|
243
|
-
### Token & Wallet
|
|
244
|
-
|
|
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...
|
|
254
|
-
```
|
|
255
|
-
|
|
256
|
-
### Price & Market Data
|
|
257
|
-
|
|
258
|
-
```bash
|
|
259
|
-
# Oracle + DEX prices (--chain required)
|
|
260
|
-
defi --json --chain hyperevm price --asset WHYPE
|
|
261
|
-
|
|
262
|
-
# DEX prices only
|
|
263
|
-
defi --json --chain hyperevm price --asset WHYPE --source dex
|
|
264
|
-
|
|
265
|
-
# Oracle prices only
|
|
266
|
-
defi --json --chain hyperevm price --asset USDC --source oracle
|
|
161
|
+
# Pick the cheapest provider per chain
|
|
162
|
+
defi --chain mantle swap --provider lifi --from MOE --to WMNT --amount <wei> --broadcast
|
|
163
|
+
defi --chain base swap --provider kyber --from WETH --to USDC --amount <wei> --broadcast
|
|
164
|
+
defi --chain bnb swap --provider relay --from WBNB --to USDT --amount <wei> --broadcast
|
|
267
165
|
```
|
|
268
166
|
|
|
269
167
|
## Agent-First Design
|
|
270
168
|
|
|
271
|
-
Built for AI agents and automation with structured output, schema introspection, and validation:
|
|
272
|
-
|
|
273
169
|
```bash
|
|
274
170
|
# Every command returns JSON envelope
|
|
275
171
|
defi --json status
|
|
276
172
|
# → { "ok": true, "data": {...}, "meta": { "timestamp": "..." } }
|
|
277
173
|
|
|
278
|
-
#
|
|
174
|
+
# Schema introspection
|
|
279
175
|
defi --json schema
|
|
280
176
|
|
|
281
|
-
# Filter output
|
|
177
|
+
# Filter output (saves tokens)
|
|
282
178
|
defi --json --fields balance,positions status
|
|
283
179
|
|
|
284
|
-
# Stream large lists
|
|
180
|
+
# Stream large lists
|
|
285
181
|
defi --json --ndjson lp discover
|
|
286
182
|
|
|
287
|
-
#
|
|
288
|
-
defi --
|
|
289
|
-
|
|
290
|
-
# Safe by default: --dry-run is on, use --broadcast to execute
|
|
291
|
-
defi --json --chain hyperevm swap --from WHYPE --to USDC --amount 1000000000000000000 --broadcast
|
|
292
|
-
```
|
|
293
|
-
|
|
294
|
-
Responses include `needs_approval` simulation status. Auto-approve flow: check allowance → exact approve → execute tx.
|
|
295
|
-
|
|
296
|
-
All responses are auto-sanitized (control chars stripped, prompt injection patterns blocked).
|
|
297
|
-
Errors include `retryable` flag — only retry when `true`.
|
|
298
|
-
|
|
299
|
-
## Global Flags
|
|
300
|
-
|
|
301
|
-
```bash
|
|
302
|
-
--json # Output as JSON (structured for agents)
|
|
303
|
-
--ndjson # Output as newline-delimited JSON
|
|
304
|
-
--fields <f> # Select output fields (comma-separated)
|
|
305
|
-
--chain <chain> # Target chain: hyperevm or mantle (required for tx commands)
|
|
306
|
-
--dry-run # Dry-run mode (default, no broadcast)
|
|
307
|
-
--broadcast # Execute transaction on-chain
|
|
183
|
+
# Dry-run by default — explicit --broadcast required
|
|
184
|
+
defi --chain hyperevm swap --from WHYPE --to USDC --amount 1000000000000000000 # simulated
|
|
185
|
+
defi --chain hyperevm swap --from WHYPE --to USDC --amount 1000000000000000000 --broadcast # executed
|
|
308
186
|
```
|
|
309
187
|
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
```bash
|
|
313
|
-
DEFI_PRIVATE_KEY # Private key for signing transactions
|
|
314
|
-
DEFI_WALLET_ADDRESS # Wallet address for queries and execution
|
|
315
|
-
HYPEREVM_RPC_URL # Override HyperEVM RPC endpoint
|
|
316
|
-
MANTLE_RPC_URL # Override Mantle RPC endpoint
|
|
317
|
-
```
|
|
188
|
+
Auto-approve flow: simulation returns `needs_approval` with `pending_approvals` list → executor prepends the approve tx automatically.
|
|
318
189
|
|
|
319
190
|
## MCP Server
|
|
320
191
|
|
|
321
|
-
17 MCP tools for Claude Desktop, Cursor, and other MCP clients.
|
|
322
|
-
|
|
323
192
|
```json
|
|
324
193
|
{
|
|
325
194
|
"mcpServers": {
|
|
@@ -331,21 +200,35 @@ MANTLE_RPC_URL # Override Mantle RPC endpoint
|
|
|
331
200
|
}
|
|
332
201
|
```
|
|
333
202
|
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
See `mcp-config.example.json` for full configuration.
|
|
203
|
+
Tools include: `defi_status`, `defi_yield_scan`, `defi_lending_*`, `defi_lp_*`, `defi_swap`, `defi_bridge`, `defi_price`, `defi_token_*`, `defi_portfolio`, `defi_schema`. See `mcp-config.example.json`.
|
|
337
204
|
|
|
338
205
|
## Claude Code Skill
|
|
339
206
|
|
|
340
|
-
Install the skill for AI-assisted DeFi operations:
|
|
341
|
-
|
|
342
207
|
```bash
|
|
343
|
-
# Install from npm package
|
|
344
208
|
npx -y @hypurrquant/defi-cli skill install
|
|
345
209
|
```
|
|
346
210
|
|
|
347
211
|
Or copy `skills/defi-cli/` into your Claude Code skills directory.
|
|
348
212
|
|
|
213
|
+
## Environment Variables
|
|
214
|
+
|
|
215
|
+
| Variable | Description |
|
|
216
|
+
|---|---|
|
|
217
|
+
| `{CHAIN}_RPC_URL` | Per-chain RPC override (e.g., `MANTLE_RPC_URL`, `BASE_RPC_URL`) |
|
|
218
|
+
| `DEFI_PRIVATE_KEY` | Private key for `--broadcast` |
|
|
219
|
+
| `DEFI_WALLET_ADDRESS` | Default wallet (accepts `ows:<name>` for OWS vault) |
|
|
220
|
+
|
|
221
|
+
## Global Flags
|
|
222
|
+
|
|
223
|
+
```bash
|
|
224
|
+
--chain <name> # hyperevm | mantle | base | bnb | monad
|
|
225
|
+
--json # JSON output
|
|
226
|
+
--ndjson # NDJSON streaming
|
|
227
|
+
--fields <a,b> # Output field filter
|
|
228
|
+
--dry-run # Default — simulate only
|
|
229
|
+
--broadcast # Send tx on-chain
|
|
230
|
+
```
|
|
231
|
+
|
|
349
232
|
## License
|
|
350
233
|
|
|
351
234
|
MIT
|