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 decentralized finance (DeFi) protocol data, specifically focusing on the "Get Protocol TVL" operation within the "Protocol" resource. This operation fetches the current Total Value Locked (TVL) for a specified DeFi protocol identified by its slug.
This node is beneficial for users who want to monitor the liquidity or locked assets in various DeFi protocols, which is a key metric for assessing protocol size, health, and user trust. For example, a user might use this node to get the TVL of popular protocols like Aave or Uniswap to track their growth or compare them against competitors.
Practical examples:
- Fetching the current TVL of "aave" to analyze its market position.
- Integrating TVL data into dashboards or alerts for investment decisions.
- Combining TVL data with other metrics for comprehensive DeFi analytics.
Properties
| Name | Meaning |
|---|---|
| Protocol Slug | The unique identifier (slug) of the protocol to query (e.g., "aave", "uniswap", "curve-dao"). Must be lowercase letters, numbers, hyphens, or underscores. |
| Additional Fields | Optional collection of extra parameters; not specifically used for this operation but available for other operations. |
Note: For the "Get Protocol TVL" operation, only the "Protocol Slug" property is required and relevant.
Output
The output JSON contains the current TVL data for the specified protocol under the tvl field, along with the protocol slug under protocol. The structure includes:
tvl: An array of objects representing historical TVL snapshots, each typically containing timestamped TVL values.protocol: The slug string of the queried protocol.
Additionally, the node formats some fields for readability (e.g., formatted currency strings), and appends metadata including resource name, operation, and fetch timestamp.
Example output snippet:
{
"tvl": [
{
"date": 1680000000,
"totalLiquidityUSD": 123456789.12
},
...
],
"protocol": "aave",
"_metadata": {
"resource": "protocol",
"operation": "getProtocolTvl",
"fetched_at": "2024-06-01T12:00:00.000Z"
}
}
No binary data output is produced by this operation.
Dependencies
- External Service: DefiLlama API (
https://api.llama.fi) - Optional: An API key credential can be configured for authenticated requests, but it is not mandatory.
- HTTP client: Axios library is used internally to make API requests.
Troubleshooting
- Missing or invalid Protocol Slug: The node requires a valid protocol slug. If missing or improperly formatted (only lowercase letters, numbers, hyphens, underscores allowed), an error will be thrown. Ensure the slug matches DefiLlama's naming conventions.
- Protocol Not Found: If the slug does not correspond to any known protocol on DefiLlama, a "Protocol not found" error occurs. Verify the slug exists on DefiLlama.
- API Errors: HTTP 400 errors indicate invalid input; HTTP 404 indicates resource absence. Check inputs and network connectivity.
- Empty Data: If no TVL data is returned, confirm the protocol has TVL data available on DefiLlama.