Live crypto price charts

Real-time Bitcoin, Ethereum & 20+ pairs on QuestDB

Powered by
QuestDB logoQuestDB
and
Grafana LogoGrafana

Latest trades

Real-time buy and sell orders from OKX, covering exchanges amongst assets.

SELECT timestamp,
left(symbol,strpos(symbol,'-')-1) asset,
right(symbol,length(symbol)-strpos(symbol,'-')) counter,
case when side = 'buy' then amount else -amount end quantity,
case when side = 'buy' then -amount*price else amount*price end consideration,
case when (now()-timestamp)/1000000<0.3 then 'x' else '' end new
from trades where dateadd('m', -1, now()) < timestamp
and (
symbol like '%-USDT'
or symbol like '%-ETH'
or symbol like '%-BTC'
)
order by timestamp desc
limit 50;
Launch in live demo

Real-time trades

Filled exchange orders between crypto assets, with USD notional along the y-axis. Positive values are buy orders, negative are sell orders.

SELECT timestamp time, symbol,
case when side ='buy' then amount*price
else -1*amount*price end trade
from trades where dateadd('m', -1, now()) < timestamp and (
symbol like '%-USDT'
);
Launch in live demo

Trade Blotter · OHLC · VWAP · RSI · Bollinger Bands

Tick-by-tick OKX data ingested into QuestDB and rendered in Grafana dashboards

Volume heatmap

Trade volume (USD notional) distribution per asset for the past 5 minutes.

select timestamp time, left(symbol,strpos(symbol,'-')-1) asset, sum(abs(amount)) from
trades where dateadd('m', -5, now()) < timestamp and
symbol like '%-USDT'
sample by 5s
order by asset, time;
Launch in live demo

Candlestick Chart (OHLC) BTC-USDT

An OHLC (Open, High, Low, Close) chart for BTC-USDT, sampled every five seconds over the past 5 minutes.

SELECT timestamp as time, first(price) as open, last(price) as close, min(price) as lo, max(price) as hi, sum(amount) as vol
FROM trades
WHERE symbol = 'BTC-USDT' and dateadd('m', -5, now()) < timestamp
SAMPLE BY 5s ALIGN TO CALENDAR;
Launch in live demo

Purpose-built for Tick & Order-Book Data

Store depth snapshots with ARRAY columns and query them using capital-markets SQL functions

Moving averages BTC-USDT

Moving averages on the price of BTC-USDT in the past 5 minutes, over 10-, 30-, and 45-second windows.

SELECT timestamp time, symbol, price as priceBtc
, avg(price) over (PARTITION BY symbol ORDER BY timestamp RANGE between 10 seconds PRECEDING AND CURRENT ROW) movingAvg10Sec
, avg(price) over (PARTITION BY symbol ORDER BY timestamp RANGE between 30 seconds PRECEDING AND CURRENT ROW) movingAvg30Sec
, avg(price) over (PARTITION BY symbol ORDER BY timestamp RANGE between 45 seconds PRECEDING AND CURRENT ROW) movingAvg45Sec
FROM trades WHERE dateadd('m', -5, now()) < timestamp AND symbol = 'BTC-USDT';
Launch in live demo

Rolling BTC-USDT vs ETH-USDT correlation coefficient

Calculation of the Pearson correlation coefficient (ρ) between the prices of BTC-USDT and ETH. Data is sampled every minute over the past 12 hours, and correlation is calculated over hour- and day-long windows.

WITH data as (
WITH
ETHUSD as (select timestamp, last(price) as price from trades where dateadd('h', -12, now()) < timestamp and symbol = 'ETH-USDT' sample by 1s),
asset as (select timestamp, last(price) as price from trades where dateadd('h', -12, now()) < timestamp and symbol = 'BTC-USDT' sample by 1s)
SELECT ETHUSD.timestamp, corr(ETHUSD.price,asset.price) from ETHUSD asof join asset sample by 1m)
SELECT timestamp
, avg(corr) over(ORDER BY timestamp range between 1 hour preceding and current row) hourly_corr_rolling
, avg(corr) over(ORDER BY timestamp range between 24 hour preceding and current row) daily_corr_rolling
from data;
Launch in live demo

Extreme Performance

Low-latency, Millions of rows per second, instant analytics at terabyte scale

VWAP - Yesterday vs Today - BTC-USDT

Volume Weighted Average Price of BTC-USDT from yesterday compared to today. It uses the `trades_OHLC_15m` materialized view, so data is returned at 15 minute intervals

WITH sampled AS (
SELECT
timestamp, symbol,
volume AS volume,
((open+close)/2) * volume AS traded_value
FROM trades_OHLC_15m
WHERE dateadd('d', -1, now()) < timestamp
AND symbol = 'BTC-USDT'
), cumulative AS (
SELECT timestamp, symbol,
SUM(traded_value)
OVER (ORDER BY timestamp) AS cumulative_value,
SUM(volume)
OVER (ORDER BY timestamp) AS cumulative_volume
FROM sampled
)
SELECT timestamp as time, cumulative_value/cumulative_volume AS vwap_yesterday FROM cumulative;
Launch in live demo

Bollinger Bands BTC-USDT

Bollinger Bands. We are using the moving average over the past 20 closing prices of BTC-USDT at 15 minute intervals, plus/minus twice of the standard deviation. It can help identify volatility. This query uses the `trades_OHLC_15m` materialized view

