Skip to content

Perps

Funding, marks, books and carry for US-regulated perps, benchmarked against offshore venues

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/perps/index.md to help me query Perps 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.

Which venues are reachable right now

Example output · captured
Connector release
v0.2.0
Engine
2.0.1
VGI protocol
3.4.0
SELECT venue, status, instrument_count, last_error
FROM perps.main.venues()
ORDER BY venue
Result · first 5 rows
venue status instrument_count last_error
binance error NULL VenueError: binance (ccxt binanceusdm) fetch_markets failed: ExchangeNotAvailab…
bitnomial ok 34 NULL
bybit error NULL VenueError: bybit (ccxt bybit) fetch_markets failed: RateLimitExceeded: bybit G…
coinbase ok 29 NULL
hyperliquid ok 357 NULL

Quick start

Choose where to run Perps, 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 'perps' AS perps (
  TYPE vgi,
  LOCATION 'uvx --from git+https://github.com/Query-farm/[email protected] vgi-perps-worker'
);

3. Run a query

query.sql
SELECT venue, status, instrument_count, last_error
FROM perps.main.venues()
ORDER BY venue
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 'perps' AS perps (
  TYPE vgi,
  LOCATION 'uvx --from git+https://github.com/Query-farm/[email protected] vgi-perps-worker'
);

Overview

Normalized market data for US-regulated perpetual futures on Kalshi, Coinbase Derivatives and Bitnomial, with Hyperliquid, Binance and Bybit as an offshore benchmark: funding, marks, order books, trades and carry analytics. Read-only, no API key needed.

Catalog

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

perps 1 schema
main 17 functions

Perpetual-futures table functions: venue reference, normalized market data, carry analytics and venue-only raw fields

Schema examples (21)
Examples (21)

Which venues are reachable right now

SELECT venue, status, instrument_count, last_error
FROM perps.main.venues()
ORDER BY venue;
Result · first 5 rows
venue status instrument_count last_error
binance error NULL VenueError: binance (ccxt binanceusdm) fetch_markets failed: ExchangeNotAvailab…
bitnomial ok 34 NULL
bybit error NULL VenueError: bybit (ccxt bybit) fetch_markets failed: RateLimitExceeded: bybit G…
coinbase ok 29 NULL
hyperliquid ok 357 NULL

What Coinbase Derivatives does not serve publicly, and why

SELECT capability, support, notes
FROM perps.main.capabilities(venue := 'coinbase')
WHERE support <> 'supported'
ORDER BY capability;

Every BTC perp: how much BTC one contract is and how often it funds

SELECT venue, symbol, contract_size, funding_interval_hours, funding_cap
FROM perps.main.instruments(underlying := 'BTC')
ORDER BY venue, contract_size;

Average annualized BTC funding per venue over the last week

SELECT venue, avg(rate_annualized) AS mean_apr, count(*) AS settlements
FROM perps.main.funding(underlying := 'BTC', start_date := now() - INTERVAL 7 DAY)
GROUP BY venue
ORDER BY mean_apr DESC;
17 more examples

ETH perps side by side: price, premium, carry and size

SELECT venue, symbol, mark_price, premium_bps, funding_rate_annualized,
  open_interest_usd
FROM perps.main.marks(underlying := 'ETH')
ORDER BY open_interest_usd DESC NULLS LAST;

Notional resting in the top 25 levels of Kalshi's BTC perp, per side

SELECT side, max(cum_usd) AS depth_usd
FROM perps.main.order_book('kalshi', 'KXBTCPERP', depth := 25)
GROUP BY side
ORDER BY side;

Aggressor buy vs sell notional on Kalshi BTC over 15 minutes

SELECT taker_side, count(*) AS n, sum(size_usd) AS usd
FROM perps.main.trades('kalshi', 'KXBTCPERP', start_date := now() - INTERVAL 15 MINUTE)
GROUP BY taker_side
ORDER BY taker_side;

Two weeks of daily Kalshi BTC closes, volume and open interest

SELECT ts, close, volume_usd, open_interest_contracts
FROM perps.main.candles('kalshi', 'KXBTCPERP', bar := '1d')
ORDER BY ts DESC
LIMIT 14;

Which BTC perp trades richest to its own index

SELECT venue, symbol, premium_bps
FROM perps.main.premium(underlying := 'BTC')
ORDER BY premium_bps DESC NULLS LAST;

The widest BTC funding carry between any two venues this week

SELECT venue_a, venue_b, spread_bps, carry_trade
FROM perps.main.funding_spread('BTC')
ORDER BY abs(spread_bps) DESC
LIMIT 5;

What a $50k ETH clip costs on Kalshi

SELECT spread_bps, buy_cost_bps, sell_cost_bps, imbalance
FROM perps.main.depth_metrics('kalshi', 'KXETHPERP', notional_usd := 50000);

Estimated ETH liquidation bands on Hyperliquid with the default leverage mix

SELECT side, leverage, liquidation_price, cum_notional_usd
FROM perps.main.liquidation_estimate('hyperliquid', 'ETH')
WHERE feasible
ORDER BY side, distance_pct;

Where the next BTC funding settlement is heading

SELECT weight_accrued, accrued_rate * 1e4 AS accrued_bps,
  projected_rate_annualized
FROM perps.main.kalshi_funding_nowcast('KXBTCPERP');

Kalshi crypto perps' funding deadbands

SELECT symbol, funding_deadband, funding_limit_unit
FROM perps.main.raw_kalshi_markets()
WHERE asset_class = 'Crypto'
ORDER BY symbol;

Mean and worst BTC premium over the last half hour

SELECT avg(premium_bps) AS mean_bps, max(abs(premium_bps)) AS worst_bps
FROM perps.main.raw_kalshi_premium_index('KXBTCPERP', start_date := now() - INTERVAL 30 MINUTE);

Coinbase perps with the highest overnight margin

SELECT symbol, intraday_long_margin_rate, overnight_long_margin_rate
FROM perps.main.raw_coinbase_products()
ORDER BY overnight_long_margin_rate DESC
LIMIT 5;

Bitnomial perps with their size tier and margin rate

SELECT symbol, contract_size, product_group_margin_rate
FROM perps.main.raw_bitnomial_products()
ORDER BY symbol;

How much of its per-interval funding cap each BTC perp's current rate uses (marks joined to instruments; venues that publish no cap drop out)

SELECT m.venue, m.symbol, m.funding_rate, i.funding_cap,
  abs(m.funding_rate) / i.funding_cap AS cap_used
