BlockJuice loads price candles from Binance and Coinbase spot markets into a Postgres you run, next to your onchain tables. Each row is one candle of one token against one quote asset, at one interval, from one exchange. The data comes from each exchange’s public market-data API, not from a chain.
Coverage
Each source reads only the pairs you list in its tokens.json. It loads one interval, set by CANDLE_INTERVAL in its .env, 1h by default. Binance serves intervals from 1m to 1w, Coinbase 1m, 5m, 15m, 1h, 6h and 1d. interval uses Binance’s names. Prices are in quote-asset units, such as USDT or USD, and volume is in token units. Coinbase leaves quote_volume and trades null.
Binance, Coinbase
Tables
01
Columns
13
Tables
One candle of one token against one quote asset at one interval, from one exchange. Prices are in quote-asset units and volume in token units. Covers Binance and Coinbase spot markets, for the pairs in each source's tokens.json. Binance serves intervals from 1m to 1w, Coinbase 1m, 5m, 15m, 1h, 6h and 1d.
The prices pipeline builds it from the call sources binance-candles and coinbase-candles, which read each exchange's public market-data API.
analytics.token_prices
exchange
text
binance or coinbase.
token
text
The token's ticker on the exchange, such as UNI.
quote
text
The asset the prices are in, such as USDT or USD.
interval
text
The candle's length in Binance's names, such as 1h or 1d.
open_time
timestamptz
When the candle opened.
close_time
timestamptz
The candle's last millisecond.
open
numeric
The first trade's price, in quote-asset units.
high
numeric
The highest trade price.
low
numeric
The lowest trade price.
close
numeric
The last trade's price.
volume
numeric
How much of the token traded, in token units.
quote_volume
numeric
How much of the quote asset traded. Null for Coinbase.
trades
bigint
How many trades the candle holds. Null for Coinbase.
Query it
select exchange, token, quote, open_time, open, high, low, close, volume
from analytics.token_prices
where "interval" = '1h'
order by open_time desc
limit 20
Each row is one hourly candle of one pair on one exchange, with prices in the quote asset. The query quotes interval because it is also a SQL keyword.
select exchange, quote, open_time, close
from analytics.token_prices
where token = 'ETH' and "interval" = '1h'
order by open_time desc, exchange
limit 20
Each row is one hourly ETH candle from Binance or Coinbase, each priced in its own quote asset.
Load it
The prices pipeline builds the table on this page.
uv run --project orchestration bj run prices
List the pairs you follow in each source’s tokens.json.
Build the tables with bj run <pipeline>, or turn on the pipeline’s schedule in Dagster to rebuild them each day at 06:00 UTC.
Query the analytics schema in your Postgres with SQL, or ask in plain language with /bj <question>.