Process perform on-chain analysis including whale tracking, token flows, and network activity.
Use when performing crypto analysis.
Trigger with phrases like "analyze crypto", "check blockchain", or "monitor market".
Analyze DeFi protocol metrics, chain-level TVL, fee revenue, DEX volumes, yield opportunities, and stablecoin market caps using DeFiLlama as the primary data source. Designed for DeFi researchers, protocol analysts, and yield farmers who need programmatic access to on-chain analytics without writing custom subgraph queries.
Prerequisites
Python 3.8+ with requests library installed
DeFiLlama API access (free, no key required for most endpoints)
Optional: CoinGecko API key for supplementary token price data
onchain_analytics.py CLI script available in the plugin directory
data_fetcher.py and metrics_calculator.py modules for programmatic usage
Instructions
Run python onchain_analytics.py protocols to retrieve the top DeFi protocols ranked by total value locked (TVL).
Filter protocol results by category using --category lending, , or to narrow the scope.
--category dex
--category "liquid staking"
Filter by chain with --chain ethereum or --chain arbitrum to isolate chain-specific protocol data.
Sort results by alternative metrics using --sort market_share or --sort tvl_to_mcap to surface undervalued protocols.
Run python onchain_analytics.py chains to retrieve chain-level TVL rankings across all tracked networks.
Run python onchain_analytics.py fees --protocol aave to pull fee and revenue data for a specific protocol.
Run python onchain_analytics.py dex --chain ethereum to analyze DEX trading volumes filtered by chain.
Run python onchain_analytics.py yields --min-tvl 5000000 --chain ethereum to identify yield opportunities above a minimum TVL threshold.
Run python onchain_analytics.py trends --threshold 5 to detect protocols with significant TVL changes (threshold is percentage).
Export results in JSON or CSV format using --format json or --format csv and redirect to file for downstream analysis.
See ${CLAUDE_SKILL_DIR}/references/implementation.md for the full four-step implementation workflow.
Output
Protocol rankings table with name, TVL, market share percentage, and TVL-to-market-cap ratio
Chain TVL rankings showing aggregate locked value per network
Fee and revenue reports per protocol with daily/weekly/monthly breakdowns
DEX volume tables with per-chain and per-DEX breakdowns
Yield opportunity listings filtered by minimum TVL and chain, including APY and pool details
Ranks all lending protocols by TVL-to-market-cap ratio (identifying potentially undervalued protocols), then pulls detailed fee and revenue data for Aave.