Skip to content

CCXT

Candles, quotes, order books, trades and perpetual funding from 100+ crypto exchanges

Connector software
Free and open source
Service credentials
Not needed
Use with an agent

Install the Orchard skill in your project to help your agent find connectors, configure them, and verify SQL results.

npx skills add Query-farm/vgi-skills --skill orchard

Copy this request into your coding agent to get started.

Use https://query.farm/products/orchard/connectors/ccxt/index.md to help me query CCXT with DuckDB or Haybarn 2.0.1 and VGI protocol 3.4. Ask only for missing details about the result I need or whether I want local execution, self-hosting or Query Farm hosting. Check the connector's actual hosting availability, credentials and input requirements. Read one format of each needed reference and the exact object declarations before writing SQL. Use a released connector, and distinguish a saved example result from anything you actually execute. If you cannot run the query, tell me what remains to verify.

Daily BTC/USD candles on Coinbase for January 2025

Example output · captured
Connector release
v0.2.0
Engine
2.0.1
VGI protocol
3.4.0
SELECT ts, close, volume
FROM ccxt.main.ohlcv('coinbase', 'BTC/USD', '1d', since := TIMESTAMP '2025-01-01', until := TIMESTAMP '2025-02-01')
ORDER BY ts
Result · first 5 rows
ts close volume
2025-01-01 00:00 94,383.59 6,871.74
2025-01-02 00:00 96,903.19 10,912.47
2025-01-03 00:00 98,136.51 9,021.89
2025-01-04 00:00 98,209.85 2,742.09
2025-01-05 00:00 98,345.33 2,377.92

Quick start

Choose where to run CCXT, then follow the steps below.

The connector runs alongside DuckDB or Haybarn. No Query Farm account is needed.

1. Install the vgi extension

Run this in your SQL client. On DuckDB, keep FROM query_farm on LOAD in later sessions.

setup.sql
SET allow_extension_repositories = 'allowed';

CREATE EXTENSION REPOSITORY IF NOT EXISTS query_farm
    WITH PREFIX 'https://duckdb-extensions.query.farm';

INSTALL vgi FROM query_farm;
LOAD vgi FROM query_farm;

2. Attach the connector

Attach with uvx

Needs uv. uvx builds the worker from its release tag on first attach and reuses the cached environment after that.

ATTACH 'ccxt' AS ccxt (
  TYPE vgi,
  LOCATION 'uvx --from git+https://github.com/Query-farm/[email protected] vgi-ccxt-worker'
);

3. Run a query

query.sql
SELECT ts, close, volume
FROM ccxt.main.ohlcv('coinbase', 'BTC/USD', '1d', since := TIMESTAMP '2025-01-01', until := TIMESTAMP '2025-02-01')
ORDER BY ts
More example queries →
Technical details
Verified connector release
v0.2.0
Engine
2.0.1
VGI protocol
3.4.0
Verified on
December 1, 2026
Release notes on GitHub
Pin a version for production

When running the connector yourself, keep a specific release until you’re ready to upgrade. Replace the ATTACH statement above with this one and follow the same extension and credential setup.

Attach with uvx

Needs uv. uvx builds the worker from its release tag on first attach and reuses the cached environment after that.

ATTACH 'ccxt' AS ccxt (
  TYPE vgi,
  LOCATION 'uvx --from git+https://github.com/Query-farm/[email protected] vgi-ccxt-worker'
);

Overview

Public cryptocurrency market data from more than one hundred centralized exchanges through the CCXT library: candles, trades, quotes, order books, and perpetual funding and open interest. Every query is a live request to the exchange. No API key needed.

Catalog

Everything ccxt exposes once attached — read straight from the worker's released build.

ccxt 1 schema
main 1 table · 9 functions

Public crypto market data from CCXT exchanges: history, snapshots, derivatives and reference tables.

Schema examples (13)
Examples (13)

Daily BTC/USD candles on Coinbase for January 2025

