Automated DeFi protocol due diligence with fully live data. Pulls TVL history, audit reports, red flags, governance activity, and community sentiment in real time, then synthesizes everything into a structured markdown report with a 0-10 risk score.
Stack: Python 3 · DeFiLlama API · GitHub API · Snapshot GraphQL · Etherscan · requests · marked.js
The first version of this agent used static template data for the web research sections. That made the reports feel hollow. This version replaces every placeholder with live API calls: audit reports sourced from known audit firm GitHub orgs, red flags derived from actual DeFiLlama hack history and Etherscan contract verification, governance data from Snapshot, and developer activity from GitHub. The reports are now genuinely useful for due diligence.
- Executive Summary Verdict, global score (0-10), top, positive signals
- On-Chain Findings TVL, multi-chain deployment, funding history, security incidents, key events
- Third-Party Intelligence Live audit reports, bug bounty info, community sentiment
- Red Flags Register Severity-ranked risk indicators derived from live data
- Data Limitations Gaps and areas needing further investigation
| Section | Source |
|---|---|
| TVL, chains, funding, hacks | DeFiLlama API |
| Audit reports | GitHub API (Trail of Bits, OpenZeppelin, Certora, Sherlock, Code4rena, and more) |
| Bug bounty | Immunefi (best-effort, degrades gracefully) |
| Red flags | DeFiLlama hack history + Etherscan contract verification |
| Governance | Snapshot GraphQL (proposal counts, voter participation) |
| Developer activity | GitHub API (commit frequency, open issues, contributors) |
pip install -r requirements.txt
python3 main.py aave
python3 main.py aave --days 90
python3 main.py uniswap --json
Reports are saved to reports/-.md.
python3 web.py
Open http://localhost:8000. Type any protocol name or use the quick-pick cards (Aave, Lido, Ethena, Uniswap, Maker). Reports render inline and can be downloaded as .md files.
main.py CLI entry point
web.py Web UI server (port 8000)
defillama.py DeFiLlama API client with caching and fuzzy resolution
report.py Structured report builder
markdown_report.py Markdown renderer
web_research.py Live web research module
requirements.txt Dependencies
reports/ Generated reports (gitignored)
- DeFiLlama data: Live
- Web research: Live (audit reports, red flags, governance, developer activity)
- Global Score: Synthesizes TVL, security, audits, and funding into a 0-10 rating
defi python due-diligence defillama tvl risk-assessment agent crypto github-api snapshot