Actions20
- Bridge Actions
- Category Actions
- Chain Actions
- DEXs & Volume Actions
- Fees & Revenue Actions
- Hack Actions
- Oracle Actions
- Protocol Actions
- Raise Actions
- Stablecoin Actions
- TVL Actions
- Yield Actions
Overview
The node provides access to DeFi protocol category data from the DefiLlama API, specifically supporting the "List Categories" operation under the "Category" resource. It fetches a list of all DeFi protocol categories, which can be useful for users who want to explore or analyze different segments of the DeFi ecosystem.
Common scenarios where this node is beneficial include:
- Displaying available DeFi categories for filtering or selection in workflows.
- Aggregating or reporting on protocols grouped by category.
- Enriching datasets with category metadata for further processing.
Example: A user wants to retrieve and display the top 20 DeFi categories with their total value locked (TVL) to understand market segmentation.
Properties
| Name | Meaning |
|---|---|
| Additional Fields | Optional parameters to customize the request: |
| - Max Results | Maximum number of results to return (1-100). Defaults to 20. |
For the "Category" resource and "List Categories" operation, only "Max Results" from Additional Fields is applicable.
Output
The output is an array of JSON objects, each representing a DeFi protocol category with various fields such as:
name: The name of the category.tvl: Total Value Locked in USD (numeric).tvl_formatted: Human-readable formatted TVL (e.g., "$1.23B").protocols: Number of protocols in the category._metadata: Metadata including resource name, operation, and fetch timestamp.
If no data is found, the output contains a message indicating no data was found.
Example output item structure (simplified):
{
"name": "Lending",
"tvl": 1234567890,
"tvl_formatted": "$1.23B",
"protocols": 15,
"_metadata": {
"resource": "categories",
"operation": "listCategories",
"fetched_at": "2024-06-01T12:00:00.000Z"
}
}
Dependencies
- External API: DefiLlama public API at
https://api.llama.fi/categories. - Optional API key credential for DefiLlama API (not required but supported if provided).
- HTTP client library Axios is used internally for requests.
No special environment variables are required beyond optional API credentials.
Troubleshooting
- Empty or no data returned: Check if the API endpoint is reachable and that the DefiLlama service is operational.
- API rate limits or authentication errors: If using an API key, ensure it is valid and has sufficient permissions.
- Invalid maxResults value: Ensure the "Max Results" property is between 1 and 100; otherwise, the node may throw an error or return unexpected results.
- Network issues: Verify network connectivity to
api.llama.fi.
Common error messages:
- "No data found": Indicates the API returned no categories.
- HTTP errors from the API will be surfaced as node errors unless "Continue On Fail" is enabled.
Links and References
- DefiLlama API documentation: https://defillama.com/docs/api
- DefiLlama categories endpoint: https://api.llama.fi/categories
This summary focuses exclusively on the "Category" resource with the "List Categories" operation as requested.