SELECT ts, close, volume
FROM ccxt.main.ohlcv('coinbase', 'BTC/USD', '1d', since := TIMESTAMP '2025-01-01', until := TIMESTAMP '2025-02-01')
ORDER BY ts;
Result · first 5 rows
ts close volume
2025-01-01 00:00 94,383.59 6,871.74
2025-01-02 00:00 96,903.19 10,912.47
2025-01-03 00:00 98,136.51 9,021.89
2025-01-04 00:00 98,209.85 2,742.09
2025-01-05 00:00 98,345.33 2,377.92

Buy versus sell volume in Kraken's most recent BTC/USD trades

SELECT side, count(*) AS trades, sum(amount) AS btc
FROM ccxt.main.trades('kraken', 'BTC/USD')
GROUP BY side
ORDER BY side;

Compare BTC/USD on two US exchanges

SELECT exchange, last, ask - bid AS spread, quote_volume
FROM ccxt.main.ticker(['kraken', 'coinbase'], 'BTC/USD')
WHERE error IS NULL
ORDER BY last;

Liquidity in the top 50 levels on each side of Kraken's BTC/USD book

SELECT side, sum(amount) AS btc, sum(price * amount) AS usd
FROM ccxt.main.order_book('kraken', 'BTC/USD', depth := 50)
GROUP BY side
ORDER BY side;
9 more examples

BTC perpetual swaps listed on OKX

SELECT symbol, settle, contract_size
FROM ccxt.main.markets('okx')
WHERE type = 'swap' AND base = 'BTC'
ORDER BY symbol;

Which of three exchanges publish funding-rate history

SELECT exchange, supported
FROM ccxt.main.has(['kraken', 'okx', 'binance'])
WHERE method = 'fetchFundingRateHistory'
ORDER BY exchange;

Number of settlements and average annualized BTC perpetual funding on Binance over June 2025 (for a rolling window, pass start_date := current_date - INTERVAL 30 DAY)

SELECT count(*) AS settlements, avg(funding_rate_annualized) AS avg_apr
FROM ccxt.main.funding_rates('binance', 'BTC/USDT:USDT', start_date := DATE '2025-06-01', end_date := DATE '2025-07-01');

Rank venues by annualized BTC perpetual funding

SELECT exchange, funding_rate, interval_hours, funding_rate_annualized
FROM ccxt.main.funding_rate(['binance', 'okx'], 'BTC/USDT:USDT')
WHERE error IS NULL
ORDER BY funding_rate_annualized DESC;

BTC perpetual open interest by venue, largest first

SELECT exchange, open_interest_value
FROM ccxt.main.open_interest(['binance', 'okx'], 'BTC/USDT:USDT')
WHERE error IS NULL
ORDER BY open_interest_value DESC;

Exchanges that publish both funding history and open interest

SELECT id, name
FROM ccxt.main.exchanges
WHERE has_funding_rate_history AND has_open_interest
ORDER BY id;

Current annualized BTC perpetual funding across Binance and OKX, weighted by each venue's open interest (funding_rate joined to open_interest)

SELECT sum(f.funding_rate_annualized * o.open_interest_value) / sum(o.open_interest_value) AS oi_weighted_apr,
  sum(o.open_interest_value) AS total_oi_usdt, count(*) AS venues
FROM ccxt.main.funding_rate(['binance', 'okx'], 'BTC/USDT:USDT') AS f
JOIN ccxt.main.open_interest(['binance', 'okx'], 'BTC/USDT:USDT') AS o USING (exchange)
WHERE f.error IS NULL AND o.error IS NULL;

What a 2 BTC market buy on Kraken would cost: walk the ask side of the order book, then add the market's default taker fee from markets (filled_btc is below 2 if the book is too thin)

