Pools API

Candles of one pool in its own exchange rate

Open/high/low/close of ONE pool with the base token priced in the quote token (not USD), base and quote named, volume in base units and in USD.

GET/api/external/pool-analysis/pool-rate-ohlcv/{chain}/{pool}

What it returns

Price candles for one liquidity pool in the pool's OWN exchange rate: open/high/low/close are one unit of base priced in units of quote (on a SOL/BONK pool, about 32 million BONK per SOL), not USD — pool-ohlcv is the USD sibling. Which token is the base is fixed per pool and is not necessarily the pool's first token; read base and quote. volumeBase is in base-token units and volumeUsd in USD. On SOL both sides are named by address and symbol; on the other chains by symbol only (address is null). A bucket in which the pool did not trade is missing rather than filled. An unknown pool answers an empty series with nothing named — it cannot be told from a pool that did not trade in the window. A window that has not happened yet is refused with 400.

Chains

  • Solana SOL
  • BNB Chain BNB
  • Ethereum ETH
  • Base BASE
  • Robinhood Chain RHC

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/pool-analysis/pool-rate-ohlcv/SOL/<pool>?interval=1m&from=<from>&to=<to>"
Parameters
ParameterDescription
interval

query · string · required

Candle width.1m5m15m1h4h1d
from

query · integer · required

Window start, Unix SECONDS. A candle is returned when its OPEN is at or after this time.
to

query · integer · required

Window end, Unix SECONDS, inclusive. At most 1000 candles fit in one request — a wider window returns 400.
chain

path · string · required

The chain the pool lives on. SOL, ETH, BNB, BASE and RHC are served; STABLE and ARC return 400. CELO, ARB, OP and SCROLL return 400 here.
pool

path · string · required

The pool identifier — a pool/pair address on most venues, or a 32-byte pool ID where the venue uses one (Uniswap v4). It identifies the POOL, not a token traded in it.

Response fields

A JSON response. Every field is always present; null means the value could not be established, never zero.

Response fields of Candles of one pool in its own exchange rate
FieldTypeDescription
chainstring
poolstringThe pool asked; EVM addresses lower-cased.
intervalstring
baseobjectThe token each price is FOR.
base.addressstring | nullMint (Solana) or contract address. null on chains where the pair is named by symbol only (every chain but SOL).
base.symbolstring | nullnull when the pair's name cannot be split unambiguously.
quoteobjectThe token each price is DENOMINATED IN.
quote.addressstring | nullMint (Solana) or contract address. null on chains where the pair is named by symbol only (every chain but SOL).
quote.symbolstring | nullnull when the pair's name cannot be split unambiguously.
candlesobject[]Ascending by at.
candles[].atnumberThe bucket's OPEN, Unix seconds.
candles[].opennumber | nullOne base unit in quote units.
candles[].highnumber | null
candles[].lownumber | null
candles[].closenumber | null
candles[].volumeBasenumber | nullTraded in the bucket, in base-token units.
candles[].volumeUsdnumber | nullTraded in the bucket, in USD.
candles[].completebooleanWhether the bucket has ended. The newest candle is usually the one in progress.

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