A data-driven tool to track stablecoin flows across blockchain ecosystems and identify "smart money" movements using DefiLlama data.
- Stablecoins are the main liquidity leg in DeFi
- When stablecoin balances move between chains, it signals capital rotation into/out of ecosystems
- Concentration in reputable venues (Aave, Curve, Maker) vs random farms = proxy for "smart money" behavior
- Combining chain-level netflows + venue-level TVL gives early signals on where serious capital is rotating
- Fetch historical stablecoin circulation data by chain
- Calculate netflows (inflows/outflows) to detect capital rotation
- Track TVL in major DeFi protocols (smart money venues)
- Generate smart money scores based on venue concentration × netflow strength
- Interactive heatmap visualizations showing chains over time
- Export data to CSV for custom analysis
pip install -r requirements.txtGenerate all visualizations and metrics:
python3 main.pyOutput saved to output/ directory:
- Interactive HTML heatmaps and charts
- CSV data files for further analysis
Quick chain analysis:
# Analyze a single chain
python3 analyze.py --chain Ethereum
# Compare multiple chains
python3 analyze.py --compare Arbitrum Base Optimism
# Show top N chains
python3 analyze.py --top 10Combines netflows (capital rotation) with concentration (% in major protocols).
High score = Strong inflows + High concentration in reputable venues (bullish signal)
Percentage of stablecoins deposited in major protocols (Aave, MakerDAO, Uniswap, etc.) vs total stablecoin supply.
High concentration = More institutional/"smart" capital Low concentration = More retail/speculative activity
Daily change in stablecoin supply, smoothed over 7-day window.
Positive = Inflows (capital entering the chain) Negative = Outflows (capital exiting the chain)
Top Smart Money Chains:
- Arbitrum (15.4) - Strong inflows + 32% concentration
- Avalanche (14.7) - Healthy growth + 31% concentration
- Base (13.4) - Massive inflows + 25% concentration
Notable Trends:
- Base seeing explosive 37% annual growth
- Ethereum losing stables to L2s (-2.3% monthly)
- Solana experiencing -9.2% outflows
- Tron dominates supply ($84B) but zero DeFi usage
See RESULTS_SUMMARY.md for detailed analysis.
stablecoin-heatmap/
├── main.py # Main analysis pipeline
├── analyze.py # Quick analysis CLI
├── src/
│ ├── config.py # Configuration
│ ├── api_client.py # DefiLlama API client
│ ├── data_processor.py # Metrics calculation
│ └── visualizer.py # Plotly visualizations
├── data/ # Cached API responses
└── output/ # Generated visualizations
QUICKSTART.md- Installation and usage guideRESULTS_SUMMARY.md- Latest analysis resultsPROJECT_STRUCTURE.md- Detailed technical documentation
Edit src/config.py to:
- Add/remove chains to track
- Change smart money protocols
- Adjust time windows and parameters
All data sourced from DefiLlama API
- Free and open API
- No authentication required
- Data cached locally for 6 hours