WITH asks AS (SELECT price, amount, sum(amount) OVER (ORDER BY level) - amount AS ahead FROM ccxt.main.order_book('kraken', 'BTC/USD', depth := 50) WHERE side = 'ask'), fill AS (SELECT sum(least(amount, greatest(2 - ahead, 0))) AS filled_btc, sum(price * least(amount, greatest(2 - ahead, 0))) AS cost_usd FROM asks) SELECT fill.filled_btc, fill.cost_usd / fill.filled_btc AS avg_fill_price, fill.cost_usd * (1 + m.taker) AS cost_with_taker_fee_usd
FROM fill
JOIN ccxt.main.markets('kraken') AS m ON m.symbol = 'BTC/USD';

Funding settled each UTC day on Binance's BTC perpetual next to that day's open-to-close return of the perpetual itself, first week of 2025 (funding_rates joined to ohlcv)

WITH funding AS (SELECT CAST(ts AS DATE) AS day, sum(funding_rate) AS daily_funding FROM ccxt.main.funding_rates('binance', 'BTC/USDT:USDT', start_date := DATE '2025-01-01', end_date := DATE '2025-01-08') GROUP BY day), candles AS (SELECT CAST(ts AS DATE) AS day, close / open - 1 AS price_return FROM ccxt.main.ohlcv('binance', 'BTC/USDT:USDT', '1d', since := TIMESTAMP '2025-01-01', until := TIMESTAMP '2025-01-08')) SELECT day, daily_funding, price_return
FROM funding
JOIN candles USING (day)
ORDER BY day;
Tables
exchanges 2 examples11 cols

Every crypto exchange CCXT supports, with name, countries and key capabilities

Columns
idnot null VARCHAR
CCXT exchange id: the value every other function takes.
name VARCHAR
Display name, e.g. 'Kraken'.
countries VARCHAR[]
ISO country codes CCXT lists for the exchange.
certified BOOLEAN
Whether CCXT marks the integration as certified.
pro BOOLEAN
Whether CCXT Pro supports the exchange over WebSockets.
rate_limit_ms DOUBLE
Minimum spacing CCXT keeps between requests, in milliseconds.
website VARCHAR
The exchange's home page.
has_ohlcv BOOLEAN
Whether ohlcv works on this exchange.
has_trades BOOLEAN
Whether trades works on this exchange.
has_funding_rate_history BOOLEAN
Whether funding_rates works on this exchange.
has_open_interest BOOLEAN
Whether open_interest works on this exchange.
ConstraintsPRIMARY KEY (id)
Examples (2)

Exchanges that publish both funding history and open interest

SELECT id, name
FROM ccxt.main.exchanges
WHERE has_funding_rate_history AND has_open_interest
ORDER BY id;

The ten countries listed for the most exchanges

SELECT unnest(countries) AS country, count(*) AS exchanges
FROM ccxt.main.exchanges
GROUP BY country
ORDER BY exchanges DESC
LIMIT 10;
Link
Table functions
funding_rate (exchange ANY, symbol VARCHAR) 3 examples

Current funding rate of a perpetual swap, per interval and annualized, across exchanges

Arguments
exchange ANY
One CCXT exchange id such as 'kraken', or a list of up to 50 ids to compare exchanges side by side.
symbol VARCHAR
CCXT unified symbol such as 'BTC/USD'; perpetual swaps look like 'BTC/USDT:USDT'.
Returns columns
exchange VARCHAR
CCXT exchange id.
symbol VARCHAR
CCXT unified perpetual symbol.
ts TIMESTAMP
When the exchange published the rate, UTC.
funding_rate DOUBLE
Rate for the upcoming settlement as a decimal per interval; positive means longs pay shorts.
interval_hours DOUBLE
Funding interval in hours, as the exchange declares it.
funding_rate_annualized DOUBLE
funding_rate times intervals per 365-day year (simple).
next_funding_ts TIMESTAMP
When the rate settles, UTC.
mark_price DOUBLE
Mark price used for margining.
index_price DOUBLE
Spot index price the perpetual tracks.
error VARCHAR
NULL on success; otherwise why this exchange returned no data (the other columns are then NULL).
Examples (3)

Rank venues by annualized BTC perpetual funding

