Skip to content

Commit ca7350b

Browse files
Hiksangclaude
andcommitted
Update placeholder configs with real addresses and rewrite README
- Euler V2: add EVK vault + oracle addresses (live via HypurrFi) - Kinetiq Markets: add kmHYPE token address - Spectra V2: add 5 pool addresses (dnHYPE, USDT0, wVLP, hbHYPE, WHYPE) - README: full protocol reference with app URLs, contract addresses, status (LIVE/placeholder), and categorized tables 28 LIVE / 28 placeholder protocols Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent e26b995 commit ca7350b

4 files changed

Lines changed: 155 additions & 95 deletions

File tree

README.md

Lines changed: 144 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
# DeFi CLI
22

3-
Rust CLI for interacting with 60+ DeFi protocols on HyperEVM. Agent-first design with JSON output, schema introspection, and MCP server.
3+
Rust CLI for interacting with DeFi protocols on HyperEVM. Agent-first design with JSON output, schema introspection, and MCP server.
44

55
## Install
66

77
```bash
8-
# From source
9-
cargo install --path crates/defi-cli
10-
11-
# Or build
128
cargo build --release
139
./target/release/defi --help
1410
```
@@ -25,14 +21,20 @@ defi lending rates --protocol hyperlend --asset USDC --json
2521
# Compare yields across protocols
2622
defi yield compare --asset USDC --json
2723

28-
# Build a swap transaction (dry-run by default)
29-
defi dex swap --protocol hyperswap-v3 --token-in WHYPE --token-out USDC --amount 1.0 --json
24+
# Query asset prices from oracles
25+
defi price --asset WHYPE --json
26+
27+
# Check health factor / lending position
28+
defi lending position --protocol hyperlend --address 0x... --json
3029

31-
# Supply to lending pool (dry-run)
32-
defi lending supply --protocol hyperlend --asset USDC --amount 100.0 --json
30+
# Felix CDP trove info
31+
defi cdp info --protocol felix --position <trove_id> --json
3332

34-
# Stake HYPE for kHYPE (dry-run)
35-
defi staking stake --protocol kinetiq --amount 10.0 --json
33+
# Staking info (exchange rate, TVL)
34+
defi staking info --protocol kinetiq --json
35+
36+
# Build a swap transaction (dry-run by default)
37+
defi dex swap --protocol hyperswap-v2 --token-in WHYPE --token-out USDC --amount 1.0 --json
3638

3739
# Actually broadcast (requires DEFI_PRIVATE_KEY)
3840
export DEFI_PRIVATE_KEY=0x...
@@ -43,68 +45,127 @@ defi lending supply --protocol hyperlend --asset USDC --amount 100.0 --broadcast
4345

4446
| Command | Description |
4547
|---------|-------------|
46-
| `status` | Chain info and protocol list (`--verify` for on-chain check) |
48+
| `status` | Chain info and protocol list |
4749
| `schema` | JSON Schema for any action (agent-friendly) |
4850
| `dex` | `swap`, `quote`, `compare` |
4951
| `lending` | `supply`, `borrow`, `repay`, `withdraw`, `rates`, `position` |
5052
| `cdp` | `open`, `adjust`, `close`, `info` |
51-
| `bridge` | `send`, `quote` |
5253
| `staking` | `stake`, `unstake`, `info` |
5354
| `vault` | `deposit`, `withdraw`, `info` |
55+
| `gauge` | `deposit`, `withdraw`, `claim`, `lock`, `vote` (ve(3,3)) |
5456
| `yield` | `compare`, `optimize` |
55-
| `wallet` | `balance` |
57+
| `price` | Oracle and DEX price queries |
5658
| `token` | `balance`, `approve`, `allowance`, `transfer` |
59+
| `wallet` | `balance` |
5760
| `agent` | JSON stdin batch mode for AI agents |
5861

