81trust / 100

Defi Tvl

by DeFi protocol TVL in Onchain & crypto

x402 APIPassing, checked 2 h ago

Look up the current Total Value Locked (TVL) for a DeFi protocol via DeFiLlama's public API. Identify the protocol by its DeFiLlama slug (uniswap, aave, lido, ethena, etc.). Returns the total TVL plus per-chain breakdown and 24h/7d/30d change where DeFiLlama exposes it.

POST https://agent402.tools/api/defi-tvl

Last 30 days

All checks passedSome failedAll failedNot checked
Uptime
100%
Response time
210 ms typical, 210 ms slowest 5%
Last check
2 h ago
Next check
any minute now

How to call it

# See the payment challenge (nothing is charged)
curl -i -X POST "https://agent402.tools/api/defi-tvl" \
  -H "content-type: application/json" \
  -d '{"protocol":"aave"}'
import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const client = new x402Client().register(
  "eip155:8453",
  new ExactEvmScheme(privateKeyToAccount(process.env.AGENT_KEY)),
);
const pay = wrapFetchWithPayment(fetch, client);

// Not sure it's safe to pay? Preflight it first for $0.005:
// GET https://toolvet.app/api/v1/check?url=https%3A%2F%2Fagent402.tools%2Fapi%2Fdefi-tvl
const res = await pay("https://agent402.tools/api/defi-tvl", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({"protocol":"aave"}),
});
console.log(await res.json());

Example input

{
  "protocol": "aave"
}

Example output

{
  "category": "Lending",
  "chainTvls": [
    {
      "chain": "Ethereum",
      "tvlUsd": 11000000000
    }
  ],
  "change24h": 0.5,
  "change30d": 8,
  "change7d": 2.1,
  "name": "AAVE",
  "protocol": "aave",
  "tvlUsd": 15000000000
}

Security scan

  • No findings. We scan names, descriptions and tool definitions for hidden instructions and other prompt-injection patterns.

Recent checks

WhenResultHTTPTimePrice
2 h agoPassed402210 ms$0.001
7 h agoPassed402291 ms$0.001