L2 TVL ranking

$0.002 per call · USDC via x402 · POST /api/l2-tvl

Top L2s by Total Value Locked (TVL) via DeFiLlama. Send POST /api/l2-tvl with no required fields (1 optional) and pay $0.002 per call over x402 or MPP (there is no free tier). It returns a JSON object with count, totalTvlUsd, chains, source and note.

Returns each L2 with TVL in USD, native token symbol, and CoinGecko/CMC ids. Classification combines DeFiLlama's parent-chain hint with a curated list of well-known L2s (Arbitrum, Optimism, Base, zkSync Era, Linea, Scroll, Mantle, Polygon zkEVM, Starknet, Blast, Mode, Manta, Metis, Polygon, Taiko, Immutable zkEVM, World Chain).

Category: Crypto & onchain data · Tags: l2 tvl defillama rollup rollups ranking l2beat tvs

TRY IN PLAYGROUND →

Parameters

NameTypeRequiredDescription
limitnumbernoNumber of L2s to return (1-50, default 15).

Example request

curl -i -X POST https://agent402.tools/api/l2-tvl \
  -H "Content-Type: application/json" \
  -d '{"limit":10}'

Without payment this returns HTTP 402 Payment Required with the exact price for l2-tvl; any x402 v2 or MPP client pays it and retries.

Example response

{
  "count": 2,
  "totalTvlUsd": 5500000000,
  "chains": [
    {
      "name": "Arbitrum",
      "tvlUsd": 3000000000,
      "tokenSymbol": "ARB",
      "gecko": "arbitrum",
      "cmcId": 11841
    },
    {
      "name": "Base",
      "tvlUsd": 2500000000,
      "tokenSymbol": "ETH",
      "gecko": "base",
      "cmcId": null
    }
  ],
  "source": "defillama",
  "note": "TVL is the cross-DeFi snapshot from DeFiLlama; L2 classification combines parent-chain hint + a curated list of well-known L2s."
}
FieldTypeAlways presentIn the example
countnumberyes2
totalTvlUsdnumberyes5500000000
chainsarray of objectsyes2 items in the example
sourcestringyesdefillama
notestringyesTVL is the cross-DeFi snapshot from DeFiLlama; L2 classification combines par...

From an MCP client

catalog.call {
  "slug": "l2-tvl",
  "params": {
    "limit": 10
  }
}

The hosted connector at https://agent402.tools/mcp needs a payment for l2-tvl; the stdio package pays it from a wallet or from AGENT402_CREDITS_KEY. Local install: npx -y agent402-mcp.

Errors and behavior

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?.(false); // keep your own spending ceiling in code
registerExactEvmScheme(client, { signer: privateKeyToAccount(KEY) });
const payFetch = wrapFetchWithPayment(fetch, client);

const res = await payFetch("https://agent402.tools/api/l2-tvl", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "limit": 10
  }),
});

Related tools

DeFi TVL by chain

$0.002 · POST /api/defi-chains

Blockchains ranked by DeFi TVL from DefiLlama's free chain list: name, TVL in USD, share of total DeFi TVL, native token…

DeFi protocols ranked by TVL

$0.002 · POST /api/defi-protocols

DeFi protocols ranked by current TVL from DefiLlama's free protocol list: filter by category (Lending, Dexs, Liquid Stak…

DeFi chain TVL history

$0.002 · POST /api/defi-chain-tvl-history

Daily TVL history for one chain (Ethereum, Base, Solana, Arbitrum...) or for all of DeFi (chain "all") from DefiLlama's …

DEX volume by protocol

$0.001 · POST /api/defi-dex-volume

Decentralized exchanges ranked by 24h spot trading volume from DefiLlama's free DEX overview: per-DEX 24h/7d/30d/1y/all-…

DeFi protocol fees and revenue

$0.002 · POST /api/defi-fees

Protocols ranked by fees paid by users (or by protocol revenue with metric "revenue") over the last 24h from DefiLlama's…

DeFi protocol profile

$0.002 · POST /api/defi-protocol

Profile of one DeFi protocol by DefiLlama slug (aave-v3, uniswap-v3, lido, morpho-v1...): TVL rank among all protocols, …