FROM perps.main.marks(underlying := 'BTC') AS m
JOIN perps.main.instruments(underlying := 'BTC') AS i USING (venue, symbol)
WHERE i.funding_cap IS NOT NULL
ORDER BY cap_used DESC, m.venue, m.symbol;

Venues that answer right now and serve a public order book, with the endpoint each uses

SELECT v.venue, v.status, c.notes
FROM perps.main.venues() AS v
JOIN perps.main.capabilities() AS c USING (venue)
WHERE c.capability = 'order_book' AND c.support = 'supported' AND v.status = 'ok'
ORDER BY v.venue;

Kalshi BTC perp, last week: each daily bar's open-to-close return next to the funding its three settlements charged longs, both in bps

WITH bars AS (SELECT ts, coalesce(lead(ts) OVER (ORDER BY ts), ts + INTERVAL 1 DAY) AS bar_end, (close / open - 1) * 1e4 AS return_bps FROM perps.main.candles('kalshi', 'KXBTCPERP', bar := '1d')) SELECT b.ts, b.return_bps, sum(f.rate_bps) AS funding_bps
FROM bars AS b
JOIN perps.main.funding(venue := 'kalshi', underlying := 'BTC') AS f ON f.funding_time > b.ts AND f.funding_time <= b.bar_end
GROUP BY b.ts, b.return_bps
HAVING count(*) = 3
ORDER BY b.ts;

The next Kalshi BTC settlement's projected annualized rate against the past week's settled average

SELECT n.funding_time, n.weight_accrued, n.projected_rate_annualized,
  h.week_mean_apr, n.projected_rate_annualized - h.week_mean_apr AS vs_week
FROM perps.main.kalshi_funding_nowcast('KXBTCPERP') AS n
CROSS JOIN (SELECT avg(rate_annualized) AS week_mean_apr FROM perps.main.funding(venue := 'kalshi', underlying := 'BTC')) AS h;
Table functions
candles (venue VARCHAR, symbol VARCHAR, bar := VARCHAR, end_date := TIMESTAMP WITH TIME ZONE, start_date := TIMESTAMP WITH TIME ZONE) 3 examples

OHLCV bars for one contract (1m, 1h, 1d) with prices per underlying unit and volume in contracts and USD

Positional arguments
venue VARCHAR
Venue to query: one of kalshi, coinbase, bitnomial, og, hyperliquid, binance, bybit.
symbol VARCHAR
Venue-native contract symbol, as in instruments().symbol, e.g. 'KXBTCPERP' or 'BIP-20DEC30-CDE'.
Named arguments
bar := VARCHAR
Bar length: '1m', '1h' or '1d' (default '1h'). · default "1h"
end_date := TIMESTAMP WITH TIME ZONE
End of the time window, inclusive. Default: now. · default null
start_date := TIMESTAMP WITH TIME ZONE
Start of the time window. Default: 1 day (1m bars), 7 days (1h) or 90 days (1d) before end_date. · default null
Returns columns
venue VARCHAR
Venue name.
symbol VARCHAR
Venue-native contract symbol.
ts TIMESTAMP WITH TIME ZONE
Bar start, UTC.
bar VARCHAR
Bar length: '1m', '1h' or '1d'.
open DOUBLE
First trade price per underlying unit; NULL if no trades in the bar.
high DOUBLE
Highest trade price per underlying unit.
low DOUBLE
Lowest trade price per underlying unit.
close DOUBLE
Last trade price per underlying unit.
volume_contracts DOUBLE
Traded contracts in the bar.
volume_usd DOUBLE
Traded notional in quote currency, where the venue publishes it or it can be derived.
open_interest_contracts DOUBLE
Open interest at bar end (Kalshi only).
Examples (3)

Two weeks of daily Kalshi BTC closes, volume and open interest

SELECT ts, close, volume_usd, open_interest_contracts
FROM perps.main.candles('kalshi', 'KXBTCPERP', bar := '1d')
ORDER BY ts DESC
LIMIT 14;

Coinbase ETH perp trading range over the last day

SELECT max(high) - min(low) AS range_usd
FROM perps.main.candles('coinbase', 'ETP-20DEC30-CDE', start_date := now() - INTERVAL 1 DAY);

Kalshi BTC perp, last week: each daily bar's open-to-close return next to the funding its three settlements charged longs, both in bps

WITH bars AS (SELECT ts, coalesce(lead(ts) OVER (ORDER BY ts), ts + INTERVAL 1 DAY) AS bar_end, (close / open - 1) * 1e4 AS return_bps FROM perps.main.candles('kalshi', 'KXBTCPERP', bar := '1d')) SELECT b.ts, b.return_bps, sum(f.rate_bps) AS funding_bps
FROM bars AS b
JOIN perps.main.funding(venue := 'kalshi', underlying := 'BTC') AS f ON f.funding_time > b.ts AND f.funding_time <= b.bar_end
GROUP BY b.ts, b.return_bps
HAVING count(*) = 3
ORDER BY b.ts;
Link
capabilities (venue := VARCHAR) 4 examples

Capability matrix: which data each venue serves publicly, with auth, depth and caveats

Named arguments
venue := VARCHAR
Venue to query: one of kalshi, coinbase, bitnomial, og, hyperliquid, binance, bybit. NULL (default) queries every venue. · default null
Returns columns
venue VARCHAR
Venue name.
capability VARCHAR
Capability name, e.g. 'funding_history', 'order_book'.
support VARCHAR
'supported', 'partial' or 'unsupported' through public endpoints.
auth_required BOOLEAN
True when the venue gates this data behind API credentials.
history_depth VARCHAR
How far back the public source reaches.
notes VARCHAR
Endpoint used, or why the capability is missing or partial.
Examples (4)

What Coinbase Derivatives does not serve publicly, and why

SELECT capability, support, notes
FROM perps.main.capabilities(venue := 'coinbase')
WHERE support <> 'supported'
ORDER BY capability;

How many venues fully support each capability

SELECT capability,
  count(*) FILTER (WHERE support = 'supported') AS venues_supported
FROM perps.main.capabilities()
GROUP BY capability
ORDER BY capability;
SELECT venue
FROM perps.main.capabilities()
WHERE capability = 'order_book' AND support = 'supported'
ORDER BY venue;
1 more example
SELECT support, auth_required
FROM perps.main.capabilities(venue := 'kalshi')
WHERE capability = 'funding_history';
Link
depth_metrics (venue VARCHAR, symbol VARCHAR, depth := BIGINT, notional_usd := DOUBLE) 2 examples

