DefiLlama icon

DefiLlama

Access DeFi protocols data using the DefiLlama API

Overview

The node integrates with the DefiLlama API to retrieve data about stablecoins, specifically supporting the operation Get Stablecoin Prices. This operation fetches current price information for various stablecoins, optionally filtered and limited by user-defined parameters.

This node is beneficial in scenarios where users want to monitor or analyze the latest stablecoin prices within decentralized finance (DeFi) ecosystems. For example, a DeFi analyst might use it to track price stability across multiple stablecoins, or a portfolio manager could integrate it into workflows that require up-to-date stablecoin valuations.

Practical examples:

  • Fetching the top 20 stablecoins by price for display on a dashboard.
  • Filtering stablecoins by minimum market capitalization to focus on significant assets.
  • Including or excluding pegged assets based on investment criteria.

Properties

Name Meaning
Additional Fields Collection of optional filters and settings:
- Max Results Maximum number of stablecoin results to return (1-100). Defaults to 20.
- Min Market Cap Minimum market capitalization threshold in USD to filter stablecoins. Defaults to 0 (no filter).
- Include Pegged Whether to include pegged assets in the results. Boolean, defaults to true.

These properties allow users to customize the scope and size of the stablecoin price data retrieved.

Output

The output is an array of JSON objects, each representing a stablecoin with its associated data fields. Each object includes:

  • Raw data fields from the DefiLlama API about the stablecoin's current price and related metrics.
  • Formatted fields for easier readability, such as:
    • price_formatted: Price formatted as a string with a dollar sign and four decimals (e.g., $1.0000).
    • market_cap_formatted: Market cap formatted in human-readable currency units (e.g., $1.23B).
  • Metadata including resource name (stablecoins), operation (getStablecoinPrices), and timestamp of data retrieval.

If the "AI Agent Mode" is enabled via additional fields, the output can also include a simplified structured summary optimized for AI consumption.

No binary data output is produced by this node.

Dependencies

  • External API: DefiLlama API endpoints at https://stablecoins.llama.fi/stablecoinprices.
  • Optional API key credential support for authenticated requests, though not required.
  • HTTP client library (axios) used internally for API calls.

No special environment variables are required beyond optional API credentials.

Troubleshooting

Common Issues

  • Empty or no data returned: Could be due to overly restrictive filters like very high minimum market cap or max results set to zero.
  • Invalid parameter values: For example, setting max results outside the allowed range (1-100) may cause unexpected behavior.
  • API connectivity issues: Network problems or DefiLlama service downtime will result in errors.

Error Messages

  • The node throws descriptive errors if required parameters are missing or invalid.
  • If the API returns a 4xx or 5xx error, the node surfaces these as operation errors with messages indicating the failure reason.
  • Users should verify parameter correctness and network connectivity when encountering errors.

Links and References


This summary focuses exclusively on the "Stablecoin" resource and the "Get Stablecoin Prices" operation as requested.

Discussion