Demo Data Schema

The QuestDB demo instance at demo.questdb.com contains two datasets that you can query directly: simulated FX market data and real cryptocurrency trades. This page describes the available tables and their structure.

tip

The demo instance is read-only. For testing write operations (INSERT, UPDATE, DELETE), you'll need to run QuestDB locally. See the Quick Start guide for installation instructions.

Overview

The demo instance provides two independent datasets:

  1. FX Market Data (Simulated) - Foreign exchange prices and order books
  2. Cryptocurrency Trades (Real) - Live cryptocurrency trades from OKX exchange

FX Market Data (Simulated)

The FX dataset contains simulated foreign exchange market data for 30 currency pairs. We fetch real reference prices from Yahoo Finance every few seconds, but all order book levels and price updates are generated algorithmically based on these reference prices.

core_price Table

The core_price table contains individual FX price updates from various liquidity providers. Each row represents a bid/ask quote update for a specific currency pair from a specific ECN.

Schema

core_price table structure
CREATE TABLE 'core_price' (
timestamp TIMESTAMP,
symbol SYMBOL CAPACITY 16384 CACHE,
ecn SYMBOL CAPACITY 256 CACHE,
bid_price DOUBLE,
bid_volume LONG,
ask_price DOUBLE,
ask_volume LONG,
reason SYMBOL CAPACITY 256 CACHE,
indicator1 DOUBLE,
indicator2 DOUBLE
) timestamp(timestamp) PARTITION BY HOUR TTL 3 DAYS WAL;

Columns

  • timestamp - Time of the price update (designated timestamp)
  • symbol - Currency pair from the 30 tracked symbols (see list below)
  • ecn - Electronic Communication Network providing the quote: LMAX, EBS, Currenex, or Hotspot
  • bid_price - Bid price (price at which market makers are willing to buy)
  • bid_volume - Volume available at the bid price
  • ask_price - Ask price (price at which market makers are willing to sell)
  • ask_volume - Volume available at the ask price
  • reason - Reason for the price update: "normal", "liquidity_event", or "news_event"
  • indicator1, indicator2 - Additional market indicators

The table tracks 30 currency pairs: EURUSD, GBPUSD, USDJPY, USDCHF, AUDUSD, USDCAD, NZDUSD, EURJPY, GBPJPY, EURGBP, AUDJPY, CADJPY, NZDJPY, EURAUD, EURNZD, AUDNZD, GBPAUD, GBPNZD, AUDCAD, NZDCAD, EURCAD, EURCHF, GBPCHF, USDNOK, USDSEK, USDZAR, USDMXN, USDSGD, USDHKD, USDTRY.

Sample Data

Recent core_price updatesDemo this query
SELECT * FROM core_price
WHERE timestamp IN today()
LIMIT -10;

Results:

timestampsymbolecnbid_pricebid_volumeask_priceask_volumereasonindicator1indicator2
2025-12-18T11:46:13.059566ZUSDCHFLMAX0.79592198840.7971223174liquidity_event0.641
2025-12-18T11:46:13.060542ZUSDSGDCurrenex1.2912957570491.2982301215620normal0.034
2025-12-18T11:46:13.061853ZEURAUDLMAX1.765162076301.76915631029liquidity_event0.027
2025-12-18T11:46:13.064138ZAUDNZDLMAX1.13442276681.1356212604liquidity_event0.881
2025-12-18T11:46:13.065041ZGBPNZDLMAX2.330720211662.33371712096normal0.308
2025-12-18T11:46:13.065187ZUSDCADEBS1.383723949781.38692300556normal0.084
2025-12-18T11:46:13.065722ZUSDZAREBS16.72112810702116.726323536519liquidity_event0.151
2025-12-18T11:46:13.066128ZEURAUDEBS1.7638104718221.7712883424752news_event0.027
2025-12-18T11:46:13.066700ZCADJPYCurrenex113.6320300827114.1119720915normal0.55
2025-12-18T11:46:13.071607ZNZDJPYCurrenex89.953528422890.4630552528liquidity_event0.69

market_data Table

The market_data table contains order book snapshots for currency pairs. Each row represents a complete view of the order book at a specific timestamp, with bid and ask prices and volumes stored as 2D arrays.

Schema

market_data table structure
CREATE TABLE 'market_data' (
timestamp TIMESTAMP,
symbol SYMBOL CAPACITY 16384 CACHE,
bids DOUBLE[][],
asks DOUBLE[][]
) timestamp(timestamp) PARTITION BY HOUR TTL 3 DAYS;

Columns

  • timestamp - Time of the order book snapshot (designated timestamp)
  • symbol - Currency pair (e.g., EURUSD, GBPJPY)
  • bids - 2D array containing bid prices and volumes: [[price1, price2, ...], [volume1, volume2, ...]]
  • asks - 2D array containing ask prices and volumes: [[price1, price2, ...], [volume1, volume2, ...]]

