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 integrates with the DefiLlama API to retrieve data about blockchain chains and their Total Value Locked (TVL). Specifically, for the "Chain" resource and "List All Chains" operation, it fetches a list of all blockchain chains along with their TVL data. This is useful for users who want to monitor or analyze the TVL distribution across different blockchains in the decentralized finance (DeFi) ecosystem.
Common scenarios include:
- Portfolio analysis by chain TVL.
- Market research on blockchain adoption and liquidity.
- Building dashboards that display TVL metrics per chain.
Example: A user can list the top 20 chains by TVL to understand which blockchains currently hold the most value locked in DeFi protocols.
Properties
| Name | Meaning |
|---|---|
| Additional Fields | Collection of optional parameters: |
| - Max Results | Maximum number of results to return (1-100). Limits how many chains are returned. |
For this specific Resource-Operation ("Chain" - "List All Chains"), only "Max Results" from Additional Fields applies.
Output
The output is an array of JSON objects, each representing a blockchain chain with its associated data. Each item includes:
- Chain details such as name and slug.
- TVL value (
tvl) and a formatted string version (tvl_formatted), e.g., "$1.23B". - Number of protocols on the chain.
- Metadata including resource type ("chain"), operation ("listChains"), and timestamp when data was fetched.
The node formats numeric values like TVL into human-readable currency strings for convenience.
No binary data output is produced by this operation.
Dependencies
- External API: DefiLlama public API at
https://api.llama.fi/chains. - Optional: An API key credential can be used if available but is not required.
- HTTP client: Axios library is used internally to make requests.
No special environment variables or n8n configurations are mandatory beyond standard HTTP access.
Troubleshooting
- Empty or no data returned: Check network connectivity and ensure the DefiLlama API is reachable.
- API rate limits or errors: If using an API key, verify it is valid; otherwise, consider retrying later.
- Invalid Max Results value: Ensure the "Max Results" input is between 1 and 100.
- Unexpected response format: The node expects the API to return an array of chains; changes in the API may cause issues.
If errors occur, the node will throw descriptive messages indicating the problem, such as invalid parameters or API failures.