SELECT exchange, funding_rate, interval_hours, funding_rate_annualized
FROM ccxt.main.funding_rate(['binance', 'okx'], 'BTC/USDT:USDT')
WHERE error IS NULL
ORDER BY funding_rate_annualized DESC;

The next ETH perpetual funding settlement on OKX

SELECT funding_rate, next_funding_ts
FROM ccxt.main.funding_rate('okx', 'ETH/USDT:USDT')
WHERE error IS NULL;

Current annualized BTC perpetual funding across Binance and OKX, weighted by each venue's open interest (funding_rate joined to open_interest)

SELECT sum(f.funding_rate_annualized * o.open_interest_value) / sum(o.open_interest_value) AS oi_weighted_apr,
  sum(o.open_interest_value) AS total_oi_usdt, count(*) AS venues
FROM ccxt.main.funding_rate(['binance', 'okx'], 'BTC/USDT:USDT') AS f
JOIN ccxt.main.open_interest(['binance', 'okx'], 'BTC/USDT:USDT') AS o USING (exchange)
WHERE f.error IS NULL AND o.error IS NULL;
Link
funding_rates (exchange VARCHAR, symbol VARCHAR, end_date := ANY, max_rows := BIGINT, start_date := ANY) 3 examples

Historical funding rates of a perpetual swap, per interval and annualized

Positional arguments
exchange VARCHAR
CCXT exchange id such as 'kraken'; ccxt.main.exchanges lists every id.
symbol VARCHAR
CCXT unified perpetual symbol such as 'BTC/USDT:USDT'.
Named arguments
end_date := ANY
Include settlements before this time, UTC, exclusive. Defaults to now. · default null
max_rows := BIGINT
Stop after this many rows (default 100,000). · default 100000
start_date := ANY
First settlement to include, UTC, inclusive. Omit for the most recent page only. · default null
Returns columns
exchange VARCHAR
CCXT exchange id.
symbol VARCHAR
CCXT unified perpetual symbol, e.g. 'BTC/USDT:USDT'.
ts TIMESTAMP
Funding settlement time, UTC.
funding_rate DOUBLE
Rate charged for the interval ending at ts, as a decimal (0.0001 = 0.01%). Positive means longs pay shorts; negative means shorts pay longs.
interval_hours DOUBLE
Length of the funding interval in hours (1, 4, 8, ...), inferred from the spacing of settlements.
funding_rate_annualized DOUBLE
funding_rate times the intervals in a 365-day year (simple, not compounded).
Examples (3)

Number of settlements and average annualized BTC perpetual funding on Binance over June 2025 (for a rolling window, pass start_date := current_date - INTERVAL 30 DAY)

SELECT count(*) AS settlements, avg(funding_rate_annualized) AS avg_apr
FROM ccxt.main.funding_rates('binance', 'BTC/USDT:USDT', start_date := DATE '2025-06-01', end_date := DATE '2025-07-01');

Daily total ETH perpetual funding on Binance over the first two weeks of 2025

SELECT date_trunc('day', ts) AS day, sum(funding_rate) AS daily_funding
FROM ccxt.main.funding_rates('binance', 'ETH/USDT:USDT', start_date := DATE '2025-01-01', end_date := DATE '2025-01-15')
GROUP BY day
ORDER BY day;

Funding settled each UTC day on Binance's BTC perpetual next to that day's open-to-close return of the perpetual itself, first week of 2025 (funding_rates joined to ohlcv)

WITH funding AS (SELECT CAST(ts AS DATE) AS day, sum(funding_rate) AS daily_funding FROM ccxt.main.funding_rates('binance', 'BTC/USDT:USDT', start_date := DATE '2025-01-01', end_date := DATE '2025-01-08') GROUP BY day), candles AS (SELECT CAST(ts AS DATE) AS day, close / open - 1 AS price_return FROM ccxt.main.ohlcv('binance', 'BTC/USDT:USDT', '1d', since := TIMESTAMP '2025-01-01', until := TIMESTAMP '2025-01-08')) SELECT day, daily_funding, price_return
FROM funding
JOIN candles USING (day)
ORDER BY day;
Link
has (exchange ANY) 3 examples

