# Heurist Mesh: DefiLlama Chain Metrics Agent

> Heurist Mesh: DefiLlama Chain Metrics Agent is a paid API for AI agents from mesh.heurist.xyz, paid per call via x402, $0.003/call, status unknown (last checked 2026-09-14).

Retrieves blockchain-level DeFi metrics including TVL, fees, top protocols by fees, and growth trends for a specified chain via DefiLlama data.

## Facts

- Endpoint: POST https://mesh.heurist.xyz/x402/solana/agents/DefiLlamaAgent/get_chain_metrics
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/heurist-mesh-defillama-chain-metrics-agent-a6ffad0f
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_sHqFOc1XfpJPw0jzCbQHA

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability heurist-mesh-defillama-chain-metrics-agent-a6ffad0f -d '<json body>'
```

Example prompt: What's the current TVL, total fees, and top protocols by fees on Solana, and how has it been trending recently?

## When to prefer this

Use this endpoint when you need aggregated, chain-level DeFi statistics (TVL, fees, protocol rankings, growth trends) for a specific blockchain. Prefer this over wallet-level or token-level endpoints when the goal is ecosystem-wide analysis. It is best suited for macro DeFi research, chain comparison, or investment due diligence — not for individual wallet analysis or token price lookups.

## Known failure modes

- Unsupported or misspelled chain name returns an error or empty result
- DefiLlama data unavailable or stale for niche chains
- Rate limiting or payment failure with x402 protocol returns 402 status
- Chain with very low DeFi activity may return sparse or zero-value metrics

## How this service works

Get metrics for a blockchain including TVL, fees, top protocols by fees, and growth trends.

## Output

Returns structured DeFi metrics for the specified blockchain, including total value locked (TVL), total fees, a ranked list of top protocols by fee generation, and chain-level growth trend data — all sourced from DefiLlama.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "type": "object",
     "required": [
      "chain"
     ],
     "properties": {
      "chain": {
       "type": "string",
       "description": "Chain name (e.g., 'Solana', 'Base')"
      },
      "debug": {
       "type": "boolean",
       "default": false,
       "description": "Debug mode flag. ALWAYS use false."
      }
     }
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "result": {
       "type": "object",
       "additionalProperties": true
      }
     }
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/heurist-mesh-defillama-chain-metrics-agent-a6ffad0f/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from mesh.heurist.xyz](https://www.zero.xyz/host/mesh.heurist.xyz/llms.txt)
