DeFi protocols API
How much does this protocol earn or trade, and on which chains?
One DeFi protocol's fees, revenue or trading volume over the last 24 hours, 7 days, 30 days and year, in total and per chain.
/api/external/protocol-analysis/protocol-metrics/{slug}What it returns
One protocol's total for the metric chosen with metric over four trailing windows, then the same four totals on each chain it runs on, largest 30-day total first. fees is what users paid the protocol, revenue the part of those fees the protocol kept, volume what was traded on it as an exchange. Where every chain reports a window, the chain totals add up to the protocol total. A parent slug totals its versions; a version slug answers its own figures. The slug is the one GET /protocol-analysis/protocols lists. A protocol that is unknown, or has no figures for the metric (an exchange volume for a lender), answers 404.
Chains
This endpoint is not tied to a chain: it takes no chain in its request.
Request
Send your key in the x-dex-data-key header. Replace each <placeholder> with a real value.
curl -H "x-dex-data-key: $DEXDATA_API_KEY" \ "https://api.dexdata.io/api/external/protocol-analysis/protocol-metrics/<slug>"
| Parameter | Description |
|---|---|
metricquery · string · optional | What to total. fees: what users paid. revenue: the part of the fees the protocol kept. volume: exchange trading volume. Defaults to fees.feesrevenuevolume |
slugpath · string · required | A DeFi protocol's slug, e.g. "pancakeswap-amm" — not a token mint or contract address, and not scoped to any single chain. |
Response fields
A JSON response. Every field is always present; null means the value could not be established, never zero.
| Field | Type | Description |
|---|---|---|
slug | string | The protocol asked about. |
metric | string | What the totals are. |
name | string | The protocol's name. |
totals | object | The protocol, every chain together. |
totals.24h | number | null | The total over the trailing 24h, in USD. null when not reported. |
totals.7d | number | null | The total over the trailing 7d, in USD. null when not reported. |
totals.30d | number | null | The total over the trailing 30d, in USD. null when not reported. |
totals.1y | number | null | The total over the trailing 1y, in USD. null when not reported. |
chains | object[] | One per chain, largest 30-day total first; a chain with no 30-day figure last. |
chains[].chain | string | The chain's name. |
chains[].totals | object | The protocol on this chain. |
chains[].totals.24h | number | null | The total over the trailing 24h, in USD. null when not reported. |
chains[].totals.7d | number | null | The total over the trailing 7d, in USD. null when not reported. |
chains[].totals.30d | number | null | The total over the trailing 30d, in USD. null when not reported. |
chains[].totals.1y | number | null | The total over the trailing 1y, in USD. null when not reported. |
Start building with DexData today
Sign in, create a key and make your first call in a minute. Free credits every month, and you only pay for calls that succeed.
Get a free API key