# DEX Metrics

Returns aggregate DEX-level statistics including volume, fees, open interest, and platform metrics.

## Overview

|                    |                 |
| ------------------ | --------------- |
| **Method**         | GET             |
| **Poll frequency** | Every 5 minutes |
| **Auth**           | Bearer API key  |
| **Rate limit**     | 60 req/min      |

## Request

No query parameters.

### Headers

| Header          | Required | Description        |
| --------------- | -------- | ------------------ |
| `Authorization` | yes      | `Bearer <api_key>` |

## Response

Returns a single `data` object with platform-wide aggregate statistics.

> **RECENTLY UPDATED:** Platform-token staking data (`tokenStakedPct`, `tokenStakingApy`) belongs on the [token](/for-partners/endpoints/dex-token.md) endpoint — do not duplicate it here.

### Fields — Metrics Object

| Field             | Type    | Required | Description                                                                    |
| ----------------- | ------- | -------- | ------------------------------------------------------------------------------ |
| `volume24h`       | number  | yes      | Total trading volume in the last 24 hours, in USD.                             |
| `openInterest24h` | number  | yes      | Total open interest across all markets, in USD.                                |
| `fees24h`         | number  | yes      | Total fees collected in the last 24 hours, in USD.                             |
| `volume7d`        | number  | no       | Total trading volume over the last 7 days, in USD.                             |
| `volumeAllTime`   | number  | no       | All-time total trading volume, in USD.                                         |
| `volumeChange1d`  | number  | no       | 24-hour volume change as a decimal percentage.                                 |
| `volumeChange7d`  | number  | no       | 7-day volume change as a decimal percentage.                                   |
| `openInterest7d`  | number  | no       | Total open interest over the last 7 days, in USD.                              |
| `fees7d`          | number  | no       | Total fees collected over the last 7 days, in USD.                             |
| `fees30d`         | number  | no       | Total fees collected over the last 30 days, in USD.                            |
| `revenue24h`      | number  | no       | Protocol revenue (after LP/staker distributions) in the last 24 hours, in USD. |
| `tvl`             | number  | no       | Total value locked across all vaults and liquidity pools, in USD.              |
| `traders24h`      | integer | no       | Number of unique trader addresses active in the last 24 hours.                 |
| `marketsCount`    | integer | no       | Total number of active markets.                                                |

## Example Response

```json
{
  "success": true,
  "data": {
    "volume24h": 1234567890.5,
    "openInterest24h": 98765432.1,
    "fees24h": 12345.0,
    "volume7d": 8765432100.0,
    "volumeAllTime": 999999999999.0,
    "volumeChange1d": 5.25,
    "volumeChange7d": -2.1,
    "openInterest7d": 105000000.0,
    "fees7d": 123456.0,
    "fees30d": 456789.0,
    "revenue24h": 12345.0,
    "tvl": 500000000.0,
    "traders24h": 12500,
    "marketsCount": 150
  },
  "timestamp": "2026-01-20T21:00:00Z"
}
```

## Error Responses

| Status | Error                          | When                      |
| ------ | ------------------------------ | ------------------------- |
| `401`  | `"Invalid or missing API key"` | Bad or absent auth header |
| `500`  | `"Internal server error"`      | Unexpected failure        |

## Notes

* All values are point-in-time snapshots at the moment of the response.
* Rolling windows (e.g. `volume24h`) should be calculated as the trailing 24 hours from `timestamp`, not calendar-day totals.
* `revenue24h` is distinct from `fees24h` — revenue is what the protocol retains after distributing fees to LPs and stakers.
* Omit optional fields entirely rather than returning `null` if the data is unavailable.


---

# Agent Instructions: 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.dexpal.io/for-partners/endpoints/dex-metrics.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.
