Claude-code-plugins-plus-skills analyzing-on-chain-data
install
source · Clone the upstream repo
git clone https://github.com/jeremylongshore/claude-code-plugins-plus-skills
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/jeremylongshore/claude-code-plugins-plus-skills "$T" && mkdir -p ~/.claude/skills && cp -r "$T/plugins/crypto/on-chain-analytics/skills/analyzing-on-chain-data" ~/.claude/skills/jeremylongshore-claude-code-plugins-plus-skills-analyzing-on-chain-data && rm -rf "$T"
manifest:
plugins/crypto/on-chain-analytics/skills/analyzing-on-chain-data/SKILL.mdsource content
Analyzing On-Chain Data
Overview
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
library installedrequests - DeFiLlama API access (free, no key required for most endpoints)
- Optional: CoinGecko API key for supplementary token price data
CLI script available in the plugin directoryonchain_analytics.py
anddata_fetcher.py
modules for programmatic usagemetrics_calculator.py
Instructions
- Run
to retrieve the top DeFi protocols ranked by total value locked (TVL).python onchain_analytics.py protocols - Filter protocol results by category using
,--category lending
, or--category dex
to narrow the scope.--category "liquid staking" - Filter by chain with
or--chain ethereum
to isolate chain-specific protocol data.--chain arbitrum - Sort results by alternative metrics using
or--sort market_share
to surface undervalued protocols.--sort tvl_to_mcap - Run
to retrieve chain-level TVL rankings across all tracked networks.python onchain_analytics.py chains - Run
to pull fee and revenue data for a specific protocol.python onchain_analytics.py fees --protocol aave - Run
to analyze DEX trading volumes filtered by chain.python onchain_analytics.py dex --chain ethereum - Run
to identify yield opportunities above a minimum TVL threshold.python onchain_analytics.py yields --min-tvl 5000000 --chain ethereum - Run
to detect protocols with significant TVL changes (threshold is percentage).python onchain_analytics.py trends --threshold 5 - Export results in JSON or CSV format using
or--format json
and redirect to file for downstream analysis.--format csv
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
- Trending protocol alerts showing TVL percentage changes above the configured threshold
- Stablecoin market cap summaries
- JSON (
) or CSV (output.json
) export files for programmatic consumptionoutput.csv
Error Handling
| Error | Cause | Solution |
|---|---|---|
| DeFiLlama API slow or unreachable | Wait and retry; check https://status.llama.fi/ for outages; use cached data if available |
| Protocol slug does not match DeFiLlama database | Run to find the exact slug; slugs are case-sensitive |
| Filter too restrictive or data unavailable | Remove filters and retry; verify the category or chain exists; try a broader time range |
| New protocols or data collection gaps | Check DeFiLlama directly; data typically appears within 24 hours of listing |
| Local cache not refreshed | Clear cache with ; use to check cache status |
| Output truncated for readability | Use to increase count or for full untruncated data |
| Terminal encoding mismatch | Use for safe output or set |
Examples
Daily DeFi Overview
python onchain_analytics.py protocols --limit 20 python onchain_analytics.py chains python onchain_analytics.py trends
Produces a snapshot of the top 20 protocols by TVL, all chain rankings, and any protocols trending above the default threshold.
Research a Lending Protocol
python onchain_analytics.py protocols --category lending --sort tvl_to_mcap python onchain_analytics.py fees --protocol aave
Ranks all lending protocols by TVL-to-market-cap ratio (identifying potentially undervalued protocols), then pulls detailed fee and revenue data for Aave.
Find High-TVL Yield Opportunities on Ethereum
python onchain_analytics.py yields --min-tvl 10000000 --chain ethereum --limit 50 # 10000000 = 10M limit
Returns up to 50 yield pools on Ethereum with at least $10M in TVL, sorted by APY. Export with
--format csv > yields.csv for spreadsheet analysis.
Resources
- DeFiLlama API Documentation -- primary data source for TVL, fees, yields, and DEX volumes
- DeFiLlama Status Page -- check API availability and outage reports
- CoinGecko API -- supplementary token price and market cap data
- Dune Analytics -- custom SQL queries against on-chain data for deeper analysis
- The Graph -- decentralized indexing protocol for querying blockchain data via GraphQL