Liquidity summary for one contract: spread, bps cost to fill a USD notional on each side, depth and imbalance

Positional arguments
venue VARCHAR
Venue to query: one of kalshi, coinbase, bitnomial, og, hyperliquid, binance, bybit.
symbol VARCHAR
Venue-native contract symbol, as in instruments().symbol, e.g. 'KXBTCPERP' or 'BIP-20DEC30-CDE'.
Named arguments
depth := BIGINT
Book levels to fetch per side, 1 to 500 (default 200). · default 200
notional_usd := DOUBLE
Notional to fill on each side, in quote currency (default 100,000). · default 100000.0
Returns columns
venue VARCHAR
Venue name.
symbol VARCHAR
Venue-native contract symbol.
best_bid DOUBLE
Best bid per underlying unit.
best_ask DOUBLE
Best ask per underlying unit.
mid DOUBLE
(best_bid + best_ask) / 2.
spread_bps DOUBLE
(best_ask - best_bid) / mid in basis points.
notional_usd DOUBLE
The notional each side was asked to fill.
buy_cost_bps DOUBLE
Distance of the VWAP to buy notional_usd (walking asks) from mid, bps.
sell_cost_bps DOUBLE
Distance of the VWAP to sell notional_usd (walking bids) from mid, bps.
buy_filled_usd DOUBLE
Notional the fetched asks could absorb (< notional_usd if the book ran out).
sell_filled_usd DOUBLE
Notional the fetched bids could absorb.
fully_filled BOOLEAN
True when both sides could fill the whole notional.
bid_depth_usd DOUBLE
Total bid notional in the fetched levels.
ask_depth_usd DOUBLE
Total ask notional in the fetched levels.
imbalance DOUBLE
(bid_depth_usd - ask_depth_usd) / (bid + ask): +1 all bids, -1 all asks.
bid_levels INTEGER
Bid levels fetched.
ask_levels INTEGER
Ask levels fetched.
Examples (2)

What a $50k ETH clip costs on Kalshi

SELECT spread_bps, buy_cost_bps, sell_cost_bps, imbalance
FROM perps.main.depth_metrics('kalshi', 'KXETHPERP', notional_usd := 50000);

Can Coinbase's BTC perp absorb a $1m market buy

SELECT venue, buy_cost_bps, fully_filled
FROM perps.main.depth_metrics('coinbase', 'BIP-20DEC30-CDE', notional_usd := 1000000);
Link
funding (end_date := TIMESTAMP WITH TIME ZONE, include_estimates := BOOLEAN, start_date := TIMESTAMP WITH TIME ZONE, underlying := VARCHAR, venue := VARCHAR) 2 examples

Funding-rate history across venues, positive = longs pay shorts, with per-interval and annualized rates

Named arguments
end_date := TIMESTAMP WITH TIME ZONE
End of the time window, inclusive. Default: now. · default null
include_estimates := BOOLEAN
Append each venue's in-progress estimate (is_final = false) where available (default false). · default false
start_date := TIMESTAMP WITH TIME ZONE
Start of the time window, inclusive. Default: 7 days before end_date. · default null
underlying := VARCHAR
Canonical underlying to filter on, as in instruments().underlying. NULL (default) keeps every underlying; offshore venues are scanned only when it is set, because they list hundreds of contracts. · default null
venue := VARCHAR
Venue to query: one of kalshi, coinbase, bitnomial, og, hyperliquid, binance, bybit. NULL (default) queries every venue. · default null
Returns columns
venue VARCHAR
Venue name.
symbol VARCHAR
Venue-native contract symbol.
canonical_id VARCHAR
'<UNDERLYING>-<QUOTE>-PERP', shared across venues.
underlying VARCHAR
Canonical underlying; join venues on this.
funding_time TIMESTAMP WITH TIME ZONE
When the rate settled (or, for an estimate, will settle), UTC.
rate_per_interval DOUBLE
Funding rate for the interval, decimal; positive = longs pay shorts.
interval_hours DOUBLE
Length of the funding interval in hours.
rate_annualized DOUBLE
Simple annualization: rate_per_interval * 8760 / interval_hours.
rate_bps DOUBLE
rate_per_interval in basis points.
mark_price DOUBLE
Mark price at funding, quote currency per underlying unit, where published.
index_price DOUBLE
Index price at funding, quote currency per underlying unit, where published.
premium_bps DOUBLE
(mark_price / index_price - 1) in basis points, when both are present.
is_final BOOLEAN
True for a settled rate; false for the venue's in-progress estimate.
Examples (2)

Average annualized BTC funding per venue over the last week

SELECT venue, avg(rate_annualized) AS mean_apr, count(*) AS settlements
FROM perps.main.funding(underlying := 'BTC', start_date := now() - INTERVAL 7 DAY)
GROUP BY venue
ORDER BY mean_apr DESC;

Bitnomial's last nine ETH funding settlements with the mark-vs-index premium

SELECT funding_time, rate_bps, premium_bps
FROM perps.main.funding(venue := 'bitnomial', underlying := 'ETH')
ORDER BY funding_time DESC
LIMIT 9;
Link
funding_spread (underlying VARCHAR, end_date := TIMESTAMP WITH TIME ZONE, start_date := TIMESTAMP WITH TIME ZONE) 2 examples

Cross-venue funding carry for one underlying: mean annualized rates per contract and the spread for every venue pair

Positional arguments
underlying VARCHAR
Canonical underlying to compare across venues, e.g. 'BTC'.
Named arguments
end_date := TIMESTAMP WITH TIME ZONE
End of the time window, inclusive. Default: now. · default null
start_date := TIMESTAMP WITH TIME ZONE
Start of the time window, inclusive. Default: 7 days before end_date. · default null
Returns columns
underlying VARCHAR
Canonical underlying both legs reference.
venue_a VARCHAR
Venue of leg A (alphabetically first of the pair).
symbol_a VARCHAR
Contract of leg A.
venue_b VARCHAR
Venue of leg B.
symbol_b VARCHAR
Contract of leg B.
annualized_a DOUBLE
Mean annualized funding of A over the window (decimal).
annualized_b DOUBLE
Mean annualized funding of B over the window (decimal).
spread_annualized DOUBLE
annualized_a - annualized_b: carry earned per year by short A / long B.
spread_bps DOUBLE
spread_annualized in basis points per year.
observations_a BIGINT
Settled funding observations for A in the window.
observations_b BIGINT
Settled funding observations for B in the window.
carry_trade VARCHAR
Which way collects the spread: 'short A / long B', the reverse, or 'flat'.
window_start TIMESTAMP WITH TIME ZONE
Start of the averaging window, UTC.
window_end TIMESTAMP WITH TIME ZONE
End of the averaging window, UTC.
Examples (2)

