DefiLlama icon

DefiLlama

Access DeFi protocols data using the DefiLlama API

Overview

The node integrates with the DefiLlama API to retrieve data about DeFi protocols, specifically focusing on listing all protocols and their TVL (Total Value Locked) data. It allows users to fetch a filtered list of DeFi protocols based on criteria such as minimum TVL and maximum number of results. This is useful for analysts, developers, or enthusiasts who want to monitor or analyze the DeFi ecosystem by obtaining up-to-date protocol information.

Practical examples:

  • Fetching the top 20 DeFi protocols by TVL to analyze market leaders.
  • Filtering protocols with a minimum TVL threshold to focus on more significant projects.
  • Using the output in dashboards or reports to track DeFi protocol performance.

Properties

Name Meaning
Additional Fields Collection of optional filters and settings:
- Max Results Maximum number of protocols to return (1-100). Default is 20.
- Min TVL Minimum TVL (in USD) threshold to filter protocols. Default is 0 (no minimum).
- 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 an array of JSON objects representing DeFi protocols. Each object contains detailed protocol data including:

  • Protocol name, slug, category, chains supported.
  • TVL value and a formatted TVL string (e.g., "$1.23B").
  • Metadata about the resource, operation, and fetch timestamp.
  • Additional formatted fields for easier readability (e.g., formatted currency, percentages).

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

  • ai_summary: A human-readable summary text describing the fetched protocols.
  • total_results: Number of protocols returned.
  • data: The array of protocol data objects.
  • resource, operation, and timestamp fields for context.

No binary data is produced by this node.

Dependencies

  • Requires access to the public DefiLlama API endpoints (https://api.llama.fi/protocols).
  • Optionally supports using an API key credential if provided, which will be sent as a Bearer token in the Authorization header.
  • Uses the Axios HTTP client library internally for API requests.

Troubleshooting

  • Missing or invalid protocol slug: For operations requiring a protocol slug, ensure it is provided, lowercase, and matches the expected format (letters, numbers, hyphens, underscores). Errors like "Invalid protocol slug" or "Protocol not found" indicate issues with the slug input.
  • API request failures: Network issues or API downtime may cause errors. Check connectivity and retry later.
  • Max Results limits: Setting max results outside the allowed range (1-100) may cause unexpected behavior; keep within limits.
  • Empty results: If filtering by Min TVL is too restrictive, no protocols may be returned.

Links and References


This summary covers the "Protocol" resource with the "List All Protocols" operation only, as requested.

Discussion