# Stats

Global ecosystem snapshot across all scored protocols.

```
GET  /v1/stats

Aggregate stats across the protocol registry
```

### Authentication

Optional. Anonymous-friendly — no API key required.

### Response Codes

| **Code** | **Meaning**                     |
| -------- | ------------------------------- |
| 200      | Success. SingleResponse\<Stats> |
| 429      | Rate limit exceeded             |

### Example Request

```typescript
const res = await fetch("https://api.diapleo.xyz/v1/stats");
const { data: stats } = await res.json();
```

### Example Response

```json
{
  "success": true,
  "data": {
    "protocolCount": 7391,
    "chainCount": 467,
    "globalRiskIndex": 3.77,
    "globalRiskDelta7d": -0.02,
    "totalTvlUsd": 516092697786.13,
    "recentExploitsCount": 0,
    "updatedAt": "2026-04-21T12:00:32.579Z"
  }
}
```

### Field Reference

| **Field**             | **Description**                                                                                           |
| --------------------- | --------------------------------------------------------------------------------------------------------- |
| `protocolCount`       | Total protocols in the registry                                                                           |
| `chainCount`          | Distinct chains (EVM + Solana + others) across all protocols                                              |
| `globalRiskIndex`     | Mean composite score across all protocols with a score (lower = safer)                                    |
| `globalRiskDelta7d`   | 7-day change in the global risk index (mean of per-protocol deltas). Positive = ecosystem getting riskier |
| `totalTvlUsd`         | Sum of latest TVL across all tracked protocols (USD)                                                      |
| `recentExploitsCount` | Exploits logged in the last 7 days                                                                        |
| `updatedAt`           | When this snapshot was computed (server-cached \~60s)                                                     |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.diapleo.com/api-reference/endpoints/endpoints-stats.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