The arrays are structured so that:

  • bids[1] contains bid prices (descending order - highest first)
  • bids[2] contains corresponding bid volumes
  • asks[1] contains ask prices (ascending order - lowest first)
  • asks[2] contains corresponding ask volumes

Sample Query

Recent order book snapshotsDemo this query
SELECT timestamp, symbol,
array_count(bids[1]) as bid_levels,
array_count(asks[1]) as ask_levels
FROM market_data
WHERE timestamp IN today()
LIMIT -5;

Results:

timestampsymbolbid_levelsask_levels
2025-12-18T12:04:07.071512ZEURAUD4040
2025-12-18T12:04:07.072060ZUSDJPY4040
2025-12-18T12:04:07.072554ZUSDMXN4040
2025-12-18T12:04:07.072949ZUSDCAD4040
2025-12-18T12:04:07.073002ZUSDSEK4040

Each order book snapshot contains 40 bid levels and 40 ask levels.

fx_trades Table

The fx_trades table contains simulated FX trade executions. Each row represents a trade that executed against the order book, with realistic partial fills and level walking.

Schema

fx_trades table structure
CREATE TABLE 'fx_trades' (
timestamp TIMESTAMP_NS,
symbol SYMBOL,
ecn SYMBOL,
trade_id UUID,
side SYMBOL,
passive BOOLEAN,
price DOUBLE,
quantity DOUBLE,
counterparty SYMBOL,
order_id UUID
) timestamp(timestamp) PARTITION BY HOUR TTL 1 MONTH WAL;

Columns

  • timestamp - Time of trade execution with nanosecond precision (designated timestamp)
  • symbol - Currency pair (same 30 pairs as core_price)
  • ecn - ECN where trade executed: LMAX, EBS, Currenex, or Hotspot
  • trade_id - Unique identifier for this specific trade
  • side - Trade direction: buy or sell
  • passive - Whether this was a passive (limit) or aggressive (market) order
  • price - Execution price
  • quantity - Trade size
  • counterparty - 20-character LEI (Legal Entity Identifier) of the counterparty
  • order_id - Parent order identifier (multiple trades can share the same order_id for partial fills)

Sample Data

Recent FX tradesDemo this query
SELECT * FROM fx_trades
WHERE timestamp IN today()
LIMIT -10;

Results:

timestampsymbolecntrade_idsidepassivepricequantitycounterpartyorder_id
2026-01-12T12:18:57.138282586ZEURUSDLMAXd14e6e54-6c6b-495d-865d-47311a36519bsellfalse1.1705193615.0004409EA0ED5B9FF954Bdb3cd1e6-c3e7-4909-8a64-31a2b6f0f9c0
2026-01-12T12:18:57.138912209ZEURUSDLMAXbe857ed7-848f-4d23-83ff-3e5636cbc9desellfalse1.1707107749.0000A4FB276D1BE98F143db3cd1e6-c3e7-4909-8a64-31a2b6f0f9c0
2026-01-12T12:18:57.259555330ZGBPUSDEBS446cac16-9b25-4205-b1e1-3eda4a3bb539sellfalse1.3401192701.000119FEF98D9EC079D15d0d74987-8929-4c48-bc18-7164b1a956e3
2026-01-12T12:18:57.303333947ZGBPUSDEBS27515a12-9ab6-4175-8fa3-422d4529f365selltrue1.340466295.000363EC8480C058FD36C239eae98-fc45-4e1c-bd45-8933909a67fc
2026-01-12T12:18:57.334406432ZUSDTRYEBSc82453b3-9961-40ea-a6ac-43c33fe0f235selltrue43.100165849.0002A80CCE4AFD37D06422ce77a03-0f21-4241-8ca7-903080848dc0
2026-01-12T12:18:57.365445776ZUSDJPYLMAXbf918a88-60c2-4a20-8f53-65298b5a10febuyfalse156.8255548.000EB428CCC1C1C240F717458b51d-65fa-4ffb-8fa8-840e88d2c316
2026-01-12T12:18:57.479674129ZUSDJPYEBSc7c902bd-7075-4952-88d1-76d39ba4c706buyfalse156.8298591.000A10D27678CC03A01615992296a-684f-4783-9e8c-7206519a85f8
2026-01-12T12:18:57.480051522ZUSDJPYEBSa20b6f91-7148-4b64-8a36-85da5bec66f9buyfalse156.85178152.000CBD8490AE2844C85545992296a-684f-4783-9e8c-7206519a85f8
2026-01-12T12:18:57.509773474ZGBPUSDCurrenexae6b771b-5abd-44c7-9e0e-3527ce6fb5b4sellfalse1.340462305.0006728CF215E44412D1854ff8191-1891-4a5c-8b67-d5cd961ec5e8
2026-01-12T12:18:57.334732460ZUSDTRYEBS469637a5-6553-4aad-aad9-f7114c8a442dselltrue43.1101177.0002CAC92E93AB4B3D30C2ce77a03-0f21-4241-8ca7-903080848dc0

