@hypurrquant/defi-cli 1.0.0 → 1.0.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hypurrquant/defi-cli",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Multi-chain DeFi CLI \u2014 lending, DEX, LP, bridge, vault, staking from your terminal",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -1,43 +1,44 @@
1
1
  ---
2
2
  name: defi-cli
3
- description: "Multi-chain DeFi operations CLI for HyperEVM (Hyperliquid) and Mantle. Use when user asks to: supply/withdraw from lending, swap tokens, add/remove LP, bridge assets, manage LP autopilot, claim rewards, compare APYs, check prices, track portfolio, or mentions defi-cli, HyperEVM, Hyperliquid EVM, Mantle, HypurrFi, HyperLend, Felix, KittenSwap, NEST, Ramses, Merchant Moe, KyberSwap, OpenOcean, LiquidSwap."
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.4.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 — all from your terminal.
13
+ Multi-chain DeFi CLI — lending, DEX swaps, LP management, bridging, yield comparison.
14
14
 
15
- 2 chains: **HyperEVM** (Hyperliquid EVM, chain ID 999) and **Mantle** (chain ID 5000).
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 (`lending supply`, `swap`, `lp`, `token`, `price`, `wallet`, `bridge`). Query commands (`yield`, `status`) scan all chains by default.
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 most tokens, 6 for USDC/USDT). Use `BigInt(humanAmount * 10**decimals)` to convert.
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 # check if installed
31
- npm install -g @hypurrquant/defi-cli@latest 2>/dev/null || npx -y @hypurrquant/defi-cli@latest --json status
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 or mantle, required for tx commands) | `--dry-run` (default, safe) | `--broadcast` (executes tx) | `--fields <f1,f2>` | `--ndjson`
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 | Full Name | Chain ID |
52
- |-------|-----------|----------|
53
- | `hyperevm` | HyperEVM (Hyperliquid) | 999 |
54
- | `mantle` | Mantle | 5000 |
55
-
56
- ## Protocol Slugs
57
-
58
- ### HyperEVM Lending
59
- | Slug | Protocol | Interface |
60
- |------|----------|-----------|
61
- | `hyperlend` | HyperLend | aave_v3 |
62
- | `hypurrfi` | HypurrFi | aave_v3 |
63
- | `felix-morpho` | Felix Morpho | morpho_blue |
64
-
65
- ### HyperEVM DEX
66
- | Slug | Protocol | Interface |
67
- |------|----------|-----------|
68
- | `kittenswap` | KittenSwap | algebra_v3 |
69
- | `nest-v1` | NEST V1 | algebra_v3 |
70
- | `ramses-cl` | Ramses CL | uniswap_v3 |
71
- | `ramses-hl` | Ramses HL | solidly_v2 |
72
- | `hybra` | Hybra | solidly_v2 |
73
- | `project-x` | Project X | uniswap_v2 |
74
-
75
- ### HyperEVM Vaults / CDP
76
- | Slug | Protocol | Interface |
77
- |------|----------|-----------|
78
- | `felix` | Felix CDP | liquity_v2 |
79
- | `felix-vaults` | Felix Vaults | erc4626 |
80
- | `hyperbeat` | Hyperbeat | erc4626 |
81
- | `looping` | Looping | erc4626 |
82
- | `upshift` | Upshift | erc4626 |
83
- | `lazy-summer` | Lazy Summer | erc4626 |
84
-
85
- ### Mantle Protocols
86
- | Slug | Protocol | Interface |
87
- |------|----------|-----------|
88
- | `aave-v3-mantle` | Aave V3 Mantle | aave_v3 |
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 # compare APYs (all chains)
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 # dry-run
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: Swap (DEX Aggregator)
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 hyperevm swap --from WHYPE --to USDC --amount 1000000000000000000 # dry-run
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 hyperevm swap --from WHYPE --to USDC --amount 1000000000000000000 --broadcast
107
+ 3. defi --json --chain mantle swap --provider lifi --from MOE --to WMNT --amount <wei> --broadcast
111
108
  ```
112
109
 
113
- ## Core Workflow: LP Autopilot
110
+ ## Core Workflow: LP with Emission Claim (Merchant Moe LB)
114
111
 
115
112
  ```
