DefiLlama icon

DefiLlama

Access DeFi protocols data using the DefiLlama API

Overview

The node integrates with the DefiLlama API to retrieve data about yield farming opportunities across various DeFi protocols. Specifically, the "Get Yield Pools" operation fetches a list of yield pools, which are investment opportunities where users can stake or lend assets to earn yield (interest or rewards). This node is useful for DeFi analysts, investors, and developers who want to monitor or analyze yield farming options programmatically.

Typical use cases include:

  • Fetching current yield farming pools filtered by blockchain networks.
  • Filtering pools based on minimum APY (Annual Percentage Yield) or whether they involve stablecoins.
  • Limiting the number of results returned for concise reporting.
  • Optimizing output for AI agents with structured summaries.

Example: A user wants to get the top 10 Ethereum and Polygon yield pools with an APY above 5%, focusing only on stablecoin pools.

Properties

Name Meaning
Additional Fields Collection of optional filters and settings:
- Max Results Maximum number of yield pools to return (1-100). Default is 20.
- Chain Filter Comma-separated list of blockchain chains to filter by (e.g., "ethereum,polygon").
- Min APY Minimum APY percentage to filter pools (e.g., 5 means only pools with APY ≥ 5%).
- Stablecoin Only Boolean flag to filter for stablecoin pools only (true/false).
- AI Agent Mode Boolean flag 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 (true/false).

Output

The node outputs JSON objects representing yield pools with detailed information such as:

  • project: The name of the project offering the yield pool.
  • symbol: The token symbol associated with the pool.
  • apy: The raw APY value (number).
  • apy_formatted: APY formatted as a percentage string (e.g., "12.34%").
  • tvl: Total Value Locked in the pool (number).
  • tvl_formatted: TVL formatted as a currency string (e.g., "$1.23M").
  • chain: Blockchain network of the pool.
  • stablecoin: Boolean indicating if the pool involves stablecoins.
  • _metadata: Metadata including resource type ("yield"), operation ("getYieldPools"), and timestamp of data fetch.

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

  • ai_summary: A human-readable summary describing the top yield pools.
  • total_results: Number of yield pools returned.
  • data: Array of the yield pool objects.
  • resource, operation, and timestamp fields for context.

No binary data is output by this node.

Dependencies

  • External API: DefiLlama's public API endpoints at https://yields.llama.fi/pools.
  • Optional API key credential for DefiLlama API (if provided, used as Bearer token).
  • HTTP client library axios (bundled).
  • No special environment variables required beyond optional API key configuration.

Troubleshooting

  • Empty or no data returned: Check that the chain filter and APY filters are not too restrictive.
  • Invalid API key or authentication errors: If using an API key, ensure it is valid and correctly configured.
  • Network or timeout errors: Verify internet connectivity and DefiLlama API availability.
  • Incorrect property values: For example, entering invalid chain names in the chain filter may result in no matches.
  • Max Results out of range: Ensure max results is between 1 and 100.
  • Unexpected response structure: The node expects the API to return data under .data.data or .data. Changes in the API could break parsing.

Links and References

Discussion