The widest BTC funding carry between any two venues this week

SELECT venue_a, venue_b, spread_bps, carry_trade
FROM perps.main.funding_spread('BTC')
ORDER BY abs(spread_bps) DESC
LIMIT 5;

30-day ETH carry of Bitnomial against every other venue

SELECT symbol_a, symbol_b, spread_bps
FROM perps.main.funding_spread('ETH', start_date := now() - INTERVAL 30 DAY)
WHERE venue_a = 'bitnomial' OR venue_b = 'bitnomial'
ORDER BY spread_bps;
Link
instruments (include_inactive := BOOLEAN, underlying := VARCHAR, venue := VARCHAR) 2 examples

Perpetual contract specifications per venue: underlying, contract size, tick, funding interval, cap, margin

Named arguments
include_inactive := BOOLEAN
Also list inactive or halted contracts (default false). · default false
underlying := VARCHAR
Canonical underlying to filter on, as in instruments().underlying. NULL (default) keeps every underlying; offshore venues are scanned only when it is set, because they list hundreds of contracts. · default null
venue := VARCHAR
Venue to query: one of kalshi, coinbase, bitnomial, og, hyperliquid, binance, bybit. NULL (default) queries every venue. · default null
Returns columns
venue VARCHAR
Venue name.
symbol VARCHAR
Venue-native contract symbol; pass it to the single-venue functions.
canonical_id VARCHAR
'<UNDERLYING>-<QUOTE>-PERP': the economic exposure, shared across venues.
underlying VARCHAR
Canonical underlying (BTC, ETH, AAPL, XAU, US500, ...); join venues on this.
asset_class VARCHAR
'crypto', 'equity', 'index' or 'commodity'; 'unknown' for Hyperliquid HIP-3 markets (builders publish none).
quote_ccy VARCHAR
Quote and settlement currency: USD (US venues), USDT or USDC (offshore).
instrument_type VARCHAR
'perpetual', or 'perp_style_future' for long-dated futures with funding.
status VARCHAR
Venue status, normalized to 'active' where trading.
contract_size DOUBLE
Underlying units per contract (0.0001 = one contract is 0.0001 BTC).
native_price_unit VARCHAR
How the venue quotes prices before normalization.
tick_size DOUBLE
Minimum price increment, in quote currency per underlying unit.
funding_interval_hours DOUBLE
Hours between funding settlements (1, 8, 24).
funding_cap DOUBLE
Absolute cap on the funding rate per interval (decimal); NULL if none published.
max_leverage DOUBLE
Maximum leverage the venue publishes (1 / initial margin rate).
initial_margin_rate DOUBLE
Initial margin as a fraction of notional, where published.
maintenance_margin_rate DOUBLE
Maintenance margin fraction, only where the venue documents it.
margin_source VARCHAR
Where the margin figures come from, and their caveats.
listed_at TIMESTAMP WITH TIME ZONE
Listing date where the venue publishes it.
dex VARCHAR
Hyperliquid HIP-3 builder dex the contract trades on ('xyz', 'para', ...); NULL for Hyperliquid's main dex and every other venue.
Examples (2)

Every BTC perp: how much BTC one contract is and how often it funds

SELECT venue, symbol, contract_size, funding_interval_hours, funding_cap
FROM perps.main.instruments(underlying := 'BTC')
ORDER BY venue, contract_size;

Kalshi's active perps by asset class

SELECT asset_class, count(*) AS contracts
FROM perps.main.instruments(venue := 'kalshi')
GROUP BY asset_class
ORDER BY contracts DESC;
Link
kalshi_funding_nowcast (symbol VARCHAR, assume_premium := DOUBLE, funding_time := TIMESTAMP WITH TIME ZONE, recent_minutes := BIGINT) 3 examples

Kalshi funding for one window, computed from the per-second premium with Kalshi's linear time weights: accrued so far, projected to settlement, or reconstructed for a past window

Positional arguments
symbol VARCHAR
Kalshi perps ticker, e.g. 'KXBTCPERP'.
Named arguments
assume_premium := DOUBLE
Premium (fraction, e.g. 0.00015 = 1.5 bps) assumed for the rest of the window. Default: the mean premium over the last recent_minutes. · default null
funding_time := TIMESTAMP WITH TIME ZONE
Window to compute, by its funding time. Default: the current window. A past funding time reconstructs that settlement (premium history is retained for a few days only). · default null
recent_minutes := BIGINT
Minutes of recent premium averaged for the default projection, 1 to 480 (default 15). · default 15
Returns columns
symbol VARCHAR
Kalshi perps ticker.
funding_time TIMESTAMP WITH TIME ZONE
The funding time this window settles at, UTC.
window_start TIMESTAMP WITH TIME ZONE
Start of the window (the previous funding time), UTC.
as_of TIMESTAMP WITH TIME ZONE
End of the observed part of the window: now, or funding_time for a finished window.
interval_hours DOUBLE
Window length in hours.
elapsed_seconds BIGINT
Seconds of the window observed.
weight_accrued DOUBLE
Share of the window's total weight already elapsed (second i weighs i, so the last hour of an 8-hour window carries about 23%).
accrued_rate DOUBLE
Linear-weighted mean premium over the elapsed seconds, per interval, before the deadband. Equals Kalshi's own estimate before rounding.
assumed_premium DOUBLE
Premium assumed for the rest of the window (assume_premium, else the mean of the last recent_minutes).
projected_rate_raw DOUBLE
Projected window average before the deadband and cap.
projected_rate DOUBLE
Projected settlement per interval: 0 inside the deadband, clamped to the cap. Positive = longs pay.
projected_rate_annualized DOUBLE
projected_rate * 8760 / interval_hours.
kalshi_estimate_rate DOUBLE
Kalshi's published estimate (current window only).
settled_rate DOUBLE
The settled rate (finished windows only), to check the reconstruction.
funding_deadband DOUBLE
Zero threshold per interval.
funding_cap DOUBLE
Absolute cap per interval.
invalid_premium_handling VARCHAR
'dampen' (no-premium seconds count as 0) or 'exclude'.
method VARCHAR
Formula version: linear time weights over per-second premiums.
Examples (3)

Where the next BTC funding settlement is heading

SELECT weight_accrued, accrued_rate * 1e4 AS accrued_bps,
  projected_rate_annualized
