Skip to main content

Candles

Returns OHLCV (Open, High, Low, Close, Volume) candlestick data for any token. Powered by TimescaleDB continuous aggregates that automatically roll up raw trades into 1-minute, 5-minute, 1-hour, and 1-day buckets.

Endpoint

GET /api/candles/:tokenAddress

Path Parameters

ParameterTypeDescription
tokenAddressstringCW20 contract address of the token

Query Parameters

ParameterTypeDefaultDescription
timeframestring"1h"Candle interval: "1m", "5m", "1h", "1d"
fromstring24h agoStart time (ISO 8601 with timezone, e.g., 2026-02-18T00:00:00Z)
tostringnowEnd time (ISO 8601 with timezone)
limitnumber300Maximum candles to return (1-1000)

Examples

# Last 24 hours of 1-hour candles (default)
curl http://67.205.164.156:3001/api/candles/xyz1cw20contract...

# Last 7 days of daily candles
curl "http://67.205.164.156:3001/api/candles/xyz1cw20contract...?timeframe=1d&from=2026-02-12T00:00:00Z"

# Last 2 hours of 5-minute candles
curl "http://67.205.164.156:3001/api/candles/xyz1cw20contract...?timeframe=5m&from=2026-02-19T08:00:00Z&limit=24"

Response

{
  "token_address": "xyz1cw20contract...",
  "timeframe": "1h",
  "candles": [
    {
      "time": "2026-02-19T08:00:00.000Z",
      "open": "50000",
      "high": "55000",
      "low": "48000",
      "close": "52000",
      "volume": "250000000000",
      "trade_count": 47
    },
    {
      "time": "2026-02-19T09:00:00.000Z",
      "open": "52000",
      "high": "58000",
      "low": "51000",
      "close": "56000",
      "volume": "180000000000",
      "trade_count": 31
    }
  ]
}

Response Fields

FieldTypeDescription
timestringStart of the candle period (ISO 8601)
openstringPrice at the start of the period (uxyz per token, scaled by 10^6)
highstringHighest price during the period
lowstringLowest price during the period
closestringPrice at the end of the period
volumestringTotal XYZ trading volume during the period (in uxyz)
trade_countnumberNumber of trades during the period

Price Conversion

All price values are in uxyz per token, scaled by 10^6:
"close": "52000"  →  52000 / 10^6 = 0.052 uxyz per micro-token
                  →  0.052 XYZ per token

Volume Conversion

Volume is in uxyz:
"volume": "250000000000"  →  250000000000 / 10^6 = 250,000 XYZ

Timeframe Details

TimeframeBucket SizeBest ForData Retention
1m1 minuteScalping, live charts90 days
5m5 minutesShort-term trading90 days
1h1 hourDaily analysis90 days
1d1 dayLong-term trends90 days
Candles are computed from raw trades using TimescaleDB continuous aggregates. They auto-refresh as new trades come in — there is no delay beyond the ~5 second indexing lag.
Periods with no trades will be missing from the response (no zero-volume candles). If you need a continuous series for charting, fill gaps client-side using the previous candle’s close price.

Errors

StatusCondition
400Invalid query parameters (bad timeframe, unparseable date, limit out of range)
500Internal server error