DefiLlama Data Aggregator is a professional-grade command-line tool that provides unified access to DefiLlama's comprehensive DeFi data. It supports querying Total Value Locked (TVL), protocol data, chain statistics, and yield pool information with built-in security validation and error handling.
- β DeFi TVL - Total DeFi TVL and chain-level TVL
- β Protocol Data - Protocol details, listings, and rankings
- β Chain Data - Individual chain TVL and statistics
- β Yield Pools - Yield rate queries and filtering
- β Health Monitoring - API health status monitoring
- β Security Validation - Input sanitization and error handling
- β Flexible Output - Pretty/Table/JSON/CSV formats
- Node.js >= 16.0.0
- npm (comes with Node.js)
cd /workspace/projects/workspace/skills/defillama-data-aggregator
npm installnpm linkThis creates a global defillama-data command that you can use from anywhere.
# View version
defillama-data --version
# Get total DeFi TVL
defillama-data defillama tvl
# Get protocol TVL
defillama-data defillama protocol -n aave
# Get protocol rankings
defillama-data defillama protocols --limit 10 --sort tvl -f table
# Find high-yield pools
defillama-data defillama yields --min-apy 10 --limit 20 -f table
# Check API health
defillama-data health
# View system status
defillama-data statusGet the total value locked across all DeFi protocols.
defillama-data defillama tvl [options]Options:
-f, --format <type>: Output format (json, table, csv, pretty) - Default: pretty
Example:
defillama-data defillama tvl
defillama-data defillama tvl -f json | jq '.totalTvl'Response:
{
"totalTvl": 94518602394.26,
"chains": [...],
"timestamp": "2026-03-27T09:00:00.000Z"
}Get TVL for a specific protocol.
defillama-data defillama protocol -n <name> [options]Required Options:
-n, --name <name>: Protocol name (e.g., aave, uniswap, compound)
Options:
-f, --format <type>: Output format (json, table, csv, pretty) - Default: pretty
Example:
defillama-data defillama protocol -n aave
defillama-data defillama protocol -n uniswap -f jsonValidation Rules:
- Only alphanumeric characters and hyphens allowed
- Length: 1-50 characters
- Automatically converted to lowercase
Valid Examples: aave, uniswap-v3, compound-protocol
Invalid Examples: aave<script>, uni/swap, aave&x
Get a list of all protocols with filtering and sorting.
defillama-data defillama protocols [options]Options:
-c, --category <name>: Filter by category (e.g., lending, dex)--min-tvl <amount>: Minimum TVL in USD--limit <number>: Limit results (1-500)--sort <field>: Sort by field (tvl) - Default: tvl-f, --format <type>: Output format (json, table, csv, pretty) - Default: pretty
Example:
# Get all protocols
defillama-data defillama protocols
# Sort by TVL, top 20
defillama-data defillama protocols --sort tvl --limit 20
# Filter lending protocols
defillama-data defillama protocols -c lending --min-tvl 100000000
# Combined filters
defillama-data defillama protocols -c lending --min-tvl 100000000 --limit 50 --sort tvl -f tableGet TVL for a specific blockchain.
defillama-data defillama chain -n <name> [options]Required Options:
-n, --name <name>: Chain name (e.g., ethereum, solana, polygon)
Options:
-f, --format <type>: Output format (json, table, csv, pretty) - Default: pretty
Example:
defillama-data defillama chain -n ethereum
defillama-data defillama chain -n solana -f jsonGet yield pool information with filtering.
defillama-data defillama yields [options]Options:
--min-apy <number>: Minimum APY percentage (0-1000)--min-tvl <number>: Minimum TVL in USD--chain <name>: Filter by chain name (e.g., ethereum, arbitrum)--stablecoin: Filter stablecoin pools only--limit <number>: Limit results (1-500)-f, --format <type>: Output format (json, table, csv, pretty) - Default: pretty
Example:
# Get all yield pools
defillama-data defillama yields
# High APY pools (APY > 10%)
defillama-data defillama yields --min-apy 10
# Ethereum high-yield pools
defillama-data defillama yields --chain ethereum --min-apy 5
# Combined filters
defillama-data defillama yields --min-apy 10 --chain ethereum --min-tvl 1000000 --limit 20 -f tableCheck API health status.
defillama-data health [options]Options:
-q, --quiet: Quiet mode (summary only)--timeout <ms>: Request timeout in milliseconds - Default: 5000
Example:
# Full health check
defillama-data health
# Quiet mode
defillama-data health --quiet
# Custom timeout
defillama-data health --timeout 10000Display system status and available platforms.
defillama-data statusExample:
defillama-data status# Copy example configuration
cp config/keys.example.js config/keys.js// config/keys.js
module.exports = {
defillama: {
baseUrl: 'https://api.llama.fi'
},
settings: {
defaultCacheDuration: 300, // Cache duration in seconds
timeout: 30000, // Request timeout in milliseconds
maxRetries: 3, // Maximum retry attempts
retryDelay: 1000, // Retry delay in milliseconds
debug: process.env.DEBUG === 'true' // Enable debug logging
}
};# Get top 10 lending protocols by TVL
defillama-data defillama protocols -c lending --limit 10 --sort tvl -f table# Find high-yield pools on Ethereum with APY > 10%
defillama-data defillama yields --chain ethereum --min-apy 10 --min-tvl 1000000 --limit 20 -f table# Compare TVL across multiple chains
for chain in ethereum solana polygon arbitrum avalanche; do
echo "=== $chain ==="
defillama-data defillama chain -n $chain -f json | jq '.tvl'
done# Export protocols to CSV
defillama-data defillama protocols --limit 100 -f csv > protocols.csv
# Export yields to CSV
defillama-data defillama yields --limit 100 -f csv > yields.csv| Document | Description |
|---|---|
| README.md | User manual (this file) |
| SKILL.md | Skill technical documentation |
| QUICK_REFERENCE.md | Quick reference card |
| FULL_FEATURE_LIST.md | Complete feature list |
| DEPLOYMENT_CHECKLIST.md | Deployment checklist |
| LAUNCH_REPORT.md | Launch report |
For detailed DefiLlama API documentation: