{"uid":"cap_GFxj2gn6iIkIhjEZchSO7","slug":"defillama-protocol-chain-tvl-data-via-x402-1de3fa36","name":"DefiLlama Protocol & Chain TVL Data via x402","description":"Pay-per-call crypto microdata for trading/onchain AI agents via x402 (USDC on Base): Base gas, token risk, balances, multi-venue prices, Hyperliquid book/funding, kimchi premium. No API keys.","url":"https://kr-x402-mvp.kgy5612.workers.dev/api/v1/defillama/protocol?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET"],"type":"string"},"queryParams":{"type":"object","properties":{"chain":{"type":"string","examples":["Base","Ethereum"],"maxLength":40,"description":"Chain name, e.g. Base, Ethereum, Solana"},"limit":{"type":"integer","maximum":50,"minimum":1,"description":"Top chains to list (default 15)"},"protocol":{"type":"string","examples":["aave"],"maxLength":60,"description":"DefiLlama protocol slug, e.g. aave, lido, aerodrome"}},"additionalProperties":false}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object"}}}}},"responseSchema":{"type":"json","example":{"defi":{"base":{"rank":5,"tvl_usd":3900000000,"share_pct":3.1},"flow":"flat","change_1d_pct":0.3,"change_7d_pct":-2.1,"total_tvl_usd":125000000000,"chains_counted":300,"change_30d_pct":4},"next":["/crypto/global-market","/crypto/stablecoin-peg"],"chain":{"flow":"flat","name":"Base","rank":5,"as_of":"2026-10-30","tvl_usd":3900000000,"chain_id":8453,"change_1d_pct":0.4,"change_7d_pct":-1.2,"change_30d_pct":5.6,"share_of_defi_pct":3.1},"signal":"NEUTRAL","source":"https://defillama.com","reasons":["DeFi TVL $125.0B, 7d -2.1%","Base #5 $3.90B, 7d -1.2% (flat)"],"top_chains":[{"name":"Ethereum","rank":1,"token":"ETH","tvl_usd":70000000000,"share_pct":56}],"updated_at":"2026-10-30T02:30:00Z"}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.002","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.002/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_5ikFR3aMeZXMX3QkbyP4Y","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Fetches DeFi TVL metrics, chain rankings, and protocol data from DefiLlama, paid per-call with USDC on Base via x402","exampleAgentPrompt":"What's the current TVL and chain rank for Base, and how has it changed over the last 7 days — show me the top 15 chains too?","exampleUseCases":[{"title":"Monitor Aave protocol TVL","prompt":"What is the current TVL for the Aave protocol and how has it changed over the last week?"},{"title":"Compare top DeFi chains by TVL","prompt":"Give me the top 10 DeFi chains ranked by TVL right now, including their share of total DeFi and recent trend."},{"title":"Check Base chain DeFi health","prompt":"What's Base chain's current DeFi TVL, its rank among all chains, and is money flowing in or out lately?"}],"resultDescription":"Returns a structured JSON object with: global DeFi TVL, chain-specific TVL and rank, 1d/7d/30d percentage changes, TVL flow signal (e.g. NEUTRAL), top chains list with token and share data, protocol-specific data if requested, and source attribution with timestamp.","failureModes":["Invalid protocol slug returns empty or error response","Unknown chain name may return no chain-specific data","Rate limiting if x402 payment fails or is insufficient","Stale data if DefiLlama upstream is delayed","limit parameter out of range (must be 1-50) returns validation error"],"whenToPreferThis":"Use this endpoint when an AI agent needs real-time DeFi TVL data, chain rankings, or protocol metrics without managing API keys — particularly suitable for autonomous trading or onchain agents that can pay micropayments via x402 on Base. Prefer over direct DefiLlama API integration when operating in a pay-per-call agent architecture.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-02T18:33:10.697Z","isFirstParty":false,"canonicalSlug":"defillama-protocol-chain-tvl-data-via-x402-1de3fa36"}