|
| 1 | +# Deep Interview Spec: Mantle CLI |
| 2 | + |
| 3 | +## Metadata |
| 4 | +- Rounds: 4 |
| 5 | +- Final Ambiguity Score: 19.5% |
| 6 | +- Type: brownfield |
| 7 | +- Generated: 2026-03-17 |
| 8 | +- Threshold: 20% |
| 9 | +- Status: PASSED |
| 10 | + |
| 11 | +## Clarity Breakdown |
| 12 | +| Dimension | Score | Weight | Weighted | |
| 13 | +|-----------|-------|--------|----------| |
| 14 | +| Goal Clarity | 0.90 | 35% | 0.315 | |
| 15 | +| Constraint Clarity | 0.70 | 25% | 0.175 | |
| 16 | +| Success Criteria | 0.75 | 25% | 0.1875 | |
| 17 | +| Context Clarity | 0.85 | 15% | 0.1275 | |
| 18 | +| **Total Clarity** | | | **0.805** | |
| 19 | +| **Ambiguity** | | | **19.5%** | |
| 20 | + |
| 21 | +## Goal |
| 22 | +Mantle 체인 전용 CLI 바이너리(`mantle`)를 기존 defi-cli workspace에 새 crate로 추가하여, Mantle Squad Bounty(~3/31)에 제출한다. `--chain` 플래그 없이 Mantle 하드코딩된 8개 핵심 커맨드를 제공하고, GitHub repo + X 스레드 + 데모 영상으로 제출한다. |
| 23 | + |
| 24 | +## Constraints |
| 25 | +- **마감**: 2026-03-31 |
| 26 | +- **코드 구조**: defi-cli workspace에 `crates/mantle-cli/` 추가. defi-core + defi-protocols 공유. |
| 27 | +- **바이너리명**: `mantle` |
| 28 | +- **체인**: Mantle만 (chain_id: 5000). `--chain` 플래그 제거. |
| 29 | +- **의존성**: defi-core, defi-protocols, reqwest, clap, serde_json, tokio, alloy |
| 30 | + |
| 31 | +## Non-Goals |
| 32 | +- 다른 체인 지원 (Mantle 전용) |
| 33 | +- 신규 프로토콜 어댑터 개발 |
| 34 | +- 웹 UI / TUI 대시보드 |
| 35 | +- 실제 트랜잭션 브로드캐스트 (dry-run/시뮬레이션 중심) |
| 36 | + |
| 37 | +## Acceptance Criteria |
| 38 | +- [ ] `cargo build --bin mantle` 로 별도 바이너리 빌드 |
| 39 | +- [ ] 8개 커맨드 동작: status, scan, swap, bridge, whales, positions, lending (rates), yield (compare) |
| 40 | +- [ ] 모든 커맨드에 `--json` 출력 지원 |
| 41 | +- [ ] `--chain` 플래그 없이 Mantle 하드코딩 |
| 42 | +- [ ] README.md: 설치법, 사용법, 스크린샷, Mantle 생태계 소개 |
| 43 | +- [ ] CI 통과 (clippy, fmt, test, build) |
| 44 | +- [ ] 데모 실행 성공: scan→alert, whales→position, swap quote, bridge quote |
| 45 | + |
| 46 | +## Assumptions Exposed & Resolved |
| 47 | +| Assumption | Challenge | Resolution | |
| 48 | +|------------|-----------|------------| |
| 49 | +| 별도 repo 필요 | 유지보수 2배 문제 | 같은 workspace, crate만 분리 | |
| 50 | +| 전체 22개 커맨드 | bounty에 불필요한 것 많음 | 핵심 8개만 | |
| 51 | +| 코드 복사 필요 | defi-core 공유 가능 | workspace dependency로 해결 | |
| 52 | + |
| 53 | +## Technical Context |
| 54 | +- 기존 defi-cli workspace: 4 crates (defi-core, defi-protocols, defi-cli, defi-mcp) |
| 55 | +- Mantle 설정: 8 protocols, 12 tokens, chain config 이미 존재 |
| 56 | +- 핵심 재사용: Registry, multicall_read(), Executor, OutputMode |
| 57 | +- 신규 작성: main.rs, commands/mod.rs (8개 커맨드 래퍼), README.md |
| 58 | + |
| 59 | +## Ontology (Key Entities) |
| 60 | + |
| 61 | +| Entity | Type | Fields | Relationships | |
| 62 | +|--------|------|--------|---------------| |
| 63 | +| MantleCLI | product | binary_name, commands[], version | uses defi-core, targets Bounty | |
| 64 | +| defi-cli | source | 22 commands, 11 chains | shares core with MantleCLI | |
| 65 | +| Bounty | external | deadline(3/31), prize($10K MNT), criteria[] | receives MantleCLI + XThread + DemoVideo | |
| 66 | +| Commands | feature set | scan, swap, bridge, whales, positions, lending, yield, status | belongs to MantleCLI | |
| 67 | +| MantleEcosystem | domain | 8 protocols, 12 tokens, chain_id=5000 | queried by Commands | |
| 68 | +| XThread | deliverable | text, screenshots, @Mantle_Official tag | part of Bounty submission | |
| 69 | +| DemoVideo | deliverable | 1-2min, scan/whales/swap/bridge demo | part of Bounty submission | |
| 70 | +| Workspace | architecture | Cargo workspace, shared crates | contains MantleCLI + defi-cli | |
| 71 | + |
| 72 | +## Ontology Convergence |
| 73 | + |
| 74 | +| Round | Entity Count | New | Changed | Stable | Stability Ratio | |
| 75 | +|-------|-------------|-----|---------|--------|----------------| |
| 76 | +| 1 | 3 | 3 | - | - | N/A | |
| 77 | +| 2 | 5 | 2 | 0 | 3 | 60% | |
| 78 | +| 3 | 7 | 2 | 0 | 5 | 71% | |
| 79 | +| 4 | 8 | 1 | 0 | 7 | 87.5% | |
| 80 | + |
| 81 | +## Implementation Plan |
| 82 | + |
| 83 | +### Phase 1: Crate 생성 (~30min) |
| 84 | +1. `crates/mantle-cli/Cargo.toml` 생성 |
| 85 | +2. `crates/mantle-cli/src/main.rs` — Mantle 하드코딩 entry point |
| 86 | +3. `crates/mantle-cli/src/commands/mod.rs` — 8개 커맨드 등록 |
| 87 | +4. 각 커맨드: defi-cli 로직 재사용, chain을 "mantle"로 고정 |
| 88 | + |
| 89 | +### Phase 2: 커맨드 구현 (~1hr) |
| 90 | +- `status` → Mantle 프로토콜 현황 |
| 91 | +- `scan` → Oracle 괴리 + 디페그 + exchange rate |
| 92 | +- `swap` → ODOS aggregator (Mantle) |
| 93 | +- `bridge` → LI.FI (from/to Mantle) |
| 94 | +- `whales` → routescan API (Mantle 무료) |
| 95 | +- `positions` → 토큰 잔고 + lending 포지션 |
| 96 | +- `lending rates` → Aave V3/Lendle 이율 |
| 97 | +- `yield compare` → 전체 프로토콜 이율 비교 |
| 98 | + |
| 99 | +### Phase 3: README + 문서 (~30min) |
| 100 | +- README.md: 설치법, 사용법, 스크린샷 |
| 101 | +- Mantle 생태계 소개 ($748M TVL, 8 protocols) |
| 102 | + |
| 103 | +### Phase 4: CI + 테스트 (~15min) |
| 104 | +- cargo build, clippy, fmt, test |
| 105 | +- 라이브 테스트 (scan, swap, bridge, whales) |
0 commit comments