Which CCXT methods an exchange supports: native, emulated or not at all

Arguments
exchange ANY
One CCXT exchange id, or a list of up to 50 to compare capabilities.
Returns columns
exchange VARCHAR
CCXT exchange id.
method VARCHAR
CCXT unified method or feature name, e.g. 'fetchOHLCV' or 'fetchFundingRateHistory'.
supported BOOLEAN
True when the method is native or emulated.
status VARCHAR
'native', 'emulated' (CCXT builds it from other calls), 'unsupported' or 'unknown'.
exposed_by_worker BOOLEAN
True for the public market-data methods this worker calls; private and trading methods are never exposed.
Examples (3)

Which of three exchanges publish funding-rate history

SELECT exchange, supported
FROM ccxt.main.has(['kraken', 'okx', 'binance'])
WHERE method = 'fetchFundingRateHistory'
ORDER BY exchange;

Kraken's support for every method this worker uses

SELECT method, status
FROM ccxt.main.has('kraken')
WHERE exposed_by_worker
ORDER BY method;
SELECT method, supported
FROM ccxt.main.has('kraken')
WHERE method IN ('fetchOHLCV', 'fetchFundingRateHistory')
ORDER BY method;
Link
markets (exchange VARCHAR) 2 examples

Every market an exchange lists: symbols, currencies, contract terms, fees and limits

Arguments
exchange VARCHAR
CCXT exchange id, e.g. 'kraken' or 'okx'.
Returns columns
exchange VARCHAR
CCXT exchange id.
symbol VARCHAR
CCXT unified symbol: pass this to the other functions.
market_id VARCHAR
The exchange's own market identifier.
base VARCHAR
Base currency, e.g. 'BTC'.
quote VARCHAR
Quote currency, e.g. 'USD'.
settle VARCHAR
Settlement currency for derivatives (NULL for spot).
type VARCHAR
'spot', 'swap' (perpetual), 'future' or 'option'.
contract BOOLEAN
True for derivatives.
linear BOOLEAN
For derivatives: settled in the quote currency (USDT-margined).
inverse BOOLEAN
For derivatives: settled in the base currency (coin-margined).
contract_size DOUBLE
Base-currency amount per contract, for derivatives.
expiry TIMESTAMP
Expiry time for futures and options, UTC.
active BOOLEAN
Whether the exchange currently lists the market as tradable.
maker DOUBLE
Default maker fee as a decimal (0.001 = 0.1%).
taker DOUBLE
Default taker fee as a decimal.
price_precision DOUBLE
CCXT price precision: the tick size on most exchanges, decimal places on a few.
amount_precision DOUBLE
CCXT amount precision: the lot step on most exchanges.
min_amount DOUBLE
Smallest order amount, in the base currency.
min_cost DOUBLE
Smallest order value, in the quote currency.
Examples (2)

BTC perpetual swaps listed on OKX

SELECT symbol, settle, contract_size
FROM ccxt.main.markets('okx')
WHERE type = 'swap' AND base = 'BTC'
ORDER BY symbol;

Kraken's five most common quote currencies

SELECT quote, count(*) AS pairs
FROM ccxt.main.markets('kraken')
WHERE type = 'spot' AND active
GROUP BY quote
ORDER BY pairs DESC
LIMIT 5;
Link
ohlcv (exchange VARCHAR, symbol VARCHAR, timeframe VARCHAR, max_rows := BIGINT, since := ANY, until := ANY) 2 examples

OHLCV candles for one market on one exchange, backfilled over a time window

