mantis/
├── engine/
│ ├── index.ts ← entry point + scan loop
│ ├── config.ts ← Zod-validated env config
│ ├── types.ts ← all shared interfaces
│ ├── logger.ts ← structured logger + JSONL audit trail
│ ├── memory/
│ │ └── store.ts ← ChromaDB wrapper, TTL, cosine merge
│ ├── adapters/
│ │ └── meteora.ts ← Meteora DLMM SDK + Helius RPC calls
│ ├── probes/
│ │ └── dlmm.ts ← fee/IL ratio, volume auth, bin utilization
│ ├── risk/
│ │ └── gate.ts ← confidence gate, drawdown, position caps
│ └── tools/
│ └── index.ts ← 7 MCP tools exposed to Claude agent
├── ops/
│ ├── setup.ts ← interactive .env wizard
│ └── backtest.ts ← historical simulation
├── bench/
│ ├── strategy.test.ts
│ └── risk.test.ts
├── .agents/skills/
│ └── dlmm-rebalancer.md
└── .github/workflows/
└── ci.yml
SCAN (every 10 min)
└─ For each pool in WATCHLIST_POOLS:
1. memory_query ← retrieve past patterns/warnings
2. meteora_get_pool_state
3. meteora_get_bin_array
4. volume_authenticity_check
5. [optional] meteora_simulate_rebalance
6. memory_write ← persist new observation
7. meteora_decision ← intercepted: HOLD | REBALANCE | EXIT | ENTER
└─ RiskEngine.evaluate()
└─ [PAPER] log | [LIVE] execute
└─ memory.recordOutcome()
Entries with cosine similarity > 0.70 are merged instead of duplicated.