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.

GET/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>"
Parameters
ParameterDescription
metric

query · 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
slug

path · 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.

Response fields of How much does this protocol earn or trade, and on which chains?
FieldTypeDescription
slugstringThe protocol asked about.
metricstringWhat the totals are.
namestringThe protocol's name.
totalsobjectThe protocol, every chain together.
totals.24hnumber | nullThe total over the trailing 24h, in USD. null when not reported.
totals.7dnumber | nullThe total over the trailing 7d, in USD. null when not reported.
totals.30dnumber | nullThe total over the trailing 30d, in USD. null when not reported.
totals.1ynumber | nullThe total over the trailing 1y, in USD. null when not reported.
chainsobject[]One per chain, largest 30-day total first; a chain with no 30-day figure last.
chains[].chainstringThe chain's name.
chains[].totalsobjectThe protocol on this chain.
chains[].totals.24hnumber | nullThe total over the trailing 24h, in USD. null when not reported.
chains[].totals.7dnumber | nullThe total over the trailing 7d, in USD. null when not reported.
chains[].totals.30dnumber | nullThe total over the trailing 30d, in USD. null when not reported.
chains[].totals.1ynumber | nullThe 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