DeFi Llama Node
The DeFi Llama node pulls DeFi analytics into your workflow — Total Value Locked (TVL) for protocols and chains, pool yields and APY rates, stablecoin supply, DEX volumes, and protocol fee/revenue data. Use it to monitor protocol health, optimize yield strategies, generate TVL-based trading signals, or build dashboards over the broader DeFi ecosystem. The data comes from DeFi Llama ↗, a free public API that requires no API key.
Configuration
General
Give this node a custom name to identify it in your workflow
Continue workflow if this node fails
DeFi Llama
Free DeFi data — no API key required
Type of DeFi data to fetch
Protocol slug from defillama.com (e.g. aave, uniswap, lido)
Chain name (e.g. ethereum, arbitrum, polygon, base)
Time & Data
Configure time range and result size
Max number of results returned (1–500)
Why DeFi Data Matters
On-chain DeFi metrics tell you what is actually happening with capital, not just what prices say. Each query type unlocks a different layer:
- Protocol TVL measures the dollar value locked in a single protocol over time. Sharp inflows often precede price moves; sharp outflows can signal a loss of confidence or a security incident.
- Chain TVL shows the total liquidity hosted on a blockchain. Comparing chain TVL trajectories surfaces which ecosystems are gaining or losing share.
- Yields / APY lists every tracked liquidity pool with its current APY, base yield, reward yield, and TVL. Useful for yield optimization and ranking opportunities by risk.
- Stablecoins tracks circulating supply by issuer (USDT, USDC, DAI, etc.). Supply expansion is a leading indicator of capital entering crypto.
- DEX Volumes ranks decentralized exchanges by trading volume across multiple windows (24h, 7d, 30d, all-time).
- Fees & Revenue measures protocol monetization. A protocol generating real fees is fundamentally healthier than one subsidized purely by token emissions.
Feed this data into an LLM or Function node to build workflows that react to fundamentals rather than just price action.
Configuration
| Field | Description |
|---|---|
| Query Type | Which DeFi Llama dataset to fetch (see table below). Default: Protocol TVL. |
| Protocol | The DeFi Llama protocol slug (e.g. aave, uniswap, lido). Required for Protocol TVL; optional filter for Yields. Find slugs at defillama.com/protocols ↗. Supports {edgeLabel.field} interpolation via the f(x) toggle. |
| Chain | The chain name (e.g. ethereum, arbitrum, polygon, base). Required for Chain TVL; optional filter for Yields, DEX Volumes, and Fees & Revenue. Supports the f(x) toggle for dynamic values. |
| Time Range | Historical window for time-series data: 7d, 30d (default), 90d, 180d, 365d, or all time. Only applies to Protocol TVL and Chain TVL. |
| Data Points Limit | Maximum number of results to return. Range: 1–500. Default: 100. |
Query Types
| Query Type | Description | Protocol Field | Chain Field |
|---|---|---|---|
| Protocol TVL | Historical TVL and metadata for one protocol | Required | — |
| Chain TVL | Historical TVL for one blockchain | — | Required |
| Yields / APY | All tracked liquidity pools with APY data | Optional filter | Optional filter |
| Stablecoins | Stablecoin issuers ranked by circulating supply | — | — |
| DEX Volumes | Decentralized exchanges ranked by volume | — | Optional filter |
| Fees & Revenue | Protocols ranked by fees / revenue | — | Optional filter |
Finding the Right Slug
Protocol slugs are not always obvious — DeFi Llama uses lowercased, hyphenated identifiers. Some examples:
- Aave →
aave - Uniswap →
uniswap - Lido →
lido - Pendle →
pendle - Curve Finance →
curve-dex - PancakeSwap AMM →
pancakeswap-amm
Browse the full list at defillama.com/protocols ↗ and copy the slug from the protocol's URL.
aave, not Aave or AAVE.Dynamic Protocol & Chain Values
Toggle the f(x) button next to the Protocol or Chain field to use a value from an upstream node. For example, you can iterate over a list of protocols with a Loop node:
{loop.item}
This is useful for batch-monitoring multiple protocols or chains in a single workflow.
Workflow Examples
Protocol Health Monitor
Track a protocol's TVL and alert when it drops sharply — often a leading signal of a security incident, a contagion event, or a loss of user confidence.
The Function node computes the percentage change between the most recent TVL data point and a baseline (e.g. 7 days ago). The Conditional node triggers a Telegram alert if the drop exceeds your threshold.
Yield Optimization
Find the highest-yielding stablecoin pools on a specific chain and let an LLM rank them by risk-adjusted return.
Set the DeFi Llama node's chain filter to arbitrum. The Function node keeps only pools where stablecoin: true. The LLM compares APY against TVL, audit history, and pool composition to suggest the best opportunities, and the Email node sends the digest.
TVL-Based Trading Signal
Use chain TVL momentum as a directional bias for trades on that ecosystem's native token.
The DeFi Llama node and Price Data node both feed the LLM. The LLM looks for divergences — for example, rising chain TVL with stagnant price often precedes a catch-up rally. The Conditional node routes the decision to the Exchange node.
Pricing & Credits
Each DeFi Llama API call costs a flat 5 credits, regardless of query type, time range, or data points returned.
Output
The DeFi Llama node outputs a structured object with the fetched data and metadata. The shape of the data field varies by query type.
| Path | Description |
|---|---|
| {defillama.queryType} | The query type that was executed (e.g. protocolTvl) |
| {defillama.protocol} | The resolved protocol slug, if applicable |
| {defillama.chain} | The resolved chain name, if applicable |
| {defillama.timestamp} | Unix timestamp of the query |
| {defillama.data} | The fetched data — structure depends on query type (see below) |
| {defillama.metadata.source} | Always defillama |
| {defillama.metadata.endpoint} | The DeFi Llama endpoint that was called |
| {defillama.metadata.requestedAt} | ISO timestamp of when the request was made |
| {defillama.metadata.dataPoints} | Number of data points returned after filtering |
| {defillama.metadata.creditsUsed} | Credits charged for this call |
defillama with your node's edge label. If the edge connecting this node to the next is labeled tvl, use {tvl.data} instead.Data Shapes
- Protocol TVL —
data.tvlis an array of{ date, totalLiquidityUSD }points;data.chainTvlsis the same series broken down per chain. Other fields includename,symbol,category,chains,mcap, andcurrentChainTvls. - Chain TVL —
data.historyis an array of{ date, tvl }points anddata.chainechoes the queried chain. - Yields —
data.poolsis an array of pools (each withpool,project,chain,symbol,tvlUsd,apy,apyBase,apyReward,apyPct1D,apyPct7D,apyPct30D,stablecoin,ilRisk,exposure).data.totalMatchedis the total count before the limit was applied. - Stablecoins —
data.stablecoinsis an array of issuers withname,symbol,pegType,pegMechanism,price, and circulating supply at multiple time horizons. - DEX Volumes / Fees & Revenue —
data.protocolsis an array ranked by 24h volume/fees, each withname,chains,total24h,total7d,total30d,total1y,totalAllTime, and percentage change fields.data.total24h,data.total7d,data.total30dare the aggregate market totals.
Example Output (Protocol TVL)
{
"queryType": "protocolTvl",
"protocol": "aave",
"timestamp": 1710835200,
"data": {
"name": "Aave",
"symbol": "AAVE",
"category": "Lending",
"chains": ["Ethereum", "Arbitrum", "Polygon", "Avalanche"],
"mcap": 1450000000,
"currentChainTvls": {
"Ethereum": 19600000000,
"Arbitrum": 750000000
},
"tvl": [
{ "date": 1710748800, "totalLiquidityUSD": 21200000000 },
{ "date": 1710835200, "totalLiquidityUSD": 21450000000 }
],
"chainTvls": {
"Ethereum": [
{ "date": 1710748800, "totalLiquidityUSD": 19500000000 }
]
}
},
"metadata": {
"source": "defillama",
"endpoint": "/protocol/aave",
"requestedAt": "2026-04-10T11:46:38Z",
"dataPoints": 30,
"creditsUsed": 5
}
}
For other query types, inspect the raw shape with a Function node and console.log(inputs) if you need to parse specific fields.
Common Errors
| Error | Cause | Fix |
|---|---|---|
| Resource not found at DeFi Llama (404) | Wrong protocol slug or chain name | Look up the exact slug at defillama.com/protocols ↗ — values are lowercase and case-sensitive |
| DeFi Llama rate limit exceeded | Too many calls in a short window | DeFi Llama's public API has generous limits but is not unlimited — space requests out, or run the workflow on a longer schedule |
| DeFi Llama request timed out | Slow upstream response or large payload | Reduce the data points limit, or retry — the API is normally fast |
| Protocol slug is required | Query type is Protocol TVL but the Protocol field is empty | Set a protocol slug, or switch to a query type that doesn't need one |
| Chain name is required | Query type is Chain TVL but the Chain field is empty | Set a chain name, or switch to a different query type |
Next Steps
- LLM Node — Feed DeFi metrics into an LLM to generate analysis, rankings, or trade recommendations.
- Function Node — Parse, transform, or aggregate raw DeFi Llama data with custom JavaScript.
- Conditional Node — Route decisions based on TVL thresholds, APY ranges, or volume changes.
- Price Data Node — Combine on-chain TVL with spot price for divergence analysis.
- Loop Node — Iterate over a list of protocols or chains and aggregate the results.