@hypurrquant/defi-cli 1.0.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 +10 -18
- package/dist/mcp-server.js +349 -3
- package/dist/mcp-server.js.map +1 -1
- package/package.json +1 -1
- package/skills/defi-cli/SKILL.md +121 -90
- 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 -67
package/package.json
CHANGED
package/skills/defi-cli/SKILL.md
CHANGED
|
@@ -1,43 +1,44 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: defi-cli
|
|
3
|
-
description: "Multi-chain DeFi operations CLI for HyperEVM
|
|
3
|
+
description: "Multi-chain DeFi operations CLI for HyperEVM, Mantle, Base, BNB, Monad. Use when user asks to: supply/withdraw from lending, swap tokens via aggregator, add/remove/claim LP, bridge assets, manage LP autopilot, claim emission rewards, compound positions, compare APYs, check prices, track portfolio, or mentions defi-cli, HyperEVM, Mantle, Base, Aerodrome, Merchant Moe, KittenSwap, Ramses, Uniswap, Aave, Compound, Morpho, KyberSwap, OpenOcean, LiquidSwap, LI.FI, Relay."
|
|
4
4
|
allowed-tools: "Bash(defi:*), Bash(npx defi-cli:*), Bash(npx -y defi-cli:*)"
|
|
5
5
|
license: MIT
|
|
6
6
|
metadata:
|
|
7
7
|
author: hypurrquant
|
|
8
|
-
version: "0.
|
|
8
|
+
version: "1.0.0"
|
|
9
9
|
---
|
|
10
10
|
|
|
11
11
|
# defi-cli Agent Guide
|
|
12
12
|
|
|
13
|
-
Multi-chain DeFi CLI — lending, DEX swaps, LP management, bridging, yield comparison
|
|
13
|
+
Multi-chain DeFi CLI — lending, DEX swaps, LP management, bridging, yield comparison.
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
21 protocols across lending, DEX, vault, CDP.
|
|
15
|
+
**5 chains · 39 protocols · 5 DEX aggregators**
|
|
17
16
|
|
|
18
17
|
## Rules
|
|
19
18
|
|
|
20
19
|
1. **Always use `--json`** on every command.
|
|
21
20
|
2. **Always use `--dry-run`** (default) before any mutating transaction. Only add `--broadcast` after user confirms.
|
|
22
|
-
3. **Always use `--chain`** for transaction commands
|
|
21
|
+
3. **Always use `--chain`** for transaction commands. Query commands (`yield scan`, `status`) scan all chains by default.
|
|
23
22
|
4. **NEVER broadcast without user confirmation.**
|
|
24
23
|
5. **NEVER read private key files or `~/.` config files.**
|
|
25
|
-
6. **Amounts are in wei** (18 decimals for
|
|
24
|
+
6. **Amounts are in wei** (18 decimals for native/WETH, 6 for USDC/USDT). Use `BigInt(humanAmount * 10**decimals)` to convert.
|
|
26
25
|
|
|
27
26
|
## Install
|
|
28
27
|
|
|
29
28
|
```bash
|
|
30
|
-
defi --version 2>/dev/null
|
|
31
|
-
npm install -g @hypurrquant/defi-cli@latest
|
|
29
|
+
defi --version 2>/dev/null # check if installed
|
|
30
|
+
npm install -g @hypurrquant/defi-cli@latest
|
|
31
|
+
# or
|
|
32
|
+
npx -y @hypurrquant/defi-cli@latest --json status
|
|
32
33
|
```
|
|
33
34
|
|
|
34
|
-
Use `defi` if global install works, otherwise `npx -y @hypurrquant/defi-cli@latest` as prefix.
|
|
35
|
+
Use `defi` if global install works, otherwise `npx -y -p @hypurrquant/defi-cli@latest defi` as prefix.
|
|
35
36
|
|
|
36
37
|
## Global Flags
|
|
37
38
|
|
|
38
|
-
`--json` (required) | `--chain <chain>` (hyperevm
|
|
39
|
+
`--json` (required) | `--chain <chain>` (hyperevm, mantle, base, bnb, monad) | `--dry-run` (default, safe) | `--broadcast` (executes tx) | `--fields <f1,f2>` | `--ndjson`
|
|
39
40
|
|
|
40
|
-
**Wallet**: set `DEFI_WALLET_ADDRESS` env for read queries. Set `DEFI_PRIVATE_KEY` for tx signing.
|
|
41
|
+
**Wallet**: set `DEFI_WALLET_ADDRESS` env for read queries. Set `DEFI_PRIVATE_KEY` for tx signing. Or use `DEFI_WALLET_ADDRESS=ows:<name>` after `defi ows create <name>` for encrypted vault.
|
|
41
42
|
|
|
42
43
|
## Environment
|
|
43
44
|
|
|
@@ -48,133 +49,163 @@ export DEFI_PRIVATE_KEY=0xYourPrivateKey # only needed for broadcasting
|
|
|
48
49
|
|
|
49
50
|
## Chains
|
|
50
51
|
|
|
51
|
-
| Alias |
|
|
52
|
-
|
|
53
|
-
| `hyperevm` | HyperEVM
|
|
54
|
-
| `mantle` | Mantle | 5000 |
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
### HyperEVM
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
|
87
|
-
|
|
88
|
-
|
|
|
89
|
-
| `uniswap-v3-mantle` | Uniswap V3 | uniswap_v3 |
|
|
90
|
-
| `merchantmoe-mantle` | Merchant Moe | uniswap_v2 + lb |
|
|
52
|
+
| Alias | Chain | Chain ID | Status |
|
|
53
|
+
|-------|-------|----------|--------|
|
|
54
|
+
| `hyperevm` | HyperEVM | 999 | 🟢 production |
|
|
55
|
+
| `mantle` | Mantle | 5000 | 🟢 production |
|
|
56
|
+
| `base` | Base | 8453 | 🟢 production |
|
|
57
|
+
| `bnb` | BNB Chain | 56 | 🟡 staged |
|
|
58
|
+
| `monad` | Monad | 143 | 🟡 staged |
|
|
59
|
+
|
|
60
|
+
🟢 = mainnet broadcast verified | 🟡 = configs verified, awaiting funded broadcast
|
|
61
|
+
|
|
62
|
+
## Protocol Slugs by Chain
|
|
63
|
+
|
|
64
|
+
For full protocol list see `references/protocols.md`. High-level summary:
|
|
65
|
+
|
|
66
|
+
### HyperEVM (11)
|
|
67
|
+
**Lending**: `hyperlend`, `hypurrfi`, `felix-morpho` · **DEX**: `project-x`, `hyperswap`, `curve-hyperevm`, `ramses-cl`, `ramses-hl`, `kittenswap`, `hybra`, `nest`
|
|
68
|
+
|
|
69
|
+
### Mantle (3)
|
|
70
|
+
**Lending**: `aave-v3-mantle` · **DEX**: `uniswap-v3-mantle`, `merchantmoe-mantle` (LB + MOE emission)
|
|
71
|
+
|
|
72
|
+
### Base (5)
|
|
73
|
+
**Lending**: `aave-v3-base`, `compound-v3-base` · **DEX**: `uniswap-v3-base`, `aerodrome-base` (V2 + AERO), `aerodrome-cl` (Slipstream + AERO)
|
|
74
|
+
|
|
75
|
+
### BNB (16)
|
|
76
|
+
**Lending**: `aave-v3-bnb`, `kinza-bnb`, `venus-bnb`, `venus-flux-bnb` · **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` · **Vault**: `beefy-bnb`
|
|
77
|
+
|
|
78
|
+
### Monad (4)
|
|
79
|
+
`uniswap-v2-monad`, `uniswap-v3-monad`, `traderjoe-monad` (LB), `morpho-blue-monad`
|
|
80
|
+
|
|
81
|
+
## DEX Aggregator Providers
|
|
82
|
+
|
|
83
|
+
| Provider | Supported chains | Notes |
|
|
84
|
+
|----------|------------------|-------|
|
|
85
|
+
| KyberSwap | hyperevm, base, bnb | Default for HyperEVM |
|
|
86
|
+
| OpenOcean | hyperevm, mantle, base, bnb | Universal fallback |
|
|
87
|
+
| LiquidSwap | hyperevm | HyperEVM-native (LiquidLaunch) |
|
|
88
|
+
| LI.FI | all source chains via chainId | Cross-chain swaps too |
|
|
89
|
+
| Relay | all source chains via chainId | Multi-step routes (auto skip approve step) |
|
|
91
90
|
|
|
92
91
|
## Core Workflow: Lending
|
|
93
92
|
|
|
94
93
|
```
|
|
95
|
-
1. defi --json yield --asset USDC
|
|
94
|
+
1. defi --json yield scan --asset USDC # compare APYs across all chains
|
|
96
95
|
2. defi --json --chain hyperevm lending position --protocol hyperlend # check position
|
|
97
|
-
3. defi --json --chain hyperevm lending supply --protocol hyperlend --asset USDC --amount 1000000000
|
|
96
|
+
3. defi --json --chain hyperevm lending supply --protocol hyperlend --asset USDC --amount 1000000000 # dry-run
|
|
98
97
|
4. [show result to user, get confirmation]
|
|
99
98
|
5. defi --json --chain hyperevm lending supply --protocol hyperlend --asset USDC --amount 1000000000 --broadcast
|
|
100
99
|
6. defi --json --chain hyperevm lending position --protocol hyperlend # verify
|
|
101
100
|
```
|
|
102
101
|
|
|
103
|
-
## Core Workflow:
|
|
104
|
-
|
|
105
|
-
Aggregates KyberSwap, OpenOcean, LiquidSwap for best price automatically.
|
|
102
|
+
## Core Workflow: DEX Aggregator Swap
|
|
106
103
|
|
|
107
104
|
```
|
|
108
|
-
1. defi --json --chain
|
|
105
|
+
1. defi --json --chain mantle swap --provider lifi --from MOE --to WMNT --amount <wei> # dry-run via LI.FI
|
|
109
106
|
2. [confirm with user]
|
|
110
|
-
3. defi --json --chain
|
|
107
|
+
3. defi --json --chain mantle swap --provider lifi --from MOE --to WMNT --amount <wei> --broadcast
|
|
111
108
|
```
|
|
112
109
|
|
|
113
|
-
## Core Workflow: LP
|
|
110
|
+
## Core Workflow: LP with Emission Claim (Merchant Moe LB)
|
|
114
111
|
|
|
115
112
|
```
|
|
116
|
-
1. defi --json --chain
|
|
117
|
-
2.
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
113
|
+
1. defi --json --chain mantle lp discover --protocol merchantmoe-mantle --emission-only # active emission pools sorted by APR
|
|
114
|
+
2. defi --json --chain mantle lp add --protocol merchantmoe-mantle --token-a WMNT --token-b USDT0 \
|
|
115
|
+
--amount-a <wei> --amount-b <wei> --pool 0x... --num-bins 3 --broadcast
|
|
116
|
+
3. defi --json --chain mantle lp positions --protocol merchantmoe-mantle # see active positions + pending MOE
|
|
117
|
+
4. defi --json --chain mantle lp claim --protocol merchantmoe-mantle --pool 0x... --broadcast # auto-detects user's actual bins
|
|
118
|
+
5. defi --json --chain mantle lp remove --protocol merchantmoe-mantle --token-a WMNT --token-b USDT0 \
|
|
119
|
+
--pool 0x... --bins <bin1>,<bin2> --broadcast
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
## Core Workflow: LP with NFT Gauge (Aerodrome Slipstream / Hybra V4)
|
|
123
|
+
|
|
124
|
+
```
|
|
125
|
+
1. defi --json --chain base lp farm --protocol aerodrome-cl --token-a WETH --token-b USDC \
|
|
126
|
+
--amount-a <wei> --amount-b <wei> --range 5 --pool 0x... --broadcast # mint + auto-stake
|
|
127
|
+
2. defi --json --chain base lp claim --protocol aerodrome-cl --gauge 0x... --token-id <id> --broadcast # claim AERO
|
|
128
|
+
3. defi --json --chain base lp remove --protocol aerodrome-cl --token-a WETH --token-b USDC \
|
|
129
|
+
--liquidity <amount> --token-id <id> --gauge 0x... --broadcast # auto-unstake + remove
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
## Core Workflow: V3 Fee Auto-Compound
|
|
133
|
+
|
|
134
|
+
```
|
|
135
|
+
1. defi --json --chain base lp compound --protocol uniswap-v3-base --token-id <id> --slippage 50 # static-call detects fees
|
|
136
|
+
2. [if fees > 0, confirm and re-run with --broadcast]
|
|
137
|
+
3. defi --json --chain base lp compound --protocol uniswap-v3-base --token-id <id> --broadcast
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
## Core Workflow: Cross-chain Bridge
|
|
141
|
+
|
|
142
|
+
Bridge **source** must be a supported chain (hyperevm/mantle/base/bnb/monad). Bridge **destination** can be any chain LI.FI/deBridge route to, or any CCTP V2 chain (ethereum, arbitrum, optimism, polygon, avalanche, base).
|
|
143
|
+
|
|
144
|
+
```
|
|
145
|
+
1. defi --json --chain base bridge --token USDC --amount 100000000 --to-chain arbitrum --provider lifi # dry-run
|
|
146
|
+
2. [confirm cost + ETA]
|
|
147
|
+
3. defi --json --chain base bridge --token USDC --amount 100000000 --to-chain arbitrum --provider lifi --broadcast
|
|
121
148
|
```
|
|
122
149
|
|
|
123
150
|
## Core Workflow: Yield Comparison
|
|
124
151
|
|
|
125
152
|
```
|
|
126
|
-
1. defi --json yield
|
|
127
|
-
2. defi --json --chain mantle yield --asset
|
|
153
|
+
1. defi --json yield scan --asset USDC # all chains, all protocols
|
|
154
|
+
2. defi --json --chain mantle yield compare --asset USDT # one chain only
|
|
155
|
+
3. defi --json yield optimize --asset USDC --amount 100000000 # auto-strategy with diversification
|
|
128
156
|
```
|
|
129
157
|
|
|
130
158
|
## Error Handling
|
|
131
159
|
|
|
132
160
|
| Error | Action |
|
|
133
161
|
|-------|--------|
|
|
134
|
-
| `Chain not found: X` | use
|
|
135
|
-
| `Protocol not found: X` | run `defi --json status` to list valid slugs |
|
|
136
|
-
| `
|
|
137
|
-
| `
|
|
138
|
-
| `
|
|
162
|
+
| `Chain not found: X` | use one of: hyperevm, mantle, base, bnb, monad |
|
|
163
|
+
| `Protocol not found: X` | run `defi --json status` to list valid slugs for the chain |
|
|
164
|
+
| `KyberSwap: unsupported chain` | use openocean, lifi, or relay |
|
|
165
|
+
| `AMOUNT_TOO_LOW` (Relay) | increase amount or switch provider |
|
|
166
|
+
| `No fees to compound` | V3 position has no accumulated fees yet — wait for swaps to cross range |
|
|
167
|
+
| `No pools found` | protocol may be inactive on this chain or discover branch missing config |
|
|
139
168
|
| `DEFI_WALLET_ADDRESS not set` | set env var or pass `--address` |
|
|
140
169
|
|
|
141
170
|
## Examples
|
|
142
171
|
|
|
143
|
-
**"What are the best USDC lending rates?"**
|
|
172
|
+
**"What are the best USDC lending rates across all chains?"**
|
|
173
|
+
```bash
|
|
174
|
+
defi --json yield scan --asset USDC
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
**"Add LP to WMNT/USDT0 on Mantle and earn MOE"**
|
|
144
178
|
```bash
|
|
145
|
-
defi --json
|
|
179
|
+
defi --json --chain mantle lp add --protocol merchantmoe-mantle --token-a WMNT --token-b USDT0 \
|
|
180
|
+
--amount-a 1000000000000000000 --amount-b 600000 --pool 0x03BeafC0d25BB553fCa274301832419C05269987 --num-bins 3 --broadcast
|
|
146
181
|
```
|
|
147
182
|
|
|
148
|
-
**"
|
|
183
|
+
**"Show all my LP positions and pending rewards on Mantle"**
|
|
149
184
|
```bash
|
|
150
|
-
defi --json
|
|
151
|
-
defi --json --chain hyperevm lending supply --protocol hyperlend --asset USDC --amount 1000000000
|
|
152
|
-
# after user confirms:
|
|
153
|
-
defi --json --chain hyperevm lending supply --protocol hyperlend --asset USDC --amount 1000000000 --broadcast
|
|
185
|
+
defi --json --chain mantle lp positions --protocol merchantmoe-mantle
|
|
154
186
|
```
|
|
155
187
|
|
|
156
|
-
**"
|
|
188
|
+
**"Claim AERO from my Aerodrome Slipstream NFT"**
|
|
157
189
|
```bash
|
|
158
|
-
defi --json --chain
|
|
159
|
-
defi --json --chain hyperevm swap --from WHYPE --to USDC --amount 1000000000000000000 --broadcast
|
|
190
|
+
defi --json --chain base lp claim --protocol aerodrome-cl --gauge 0xF33a96b5932D9E9B9A0eDA447AbD8C9d48d2e0c8 --token-id <id> --broadcast
|
|
160
191
|
```
|
|
161
192
|
|
|
162
|
-
**"
|
|
193
|
+
**"Swap 1 ETH to USDC on Base via best route"**
|
|
163
194
|
```bash
|
|
164
|
-
defi --json --chain
|
|
195
|
+
defi --json --chain base swap --provider kyber --from WETH --to USDC --amount 1000000000000000000
|
|
165
196
|
```
|
|
166
197
|
|
|
167
|
-
**"Bridge 100 USDC from
|
|
198
|
+
**"Bridge 100 USDC from Base to Arbitrum via CCTP"**
|
|
168
199
|
```bash
|
|
169
|
-
defi --json --chain
|
|
200
|
+
defi --json --chain base bridge --token USDC --amount 100000000 --to-chain arbitrum --provider cctp --broadcast
|
|
170
201
|
```
|
|
171
202
|
|
|
172
|
-
**"Check my portfolio on
|
|
203
|
+
**"Check my portfolio on Base"**
|
|
173
204
|
```bash
|
|
174
|
-
defi --json --chain
|
|
205
|
+
defi --json --chain base portfolio show --address 0xYourAddress
|
|
175
206
|
```
|
|
176
207
|
|
|
177
|
-
**"
|
|
208
|
+
**"Find all Aerodrome Slipstream emission pools sorted by APR"**
|
|
178
209
|
```bash
|
|
179
|
-
defi --json --chain
|
|
210
|
+
defi --json --chain base lp discover --protocol aerodrome-cl --emission-only
|
|
180
211
|
```
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hypurrquant/defi-cli-skill",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "AI agent skill for defi-cli — multi-chain DeFi operations via CLI",
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "AI agent skill for defi-cli — multi-chain DeFi operations via CLI (7 chains, 48 protocols, 5 aggregators)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai-skill",
|
|
7
7
|
"claude",
|
|
@@ -15,8 +15,16 @@
|
|
|
15
15
|
"hyperevm",
|
|
16
16
|
"hyperliquid",
|
|
17
17
|
"mantle",
|
|
18
|
+
"base",
|
|
19
|
+
"bnb",
|
|
20
|
+
"monad",
|
|
18
21
|
"aave",
|
|
19
22
|
"uniswap",
|
|
23
|
+
"aerodrome",
|
|
24
|
+
"merchantmoe",
|
|
25
|
+
"kyberswap",
|
|
26
|
+
"openocean",
|
|
27
|
+
"lifi",
|
|
20
28
|
"yield"
|
|
21
29
|
],
|
|
22
30
|
"author": "hypurrquant",
|
|
@@ -33,6 +41,6 @@
|
|
|
33
41
|
"scripts"
|
|
34
42
|
],
|
|
35
43
|
"peerDependencies": {
|
|
36
|
-
"@hypurrquant/defi-cli": ">=0.
|
|
44
|
+
"@hypurrquant/defi-cli": ">=1.0.0"
|
|
37
45
|
}
|
|
38
46
|
}
|
|
@@ -1,113 +1,160 @@
|
|
|
1
1
|
# defi-cli Command Reference
|
|
2
2
|
|
|
3
3
|
All commands support `--json` for structured output. Always use `--json` when calling from an agent.
|
|
4
|
-
All amounts are in **wei** unless noted. USDC/USDT use 6 decimals; native tokens
|
|
4
|
+
All amounts are in **wei** unless noted. USDC/USDT/USDT0 use 6 decimals; native tokens, WETH/WMNT/WBNB/WMON/WHYPE/AERO/MOE use 18; WBTC uses 8.
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
```bash
|
|
9
|
-
defi --json # multicall balance dashboard
|
|
10
|
-
defi --json --chain mantle # Mantle dashboard
|
|
11
|
-
```
|
|
6
|
+
`--chain <chain>` selects the network: `hyperevm`, `mantle`, `base`, `bnb`, `monad`. Query commands (`yield scan`, `status`) scan all chains by default; transaction commands require an explicit `--chain`.
|
|
12
7
|
|
|
13
8
|
## Status & Discovery (read-only, safe)
|
|
14
9
|
|
|
15
10
|
```bash
|
|
16
|
-
defi --json status #
|
|
17
|
-
defi --json --chain mantle status #
|
|
11
|
+
defi --json status # current chain protocols
|
|
12
|
+
defi --json --chain mantle status # Mantle protocols + addresses
|
|
18
13
|
defi --json schema # full CLI schema as JSON
|
|
19
14
|
```
|
|
20
15
|
|
|
21
16
|
## Yield (read-only, safe)
|
|
22
17
|
|
|
23
18
|
```bash
|
|
24
|
-
defi --json yield
|
|
25
|
-
defi --json yield --asset USDT
|
|
26
|
-
defi --json
|
|
19
|
+
defi --json yield scan --asset USDC # all chains, all lending protocols, ranked by supply APY
|
|
20
|
+
defi --json --chain mantle yield compare --asset USDT
|
|
21
|
+
defi --json yield optimize --asset USDC --amount 100000000 # diversification plan
|
|
27
22
|
```
|
|
28
23
|
|
|
29
24
|
## Price (read-only, safe)
|
|
30
25
|
|
|
31
26
|
```bash
|
|
32
|
-
defi --json price --asset WHYPE
|
|
33
|
-
defi --json price --asset USDC --source oracle
|
|
34
|
-
defi --json price --asset
|
|
35
|
-
defi --json --chain mantle price --asset WMNT # price on Mantle
|
|
27
|
+
defi --json --chain hyperevm price --asset WHYPE # oracle + DEX
|
|
28
|
+
defi --json --chain hyperevm price --asset USDC --source oracle
|
|
29
|
+
defi --json --chain mantle price --asset WMNT --source dex
|
|
36
30
|
```
|
|
37
31
|
|
|
38
|
-
## Lending
|
|
32
|
+
## Lending
|
|
39
33
|
|
|
40
34
|
```bash
|
|
41
35
|
# Read-only
|
|
42
|
-
defi --json lending rates --protocol <slug> --asset <token>
|
|
43
|
-
defi --json lending position --protocol <slug>
|
|
36
|
+
defi --json --chain <chain> lending rates --protocol <slug> --asset <token>
|
|
37
|
+
defi --json --chain <chain> lending position --protocol <slug>
|
|
44
38
|
|
|
45
|
-
# Mutating (dry-run
|
|
46
|
-
defi --json lending supply
|
|
47
|
-
defi --json lending
|
|
48
|
-
defi --json lending
|
|
39
|
+
# Mutating (dry-run by default — add --broadcast to execute)
|
|
40
|
+
defi --json --chain <chain> lending supply --protocol <slug> --asset <token> --amount <wei>
|
|
41
|
+
defi --json --chain <chain> lending withdraw --protocol <slug> --asset <token> --amount <wei>
|
|
42
|
+
defi --json --chain <chain> lending borrow --protocol <slug> --asset <token> --amount <wei>
|
|
43
|
+
defi --json --chain <chain> lending repay --protocol <slug> --asset <token> --amount <wei>
|
|
49
44
|
```
|
|
50
45
|
|
|
51
|
-
Auto-approve: if token allowance is insufficient, the CLI checks, approves
|
|
46
|
+
Auto-approve: if token allowance is insufficient, the CLI checks, approves, then supplies — all in one `--broadcast` call.
|
|
52
47
|
|
|
53
|
-
## Swap (DEX aggregator —
|
|
48
|
+
## Swap (DEX aggregator — 5 providers)
|
|
54
49
|
|
|
55
50
|
```bash
|
|
56
|
-
defi --json swap --
|
|
57
|
-
defi --json swap --token-in WHYPE --token-out USDC --amount 1000000000000000000 --slippage 50
|
|
51
|
+
defi --json --chain <chain> swap --provider <p> --from <token> --to <token> --amount <wei> [--slippage <bps>]
|
|
58
52
|
```
|
|
59
53
|
|
|
60
|
-
|
|
54
|
+
Providers: `kyber` (KyberSwap), `openocean`, `liquid` (LiquidSwap, HyperEVM-only), `lifi` (LI.FI, all chains + cross-chain), `relay` (multi-step routes, auto-skips approve step).
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
defi --json --chain hyperevm swap --provider kyber --from WHYPE --to USDC --amount 1000000000000000000
|
|
58
|
+
defi --json --chain mantle swap --provider lifi --from MOE --to WMNT --amount 1000000000000000000
|
|
59
|
+
defi --json --chain base swap --provider openocean --from WETH --to USDC --amount 100000000000000000
|
|
60
|
+
```
|
|
61
61
|
|
|
62
62
|
## LP Operations
|
|
63
63
|
|
|
64
64
|
### Discover Pools
|
|
65
65
|
|
|
66
66
|
```bash
|
|
67
|
-
defi --json lp discover
|
|
68
|
-
defi --json lp discover --protocol kittenswap
|
|
69
|
-
defi --json lp discover --
|
|
67
|
+
defi --json --chain <chain> lp discover # all fee + emission pools
|
|
68
|
+
defi --json --chain hyperevm lp discover --protocol kittenswap # filter by protocol
|
|
69
|
+
defi --json --chain mantle lp discover --protocol merchantmoe-mantle --emission-only
|
|
70
|
+
defi --json --chain base lp discover --protocol aerodrome-cl --emission-only # APR-sorted
|
|
70
71
|
```
|
|
71
72
|
|
|
72
73
|
### Add Liquidity
|
|
73
74
|
|
|
74
75
|
```bash
|
|
75
|
-
defi --json
|
|
76
|
+
defi --json --chain <chain> lp add --protocol <slug> \
|
|
77
|
+
--token-a <token> --token-b <token> --amount-a <wei> --amount-b <wei> \
|
|
78
|
+
--pool <address> # required for LB / specific pool
|
|
79
|
+
[--num-bins 3] # Liquidity Book (Merchant Moe / TraderJoe)
|
|
80
|
+
[--range 5] # ±N% concentrated range (V3 / Slipstream)
|
|
81
|
+
[--tick-lower N --tick-upper N] # explicit ticks
|
|
76
82
|
```
|
|
77
83
|
|
|
78
84
|
### Farm (Add + Auto-stake)
|
|
79
85
|
|
|
80
86
|
```bash
|
|
81
|
-
|
|
82
|
-
|
|
87
|
+
defi --json --chain <chain> lp farm --protocol <slug> \
|
|
88
|
+
--token-a <token> --token-b <token> --amount-a <wei> --amount-b <wei> \
|
|
89
|
+
--pool <address> [--gauge <addr>] [--range 5]
|
|
83
90
|
```
|
|
84
91
|
|
|
92
|
+
Two-step flow: mint LP → deposit into gauge (Solidly/Hybra), enterFarming (KittenSwap/Algebra eternal), or no-op (Merchant Moe LB hooks).
|
|
93
|
+
|
|
85
94
|
### Claim Rewards
|
|
86
95
|
|
|
87
96
|
```bash
|
|
88
|
-
|
|
97
|
+
# V3 fee collect
|
|
98
|
+
defi --json --chain <chain> lp claim --protocol <slug> --token-id <id>
|
|
99
|
+
|
|
100
|
+
# Solidly / Aerodrome V2 / Ramses HL gauge (account-based)
|
|
101
|
+
defi --json --chain <chain> lp claim --protocol <slug> --gauge <addr>
|
|
102
|
+
|
|
103
|
+
# Aerodrome Slipstream / Hybra V4 / Ramses CL (NFT gauge)
|
|
104
|
+
defi --json --chain <chain> lp claim --protocol <slug> --gauge <addr> --token-id <id>
|
|
105
|
+
defi --json --chain hyperevm lp claim --protocol hybra --gauge <addr> --token-id <id> --redeem-type 0 # instant exit (penalty)
|
|
106
|
+
|
|
107
|
+
# KittenSwap eternal farming
|
|
108
|
+
defi --json --chain hyperevm lp claim --protocol kittenswap --pool <addr> --token-id <id>
|
|
109
|
+
|
|
110
|
+
# Merchant Moe LB (auto-detects user's actual bins)
|
|
111
|
+
defi --json --chain mantle lp claim --protocol merchantmoe-mantle --pool <addr>
|
|
112
|
+
|
|
113
|
+
# Off-chain Nest ticket
|
|
114
|
+
defi --json --chain hyperevm lp claim --protocol nest --address <wallet>
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### Compound (V3 fee auto-compound)
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
defi --json --chain <chain> lp compound --protocol <slug> --token-id <id> [--slippage 50]
|
|
89
121
|
```
|
|
90
122
|
|
|
123
|
+
Collects accrued fees and re-adds them as liquidity in one tx. V3 fee-only protocols (Uniswap V3, HyperSwap, Project X).
|
|
124
|
+
|
|
91
125
|
### Remove Liquidity
|
|
92
126
|
|
|
93
127
|
```bash
|
|
94
|
-
#
|
|
95
|
-
defi --json lp remove --protocol <slug>
|
|
128
|
+
# V3 / Slipstream (NFT-based)
|
|
129
|
+
defi --json --chain <chain> lp remove --protocol <slug> \
|
|
130
|
+
--token-a <token> --token-b <token> --liquidity <amount> --token-id <id> [--gauge <addr>]
|
|
131
|
+
|
|
132
|
+
# Solidly V2 (LP-token-based)
|
|
133
|
+
defi --json --chain <chain> lp remove --protocol <slug> \
|
|
134
|
+
--token-a <token> --token-b <token> --liquidity <wei> --gauge <addr>
|
|
135
|
+
|
|
136
|
+
# Liquidity Book (Merchant Moe / TraderJoe)
|
|
137
|
+
defi --json --chain <chain> lp remove --protocol <slug> \
|
|
138
|
+
--token-a <token> --token-b <token> --pool <addr> --bins <bin1>,<bin2>,...
|
|
96
139
|
```
|
|
97
140
|
|
|
98
141
|
### LP Positions
|
|
99
142
|
|
|
100
143
|
```bash
|
|
101
|
-
defi --json lp positions
|
|
144
|
+
defi --json --chain <chain> lp positions # scan all protocols
|
|
145
|
+
defi --json --chain <chain> lp positions --protocol <slug>
|
|
146
|
+
defi --json --chain mantle lp positions --protocol merchantmoe-mantle --pool <addr>
|
|
102
147
|
```
|
|
103
148
|
|
|
149
|
+
Auto-detects Merchant Moe LB user bins via on-chain balance scan, plus pending MOE rewards. Walks NPM tokenIds for V3/Algebra/Hybra positions.
|
|
150
|
+
|
|
104
151
|
### LP Autopilot
|
|
105
152
|
|
|
106
153
|
Reads `~/.defi/pools.toml` for whitelisted pools and allocates budget automatically.
|
|
107
154
|
|
|
108
155
|
```bash
|
|
109
|
-
defi --json lp autopilot --budget
|
|
110
|
-
defi --json lp autopilot --budget
|
|
156
|
+
defi --json --chain <chain> lp autopilot --budget 1000 # USD; dry-run (default)
|
|
157
|
+
defi --json --chain <chain> lp autopilot --budget 1000 --broadcast
|
|
111
158
|
```
|
|
112
159
|
|
|
113
160
|
**pools.toml format:**
|
|
@@ -116,47 +163,53 @@ defi --json lp autopilot --budget 1000000000 --broadcast # execute
|
|
|
116
163
|
protocol = "kittenswap"
|
|
117
164
|
pool_address = "0x..."
|
|
118
165
|
weight = 50
|
|
166
|
+
chain = "hyperevm"
|
|
119
167
|
|
|
120
168
|
[[pools]]
|
|
121
|
-
protocol = "
|
|
169
|
+
protocol = "aerodrome-cl"
|
|
122
170
|
pool_address = "0x..."
|
|
123
171
|
weight = 50
|
|
172
|
+
chain = "base"
|
|
124
173
|
```
|
|
125
174
|
|
|
126
175
|
## Portfolio
|
|
127
176
|
|
|
128
177
|
```bash
|
|
129
|
-
defi --json
|
|
178
|
+
defi --json --chain <chain> portfolio show [--address <addr>]
|
|
179
|
+
defi --json --chain <chain> portfolio snapshot [--address <addr>]
|
|
180
|
+
defi --json --chain <chain> portfolio pnl [--address <addr>]
|
|
130
181
|
```
|
|
131
182
|
|
|
132
183
|
## Token
|
|
133
184
|
|
|
134
185
|
```bash
|
|
135
186
|
# Read-only
|
|
136
|
-
defi --json token balance
|
|
137
|
-
defi --json token allowance --token <token> --spender <addr> [--owner <addr>]
|
|
187
|
+
defi --json --chain <chain> token balance --token <token> [--owner <addr>]
|
|
188
|
+
defi --json --chain <chain> token allowance --token <token> --spender <addr> [--owner <addr>]
|
|
138
189
|
|
|
139
190
|
# Mutating
|
|
140
|
-
defi --json token approve
|
|
141
|
-
defi --json token transfer
|
|
191
|
+
defi --json --chain <chain> token approve --token <token> --spender <addr> [--amount max|<wei>]
|
|
192
|
+
defi --json --chain <chain> token transfer --token <token> --to <addr> --amount <wei>
|
|
142
193
|
```
|
|
143
194
|
|
|
144
195
|
## Wallet
|
|
145
196
|
|
|
146
197
|
```bash
|
|
147
|
-
defi --json wallet address
|
|
148
|
-
defi --json wallet balance [--address <addr>]
|
|
198
|
+
defi --json wallet address
|
|
199
|
+
defi --json --chain <chain> wallet balance [--address <addr>]
|
|
149
200
|
```
|
|
150
201
|
|
|
151
202
|
## Bridge (cross-chain)
|
|
152
203
|
|
|
204
|
+
Source chain (`--chain`) must be a supported chain: `hyperevm`, `mantle`, `base`, `bnb`, `monad`. Destination (`--to-chain`) can be any chain LI.FI/deBridge route to, plus all CCTP V2 chains.
|
|
205
|
+
|
|
153
206
|
```bash
|
|
154
|
-
# LI.FI (default,
|
|
155
|
-
defi --json bridge --token USDC --amount 100000000 --to-chain
|
|
207
|
+
# LI.FI (default, broadest coverage)
|
|
208
|
+
defi --json --chain base bridge --token USDC --amount 100000000 --to-chain ethereum --provider lifi
|
|
156
209
|
|
|
157
210
|
# deBridge DLN
|
|
158
|
-
defi --json bridge --token USDC --amount 100000000 --to-chain arbitrum --provider debridge
|
|
211
|
+
defi --json --chain base bridge --token USDC --amount 100000000 --to-chain arbitrum --provider debridge
|
|
159
212
|
|
|
160
|
-
# Circle CCTP V2
|
|
161
|
-
defi --json bridge --token USDC --amount 100000000 --to-chain arbitrum --provider cctp
|
|
213
|
+
# Circle CCTP V2 destinations: ethereum, avalanche, optimism, arbitrum, base, polygon
|
|
214
|
+
defi --json --chain base bridge --token USDC --amount 100000000 --to-chain arbitrum --provider cctp
|
|
162
215
|
```
|