Finance4 min readBy Purrkey team

How to rank blockchains by total value locked with DefiLlama

Get a ranked list of blockchains by current total value locked, up to 500 rows, so you can compare chain TVL in one call

On this page

You need a weekly market map of the 20 largest blockchains by current total value locked for an investment committee meeting. One call to defillama.chains.tvl returns the ranked rows, and you turn those rows into a table with rank, name, tvlUsd and the optional chain identifiers

No call has been run for this guide. The worksheet below is a design, not a result, and values are placeholders showing the shape

The task and the deliverable table

The deliverable is a ranked table the committee can read in one pass. Put rank first because the tool returns chains in ranked order. Keep tvlUsd beside the name so the size difference is visible. Carry the identifier fields so a later protocol review can join on them

ranknametvlUsdtokenSymbolchainIdgeckoId
1(chain name from row 1)(number)(symbol or null)(integer or null)(id or null)
2(chain name from row 2)(number)(symbol or null)(integer or null)(id or null)
3(chain name from row 3)(number)(symbol or null)(integer or null)(id or null)

Rank is not an output field. Fill it from the array position. The item schema has no rank property, so the order of chains is the ranking you present

Input and output fields that decide the ranking

The catalog describes defillama.chains.tvl as: "List blockchains ranked by current total value locked." The catalog path is POST /v1/runs

The contract exposes a limit input. It is an integer from 1 to 500 with a default of 50. Set it to the number of ranked blockchains you want returned. Example input: limit set to 20. The reader replaces that number with the count they need

Read chains first. It is an array, and each item carries name and tvlUsd. Use tvlUsd as the value for comparison and keep name as the row label. The optional fields tokenSymbol, chainId and geckoId are identifiers for later research; each can be null, so your table needs a null marker

The top level also has matched, an integer separate from chains. Keep it above the table as a reconciliation note. matched is not a rank column and does not replace the array order

Set the limit before the call

Set limit to 20 for the committee map. That one input controls how many ranked blockchains you ask the call to return. The limit accepts 1 to 500, and the response returns at most 500 chains. A larger limit makes a longer table; it does not change the field names you read

For a weekly meeting, one call with limit at 20 is enough to produce the 20-row map. For a daily snapshot, make the same call once per day and keep the date outside the response, since the contract does not list a timestamp field

The agent prompt

Agent prompt
Set up https://purrkey.app/SKILL.md, then use Purrkey to pull a ranked
blockchain TVL table. Check the current inputs and price of
defillama.chains.tvl before running. Call defillama.chains.tvl once with
limit set to 20. Return a table with rank, name, tvlUsd, tokenSymbol,
chainId and geckoId. Fill rank from the order of the chains array. Put
the matched integer in a note above the table. Leave optional fields as
null when the response gives null. Do not invent chain names or TVL
values.

The prompt asks for one call and one table. If your committee needs a different count, change the limit value in the prompt rather than editing the table afterward

Estimated tool cost

Price read from the Purrkey catalog on November 17, 2026. The catalog lists a fixed per-call price of $0.0005 under the published tool contract, and failed executions are not charged. Treat the totals below as planning ceilings

StepFormulaUnit pricePlanned quantityTotal
One ranking pull1 call x $0.0005$0.0005 per call1$0.0005
Daily snapshot, 30 days30 calls x $0.0005$0.0005 per call30$0.015

Agent model fees are not counted. A failed execution is not charged, so a retry plan should use the same per-call figure for each successful call

Next action

Open defillama.chains.tvl, set limit to 20, and use the returned chains order to build the committee table

Get started by giving this to your agent

  • Claude Code
  • Codex
  • Gemini CLI
  • Cursor
  • GitHub Copilot
Set up https://purrkey.app/SKILL.md, then use Purrkey to show me what I can do with DefiLlama.
Explore DefiLlama tools and pricing

FAQ

How do I rank blockchains by total value locked with DefiLlama?

Call defillama.chains.tvl once with a limit set to the number of blockchains you want. Read the chains array in order and use tvlUsd as the value that drives the ranking.

What does defillama.chains.tvl return?

It returns a top-level matched integer and a chains array. Each chain row has name and tvlUsd, plus tokenSymbol, chainId and geckoId, which can be null.

How do I set the number of blockchains in the ranking?

Use the limit input. It is optional, accepts an integer from 1 to 500, and defaults to 50. Set it to 20 when you want the 20 largest blockchains by current total value locked.

What is the maximum number of blockchains the response can contain?

The limit input goes up to 500, and the chains array has a maxItems value of 500. The response returns at most 500 chains.

How much does one blockchain TVL ranking pull cost?

One ranking pull is one call at $0.0005. The planned ceiling for one pull is $0.0005, and failed executions are not charged under the published tool contract.

How much does a daily TVL snapshot for 30 days cost?

A daily snapshot for 30 days is 30 calls at $0.0005 per call. The planned ceiling is $0.015.

What fields identify a chain besides its TVL?

The required fields are name and tvlUsd. The optional tokenSymbol, chainId and geckoId fields are identifiers you can use for later research, and each can be null.

Next step

Try this with DefiLlama

The tool directory lists every endpoint with its current price. Inspect the inputs there, then let your agent run a small batch before scaling up.

See DefiLlama tools

Share this article