Positional arguments
exchange VARCHAR
CCXT exchange id such as 'kraken'; ccxt.main.exchanges lists every id.
symbol VARCHAR
CCXT unified market symbol such as 'BTC/USD' (spot) or 'BTC/USDT:USDT' (USDT-settled perpetual).
timeframe VARCHAR
Candle length in CCXT notation such as '1h' or '1d', checked against the exchange's own list.
Named arguments
max_rows := BIGINT
Stop after this many rows (default 100,000). · default 100000
since := ANY
Start of the window in UTC, inclusive; dates and ISO-8601 strings work too. Omit for the latest page. · default null
until := ANY
End of the window in UTC, exclusive. Defaults to now. · default null
Returns columns
exchange VARCHAR
CCXT exchange id the candle came from.
symbol VARCHAR
CCXT unified market symbol, e.g. 'BTC/USD'.
timeframe VARCHAR
Candle length, e.g. '1h' or '1d'.
ts TIMESTAMP
Candle open time, UTC.
open DOUBLE
First trade price in the candle, in the quote currency.
high DOUBLE
Highest trade price in the candle, in the quote currency.
low DOUBLE
Lowest trade price in the candle, in the quote currency.
close DOUBLE
Last trade price in the candle, in the quote currency.
volume DOUBLE
Traded volume in the candle, in the base currency.
Examples (2)

Daily BTC/USD candles on Coinbase for January 2025

SELECT ts, close, volume
FROM ccxt.main.ohlcv('coinbase', 'BTC/USD', '1d', since := TIMESTAMP '2025-01-01', until := TIMESTAMP '2025-02-01')
ORDER BY ts;
Result · first 5 rows
ts close volume
2025-01-01 00:00 94,383.59 6,871.74
2025-01-02 00:00 96,903.19 10,912.47
2025-01-03 00:00 98,136.51 9,021.89
2025-01-04 00:00 98,209.85 2,742.09
2025-01-05 00:00 98,345.33 2,377.92

Daily high-low range of ETH/USDT on OKX in the first week of 2025, from hourly candles

SELECT date_trunc('day', ts) AS day, max(high) - min(low) AS range_usdt
FROM ccxt.main.ohlcv('okx', 'ETH/USDT', '1h', since := TIMESTAMP '2025-01-01', until := TIMESTAMP '2025-01-08')
GROUP BY day
ORDER BY day;
Link
open_interest (exchange ANY, symbol VARCHAR) 2 examples

Current open interest of a perpetual or futures market, across one or more exchanges

Arguments
exchange ANY
One CCXT exchange id such as 'kraken', or a list of up to 50 ids to compare exchanges side by side.
symbol VARCHAR
CCXT unified symbol such as 'BTC/USD'; perpetual swaps look like 'BTC/USDT:USDT'.
Returns columns
exchange VARCHAR
CCXT exchange id.
symbol VARCHAR
CCXT unified derivatives symbol.
ts TIMESTAMP
When the exchange measured open interest, UTC.
open_interest_amount DOUBLE
Open interest in contracts or base currency, as the exchange reports it.
open_interest_value DOUBLE
Open interest in the quote or settlement currency.
error VARCHAR
NULL on success; otherwise why this exchange returned no data (the other columns are then NULL).
Examples (2)

BTC perpetual open interest by venue, largest first

SELECT exchange, open_interest_value
FROM ccxt.main.open_interest(['binance', 'okx'], 'BTC/USDT:USDT')
WHERE error IS NULL
ORDER BY open_interest_value DESC;

ETH perpetual open interest on OKX

SELECT open_interest_amount
FROM ccxt.main.open_interest('okx', 'ETH/USDT:USDT');
Link
order_book (exchange VARCHAR, symbol VARCHAR, depth := BIGINT) 3 examples

Order-book depth snapshot for one market: bids and asks by level

Positional arguments
exchange VARCHAR
CCXT exchange id, e.g. 'kraken'.
symbol VARCHAR
CCXT unified symbol, e.g. 'BTC/USD'.
Named arguments
depth := BIGINT
Price levels per side (default 20); exchanges may return fewer. · default 20
Returns columns
exchange VARCHAR
CCXT exchange id.
symbol VARCHAR
CCXT unified market symbol.
ts TIMESTAMP
Snapshot time reported by the exchange, UTC (NULL if it does not say).
side VARCHAR
'bid' (buy orders) or 'ask' (sell orders).
level BIGINT
Depth level, 1 = best price on that side.
price DOUBLE
Price level, in the quote currency.
amount DOUBLE
Quantity resting at this price, in the base currency.
Examples (3)