WITH stats AS (
SELECT
timestamp,
close,
AVG(close) OVER (
ORDER BY timestamp
ROWS BETWEEN 19 PRECEDING AND CURRENT ROW
) AS sma20,
AVG(close * close ) OVER (
ORDER BY timestamp
ROWS BETWEEN 19 PRECEDING AND CURRENT ROW
) AS avg_close_sq
FROM trades_OHLC_15m
WHERE timestamp between dateadd('h', -24, now()) AND now()
AND symbol = 'BTC-USDT'
)
SELECT
timestamp as time,
sma20,
-- sqrt(avg_close_sq - (sma20 * sma20)) as stdev20,
sma20 + 2 * sqrt(avg_close_sq - (sma20 * sma20)) as upper_band,
sma20 - 2 * sqrt(avg_close_sq - (sma20 * sma20)) as lower_band
FROM stats
ORDER BY timestamp;
Launch in live demo

Interactive SQL

Click SHOW QUERY to inspect the live QuestDB statements behind every panel

Average True Range BTC-USDT

This chart shows the 14-period Average True Range (ATR) for BTC-USDT, using 15-minute OHLC bars from the `trades_OHLC_15m` materialized view, over the past 15 days. The ATR measures short-term volatility by averaging the True Range, defined as the greatest of: • High − Low • |High − Previous Close| • |Low − Previous Close| Higher ATR values indicate greater price movement and market volatility; lower values reflect more stable, range-bound behavior.

WITH prev_close AS (
SELECT
timestamp, symbol, high, low,
LAG(close) OVER (PARTITION BY symbol ORDER BY timestamp) as prev_close
FROM trades_OHLC_15m
WHERE symbol = 'BTC-USDT'
AND dateadd('d', -15, now()) < timestamp
), true_range AS (
SELECT
timestamp, symbol,
GREATEST(
high - low,
ABS(high - prev_close),
ABS(low - prev_close)
) AS tr
FROM prev_close
)
SELECT
timestamp as time, symbol,
AVG(tr) OVER (PARTITION BY symbol ORDER BY timestamp ROWS BETWEEN 13 PRECEDING AND CURRENT ROW) AS atr_14
FROM true_range
ORDER BY timestamp;
Launch in live demo

Relative Strength Index 14 days - BTC-USDT

14-day RSI (Relative Strength Index) for BTC-USDT using daily closes from the trades_latest_1d table over the selected 1-month range. RSI is calculated by averaging 14 days of gains and losses. Values near 70 suggest overbought conditions; values near 30 suggest oversold. A smoothing window of 14 periods is applied using window functions.

WITH price_changes AS (
SELECT
timestamp,
symbol,
close,
close - prev_close price_change
FROM (
SELECT
timestamp,
symbol,
price as close,
LAG(price) OVER (PARTITION BY symbol ORDER BY timestamp) AS prev_close
FROM trades_latest_1d
WHERE dateadd('M', -1, now()) < timestamp
AND symbol = 'BTC-USDT'
)
),
gains_losses AS (
SELECT
timestamp,
symbol,
close,
CASE WHEN price_change > 0 THEN price_change ELSE 0 END AS gain,
CASE WHEN price_change < 0 THEN ABS(price_change) ELSE 0 END AS loss
FROM price_changes
),
avg_gains_losses AS (
SELECT
timestamp,
symbol,
close,
AVG(gain) OVER (PARTITION BY symbol ORDER BY timestamp ROWS BETWEEN 13 PRECEDING AND CURRENT ROW) AS avg_gain,
AVG(loss) OVER (PARTITION BY symbol ORDER BY timestamp ROWS BETWEEN 13 PRECEDING AND CURRENT ROW) AS avg_loss
FROM gains_losses
)
SELECT
timestamp as time,
symbol,
CASE
WHEN avg_loss = 0 THEN 100
ELSE 100 - (100 / (1 + (avg_gain / NULLIF(avg_loss, 0))))
END AS rsi_14
FROM avg_gains_losses
ORDER BY timestamp;
Launch in live demo

Try it yourself

Ready to store market data? Follow our tutorial series on building Grafana dashboards

Relative Strength Index 14 days - All Symbols

14-day RSI (Relative Strength Index) computed for all symbols ending in -USDT, -ETH, or -BTC using daily closing prices from the `trades_latest_1d` materialized view. Uses a 14-period rolling window of average gains and losses per symbol. Highlights overbought (>70) or oversold (<30) conditions across assets.

WITH price_changes AS (
SELECT
timestamp,
symbol,
close,
close - prev_close price_change
FROM (
SELECT
timestamp,
symbol,
price as close,
LAG(price) OVER (PARTITION BY symbol ORDER BY timestamp) AS prev_close
FROM trades_latest_1d
WHERE dateadd('M', -1, now()) < timestamp
AND (
symbol like '%-USDT'
or symbol like '%-ETH'
or symbol like '%-BTC'
)
)
),
gains_losses AS (
SELECT
timestamp,
symbol,
close,
CASE WHEN price_change > 0 THEN price_change ELSE 0 END AS gain,
CASE WHEN price_change < 0 THEN ABS(price_change) ELSE 0 END AS loss
FROM price_changes
),
avg_gains_losses AS (
SELECT
timestamp,
symbol,
close,
AVG(gain) OVER (PARTITION BY symbol ORDER BY timestamp ROWS BETWEEN 13 PRECEDING AND CURRENT ROW) AS avg_gain,
AVG(loss) OVER (PARTITION BY symbol ORDER BY timestamp ROWS BETWEEN 13 PRECEDING AND CURRENT ROW) AS avg_loss
FROM gains_losses
)
SELECT
timestamp as time,
symbol,
CASE
WHEN avg_loss = 0 THEN 100
ELSE 100 - (100 / (1 + (avg_gain / NULLIF(avg_loss, 0))))
END AS rsi_14
FROM avg_gains_losses;
Launch in live demo

Build your own on QuestDB

High performance ingest & slick visualizations.
Perfect for financial data and real-time analytics.