FROM perps.main.kalshi_funding_nowcast('KXBTCPERP');

Settlement if the BTC premium holds at 2 bps for the rest of the window

SELECT projected_rate_annualized
FROM perps.main.kalshi_funding_nowcast('KXBTCPERP', assume_premium := 0.0002);

The next Kalshi BTC settlement's projected annualized rate against the past week's settled average

SELECT n.funding_time, n.weight_accrued, n.projected_rate_annualized,
  h.week_mean_apr, n.projected_rate_annualized - h.week_mean_apr AS vs_week
FROM perps.main.kalshi_funding_nowcast('KXBTCPERP') AS n
CROSS JOIN (SELECT avg(rate_annualized) AS week_mean_apr FROM perps.main.funding(venue := 'kalshi', underlying := 'BTC')) AS h;
Link
liquidation_estimate (venue VARCHAR, symbol VARCHAR, entry_price := DOUBLE, leverages := VARCHAR, mm_rate := DOUBLE, weights := VARCHAR) 2 examples

ESTIMATE of liquidation price bands from open interest, an assumed leverage mix and the venue's maintenance margin

Positional arguments
venue VARCHAR
Venue to query: one of kalshi, coinbase, bitnomial, og, hyperliquid, binance, bybit.
symbol VARCHAR
Venue-native contract symbol, as in instruments().symbol, e.g. 'KXBTCPERP' or 'BIP-20DEC30-CDE'.
Named arguments
entry_price := DOUBLE
Assumed entry price per underlying unit (default: current mark). · default null
leverages := VARCHAR
Comma-separated leverage buckets, each > 1 (default '2,3,5,10,20'). · default "2,3,5,10,20"
mm_rate := DOUBLE
Maintenance margin fraction to assume. Default NULL uses the venue's documented schedule and refuses venues that publish none. · default null
weights := VARCHAR
Comma-separated share of open interest per bucket, renormalized to 1 (default '0.30,0.25,0.20,0.15,0.10'). An assumption, not venue data. · default "0.30,0.25,0.20,0.15,0.10"
Returns columns
venue VARCHAR
Venue name.
symbol VARCHAR
Venue-native contract symbol.
side VARCHAR
'long' or 'short' holders.
leverage DOUBLE
Assumed leverage bucket.
weight DOUBLE
Share of open interest assumed at this leverage (weights sum to 1 per side).
entry_price DOUBLE
Assumed entry price per underlying unit (default: current mark).
liquidation_price DOUBLE
Estimated liquidation price; NULL when the leverage is not reachable.
distance_pct DOUBLE
(liquidation_price / entry_price - 1) * 100.
contracts DOUBLE
Open interest assumed in this bucket, contracts.
notional_usd DOUBLE
contracts * contract_size * entry_price.
cum_notional_usd DOUBLE
Feasible notional liquidated by the time price reaches this level, per side.
feasible BOOLEAN
False when leverage exceeds the venue max or maintenance >= 1/leverage.
maintenance_margin_rate DOUBLE
Maintenance margin fraction used.
mm_source VARCHAR
Where the maintenance rate came from (venue documentation or the mm_rate argument).
open_interest_contracts DOUBLE
Total open interest the buckets split, contracts.
estimate_method VARCHAR
Model version: isolated linear margin, entry at mark, no fees or funding accrual.
Examples (2)

Estimated ETH liquidation bands on Hyperliquid with the default leverage mix

SELECT side, leverage, liquidation_price, cum_notional_usd
FROM perps.main.liquidation_estimate('hyperliquid', 'ETH')
WHERE feasible
ORDER BY side, distance_pct;

Kalshi BTC bands under an assumed 5% maintenance margin

SELECT side, leverage, distance_pct
FROM perps.main.liquidation_estimate('kalshi', 'KXBTCPERP', mm_rate := 0.05, leverages := '3,5,10', weights := '0.5,0.3,0.2')
ORDER BY side, leverage;
Link
marks (underlying := VARCHAR, venue := VARCHAR) 3 examples

Live snapshot per contract: mark, index, bid/ask, premium, current funding, open interest in contracts and USD

Named arguments
underlying := VARCHAR
Canonical underlying to filter on, as in instruments().underlying. NULL (default) keeps every underlying; offshore venues are scanned only when it is set, because they list hundreds of contracts. · default null
venue := VARCHAR
Venue to query: one of kalshi, coinbase, bitnomial, og, hyperliquid, binance, bybit. NULL (default) queries every venue. · default null
Returns columns
venue VARCHAR
Venue name.
symbol VARCHAR
Venue-native contract symbol.
canonical_id VARCHAR
'<UNDERLYING>-<QUOTE>-PERP', shared across venues.
underlying VARCHAR
Canonical underlying; join venues on this.
as_of TIMESTAMP WITH TIME ZONE
Timestamp of the snapshot (for Bitnomial: the last funding calculation).
mark_price DOUBLE
Mark price, quote currency per underlying unit (see mark_source).
mark_source VARCHAR
'venue_mark', 'mid' (no public mark), 'last_funding_mark', or 'unavailable'.
index_price DOUBLE
The venue's index/reference price per underlying unit.
last_price DOUBLE
Last traded price per underlying unit.
bid DOUBLE
Best bid per underlying unit.
ask DOUBLE
Best ask per underlying unit.
premium_bps DOUBLE
(mark_price / index_price - 1) in basis points.
funding_rate DOUBLE
Current funding rate per interval (estimate or latest settled), decimal.
funding_rate_is_estimate BOOLEAN
True for an in-progress estimate, false for the latest settled rate.
funding_rate_annualized DOUBLE
funding_rate * 8760 / funding_interval_hours.
funding_interval_hours DOUBLE
Funding interval in hours.
next_funding_time TIMESTAMP WITH TIME ZONE
Next scheduled funding time, UTC.
open_interest_contracts DOUBLE
Open interest in contracts (one side).
open_interest_usd DOUBLE
Open interest notional in quote currency.
volume_24h_usd DOUBLE
Trailing 24-hour traded notional in quote currency.
Examples (3)

ETH perps side by side: price, premium, carry and size

SELECT venue, symbol, mark_price, premium_bps, funding_rate_annualized,
  open_interest_usd
FROM perps.main.marks(underlying := 'ETH')
ORDER BY open_interest_usd DESC NULLS LAST;

Kalshi's ten largest perps by open-interest notional

SELECT underlying, open_interest_usd
FROM perps.main.marks(venue := 'kalshi')
ORDER BY open_interest_usd DESC NULLS LAST
LIMIT 10;

