# GET /chain/stats: $0.003 per call

One blockchain's economy in one call: total value locked, DEX trading volume (24 h, 7 d, 30 d and the day-on-day change), its five busiest DEXs, fees paid on the chain and the stablecoins circulating on it. Ethereum, Solana, Base, Arbitrum, BSC and 400+ more. Chain-level figures from DefiLlama; nothing about individual wallets.

- **Price:** $0.003 in USDC, the same on Base, Solana, Polygon, Arbitrum. Failed calls are never charged.
- **Free trial:** yes, 20 free calls a day from Claude, Cursor or any MCP client ([set-up](/mcp/setup)).
- **Tier:** live
- **Answers cached for:** 30 min
- **Data sources:** DefiLlama chains, DEX volumes, fees and stablecoins (free)
- **Lane:** Web3 data ([OpenAPI](/openapi/web3-data.json))
- **Live health:** [status page](/status)

## Free sample

See an answer for the demo input first, free (no payment, 10 a minute): [https://aayatai.com/sample/chain-stats](/sample/chain-stats). It is a stored real answer when we have one, otherwise an example marked `"kind": "illustrative"`.

```bash
curl "https://aayatai.com/sample/chain-stats"
```

## 1. See the price (free)

Call it without paying: you get `402 Payment Required` and a `PAYMENT-REQUIRED` header with the exact price and where to pay.

```bash
curl -i "https://aayatai.com/chain/stats?chain=Base"
```

## 2. Pay and call (TypeScript)

```bash
npm install @x402/fetch @x402/evm viem
```

```ts
import { wrapFetchWithPaymentFromConfig } from "@x402/fetch";
import { ExactEvmScheme } from "@x402/evm";
import { privateKeyToAccount } from "viem/accounts";

// A wallet used only by your agent, holding a little USDC on Base.
const account = privateKeyToAccount(process.env.WALLET_PRIVATE_KEY as `0x${string}`);
const pay = wrapFetchWithPaymentFromConfig(fetch, {
  schemes: [{ network: "eip155:8453", client: new ExactEvmScheme(account) }],
});

const res = await pay("https://aayatai.com/chain/stats?chain=Base");
console.log(await res.json());
```

## 3. Or as an MCP tool

```ts
// MCP server: https://aayatai.com/mcp (Streamable HTTP). With the x402 MCP client (see /start):
const result = await client.callTool("chain-stats", {"chain":"Base"});
```

## Inputs

- `chain` **(required)** (string): Chain name, e.g. Ethereum, Base, Solana, Arbitrum, BSC.
- `detail` (string; one of `full`, `brief`; default `full`): brief = key fields only (same price)

Bad inputs are rejected with HTTP 400 before any payment is asked for.

## Example answer

Example only: the shape of an answer, with placeholder addresses and made-up figures. It is not data about any real token or wallet; call the service (or its free sample) for real results.

```json
{
  "chain": "Base",
  "chainId": 8453,
  "nativeToken": null,
  "tvlUsd": 4300000000,
  "dexVolumeUsd": {
    "last24h": 1365912253,
    "last7d": 6813316151,
    "last30d": 27799532582,
    "change1dPct": 10.39
  },
  "topDexes24h": [
    {
      "name": "Aerodrome Slipstream",
      "volumeUsd": 659297523
    },
    {
      "name": "Uniswap V3",
      "volumeUsd": 364493611
    }
  ],
  "feesUsd": {
    "last24h": 2100000,
    "last30d": 61000000
  },
  "stablecoinsUsd": 5058940425,
  "source": "DefiLlama"
}
```

## Related

- [GET /protocol/fees](/services/protocol-fees) ($0.003): What a DeFi protocol earns: fees paid by its users and the protocol's own revenue over the last 24 hours, 7 days, 30 days, a year and all time, the day-on-day c
- [GET /dao/proposals](/services/dao-proposals) ($0.002): A DAO's governance votes from Snapshot: the latest proposals (active, closed or all) with title, dates, voting type, each choice's votes and share, the leading 

New here? [Getting started in 60 seconds](/start). All services: [Aayat AI](/).