Liquidity in the top 50 levels on each side of Kraken's BTC/USD book

SELECT side, sum(amount) AS btc, sum(price * amount) AS usd
FROM ccxt.main.order_book('kraken', 'BTC/USD', depth := 50)
GROUP BY side
ORDER BY side;

Best bid and ask for ETH/USD on Coinbase

SELECT max(price) FILTER (side = 'bid') AS best_bid,
  min(price) FILTER (side = 'ask') AS best_ask
FROM ccxt.main.order_book('coinbase', 'ETH/USD', depth := 1);

What a 2 BTC market buy on Kraken would cost: walk the ask side of the order book, then add the market's default taker fee from markets (filled_btc is below 2 if the book is too thin)

WITH asks AS (SELECT price, amount, sum(amount) OVER (ORDER BY level) - amount AS ahead FROM ccxt.main.order_book('kraken', 'BTC/USD', depth := 50) WHERE side = 'ask'), fill AS (SELECT sum(least(amount, greatest(2 - ahead, 0))) AS filled_btc, sum(price * least(amount, greatest(2 - ahead, 0))) AS cost_usd FROM asks) SELECT fill.filled_btc, fill.cost_usd / fill.filled_btc AS avg_fill_price, fill.cost_usd * (1 + m.taker) AS cost_with_taker_fee_usd
FROM fill
JOIN ccxt.main.markets('kraken') AS m ON m.symbol = 'BTC/USD';
Link
ticker (exchange ANY, symbol VARCHAR) 2 examples

Current price, best bid/ask and 24-hour stats for a market, across one or more exchanges

Arguments
exchange ANY
One CCXT exchange id such as 'kraken', or a list of up to 50 ids to compare exchanges side by side.
symbol VARCHAR
CCXT unified symbol such as 'BTC/USD'; perpetual swaps look like 'BTC/USDT:USDT'.
Returns columns
exchange VARCHAR
CCXT exchange id.
symbol VARCHAR
CCXT unified market symbol.
ts TIMESTAMP
When the exchange computed the quote, UTC (NULL if it does not say).
last DOUBLE
Last traded price, in the quote currency.
bid DOUBLE
Best bid price.
ask DOUBLE
Best ask price.
high DOUBLE
Highest price over the exchange's rolling 24-hour window.
low DOUBLE
Lowest price over the exchange's rolling 24-hour window.
open DOUBLE
Price at the start of the rolling 24-hour window.
base_volume DOUBLE
24-hour volume in the base currency.
quote_volume DOUBLE
24-hour volume in the quote currency.
change_pct DOUBLE
24-hour price change, in percent.
vwap DOUBLE
24-hour volume-weighted average price, when published.
error VARCHAR
NULL on success; otherwise why this exchange returned no data (the other columns are then NULL).
Examples (2)

Compare BTC/USD on two US exchanges

SELECT exchange, last, ask - bid AS spread, quote_volume
FROM ccxt.main.ticker(['kraken', 'coinbase'], 'BTC/USD')
WHERE error IS NULL
ORDER BY last;

The current ETH/USDT price and 24-hour change on OKX

SELECT last, change_pct FROM ccxt.main.ticker('okx', 'ETH/USDT');
Link
trades (exchange VARCHAR, symbol VARCHAR, max_rows := BIGINT, since := ANY, until := ANY) 2 examples

Public trades (time and sales) for one market on one exchange over a time window

