Actions20
- Bridge Actions
- Category Actions
- Chain Actions
- DEXs & Volume Actions
- Fees & Revenue Actions
- Hack Actions
- Oracle Actions
- Protocol Actions
- Raise Actions
- Stablecoin Actions
- TVL Actions
- Yield Actions
Overview
The node integrates with the DefiLlama API to retrieve fees and revenue data for decentralized finance (DeFi) protocols. Specifically, the "Get Protocol Fees" operation fetches detailed fee and revenue statistics for a given DeFi protocol identified by its slug (e.g., "aave", "uniswap"). This is useful for users who want to analyze the financial performance of specific DeFi projects over different time ranges such as the last 24 hours, 7 days, or 30 days.
Practical examples include:
- Monitoring daily or weekly fee income of a DeFi lending platform.
- Comparing revenue streams across multiple protocols.
- Feeding fee data into dashboards or analytics tools for investment decisions.
Properties
| Name | Meaning |
|---|---|
| Protocol Slug | The unique identifier of the protocol (e.g., "aave", "uniswap", "curve") to query fees for. |
| Additional Fields | A collection of optional parameters: |
| - Max Results | Maximum number of results to return (1-100). |
| - Date Range | Time range for data aggregation; options are "24 Hours", "7 Days", or "30 Days". |
| - AI Agent Mode | Whether to optimize output format for AI agents (simplified and structured). |
| - Include Summary | When AI Agent Mode is enabled, whether to include a human-readable summary in the output. |
Output
The node outputs JSON data containing fee and revenue information for the specified protocol. The structure includes fields such as:
total: Total fees collected in the selected date range.revenue: Revenue generated in the selected date range.fees: Fees collected in the selected date range.dateRange: The selected time range ("24h", "7d", or "30d").- Additional metadata about the protocol and fetched timestamp.
If AI Agent Mode is enabled, the output is enhanced with:
ai_summary: A human-readable summary describing the fees and revenue data.total_results: Number of results returned.data: The raw data array.resource,operation, andtimestampfields for context.
No binary data output is produced by this node.
Dependencies
- Requires access to the DefiLlama public API at
https://api.llama.fi. - Optionally uses an API key credential if provided, sent as a Bearer token in the Authorization header.
- Uses the Axios HTTP client library for making requests.
- No special environment variables are required beyond optional API credentials configured in n8n.
Troubleshooting
- Missing or invalid Protocol Slug: The node requires a valid protocol slug string. If missing or malformed (not lowercase letters, numbers, hyphens, underscores), it throws an error. Ensure the slug matches known DefiLlama protocol identifiers.
- Protocol not found errors (404): Occur if the slug does not correspond to any protocol on DefiLlama. Verify the slug spelling and existence.
- API request failures: Network issues or API downtime can cause errors. Check connectivity and retry later.
- Max Results limits: Setting max results outside 1-100 may cause unexpected behavior; keep within bounds.
- Date Range values: Only "24h", "7d", or "30d" are supported; other values will be ignored or cause errors.
Links and References
This summary focuses exclusively on the "Fees & Revenue" resource and the "Get Protocol Fees" operation as requested.