116
- 1. defi --json --chain hyperevm lp discover # find pools with APR/TVL
117
- 2. [user reviews, edits ~/.defi/pools.toml with chosen pools]
118
- 3. defi --json --chain hyperevm lp autopilot --budget 1000000000 # dry-run allocation
119
- 4. [confirm with user]
120
- 5. defi --json --chain hyperevm lp autopilot --budget 1000000000 --broadcast # execute
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 # all chains USDC rates
127
- 2. defi --json --chain mantle yield --asset USDC # Mantle only
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 `hyperevm` or `mantle` |
135
- | `Protocol not found: X` | run `defi --json status` to list valid slugs |
136
- | `No route found` | swap aggregator has no route — try smaller amount or different pair |
137
- | `No prices fetched` | asset not listed in registry — use token address directly |
138
- | `Multicall failed` | RPC issueretry or check `status` |
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 yield --asset USDC
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
- **"Supply 1000 USDC to HyperLend"**
183
+ **"Show all my LP positions and pending rewards on Mantle"**
149
184
  ```bash
150
- defi --json yield --asset USDC
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
- **"Swap 1 WHYPE to USDC"**
188
+ **"Claim AERO from my Aerodrome Slipstream NFT"**
157
189
  ```bash
158
- defi --json --chain hyperevm swap --from WHYPE --to USDC --amount 1000000000000000000
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
- **"Find Mantle LP pools with rewards"**
193
+ **"Swap 1 ETH to USDC on Base via best route"**
163
194
  ```bash
164
- defi --json --chain mantle lp discover
195
+ defi --json --chain base swap --provider kyber --from WETH --to USDC --amount 1000000000000000000
165
196
  ```
166
197
 
167
- **"Bridge 100 USDC from HyperEVM to Mantle"**
198
+ **"Bridge 100 USDC from Base to Arbitrum via CCTP"**
168
199
  ```bash
169
- defi --json --chain hyperevm bridge --token USDC --amount 100000000 --to-chain mantle
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 HyperEVM"**
203
+ **"Check my portfolio on Base"**
173
204
  ```bash
174
- defi --json --chain hyperevm portfolio show --address 0xYourAddress
205
+ defi --json --chain base portfolio show --address 0xYourAddress
175
206
  ```
176
207
 
177
- **"Claim LP rewards from KittenSwap"**
208
+ **"Find all Aerodrome Slipstream emission pools sorted by APR"**
178
209
  ```bash
179
- defi --json --chain hyperevm lp claim --protocol kittenswap --pool 0xYourPool --broadcast
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.2.0",
4
- "description": "AI agent skill for defi-cli — multi-chain DeFi operations via CLI",
3
+ "version": "1.0.2",
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.2.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 and most ERC-20s use 18.
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
- ## Dashboard (read-only, safe)
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 # list all protocols for current chain
17
- defi --json --chain mantle status # list Mantle protocols
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 # lending APY comparison (default: USDC, HyperEVM)
25
- defi --json yield --asset USDT # compare for a different asset
26
- defi --json --chain mantle yield --asset USDC # Mantle lending rates
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 # oracle + DEX prices for an asset
33
- defi --json price --asset USDC --source oracle # oracle prices only
34
- defi --json price --asset WHYPE --source dex # DEX spot prices only
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 (read-only queries, then mutating)
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 first, then --broadcast)
46
- defi --json lending supply --protocol <slug> --asset <token> --amount <wei>
47
- defi --json lending supply --protocol <slug> --asset <token> --amount <wei> --on-behalf-of <addr>
48
- defi --json lending withdraw --protocol <slug> --asset <token> --amount <wei> [--to <addr>]
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 the exact amount, then supplies — all in one `--broadcast` call.
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 — KyberSwap, OpenOcean, LiquidSwap)
48
+ ## Swap (DEX aggregator — 5 providers)
54
49
 
55
50
  ```bash
56
- defi --json swap --token-in <token> --token-out <token> --amount <wei> [--slippage <bps>]
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
- Note: `swap` aggregates multiple DEX APIs for best route. Use `--broadcast` to execute.
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 # all 134 emission pools
68
- defi --json lp discover --protocol kittenswap # filter by protocol
69
- defi --json lp discover --min-apr 10 # filter by minimum APR
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 lp add --protocol <slug> --pool-address <addr> --amount-a <wei> --amount-b <wei>
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
- # Add liquidity and stake into gauge/farming for emissions
82
- defi --json lp farm --protocol <slug> --pool-address <addr> --amount-a <wei> --amount-b <wei>
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
- defi --json lp claim --protocol <slug> --pool-address <addr>
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
- # Auto-unstake (if staked) then remove liquidity
95
- defi --json lp remove --protocol <slug> --pool-address <addr>
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 # all LP positions across protocols
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 <wei> # dry-run (default)
110
- defi --json lp autopilot --budget 1000000000 --broadcast # execute
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 = "nest-v1"
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 portfolio # aggregate positions across all protocols
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 --token <token> [--owner <addr>]
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 --token <token> --spender <addr> [--amount max|<wei>]
141
- defi --json token transfer --token <token> --to <addr> --amount <wei>
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 # show configured wallet address
148
- defi --json wallet balance [--address <addr>] # native token balance
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, supports most token/chain combos)
155
- defi --json bridge --token USDC --amount 100000000 --to-chain mantle
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 (native USDC only: ethereum, avalanche, optimism, arbitrum, base, polygon)
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
  ```