DefiLlama icon

DefiLlama

Access DeFi protocols data using the DefiLlama API

Overview

The node integrates with the DefiLlama API to provide comprehensive data about decentralized exchanges (DEXs) and their trading volumes. Specifically, the "Get DEXs Overview" operation fetches aggregated trading volume data across all DEXs for a specified time range (24 hours, 7 days, or 30 days). This is useful for users who want to monitor market activity, compare liquidity and volume trends among different DEXs, or analyze changes in trading behavior over time.

Practical examples include:

  • Tracking total trading volume on major DEXs to assess market health.
  • Filtering DEXs by minimum volume thresholds to focus on significant players.
  • Observing volume changes over recent periods to detect emerging trends or shifts in user activity.

Properties

Name Meaning
Additional Fields Collection of optional parameters:
- Max Results Maximum number of DEX results to return (1-100), default 20.
- Date Range Time range for data aggregation; options are "24 Hours", "7 Days", or "30 Days". Default is "24h".
- Min Volume Minimum volume threshold in USD to filter DEXs by trading volume.
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.

Note: For this operation, only the relevant additional fields related to DEXs overview are applicable.

Output

The node outputs an array of JSON objects, each representing a DEX with its trading volume data and metadata. Each object includes:

  • name: The name of the DEX.
  • totalVolume24h (or corresponding field based on date range): Total trading volume in USD for the selected period.
  • change_1d (or corresponding change field): Percentage change in volume compared to the previous equivalent period.
  • chains: Array of blockchain networks supported by the DEX.
  • Formatted fields such as totalVolume24h_formatted and change_1d_formatted for easier readability (e.g., "$1.23B", "+5.67%").
  • _metadata: Contains resource, operation, and timestamp information about the fetched data.

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

  • ai_summary: A concise human-readable summary of the data.
  • total_results: Number of DEX entries returned.
  • data: The array of DEX data objects.
  • resource, operation, and timestamp.

No binary data is output by this node.

Dependencies

  • External API: DefiLlama public API endpoints (https://api.llama.fi/overview/dexs).
  • Optional API key credential for DefiLlama API if provided, used as Bearer token in Authorization header.
  • HTTP client library (axios) for making REST API requests.

No special environment variables are required beyond optional API credentials configured in n8n.

Troubleshooting

  • Empty or no data returned: Check that the selected date range and minimum volume filters are not too restrictive.
  • API errors or rate limits: If using an API key, ensure it is valid and has sufficient quota. Without a key, public API limits may apply.
  • Invalid parameter values: Ensure "Max Results" is between 1 and 100, and "Date Range" is one of the allowed options.
  • Network issues: Verify network connectivity to api.llama.fi.
  • Unexpected response structure: The node expects certain fields; if the API changes, the node might fail or produce incomplete data.

Common error messages:

  • "No data found": The API returned no results matching the criteria.
  • HTTP 4xx or 5xx errors: Indicate invalid requests or server issues; check parameters and retry later.

Links and References

Discussion