agentsvc.io

services / defi-tvl

financeoperational · 458 ms

DeFi TVL and DEX Volume

DeFi data from DefiLlama in four modes. protocol: TVL, 1d/7d change, category, market cap and chain breakdown of a protocol (slug or name, e.g. aave, uniswap, lido). top: largest protocols by TVL, optional category (e.g. Lending, Dexs, Liquid Staking) and chain filter. chains: chains ranked by TVL with share. dex_volume: 24h/7d/30d DEX volume and top DEXes, optionally for one chain. Params: mode (protocol, top, chains, dex_volume; default top, or protocol if protocol is given), protocol, category, chain, limit (1 to 50, default 10).

Run free trial ↗3 free calls per day with the example input. Paid: $0.003 USDC, no limit.

Call it

import { wrapFetchWithPayment, x402Client } from "@x402/fetch";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const client = new x402Client();
registerExactEvmScheme(client, { signer: privateKeyToAccount(process.env.EVM_PRIVATE_KEY) });
const payFetch = wrapFetchWithPayment(fetch, client);

const res = await payFetch("https://agentsvc.io/api/v1/proxy/defi-tvl", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({"mode":"protocol","protocol":"aave"}),
});
const { data, payment } = await res.json();  // payment.transaction = on-chain receipt

Input

FieldTypeDescription
modeprotocol | top | chains | dex_volume
protocolstringProtocol slug or name (mode protocol)
categorystringDefiLlama category (mode top)
chainstringChain name, e.g. Base, Ethereum (modes top, dex_volume)
limitinteger = 10

Output

FieldTypeDescription
modestring
querystring
foundboolean
protocolsarray
sourcestring
checked_atstring

Example response (data)

{
  "mode": "protocol",
  "query": "aave",
  "found": true,
  "protocols": [
    {
      "name": "Aave V3",
      "slug": "aave-v3",
      "symbol": "AAVE",
      "category": "Lending",
      "tvl_usd": 18447878695,
      "change_1d_pct": -0.62,
      "change_7d_pct": 0.2,
      "mcap_usd": null,
      "mcap_to_tvl": null,
      "chain_count": 21,
      "top_chains": [
        {
          "chain": "Ethereum",
          "tvl_usd": 15545458426
        },
        {
          "chain": "Base",
          "tvl_usd": 574387153
        }
      ],
      "url": "https://aave.com",
      "defillama": "https://defillama.com/protocol/aave-v3"
    },
    {
      "name": "Aave V4",
      "slug": "aave-v4",
      "symbol": "AAVE",
      "category": "Lending",
      "tvl_usd": 675107580,
      "change_1d_pct": -0.4,
      "change_7d_pct": 3.07,
      "mcap_usd": null,
      "mcap_to_tvl": null,
      "chain_count": 3,
      "top_chains": [
        {
          "chain": "Ethereum",
          "tvl_usd": 461813271
        },
        {
          "chain": "Arc",
          "tvl_usd": 183375728
        }
      ],
      "url": "https://aave.com",
      "defillama": "https://defillama.com/protocol/aave-v4"
    }
  ],
  "source": "DefiLlama",
  "checked_at": "2026-10-06T14:29:38.091Z"
}