{"id":47673794,"url":"https://github.com/hypurrquant/defi-cli","last_synced_at":"2026-05-01T08:01:50.682Z","repository":{"id":343626988,"uuid":"1178418461","full_name":"hypurrquant/defi-cli","owner":"hypurrquant","description":null,"archived":false,"fork":false,"pushed_at":"2026-04-01T09:38:19.000Z","size":3596,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-03T01:26:07.514Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hypurrquant.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-11T02:13:32.000Z","updated_at":"2026-04-01T09:38:23.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/hypurrquant/defi-cli","commit_stats":null,"previous_names":["hypurrquant/defi-cli"],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/hypurrquant/defi-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hypurrquant%2Fdefi-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hypurrquant%2Fdefi-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hypurrquant%2Fdefi-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hypurrquant%2Fdefi-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hypurrquant","download_url":"https://codeload.github.com/hypurrquant/defi-cli/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hypurrquant%2Fdefi-cli/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32486223,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-04-02T13:13:56.496Z","updated_at":"2026-05-01T08:01:50.672Z","avatar_url":"https://github.com/hypurrquant.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DeFi CLI\n\n```\n  ██████╗ ███████╗███████╗██╗     ██████╗██╗     ██╗\n  ██╔══██╗██╔════╝██╔════╝██║    ██╔════╝██║     ██║\n  ██║  ██║█████╗  █████╗  ██║    ██║     ██║     ██║\n  ██║  ██║██╔══╝  ██╔══╝  ██║    ██║     ██║     ██║\n  ██████╔╝███████╗██║     ██║    ╚██████╗███████╗██║\n  ╚═════╝ ╚══════╝╚═╝     ╚═╝     ╚═════╝╚══════╝╚═╝\n\n  5 chains · 39 protocols · 5 aggregators\n```\n\nMulti-chain DeFi toolkit with verified mainnet broadcast paths. Lending, LP farming, DEX swap, cross-chain bridge, yield comparison — all from your terminal. Built for humans and AI agents.\n\n## Install\n\n```bash\ngit clone https://github.com/hypurrquant/defi-cli.git\ncd defi-cli/ts\npnpm install\npnpm build\n\n# Run CLI\nnode packages/defi-cli/dist/main.js\n\n# Or link globally\npnpm -C packages/defi-cli link --global\n```\n\nRequires Node.js \u003e= 20 and pnpm.\n\n## Supported Chains\n\n| Chain | ID | Status | Protocols | Native | Notes |\n|---|---|---|---|---|---|\n| **HyperEVM** | 999 | 🟢 production | 11 | HYPE | All protocols mainnet-verified incl. emission token receipt |\n| **Mantle** | 5000 | 🟢 production | 3 | MNT | Aave V3 + Uniswap V3 + Merchant Moe LB (MOE emission verified) |\n| **Base** | 8453 | 🟢 production | 5 | ETH | Aerodrome V2/CL (AERO emission) + Uniswap V3 + Aave V3 + Compound V3 |\n| **BNB** | 56 | 🟡 staged | 16 | BNB | Read-only verified, broadcast pending |\n| **Monad** | 143 | 🟡 staged | 4 | MON | TraderJoe LB pools active, broadcast pending |\n| **Arbitrum** | 42161 | 🟡 staged | 3 | ETH | Read-only + aggregator quotes verified |\n| **Ethereum** | 1 | 🟡 staged | 6 | ETH | Read-only + aggregator quotes verified |\n\n🟢 = full lifecycle broadcast (mint/supply → claim emission → withdraw/remove)\n🟡 = configs + read-only paths verified, awaiting funded broadcast\n\n## Supported Protocols\n\n### HyperEVM (11)\n\n| Slug | Category | Interface | Notes |\n|---|---|---|---|\n| `hyperlend` | Lending | aave_v3 | Aave V3 fork |\n| `hypurrfi` | Lending | aave_v3 | Aave V3 fork |\n| `felix-morpho` | Lending | morpho_blue | MetaMorpho ERC-4626 vault routing |\n| `project-x` | DEX | uniswap_v3 | V3 fee-only |\n| `hyperswap` | DEX | uniswap_v3 | V3 fee-only |\n| `curve-hyperevm` | DEX | curve_stableswap | StableswapNG |\n| `ramses-cl` | DEX | uniswap_v3 + cl_style=\"ramses\" | x(3,3) auto-stake, NPM.getPeriodReward |\n| `ramses-hl` | DEX | solidly_v2 | ve(3,3) gauge, RAM emission |\n| `kittenswap` | DEX | algebra_v3 + farming_center | Eternal farming, KITTEN/WHYPE rewards |\n| `hybra` | DEX | hybra (V4 CL) | GaugeManager + 2-year veHYBR lock (default) |\n| `nest` | DEX | algebra_v3 | Off-chain ticket-based NEST claim |\n\n### Mantle (3)\n\n| Slug | Category | Interface | Notes |\n|---|---|---|---|\n| `aave-v3-mantle` | Lending | aave_v3 | |\n| `uniswap-v3-mantle` | DEX | uniswap_v3 | |\n| `merchantmoe-mantle` | DEX | uniswap_v2 + lb_factory + masterchef | LB hooks + MOE emission via veMOE-weighted MasterChef |\n\n### Base (5)\n\n| Slug | Category | Interface | Notes |\n|---|---|---|---|\n| `aave-v3-base` | Lending | aave_v3 | |\n| `compound-v3-base` | Lending | compound_v3 | Comet |\n| `uniswap-v3-base` | DEX | uniswap_v3 | V3 fee-only |\n| `aerodrome-base` | DEX | solidly_v2 | ve(3,3) gauge, AERO emission |\n| `aerodrome-cl` | DEX | uniswap_v3 + cl_style=\"slipstream\" | Slipstream CL with NFT gauge, AERO emission |\n\n### BNB (16)\n\n| Category | Slugs |\n|---|---|\n| Lending | `aave-v3-bnb`, `kinza-bnb`, `venus-bnb`, `venus-flux-bnb` |\n| DEX | `pancakeswap-v3-bnb` (+ MasterChef CAKE), `pancakeswap-v2-bnb`, `uniswap-v3-bnb`, `thena-v1` (Solidly), `thena-fusion` (Algebra), `biswap-bnb`, `apeswap-bnb`, `bakeryswap-bnb`, `bscswap-bnb`, `babydogeswap-bnb`, `fstswap-bnb` |\n| Vault | `beefy-bnb` |\n\n### Monad (4)\n\n| Slug | Category | Interface |\n|---|---|---|\n| `uniswap-v2-monad` | DEX | uniswap_v2 |\n| `uniswap-v3-monad` | DEX | uniswap_v3 |\n| `traderjoe-monad` | DEX | uniswap_v2 + lb_factory |\n| `morpho-blue-monad` | Lending | morpho_blue |\n\n## DEX Aggregators (Live-verified)\n\n| Aggregator | HyperEVM | Mantle | Base | BNB | Monad |\n|---|---|---|---|---|---|\n| KyberSwap | ✅ | ❌ | ✅ | ✅ | — |\n| OpenOcean | ✅ | ✅ | ✅ | ✅ | — |\n| LiquidSwap | ✅ | — | — | — | — |\n| LI.FI | ✅ | ✅ | ✅ | ✅ | — |\n| Relay | ✅ | ✅ | ✅ | ✅ | — |\n\nSlug mapping per chain lives in `chains.toml` `[chain.X.aggregators]`. LI.FI/Relay route by numeric `chain_id` (slug `\"auto\"`).\n\n## What Can It Do?\n\n### Yield comparison across chains\n\n```bash\n$ defi yield scan --asset USDC\n\n USDC Yield Scan — Best: HypurrFi Pooled on HyperEVM\n┌──────────┬───────────────────┬────────────┬────────────┐\n│ Chain    │ Protocol          │ Supply APY │ Borrow APY │\n├──────────┼───────────────────┼────────────┼────────────┤\n│ HyperEVM │ HypurrFi Pooled   │ 4.66%      │ 7.21%      │\n│ Base     │ Aave V3 Base      │ 2.50%      │ 3.72%      │\n│ Mantle   │ Aave V3 Mantle    │ 0.90%      │ 2.10%      │\n└──────────┴───────────────────┴────────────┴────────────┘\n```\n\n### Discover emission pools (sorted by APR)\n\n```bash\n$ defi --chain mantle lp discover --protocol merchantmoe-mantle --emission-only\n\n# returns Merchant Moe LB pools where moePerDay \u003e 0, sorted by APR descending\n# top: COOK/WMNT 3433% · WMNT/WETH 1534% · WETH/USDT0 767% · WMNT/USDT0 294% · …\n```\n\n### LB liquidity + auto-claim MOE\n\n```bash\n# Add LB liquidity centred ±3 bins around active\ndefi --chain mantle lp add --protocol merchantmoe-mantle \\\n  --token-a WMNT --token-b USDT0 --amount-a 1000000000000000000 --amount-b 600000 \\\n  --pool 0x03BeafC0d25BB553fCa274301832419C05269987 --num-bins 3 --broadcast\n\n# Auto-scan all my LB positions + show pending MOE per bin\ndefi --chain mantle lp positions --protocol merchantmoe-mantle\n\n# Claim — auto-detects user's actual bins (active±50 scan), not just rewarder.getRewardedRange\ndefi --chain mantle lp claim --protocol merchantmoe-mantle \\\n  --pool 0x03BeafC0d25BB553fCa274301832419C05269987 --broadcast\n```\n\n### Aerodrome Slipstream CL with AERO emission\n\n```bash\n# Mint + auto-stake into CL gauge in one command\ndefi --chain base lp farm --protocol aerodrome-cl \\\n  --token-a WETH --token-b USDC --amount-a 50000000000000 --amount-b 110000 \\\n  --range 5 --pool 0xb2cc224c1c9feE385f8ad6a55b4d94E92359DC59 --broadcast\n\n# Claim AERO; gauge.withdraw(tokenId) auto-claims pending on unstake too\ndefi --chain base lp claim --protocol aerodrome-cl \\\n  --gauge 0xF33a96b5932D9E9B9A0eDA447AbD8C9d48d2e0c8 --token-id \u003cid\u003e --broadcast\n```\n\n### DEX aggregator swap (5 providers)\n\n```bash\n# Provider auto-detect via chains.toml aggregator slugs\ndefi --chain mantle swap --provider lifi --from MOE --to WMNT --amount \u003cwei\u003e --broadcast\ndefi --chain base swap --provider kyber --from WETH --to USDC --amount \u003cwei\u003e --broadcast\ndefi --chain bnb swap --provider relay --from WBNB --to USDT --amount \u003cwei\u003e --broadcast\n```\n\n### Cross-chain bridge\n\n```bash\ndefi --chain base bridge --token USDC --amount 100000000 --to-chain ethereum --provider lifi --broadcast\n```\n\n## Command Reference\n\n| Command | Description |\n|---|---|\n| `lp discover` | Scan emission pools (gauge / LB hooks / MasterChef / Curve factory). `--emission-only` filters to active pools, sorted by APR desc. |\n| `lp add` | Add liquidity. Routes to V3 NPM, Slipstream CL, or LB router based on protocol interface |\n| `lp farm` | Add liquidity + auto-stake into gauge / LB hooks |\n| `lp claim` | Claim emission/fees. Auto-detects user's actual bins for LB |\n| `lp remove` | Auto-unstake (if staked) + remove liquidity. LB supports `--bins`/`--amounts` |\n| `lp compound` | Auto-compound for V3 fee-only positions (collect → increaseLiquidity multicall) |\n| `lp positions` | Show all active LP positions across protocols + pending rewards |\n| `lp pipeline` | Print mint→stake→claim CLI sequence for a protocol's reward_strategy |\n| `lp autopilot` | Whitelist-based budget allocation (`~/.defi/pools.toml`) |\n| `lending` | rates / position / supply / borrow / repay / withdraw |\n| `yield` | compare / scan (cross-chain) / optimize / execute |\n| `swap` | DEX aggregator swap (kyber, openocean, liquid, lifi, relay) |\n| `bridge` | Cross-chain transfer (lifi, debridge, cctp) |\n| `portfolio` | show / snapshot / pnl / history |\n| `price` | Oracle + DEX prices |\n| `wallet` | Address management |\n| `token` | balance / approve / allowance / transfer |\n| `ows` | Encrypted vault wallet (multi-chain HD derivation) |\n| `setup` | Interactive RPC + wallet wizard |\n| `status` | Chain + protocol overview |\n| `schema` | JSON schema for agent introspection |\n\n## Architecture\n\n```\ndefi-cli/\n├── ts/                              # TypeScript pnpm monorepo\n│   ├── packages/\n│   │   ├── defi-core/               # Registry, multicall, traits (13 trait interfaces)\n│   │   ├── defi-protocols/          # Protocol adapters (Aave, Uniswap, Solidly, LB, …)\n│   │   └── defi-cli/                # CLI commands (~20)\n│   └── test/\n└── ts/config/\n    ├── chains.toml                  # 5 chain configs + per-chain aggregator slug map\n    ├── tokens/\u003cchain\u003e.toml          # Per-chain token registries\n    └── protocols/\u003ccategory\u003e/*.toml  # 39 protocol configs\n```\n\n### Adapter abstraction (4-layer)\n\n```\nCLI (defi-cli)  →  Factory (createDex/createLending/createGauge/…)\n  →  Trait interface (IDex / ILending / IGauge / IGaugeSystem / IVault / …)\n  →  Adapter implementation (UniswapV3Adapter, AaveV3Adapter, SolidlyGaugeAdapter, …)\n  ←  Registry (loads TOML configs at startup, dispatches by entry.interface)\n```\n\n**Key design decisions:**\n- **Config-driven** — adding a new chain = `chains.toml` row + `tokens/\u003cchain\u003e.toml`. Adding a new protocol = TOML drop (no code if the interface is supported)\n- **Adapter polymorphism** — `UniswapV3Adapter` handles standard V3 + Slipstream + Ramses CL via `cl_style` flag; `SolidlyGaugeAdapter` handles V2 + CL gauges via `clNftMode`\n- **Aggregator chain mapping** — `chains.toml [chain.X.aggregators]` declares which aggregators support each chain (slug per provider). Add a chain → add an aggregator entry, no code change\n- **Dry-run by default** — all transactions simulated unless `--broadcast` is set; auto-approve flow checks allowance and prepends approve tx\n- **Agent-first** — every command has `--json` / `--ndjson` / `--fields`, schema introspection via `defi schema`\n\n## Global Options\n\n| Flag | Description |\n|---|---|\n| `--chain \u003cname\u003e` | Target chain (hyperevm, mantle, base, bnb, monad) |\n| `--json` | Structured JSON output |\n| `--ndjson` | Newline-delimited JSON (streaming) |\n| `--fields \u003ca,b\u003e` | Filter output to selected fields |\n| `--dry-run` | Default — simulate only |\n| `--broadcast` | Actually send the transaction |\n\n## Environment Variables\n\n| Variable | Description |\n|---|---|\n| `{CHAIN}_RPC_URL` | Override RPC URL (e.g., `MANTLE_RPC_URL`, `BASE_RPC_URL`) |\n| `DEFI_PRIVATE_KEY` | Private key for `--broadcast` |\n| `DEFI_WALLET_ADDRESS` | Default wallet address (also accepts `ows:\u003cname\u003e` for OWS vault wallets) |\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhypurrquant%2Fdefi-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhypurrquant%2Fdefi-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhypurrquant%2Fdefi-cli/lists"}