Multi-Agent DeFi Analytics Pipeline β 7 specialized agents, on-chain data ingestion across 9 chains, and MiMo-powered reasoning that turns raw transactions into analyst-grade reports.
DeFiPulseAI is a production-grade multi-agent orchestration system that turns raw on-chain data into actionable DeFi intelligence. It uses MiMo (Xiaomi) as the primary reasoning engine and Claude as a cross-check backend, with the Hermes Agent framework orchestrating 7 specialized agents through configurable DAGs.
| Feature | What it does | Example output |
|---|---|---|
| π Smart Money Tracker | Identify alpha wallets, score their PnL, classify behavior | "0xabcβ¦ is a swing_trader (conf 0.87), alpha 0.74" |
| π¨ Liquidation Risk Monitor | Scan Aave/Compound positions, flag HF < 1.2 | "0xdefβ¦: HF 1.05 β URGENT, ETA to liq ~12 min" |
| π Wallet Forensics | Deep multi-chain profile + LLM narrative | "Active 18 months across 4 chains; preferred protocol: Uniswap; risk: LOW" |
| π Token Unlock Calendar | Upcoming unlocks + LLM-derived dump-risk scores | "ARB unlock in 5d: 2.3% supply, impact 78/100 β high risk" |
| π° Yield Scanner | Cross-protocol APY compare + LP recommendations | "Pendle PT-USDe 14d: 22% APY, strong_yes β TVL stable, IL=0" |
graph LR
classDef agent fill:#4f46e5,stroke:#fff,color:#fff;
classDef llm fill:#dc2626,stroke:#fff,color:#fff;
classDef io fill:#059669,stroke:#fff,color:#fff;
A[IngestionAgent]:::agent --> B[TransformationAgent]:::agent
B --> C[EnrichmentAgent]:::agent
C --> D[AnalyticsAgent]:::agent
D --> E[AlertAgent]:::agent
D --> F[ReportingAgent]:::agent
G[SchedulerAgent]:::agent -.-> A
C -.uses.-> M[MiMo]:::llm
C -.cross-check.-> CL[Claude]:::llm
A -.fetches.-> AL[Alchemy / Helius / Etherscan]:::io
A -.fetches.-> DL[DefiLlama / CoinGecko / TheGraph]:::io
E -.sends.-> TG[Telegram / Discord / Slack]:::io
F -.writes.-> RP[Markdown / JSON / PDF]:::io
- IngestionAgent (~450 LOC) β pulls data from Alchemy, Helius, Etherscan, DefiLlama, CoinGecko, The Graph
- TransformationAgent (~500 LOC) β normalizes/decodes/dedupes; chain-aware tx classification
- EnrichmentAgent (~400 LOC) β LLM-driven tagging, narrative generation, dump-risk scoring (uses MiMo + Claude)
- AnalyticsAgent (~450 LOC) β Gini, HHI, impermanent loss, health factor, alpha scoring
- AlertAgent (~370 LOC) β pattern matching β Telegram / Discord / Slack webhook fan-out
- SchedulerAgent (~250 LOC) β recurring poll loops, DAG suggestions per feature
- ReportingAgent (~280 LOC) β Markdown render + structured table + metric extraction
Total: 3,400+ LOC of agent code, 6 adapters for upstream data, 5 feature wrappers, and 170+ unit tests.
git clone https://github.com/<you>/DeFiPulseAI
cd DeFiPulseAI
pip install -e ".[dev]"
cp .env.example .env # fill in keysimport asyncio
from defipulse import load_config
from defipulse.features import WalletForensics, LiquidationRiskMonitor
async def main():
config = load_config()
# 1. Deep forensic profile of a single wallet
async with await WalletForensics.from_config(config) as wf:
report = await wf.run(
"0xd8da6bf26964af9d7eed9e03e53415d37aa96045",
chains=["ethereum", "base"],
)
print(report.summary)
# 2. Liquidation risk poll across a set of borrowers
async with await LiquidationRiskMonitor.from_config(config) as lr:
at_risk = await lr.at_risk(
["0xabc...", "0xdef..."], threshold=1.2,
)
for row in at_risk:
print(f"β οΈ {row['wallet']}: HF {row['health_factor']:.2f}")
asyncio.run(main())# wallet forensics
defipulse forensics 0xabc... --chains ethereum,base
# liquidation scan
defipulse liquidation 0xabc... 0xdef...
# top alpha wallets
defipulse smart-money --chains ethereum --top 10
# yield opportunities
defipulse yields --chains ethereum --min-tvl 5000000
# upcoming token unlocks
defipulse unlocks --days 30All settings flow through .env β defipulse.core.config.load_config():
# LLM providers
MIMO_API_KEY=...
MIMO_BASE_URL=https://9router.example.com/v1 # or SwiftRouter, or direct
MIMO_MODEL=mimo-v2-flash
ANTHROPIC_API_KEY=... # cross-check backend
CLAUDE_MODEL=claude-sonnet-4-6
# Data providers
ALCHEMY_API_KEY=...
HELIUS_API_KEY=...
ETHERSCAN_API_KEY=...
COINGECKO_API_KEY=...
THE_GRAPH_API_KEY=...
# Notifications (any subset)
TELEGRAM_BOT_TOKEN=...
TELEGRAM_CHAT_ID=...
DISCORD_WEBHOOK_URL=...
SLACK_WEBHOOK_URL=...See .env.example for the full list.
| Chain | EVM? | Native | Adapter |
|---|---|---|---|
| Ethereum | β | ETH | Alchemy + Etherscan |
| Base | β | ETH | Alchemy + Etherscan |
| Arbitrum | β | ETH | Alchemy + Etherscan |
| Optimism | β | ETH | Alchemy + Etherscan |
| Polygon | β | POL | Alchemy + Etherscan |
| BSC | β | BNB | Etherscan |
| Avalanche | β | AVAX | Etherscan |
| Solana | β | SOL | Helius |
| Hyperliquid | β | USDC | (planned) |
The EnrichmentAgent is where the LLM budget is spent. Each call has a narrow, structured contract:
| Task | Prompt β Response | LLM |
|---|---|---|
| Wallet classification | "Given activity X, tag this wallet" β {tag, confidence, reason} |
MiMo |
| Forensic narrative | Multi-chain summary β 2-paragraph profile | MiMo |
| Forensic cross-check | First-draft + raw evidence β "missed any flags?" | Claude |
| Unlock dump-risk score | event metadata β {impact_score: 0-100, rationale} |
MiMo |
| Yield review | pool metadata β {recommendation, rationale} |
MiMo |
Why this matters: every LLM call has a tight JSON contract verified by complete_json(), so we never burn tokens on un-parseable output.
pytest tests/ -v # all 170+ tests
pytest tests/ --cov # with coverage
pytest -k "analytics" # filterEvery external API is mocked via httpx.MockTransport β tests run offline and finish in under 5 seconds.
DeFiPulseAI/
βββ src/defipulse/
β βββ __init__.py
β βββ cli.py
β βββ core/
β β βββ config.py
β β βββ types.py
β β βββ mimo_client.py
β β βββ claude_client.py
β β βββ hermes_runtime.py
β β βββ pipeline.py
β βββ adapters/
β β βββ base.py
β β βββ alchemy.py
β β βββ helius.py
β β βββ etherscan.py
β β βββ coingecko.py
β β βββ defillama.py
β β βββ thegraph.py
β βββ agents/
β β βββ ingestion.py
β β βββ transformation.py
β β βββ enrichment.py
β β βββ analytics.py
β β βββ alert.py
β β βββ scheduler.py
β β βββ reporting.py
β βββ features/
β β βββ smart_money.py
β β βββ liquidation_risk.py
β β βββ wallet_forensics.py
β β βββ token_unlock.py
β β βββ yield_scanner.py
β βββ utils/
β βββ cache.py
β βββ logger.py
β βββ retry.py
β βββ rate_limit.py
βββ tests/ # 170+ tests
βββ examples/ # runnable scripts
βββ demo/ # Next.js Vercel demo (web UI)
βββ README.md
- 7-agent core pipeline
- 5 feature modules
- CLI + Python API
- 170+ unit tests
- Vercel demo site
- WebSocket support for real-time alerts
- More chains: Sei, Sui, TON, Aptos
- PDF report renderer
- Backtest engine for yield strategies
- On-chain identity resolution (ENS + Lens + Farcaster + SNS)
- Governance proposal summarizer (DAO module)
MIT β see LICENSE.
- Hermes Agent framework (in-tree implementation)
- Xiaomi MiMo
- Anthropic Claude
- DefiLlama, Alchemy, Helius, Etherscan, CoinGecko, The Graph