How much of its per-interval funding cap each BTC perp's current rate uses (marks joined to instruments; venues that publish no cap drop out)

SELECT m.venue, m.symbol, m.funding_rate, i.funding_cap,
  abs(m.funding_rate) / i.funding_cap AS cap_used
FROM perps.main.marks(underlying := 'BTC') AS m
JOIN perps.main.instruments(underlying := 'BTC') AS i USING (venue, symbol)
WHERE i.funding_cap IS NOT NULL
ORDER BY cap_used DESC, m.venue, m.symbol;
Link
order_book (venue VARCHAR, symbol VARCHAR, depth := BIGINT) 2 examples

Aggregated order book for one contract with sizes in contracts, underlying units and USD, plus cumulative depth

Positional arguments
venue VARCHAR
Venue to query: one of kalshi, coinbase, bitnomial, og, hyperliquid, binance, bybit.
symbol VARCHAR
Venue-native contract symbol, as in instruments().symbol, e.g. 'KXBTCPERP' or 'BIP-20DEC30-CDE'.
Named arguments
depth := BIGINT
Levels per side, 1 to 500 (default 50). · default 50
Returns columns
venue VARCHAR
Venue name.
symbol VARCHAR
Venue-native contract symbol.
side VARCHAR
'bid' or 'ask'.
level INTEGER
1 = best price on that side.
price DOUBLE
Level price, quote currency per underlying unit.
size_contracts DOUBLE
Resting size in contracts.
size_base DOUBLE
Resting size in underlying units (contracts * contract_size).
size_usd DOUBLE
Resting notional in quote currency (size_base * price).
cum_usd DOUBLE
Cumulative notional from the best level to this one, per side.
Examples (2)

Notional resting in the top 25 levels of Kalshi's BTC perp, per side

SELECT side, max(cum_usd) AS depth_usd
FROM perps.main.order_book('kalshi', 'KXBTCPERP', depth := 25)
GROUP BY side
ORDER BY side;

Top five levels of Coinbase's nano BTC perp

SELECT side, level, price, size_usd
FROM perps.main.order_book('coinbase', 'BIP-20DEC30-CDE', depth := 5)
ORDER BY side, level;
Link
premium (reference := VARCHAR, underlying := VARCHAR, venue := VARCHAR) 2 examples

Perp premium in bps: each contract's mark against its own venue index, or against another venue's price