Positional arguments
exchange VARCHAR
CCXT exchange id such as 'kraken'; ccxt.main.exchanges lists every id.
symbol VARCHAR
CCXT unified market symbol such as 'BTC/USD' (spot) or 'BTC/USDT:USDT' (USDT-settled perpetual).
Named arguments
max_rows := BIGINT
Stop after this many rows (default 100,000). · default 100000
since := ANY
Start of the window in UTC, inclusive. Omit for the most recent page of trades only. · default null
until := ANY
End of the window in UTC, exclusive. Defaults to now. · default null
Returns columns
exchange VARCHAR
CCXT exchange id the trade came from.
symbol VARCHAR
CCXT unified market symbol, e.g. 'BTC/USD'.
trade_id VARCHAR
The exchange's identifier for the trade, when it publishes one.
ts TIMESTAMP
Execution time, UTC.
side VARCHAR
Taker side: 'buy' or 'sell'.
price DOUBLE
Execution price, in the quote currency.
amount DOUBLE
Executed quantity, in the base currency (contracts for some derivatives).
cost DOUBLE
price times amount, in the quote currency.
taker_or_maker VARCHAR
'taker' or 'maker' when the exchange reports it.
Examples (2)

Buy versus sell volume in Kraken's most recent BTC/USD trades

SELECT side, count(*) AS trades, sum(amount) AS btc
FROM ccxt.main.trades('kraken', 'BTC/USD')
GROUP BY side
ORDER BY side;

Volume-weighted average price over Coinbase's most recent ETH/USD trades

SELECT sum(price * amount) / sum(amount) AS vwap, min(ts) AS first_trade
FROM ccxt.main.trades('coinbase', 'ETH/USD');
Link

Try these queries

Buy versus sell volume in Kraken's most recent BTC/USD trades

SELECT side, count(*) AS trades, sum(amount) AS btc
FROM ccxt.main.trades('kraken', 'BTC/USD')
GROUP BY side
ORDER BY side

Uses trades

Compare BTC/USD on two US exchanges

SELECT exchange, last, ask - bid AS spread, quote_volume
FROM ccxt.main.ticker(['kraken', 'coinbase'], 'BTC/USD')
WHERE error IS NULL
ORDER BY last

Uses ticker

Liquidity in the top 50 levels on each side of Kraken's BTC/USD book

SELECT side, sum(amount) AS btc, sum(price * amount) AS usd
FROM ccxt.main.order_book('kraken', 'BTC/USD', depth := 50)
GROUP BY side
ORDER BY side

Uses order_book

BTC perpetual swaps listed on OKX

SELECT symbol, settle, contract_size
FROM ccxt.main.markets('okx')
WHERE type = 'swap' AND base = 'BTC'
ORDER BY symbol

Uses markets

Which of three exchanges publish funding-rate history

SELECT exchange, supported
FROM ccxt.main.has(['kraken', 'okx', 'binance'])
WHERE method = 'fetchFundingRateHistory'
ORDER BY exchange

Uses has

Number of settlements and average annualized BTC perpetual funding on Binance over June 2025 (for a rolling window, pass start_date := current_date - INTERVAL 30 DAY)

SELECT count(*) AS settlements, avg(funding_rate_annualized) AS avg_apr
FROM ccxt.main.funding_rates('binance', 'BTC/USDT:USDT', start_date := DATE '2025-06-01', end_date := DATE '2025-07-01')

Uses funding_rates

17 more examples in the Catalog, each listed under the table or function it uses.

Questions it can answer

Plain-English questions from the worker's agent test tasks. An AI agent with this catalog attached should answer each one with SQL.

  • Using the ccxt worker, does the Kraken exchange support fetching OHLCV candles?
  • Using the ccxt worker, how many exchanges support fetching funding rate history?
  • Using the ccxt worker, list Coinbase's daily BTC/USD closing prices for the first week of January 2025, oldest first.
  • Using the ccxt worker, what was the average annualized funding rate of the BTC/USDT:USDT perpetual on OKX over the last 30 days?
  • Using the ccxt worker, what is the current bid-ask spread of BTC/USD on Kraken and on Coinbase?
  • Using the ccxt worker, how many trades are in Kraken's most recent page of BTC/USD trades?

CCXT is an independent open-source connector from Query.Farm. It is not affiliated with, endorsed by or sponsored by the services, projects or organisations it works with. Product names, logos and trademarks belong to their respective owners.