DefiLlama icon

DefiLlama

Access DeFi protocols data using the DefiLlama API

Fees & Revenue → Get Fees Overview

AI-generated

Overview

The node provides access to DeFi protocols' fees and revenue data via the DefiLlama API. Specifically, the "Get Fees Overview" operation under the "Fees & Revenue" resource fetches aggregated fees and revenue metrics across multiple DeFi protocols for a selected time range. This is useful for users who want to monitor or analyze the fee generation and revenue trends in the decentralized finance ecosystem.

Common scenarios include:

  • Tracking total fees generated by DeFi protocols over the last 24 hours, 7 days, or 30 days.
  • Filtering protocols by minimum volume thresholds to focus on significant players.
  • Limiting the number of results returned for concise reporting.
  • Optionally formatting output for AI agents with summaries.

Practical example:
A user wants to get an overview of the top 20 DeFi protocols by fees generated in the last 7 days, filtering out protocols with less than $1 million in volume. The node will return structured data including total fees, revenue, and protocol categories for this period.

Properties

Name Meaning
Additional Fields Collection of optional parameters:
- Max Results Maximum number of results to return (1-100). Default is 20.
- Date Range Time range for data aggregation. Options: "24 Hours", "7 Days", "30 Days". Default is "24h".
- Min Volume Minimum volume threshold in USD to filter protocols by their total fees/revenue volume.
- AI Agent Mode Whether to optimize output format for AI agents (simplified and structured). Boolean.
- Include Summary When AI Agent Mode is enabled, whether to include a human-readable summary. Boolean.

Output

The node outputs JSON objects representing fee and revenue data for each protocol matching the criteria. Each item includes fields such as:

  • name: Protocol name.
  • total: Total fees or volume for the selected date range.
  • revenue: Revenue amount for the selected date range.
  • fees: Fees amount for the selected date range.
  • category: Protocol category.
  • dateRange: The selected time range ("24h", "7d", or "30d").
  • Formatted fields like total24h_formatted, revenue24h_formatted, and fees24h_formatted provide human-readable currency strings.
  • Metadata about the resource, operation, and fetch timestamp.

If AI Agent Mode is enabled, the output is a single JSON object containing:

  • ai_summary: A human-readable summary string describing the data.
  • total_results: Number of protocols returned.
  • data: Array of the detailed protocol fee data.
  • resource, operation, and timestamp fields.

No binary data output is produced by this operation.

Dependencies

  • Requires internet access to call the DefiLlama public API endpoints.
  • Optionally uses an API key credential if provided, sent as a Bearer token in the Authorization header.
  • No other external dependencies are required.

Troubleshooting

  • Missing or invalid protocol slug: Not applicable for this operation but relevant for others; ensure slugs are lowercase alphanumeric with hyphens/underscores.
  • API rate limits or network errors: The node may throw errors if the DefiLlama API is unreachable or rate-limited. Retrying later or providing an API key may help.
  • Empty results: If filters like minVolume or maxResults are too restrictive, no data may be returned.
  • Invalid date range: Only "24h", "7d", or "30d" are supported; using unsupported values will result in unexpected output.

Links and References

Discussion