59-
## Output Modes
60-
61-
```bash
62-
--json # JSON output
63-
--ndjson # Newline-delimited JSON
64-
--fields a,b # Filter output fields
65-
```
66-
67-
## Safety
68-
69-
- All mutation operations default to `--dry-run`
70-
- Use `--broadcast` to actually send transactions
71-
- Requires `DEFI_PRIVATE_KEY` environment variable for broadcast
72-
73-
## Agent Mode
74-
75-
Send JSON commands via stdin:
76-
77-
```bash
78-
echo '{"action":"dex.swap","params":{"protocol":"hyperswap-v3","token_in":"WHYPE","token_out":"USDC","amount":"1.0"}}' | defi agent
79-
```
80-
81-
Available actions: `status`, `list_protocols`, `schema`, `dex.swap`, `dex.quote`, `lending.supply`, `lending.borrow`, `lending.repay`, `lending.withdraw`, `staking.stake`, `staking.unstake`, `vault.deposit`, `vault.withdraw`, `cdp.open`
82-
83-
## MCP Server
84-
85-
Run as an MCP server for AI agent integration:
86-
87-
```bash
88-
defi-mcp
89-
```
90-
91-
Exposes 7 tools: `defi_status`, `defi_list_protocols`, `defi_dex_swap`, `defi_lending_supply`, `defi_lending_rates`, `defi_staking_stake`, `defi_vault_deposit`
92-
93-
## Supported Protocols (60)
94-
95-
| Category | Count | Protocols |
96-
|----------|-------|-----------|
97-
| DEX | 15 | HyperSwap V3/V2, Project X, KittenSwap, NEST, Curve, Balancer V3, Ring Few, Ramses CL/HL, WOOFi, Valantis, Wombat, Hybra, Hyperliquid Spot |
98-
| Lending | 8 | HyperLend, Morpho, Euler V2, HypurrFi, TermMax, Hyperdrive, HypurrFi Isolated, Teller |
99-
| Liquid Staking | 4 | Kinetiq (kHYPE), stHYPE, Hyperbeat LST, Kintsu |
100-
| CDP | 2 | Felix, Parallel |
101-
| Bridge | 4 | Hyperliquid Bridge, Hyperlane, SoDEX, Symbiosis |
102-
| Yield Source | 10 | Pendle, Spectra, Penpie, Felix USDhl, Equilibria, Looped Hype, GrowiHF, Harmonix, HyperWave, Wrapped HLP |
103-
| Yield Aggregator | 4 | Beefy, Hyperbeat Earn, Kinetiq Earn, Lazy Summer |
104-
| Vault | 4 | Veda, Upshift, Felix Vaults, D2 Finance |
105-
| Derivatives | 3 | Hyperliquid HLP, Derive V2, Kinetiq Markets |
106-
| Options | 2 | Rysk V12, Hypersurface |
107-
| Other | 4 | Steer, Liminal, Altura, Rumpel |
62+
## Supported Protocols
63+
64+
### DEX (15) — all LIVE
65+
66+
| Protocol | Interface | App | Contracts |
67+
|----------|-----------|-----|-----------|
68+
| HyperSwap V3 | uniswap_v3 || router: `0x4E2960a8cd19B467b82d26D83fAcb0fAE26b094D` |
69+
| HyperSwap V2 | uniswap_v2 || router: `0xb4a9C4e6Ea8E2191d2FA5B380452a634Fb21240A` |
70+
| KittenSwap Algebra | algebra_v3 | [kittenswap.finance](https://kittenswap.finance) | router: `0x4e73E421480a7E0C24fB3c11019254edE194f736` |
71+
| NEST V1 | algebra_v3 | [app.nest.exchange](https://app.nest.exchange) | router: `0xaA26B8e5Cadd04430c32787eCC3AA325e99681e9` |
72+
| Project X | uniswap_v3 || router: `0x1EbDFC75FfE3ba3de61E7138a3E8706aC841Af9B` |
73+
| Ramses CL | solidly_cl | [app.ramses.exchange](https://app.ramses.exchange) | router: `0x76D91074B46fF76E04FE59a90526a40009943fd2` |
74+
| Ramses HL | solidly_v2 | [app.ramses.exchange](https://app.ramses.exchange) | router: `0xdcC44285fBc236457A5cd91C2f77AD8421B0D8ED` |
75+
| Ring Few | solidly_v2 || router: `0x701D1d675415efA2d2429fB122ccC6dD4FCcA959` |
76+
| Curve DEX | curve_stableswap | [curve.fi](https://curve.fi) | factory: `0x5eeE3091f747E60a045a2E715a4c71e600e31F6E` |
77+
| Balancer V3 | balancer_v3 | [balancer.fi](https://balancer.fi) | vault: `0xbA1333333333a1BA1108E8412f11850A5C319bA9` |
78+
| WOOFi Swap | woofi | [fi.woo.org](https://fi.woo.org) | router: `0x4c4AF8DBc524681930a27b2F1Af5bcC8062E6fB7` |
79+
| Valantis STEX | valantis || router: `0x5Abe35DDb420703bA6Dd7226ACDCb24be71192e5` |
80+
| Wombat Exchange | wombat || router: `0x7Afa6bEecBdfA7b8c9d0E1F2a3B4C5D6E7F8a9b0` |
81+
| Hybra V4 | hybra || router: `0xCAfDa2b3E5c2B5E30f6d67FEFa5AfFD3f6a93b0a` |
82+
| Hyperliquid Spot | orderbook_api | [app.hyperliquid.xyz](https://app.hyperliquid.xyz) ||
83+
84+
### Lending (8)
85+
86+
| Protocol | Interface | Status | App | Key Contract |
87+
|----------|-----------|--------|-----|-------------|
88+
| HyperLend | aave_v3 | LIVE | [app.hyperlend.finance](https://app.hyperlend.finance) | pool: `0x00A89d7a5A02160f20150EbEA7a2b5E4879A1A8b` |
89+
| HypurrFi Pooled | aave_v3 | LIVE | [app.hypurr.fi](https://app.hypurr.fi) | pool: `0xceCcE0EB9DD2Ef7996e01e25DD70e461F918A14b` |
90+
| Felix Morpho | morpho_blue | LIVE | [usefelix.xyz/lend](https://www.usefelix.xyz/lend) | morpho: `0x68e37dE8d93d3496ae143F2E900490f6280C57cD` |
91+
| Euler V2 | euler_v2 | LIVE | [app.euler.finance](https://app.euler.finance) | evk_vault: `0xac207ffa0bfce194db18d1820902d48a2d948968` |
92+
| HypurrFi Isolated | aave_v3 | LIVE | [app.hypurr.fi/markets/isolated](https://app.hypurr.fi/markets/isolated) | — (Fraxlend fork, addresses TBD) |
93+
| TermMax | termmax ||||
94+
| Hyperdrive HL | hyperdrive ||||
95+
| Teller | teller ||||
96+
97+
### Liquid Staking (4) — all LIVE
98+
99+
| Protocol | Interface | App | Key Contract |
100+
|----------|-----------|-----|-------------|
101+
| Kinetiq | kinetiq_staking | [kinetiq.xyz](https://kinetiq.xyz) | staking: `0x393D0B87Ed38fc779FD9611144aE649BA6082109`, kHYPE: `0xfD739d4e423301CE9385c1fb8850539D657C296D` |
102+
| stHYPE | sthype_staking || staking: `0xB96f07367e69e86d6e9C3F29215885104813eeAE`, stHYPE: `0xfFaa4a3D97fE9107Cef8a3F48c069F577Ff76cC1` |
103+
| Hyperbeat LST | hyperbeat_lst || staking: `0xCeaD893b162D38e714D82d06a7fe0b0dc3c38E0b`, beHYPE: `0xd8FC8F0b03eBA61F64D08B0bef69d80916E5DdA9` |
104+
| Kintsu | kintsu || staking: `0xDDC126c12F9F8DF5a6fC273f6D43C1E21b4d2945`, sHYPE: `0xBeF0142A0955a7d5dcCe5C2A13Fb84E332669D2d` |
105+
106+
### CDP (2)
107+
108+
| Protocol | Interface | Status | App | Key Contract |
109+
|----------|-----------|--------|-----|-------------|
110+
| Felix | liquity_v2 | LIVE | [usefelix.xyz/borrow](https://www.usefelix.xyz/borrow) | borrower_ops: `0xadfba621a75beced7dd1727b2067047b7eeedc8b`, trove_mgr: `0x58446c58caa8a6f6cc8be343f812ebf0b997c001`, feUSD: `0x02c6a2fA58cC01A18B8D9E00eA48d65E4dF26c70` |
111+
| Parallel Protocol V3 | parallel ||||
112+
113+
### Vault (4)
114+
115+
| Protocol | Interface | Status | App | Key Contract |
116+
|----------|-----------|--------|-----|-------------|
117+
| Felix Vaults | erc4626 | LIVE | [usefelix.xyz/lend](https://www.usefelix.xyz/lend) | feHYPE: `0x2900ABd73631b2f60747e687095537B673c06A76`, feUSDC: `0x8A862fD6c12f9ad34C9c2ff45AB2b6712e8CEa27` |
118+
| Upshift | erc4626 | LIVE | [app.upshift.fi](https://app.upshift.fi) | — (addresses TBD) |
119+
| Veda | erc4626 | LIVE (infra) || Powers Kinetiq Earn / Mizu vaults |
120+
| D2 Finance | erc4626 | LIVE | [d2.finance](https://d2.finance) | — (addresses TBD) |
121+
122+
### Yield Source (10)
123+
124+
| Protocol | Interface | Status | App | Key Contract |
125+
|----------|-----------|--------|-----|-------------|
126+
| Pendle | pendle_v2 | LIVE | [app.pendle.finance](https://app.pendle.finance) | router: `0x888888888889758F76e7103c6CbF23ABbF58F946` |
127+
| Spectra V2 | spectra | LIVE | [app.spectra.finance](https://app.spectra.finance) | 5 pools (dnHYPE, USDT0, wVLP, hbHYPE, WHYPE) |
128+
| Penpie | penpie ||||
129+
| Felix USDhl | erc4626 ||||
130+
| Equilibria | equilibria ||||
131+
| Looped Hype | erc4626 ||||
132+
| GrowiHF | growi ||||
133+
| Harmonix Finance | harmonix ||||
134+
| HyperWave | erc4626 ||||
135+
| Wrapped HLP | erc4626 ||||
136+
137+
### Yield Aggregator (4)
138+
139+
| Protocol | Interface | Status | App |
140+
|----------|-----------|--------|-----|
141+
| Beefy | beefy_vault | LIVE | [app.beefy.com](https://app.beefy.com) |
142+
| Lazy Summer | erc4626 | LIVE | [summer.fi](https://summer.fi) |
143+
| Hyperbeat Earn | erc4626 |||
144+
| Kinetiq Earn | erc4626 |||
145+
146+
### Derivatives (3)
147+
148+
| Protocol | Interface | Status | App | Key Contract |
149+
|----------|-----------|--------|-----|-------------|
150+
| Kinetiq Markets | kinetiq_markets | LIVE | [kinetiq.xyz](https://kinetiq.xyz) | kmHYPE: `0x360C140E5344A1A0593D44B4ea6Fc7C3DAf0C473` |
151+
| Derive V2 | derive_v2 | LIVE (bridge vault) | [derive.xyz](https://derive.xyz) | Core on Derive Chain |
152+
| Hyperliquid HLP | hlp_vault ||||
153+
154+
### Options (2)
155+
156+
| Protocol | Interface | Status |
157+
|----------|-----------|--------|
158+
| Rysk V12 | rysk ||
159+
| Hypersurface | hypersurface ||
160+
161+
### Other (4)
162+
163+
| Protocol | Interface | Status |
164+
|----------|-----------|--------|
165+
| Steer Protocol | steer ||
166+
| Liminal | liminal ||
167+
| Altura | altura ||
168+
| Rumpel Labs | rumpel ||
108169

109170
## Architecture
110171

@@ -114,41 +175,38 @@ defi-cli/
114175
config/ # TOML protocol registry (compiled in)
115176
crates/
116177
defi-core/ # Traits, types, registry, provider
117-
defi-protocols/ # Protocol adapters (23 implementations)
178+
defi-protocols/ # Protocol adapters
118179
defi-cli/ # CLI binary
119180
defi-mcp/ # MCP server binary
120-
SKILL.md # AI agent usage guide
121181
```
122182

123-
## Tech Stack
183+
## Gas Optimization
124184

125-
| Role | Choice |
126-
|------|--------|
127-
| Language | Rust |
128-
| EVM | alloy (`sol!` macro for compile-time ABI) |
129-
| CLI | clap (derive) |
130-
| Async | tokio |
131-
| Serialization | serde + serde_json |
132-
| Config | TOML (embedded at compile time) |
133-
| Error | thiserror |
185+
- EIP-1559 gas pricing (auto-fetches baseFee + priorityFee)
186+
- 20% gas buffer on estimates to prevent out-of-gas
187+
- Dynamic `eth_estimateGas` in both simulation and broadcast modes
134188

135-
## Development
189+
## Safety
136190

137-
```bash
138-
# Build
139-
cargo build
191+
- All mutation operations default to `--dry-run`
192+
- Use `--broadcast` to actually send transactions
193+
- Requires `DEFI_PRIVATE_KEY` environment variable for broadcast
194+
- Transaction simulation via `eth_call` before broadcast
140195

141-
# Check
142-
cargo check
196+
## Agent Mode
143197

144-
# Lint
145-
cargo clippy
198+
```bash
199+
echo '{"action":"dex.swap","params":{"protocol":"hyperswap-v2","token_in":"WHYPE","token_out":"USDC","amount":"1.0"}}' | defi agent
200+
```
146201

147-
# Test on fork
148-
anvil --fork-url https://rpc.hyperliquid.xyz/evm --port 8546
149-
# Then update config/chains.toml rpc_url to http://localhost:8546
202+
## MCP Server
203+
204+
```bash
205+
defi-mcp
150206
```
151207

208+
Exposes tools: `defi_status`, `defi_list_protocols`, `defi_dex_swap`, `defi_lending_supply`, `defi_lending_rates`, `defi_staking_stake`, `defi_vault_deposit`
209+
152210
## License
153211

154212
MIT

config/protocols/derivatives/kinetiq_markets.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ category = "derivatives"
55
interface = "kinetiq_markets"
66
chain = "hyperevm"
77
native = true
8-
description = "Kinetiq Markets — native derivatives markets, TVL $31M"
8+
description = "Kinetiq Markets — onchain perp futures DEX (equities, indices, FX, commodities)"
99

1010
[protocol.contracts]
11-
markets = "0x0000000000000000000000000000000000000001"
11+
kmhype = "0x360C140E5344A1A0593D44B4ea6Fc7C3DAf0C473"
Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
1-
# WARNING: Euler V2 is NOT deployed on HyperEVM as of 2026-03-13 (confirmed via protocol discovery)
2-
# Placeholder addresses retained; do not use until deployment is confirmed
31
[protocol]
42
name = "Euler V2"
53
slug = "euler-v2"
64
category = "lending"
75
interface = "euler_v2"
86
chain = "hyperevm"
97
native = false
10-
description = "Euler V2 — modular lending protocol with customizable risk parameters, TVL $523M"
8+
description = "Euler V2 — modular lending (EVK + EVC) via HypurrFi partnership"
119

1210
[protocol.contracts]
13-
euler = "0x0000000000000000000000000000000000000001"
14-
markets = "0x0000000000000000000000000000000000000002"
11+
evk_vault = "0xac207ffa0bfce194db18d1820902d48a2d948968"
12+
oracle = "0x692aa5a8E27D7654324618Ee65d7cd4931c39DE9"

config/protocols/yield_source/spectra.toml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@ category = "yield_source"
55
interface = "spectra"
66
chain = "hyperevm"
77
native = false
8-
description = "Spectra V2 — yield tokenization protocol, TVL $32M"
8+
description = "Spectra V2 — yield tokenization and fixed-rate trading"
99

1010
[protocol.contracts]
11-
router = "0x0000000000000000000000000000000000000001"
11+
pool_dnhype = "0xd133b055f9d7ba60049e4c5a455bfe32c109517f"
12+
pool_usdt0 = "0x94b2150c358ac42d2ccc651d554fb3217cfce925"
13+
pool_wvlp = "0x9307c7199bcf136d28ea51115c69ea158ff351f5"
14+
pool_hbhype = "0x7f20f09ea0156b3302ef1752d61fcd56075681a6"
15+
pool_whype = "0xb84402d5b48656e8deb39ad57d0cc3d4073e2e8e"

0 commit comments

Comments
 (0)