DeFi protocol TVL
POST /api/defi-tvlLook up the current Total Value Locked (TVL) for a DeFi protocol from an open DeFi analytics API. Send POST /api/defi-tvl with the required field protocol and pay $0.001 per call over x402 or MPP (there is no free tier). It returns a JSON object with protocol, name, category, tvlUsd, change24h and 3 more.
Identify the protocol by its slug (uniswap, aave, lido, ethena, etc.). Returns the total TVL plus per-chain breakdown and 24h/7d/30d change where the source exposes it.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
protocol | string | yes | Protocol slug (e.g. uniswap, aave, lido). Lowercase, hyphen-separated. |
Example request
curl -i -X POST https://agent402.tools/api/defi-tvl \
-H "Content-Type: application/json" \
-d '{"protocol":"aave"}'Without payment this returns HTTP 402 Payment Required with the exact price for defi-tvl; any x402 v2 or MPP client pays it and retries.
Example response
{
"protocol": "aave",
"name": "AAVE",
"category": "Lending",
"tvlUsd": 15000000000,
"change24h": 0.5,
"change7d": 2.1,
"change30d": 8,
"chainTvls": [
{
"chain": "Ethereum",
"tvlUsd": 11000000000
}
]
}| Field | Type | Always present | In the example |
|---|---|---|---|
protocol | string | yes | aave |
name | string | yes | AAVE |
category | string | yes | Lending |
tvlUsd | number | yes | 15000000000 |
change24h | number | yes | 0.5 |
change7d | number | yes | 2.1 |
change30d | number | yes | 8 |
chainTvls | array of objects | yes | 1 item in the example |
From an MCP client
catalog.call {
"slug": "defi-tvl",
"params": {
"protocol": "aave"
}
}The hosted connector at https://agent402.tools/mcp needs a payment for defi-tvl; the stdio package pays it from a wallet or from an AGENT402_CREDITS_KEY issued earlier. Local install: npx -y agent402-mcp@0.13.32.
Errors and behavior
protocolis required. An input the tool rejects returns an HTTP 4xx whose body carrieserror,tool,expected,requiredandexample, so the caller can correct it.- A paid call that ends in any status of 400 or above is not charged over x402, MPP or a prepaid credits key: settlement runs after the tool and only on a successful response. The exception is a Tempo push credential, a transfer the buyer sent before the call: it settles before the tool runs, so if the tool then fails the payment is recorded as a refund owed to the paying wallet.
- Wallet-only: this tool reaches the network or stored state, so it has no proof-of-work tier. A prepaid card-credits key issued earlier (
Authorization: Bearer a402_...) also pays it. - A
GETorHEADto /api/defi-tvl returns the same 402 quote, so the price can be read without a body. - An
Idempotency-Keyheader makes a retried paid call replay the first 200 instead of charging again (an answer larger than 1 MB is not replayed).
Paid call (JavaScript agent)
import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";
const client = new x402Client();
client.setSpendControls?.({ maxAmountPerPayment: "$0.001" }); // refuse any quote above this tool's price
registerExactEvmScheme(client, { signer: privateKeyToAccount(KEY) });
const payFetch = wrapFetchWithPayment(fetch, client);
const res = await payFetch("https://agent402.tools/api/defi-tvl", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"protocol": "aave"
}),
});Part of these workflows
DeFi protocol TVL is one step in these 2 skill packs, each sold as a single call:
- DeFi protocol scanner - Due-diligence a DeFi protocol in one workflow: live token price, market context, protocol TVL across chains, and recent news - the on-chain and off-chain picture together.
- DeFi dashboard - DeFi market overview: total TVL, ETH price, Base gas, and global crypto stats in one call.
Related tools
DeFi protocol profile
Profile of one DeFi protocol by protocol slug (aave-v3, uniswap-v3, lido, morpho-v1...): TVL rank among all protocols.
DeFi chain TVL history
Daily TVL history for one chain (Ethereum, Base, Solana, Arbitrum...) or for all of DeFi (chain "all") from an open DeFi.
DeFi TVL by chain
Blockchains ranked by DeFi TVL from an open DeFi analytics chain list: name, TVL in USD, share of total DeFi TVL, native.
DeFi protocols ranked by TVL
DeFi protocols ranked by current TVL from an open DeFi analytics protocol list: filter by category (Lending, Dexs.
DeFi yield pool history
Daily APY and TVL history for one DeFi yield pool (pool id from defi-yields): per-day total/base/reward APY and TVL.
DeFi yield screener
Screen DeFi yield pools (lending, LP, staking, vaults) across every chain from an open DeFi analytics yields dataset.