FX Materialized Views

The FX dataset includes several materialized views providing pre-aggregated data at different time intervals:

Best Bid/Offer (BBO) Views

  • bbo_1s - Best bid and offer aggregated every 1 second
  • bbo_1m - Best bid and offer aggregated every 1 minute
  • bbo_1h - Best bid and offer aggregated every 1 hour
  • bbo_1d - Best bid and offer aggregated every 1 day

Core Price Aggregations

  • core_price_1s - Core prices aggregated every 1 second
  • core_price_1d - Core prices aggregated every 1 day

Market Data OHLC

  • market_data_ohlc_1m - Open, High, Low, Close candlesticks at 1-minute intervals
  • market_data_ohlc_15m - OHLC candlesticks at 15-minute intervals
  • market_data_ohlc_1d - OHLC candlesticks at 1-day intervals

FX Trades OHLC

  • fx_trades_ohlc_1m - OHLC candlesticks from trade executions at 1-minute intervals
  • fx_trades_ohlc_1h - OHLC candlesticks from trade executions at 1-hour intervals

These views are continuously updated and optimized for dashboard and analytics queries on FX data.

FX Data Volume

  • market_data: Approximately 160 million rows per day (order book snapshots)
  • core_price: Approximately 73 million rows per day (price updates across all ECNs and symbols)
  • fx_trades: Approximately 5.1 million rows per day (trade executions)

Cryptocurrency Trades (Real)

The cryptocurrency dataset contains real market data streamed live from the OKX exchange using FeedHandler. These are actual executed trades, not simulated data.

trades Table

The trades table contains real cryptocurrency trade data. Each row represents an actual executed trade for a cryptocurrency pair.

Schema

trades table structure
CREATE TABLE 'trades' (
symbol SYMBOL CAPACITY 256 CACHE,
side SYMBOL CAPACITY 256 CACHE,
price DOUBLE,
amount DOUBLE,
timestamp TIMESTAMP
) timestamp(timestamp) PARTITION BY DAY WAL;

Columns

  • timestamp - Time when the trade was executed (designated timestamp)
  • symbol - Cryptocurrency trading pair from the 12 tracked symbols (see list below)
  • side - Trade side: buy or sell
  • price - Execution price of the trade
  • amount - Trade size (volume in base currency)

The table tracks 12 cryptocurrency pairs: ADA-USDT, AVAX-USD, BTC-USDT, DAI-USD, DOT-USD, ETH-BTC, ETH-USDT, LTC-USD, SOL-BTC, SOL-USD, UNI-USD, XLM-USD.

Sample Data

Recent cryptocurrency tradesDemo this query
SELECT * FROM trades
LIMIT -10;

Results:

symbolsidepriceamounttimestamp
BTC-USDTbuy85721.60.000457142025-12-18T19:31:11.203000Z
BTC-USDbuy85721.60.000457142025-12-18T19:31:11.203000Z
BTC-USDTbuy85726.60.000015012025-12-18T19:31:11.206000Z
BTC-USDbuy85726.60.000015012025-12-18T19:31:11.206000Z
BTC-USDTbuy85726.90.0008872025-12-18T19:31:11.206000Z
BTC-USDbuy85726.90.0008872025-12-18T19:31:11.206000Z
BTC-USDTbuy85731.30.000043932025-12-18T19:31:11.206000Z
BTC-USDbuy85731.30.000043932025-12-18T19:31:11.206000Z
ETH-USDTsell2827.540.0069292025-12-18T19:31:11.595000Z
ETH-USDsell2827.540.0069292025-12-18T19:31:11.595000Z

Cryptocurrency Materialized Views

The cryptocurrency dataset includes materialized views for aggregated trade data:

Trades Aggregations

  • trades_latest_1d - Latest trade data aggregated daily
  • trades_OHLC_15m - OHLC candlesticks for cryptocurrency trades at 15-minute intervals

These views are continuously updated and provide faster query performance for cryptocurrency trade analysis.

Cryptocurrency Data Volume

  • trades: Approximately 3.7 million rows per day (real cryptocurrency trades)

Data Retention

FX tables (core_price and market_data) use a 3-day TTL (Time To Live), meaning data older than 3 days is automatically removed. This keeps the demo instance responsive while providing sufficient recent data.

Cryptocurrency trades table has no retention policy and contains historical data dating back to March 8, 2022. This provides over 3 years of real cryptocurrency trade history for long-term analysis and backtesting.

Using the Demo Data

You can run queries against both datasets directly on demo.questdb.com. Throughout the Cookbook, recipes using demo data will include a direct link to execute the query.