Named arguments
reference := VARCHAR
NULL (default): each contract's own venue index. A venue name: that venue's index (or mark, if it has no index) for the same underlying, e.g. reference := 'hyperliquid'. · default null
underlying := VARCHAR
Canonical underlying to filter on, as in instruments().underlying. NULL (default) keeps every underlying; offshore venues are scanned only when it is set, because they list hundreds of contracts. · default null
venue := VARCHAR
Venue to query: one of kalshi, coinbase, bitnomial, og, hyperliquid, binance, bybit. NULL (default) queries every venue. · default null
Returns columns
venue VARCHAR
Venue name.
symbol VARCHAR
Venue-native contract symbol.
canonical_id VARCHAR
'<UNDERLYING>-<QUOTE>-PERP'.
underlying VARCHAR
Canonical underlying.
as_of TIMESTAMP WITH TIME ZONE
Snapshot time of the contract's mark.
mark_price DOUBLE
Contract mark per underlying unit.
mark_source VARCHAR
'venue_mark', 'mid', 'last_funding_mark' or 'unavailable'.
reference_price DOUBLE
Reference price per underlying unit.
reference_source VARCHAR
'<venue> index' (default: the contract's own venue) or '<venue> mark'.
premium_bps DOUBLE
(mark_price / reference_price - 1) in basis points; positive = perp rich.
premium_usd DOUBLE
mark_price - reference_price, quote currency per underlying unit.
Examples (2)

Which BTC perp trades richest to its own index

SELECT venue, symbol, premium_bps
FROM perps.main.premium(underlying := 'BTC')
ORDER BY premium_bps DESC NULLS LAST;

US ETH perps priced against Hyperliquid's oracle

SELECT venue, symbol, reference_source, premium_bps
FROM perps.main.premium(underlying := 'ETH', reference := 'hyperliquid')
ORDER BY venue;
Link
raw_bitnomial_products (symbol := VARCHAR) 2 examples

Bitnomial perpetual fields: size tier, funding bounds, daily price limits, settlement, product-group margin rate

Named arguments
symbol := VARCHAR
Keep only this venue-native contract symbol (case-insensitive). NULL (default) keeps all. · default null
Returns columns
symbol VARCHAR
Bitnomial product symbol, e.g. 'PBTCUCZ50'.
product_id BIGINT
Bitnomial numeric product id.
product_name VARCHAR
Bitnomial product name.
base_symbol VARCHAR
Bitnomial base symbol (encodes the size tier, e.g. BTCUC = centi-bitcoin).
contract_size DOUBLE
Underlying units per contract.
price_increment DOUBLE
Tick size, USD per underlying unit (prices on the API are in ticks).
funding_rate_lower_bound DOUBLE
Spec lower bound on the funding rate per interval.
funding_rate_upper_bound DOUBLE
Spec upper bound on the funding rate per interval.
daily_first_funding_interval_end VARCHAR
First funding interval end of the day (Central time).
price_limit_percentage DOUBLE
Daily price limit as a fraction.
price_limit_upper DOUBLE
Upper price limit today, USD per underlying unit.
price_limit_lower DOUBLE
Lower price limit today, USD per underlying unit.
settlement_price DOUBLE
Latest settlement price, USD per underlying unit.
settlement_time TIMESTAMP WITH TIME ZONE
When that settlement ran.
product_group_margin_rate DOUBLE
Published margin rate; Bitnomial does not say whether initial or maintenance.
Examples (2)

Bitnomial perps with their size tier and margin rate

SELECT symbol, contract_size, product_group_margin_rate
FROM perps.main.raw_bitnomial_products()
ORDER BY symbol;

Today's price limits around settlement for Bitnomial's BTC perps

SELECT symbol, price_limit_lower, settlement_price, price_limit_upper
FROM perps.main.raw_bitnomial_products()
WHERE base_symbol LIKE 'BTC%'
ORDER BY symbol;
Link
raw_coinbase_products (symbol := VARCHAR) 2 examples

Coinbase perp-style futures fields: intraday and overnight FCM margin by side, settlement, sessions

Named arguments
symbol := VARCHAR
Keep only this venue-native contract symbol (case-insensitive). NULL (default) keeps all. · default null
Returns columns
symbol VARCHAR
Coinbase product id, e.g. 'BIP-20DEC30-CDE'.
display_name VARCHAR
Coinbase display name.
contract_code VARCHAR
Exchange contract code (BIP, ETP, ...).
contract_expiry TIMESTAMP WITH TIME ZONE
Nominal expiry of the 5-year perp-style contract.
contract_size_native DOUBLE
Coinbase contract_size, in the quoted unit (1000 SHIB for '1000SHIB').
contract_root_unit VARCHAR
Coinbase's underlying root unit.
intraday_long_margin_rate DOUBLE
FCM intraday initial margin, long.
intraday_short_margin_rate DOUBLE
FCM intraday initial margin, short.
overnight_long_margin_rate DOUBLE
FCM overnight initial margin, long.
overnight_short_margin_rate DOUBLE
FCM overnight initial margin, short.
settlement_price_native DOUBLE
Most recent official daily settlement price, native quoting.
index_price_native DOUBLE
Index price, native quoting.
funding_rate DOUBLE
Latest published hourly funding rate (decimal).
funding_time TIMESTAMP WITH TIME ZONE
Time of that funding rate.
session_state VARCHAR
FCM trading session state.
session_close TIMESTAMP WITH TIME ZONE
Current session close time.
twenty_four_by_seven BOOLEAN
True for products that trade around the clock.
Examples (2)

Coinbase perps with the highest overnight margin

SELECT symbol, intraday_long_margin_rate, overnight_long_margin_rate
FROM perps.main.raw_coinbase_products()
ORDER BY overnight_long_margin_rate DESC
LIMIT 5;

Where Coinbase charges shorts the most extra overnight margin

SELECT symbol,
  overnight_short_margin_rate - overnight_long_margin_rate AS short_premium
FROM perps.main.raw_coinbase_products()
ORDER BY short_premium DESC
LIMIT 5;
Link
raw_kalshi_markets (symbol := VARCHAR) 2 examples

Kalshi-only perps fields: per-contract marks, funding deadband and cap unit, leverage by size, halts

Named arguments
symbol := VARCHAR
Keep only this venue-native contract symbol (case-insensitive). NULL (default) keeps all. · default null
Returns columns
symbol VARCHAR
Kalshi market ticker.
market_id VARCHAR
Stable market UUID (survives ticker renames).
market_version BIGINT
Increments after a corporate action such as a split.
title VARCHAR
Kalshi's market title (the contract's unit, e.g. '0.0001 BTC').
status VARCHAR
'active', 'inactive' or 'closed'.
asset_class VARCHAR
Kalshi asset class: Crypto, Equities, Indices, Metals, Energy.
contract_size_native DOUBLE
Kalshi contract_size, in the title's unit.
underlying_multiplier DOUBLE
Underlying units per contract-size unit (1000 for kSHIB).
price_per_contract DOUBLE
Last price in Kalshi's native USD-per-contract quoting.
settlement_mark_per_contract DOUBLE
Mark used for settlement and funding, USD per contract.
liquidation_mark_per_contract DOUBLE
Mark used for liquidation, USD per contract.
reference_price_per_contract DOUBLE
Underlying reference price scaled per contract.
reference_price_time TIMESTAMP WITH TIME ZONE
Timestamp of the reference price (stale when the underlying is closed).
funding_cap DOUBLE
Funding cap in funding_limit_unit.
funding_deadband DOUBLE
Rates with |rate| below this are zeroed, in funding_limit_unit.
funding_limit_unit VARCHAR
'percentage' (cap is a rate) or 'dollar' (cap is USD per contract).
funding_invalid_premium_handling VARCHAR
'dampen' (count a missing bar as 0) or 'exclude'.
leverage_estimates VARCHAR
JSON: leverage (1/margin rate) by notional size in USD.
long_leverage_estimates VARCHAR
JSON: long-side leverage by notional size.
short_leverage_estimates VARCHAR
JSON: short-side leverage by notional size.
halt_sources VARCHAR[]
Why the market is halted ('initial_setup', 'corporate_action').
is_open BOOLEAN
Session state for markets with trading hours; NULL for 24/7 markets.
next_close TIMESTAMP WITH TIME ZONE
Next scheduled close for markets with trading hours.
minimum_quantity DOUBLE
Minimum order size in contracts.
Examples (2)

Kalshi crypto perps' funding deadbands

SELECT symbol, funding_deadband, funding_limit_unit
FROM perps.main.raw_kalshi_markets()
WHERE asset_class = 'Crypto'
ORDER BY symbol;

Kalshi markets whose leverage shrinks most at $1m notional

SELECT symbol, json_extract(leverage_estimates, '$."1000000"') AS lev_at_1m
FROM perps.main.raw_kalshi_markets()
WHERE status = 'active'
ORDER BY lev_at_1m
LIMIT 10;
Link
raw_kalshi_premium_index (symbol VARCHAR, end_date := TIMESTAMP WITH TIME ZONE, start_date := TIMESTAMP WITH TIME ZONE) 2 examples

Kalshi's per-second premium index (impact book vs index) for one market, windows up to one hour

Positional arguments
symbol VARCHAR
Kalshi perps ticker, e.g. 'KXBTCPERP'.
Named arguments
end_date := TIMESTAMP WITH TIME ZONE
End of the time window, inclusive. Default: now. · default null
start_date := TIMESTAMP WITH TIME ZONE
Start of the window. Default: 10 minutes before end_date. · default null
Returns columns
symbol VARCHAR
Kalshi market ticker.
ts TIMESTAMP WITH TIME ZONE
The one-second bucket, UTC.
premium_index DOUBLE
Signed fraction of the index (not bps); 0 when no premium was measurable.
premium_bps DOUBLE
premium_index * 10000.
Examples (2)

Mean and worst BTC premium over the last half hour

SELECT avg(premium_bps) AS mean_bps, max(abs(premium_bps)) AS worst_bps
FROM perps.main.raw_kalshi_premium_index('KXBTCPERP', start_date := now() - INTERVAL 30 MINUTE);

Minute-averaged ETH premium over the last ten minutes

SELECT date_trunc('minute', ts) AS minute, avg(premium_bps) AS bps
FROM perps.main.raw_kalshi_premium_index('KXETHPERP')
GROUP BY minute
ORDER BY minute;
Link
trades (venue VARCHAR, symbol VARCHAR, end_date := TIMESTAMP WITH TIME ZONE, max_trades := BIGINT, start_date := TIMESTAMP WITH TIME ZONE) 2 examples

Public trades for one contract in a time window, normalized price and USD size, with taker side

Positional arguments
venue VARCHAR
Venue to query: one of kalshi, coinbase, bitnomial, og, hyperliquid, binance, bybit.
symbol VARCHAR
Venue-native contract symbol, as in instruments().symbol, e.g. 'KXBTCPERP' or 'BIP-20DEC30-CDE'.
Named arguments
end_date := TIMESTAMP WITH TIME ZONE
End of the time window, inclusive. Default: now. · default null
max_trades := BIGINT
Stop after this many trades, 1 to 1,000,000 (default 10,000). · default 10000
start_date := TIMESTAMP WITH TIME ZONE
Start of the time window. Default: one hour before end_date. · default null
Returns columns
venue VARCHAR
Venue name.
symbol VARCHAR
Venue-native contract symbol.
trade_id VARCHAR
Venue trade identifier.
ts TIMESTAMP WITH TIME ZONE
Execution time, UTC.
price DOUBLE
Trade price, quote currency per underlying unit.
size_contracts DOUBLE
Trade size in contracts.
size_usd DOUBLE
Trade notional in quote currency.
taker_side VARCHAR
'buy' or 'sell' from the aggressor's side; NULL where the venue does not say.
is_block_trade BOOLEAN
True for an off-book block trade, where the venue flags it.
Examples (2)

Aggressor buy vs sell notional on Kalshi BTC over 15 minutes

SELECT taker_side, count(*) AS n, sum(size_usd) AS usd
FROM perps.main.trades('kalshi', 'KXBTCPERP', start_date := now() - INTERVAL 15 MINUTE)
GROUP BY taker_side
ORDER BY taker_side;

Per-minute traded notional on Coinbase's BTC perp

SELECT date_trunc('minute', ts) AS minute, sum(size_usd) AS usd
FROM perps.main.trades('coinbase', 'BIP-20DEC30-CDE', max_trades := 2000)
GROUP BY minute
ORDER BY minute;
Link
venues (probe := BOOLEAN) 3 examples

List every venue with its regulatory type, supported capabilities and live health

Named arguments
probe := BOOLEAN
Fetch each venue's instrument list to check health (default true). · default true
Returns columns
venue VARCHAR
Venue name used by every other function's venue argument.
display_name VARCHAR
Human-readable venue and product name.
venue_type VARCHAR
'us_regulated' (CFTC-registered exchange) or 'offshore' (benchmark only).
regulator VARCHAR
Regulatory status as documented by the venue.
adapter_version VARCHAR
Version of this worker's adapter for the venue.
sign_convention VARCHAR
How the venue's funding sign maps to positive = longs pay shorts.
capabilities VARCHAR[]
Capabilities with full or partial public support.
status VARCHAR
'ok' if the probe succeeded, 'error' if it failed, 'not_probed' when probe := false.
instrument_count BIGINT
Active and inactive contracts the probe found; NULL unless status = 'ok'.
last_error VARCHAR
Error from the probe, NULL when it succeeded.
checked_at TIMESTAMP WITH TIME ZONE
When the probe ran (UTC).
Examples (3)

Which venues are reachable right now

SELECT venue, status, instrument_count, last_error
FROM perps.main.venues()
ORDER BY venue;
Result · first 5 rows
venue status instrument_count last_error
binance error NULL VenueError: binance (ccxt binanceusdm) fetch_markets failed: ExchangeNotAvailab…
bitnomial ok 34 NULL
bybit error NULL VenueError: bybit (ccxt bybit) fetch_markets failed: RateLimitExceeded: bybit G…
coinbase ok 29 NULL
hyperliquid ok 357 NULL

US-regulated venues and how many capabilities each supports, without network calls

SELECT venue, venue_type, len(capabilities) AS n_capabilities
FROM perps.main.venues(probe := false)
WHERE venue_type = 'us_regulated'
ORDER BY venue;

Venues that answer right now and serve a public order book, with the endpoint each uses

SELECT v.venue, v.status, c.notes
FROM perps.main.venues() AS v
JOIN perps.main.capabilities() AS c USING (venue)
WHERE c.capability = 'order_book' AND c.support = 'supported' AND v.status = 'ok'
ORDER BY v.venue;
Link

Try these queries

What Coinbase Derivatives does not serve publicly, and why

SELECT capability, support, notes
FROM perps.main.capabilities(venue := 'coinbase')
WHERE support <> 'supported'
ORDER BY capability

Uses capabilities

Every BTC perp: how much BTC one contract is and how often it funds

SELECT venue, symbol, contract_size, funding_interval_hours, funding_cap
FROM perps.main.instruments(underlying := 'BTC')
ORDER BY venue, contract_size

Uses instruments

Average annualized BTC funding per venue over the last week

SELECT venue, avg(rate_annualized) AS mean_apr, count(*) AS settlements
FROM perps.main.funding(underlying := 'BTC', start_date := now() - INTERVAL 7 DAY)
GROUP BY venue
ORDER BY mean_apr DESC

Uses funding

ETH perps side by side: price, premium, carry and size

SELECT venue, symbol, mark_price, premium_bps, funding_rate_annualized,
  open_interest_usd
FROM perps.main.marks(underlying := 'ETH')
ORDER BY open_interest_usd DESC NULLS LAST

Uses marks

Notional resting in the top 25 levels of Kalshi's BTC perp, per side

SELECT side, max(cum_usd) AS depth_usd
FROM perps.main.order_book('kalshi', 'KXBTCPERP', depth := 25)
GROUP BY side
ORDER BY side

Uses order_book

Aggressor buy vs sell notional on Kalshi BTC over 15 minutes

SELECT taker_side, count(*) AS n, sum(size_usd) AS usd
FROM perps.main.trades('kalshi', 'KXBTCPERP', start_date := now() - INTERVAL 15 MINUTE)
GROUP BY taker_side
ORDER BY taker_side

Uses trades

33 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 perps worker, how many distinct venues in the catalog are US-regulated?
  • On Kalshi, how much bitcoin does one contract of the BTC perpetual represent?
  • In the perps worker, if Kalshi's BTC perp shows a positive funding rate, which side pays?
  • Does Kalshi list single-stock perpetual futures? Name one underlying stock if so.
  • How many funding settlements did Kalshi's BTC perpetual have over the last three days?
  • What is the current mark price of the ETH perpetual on Coinbase Derivatives, in USD per ETH?

Perps 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.